Save some bytes with common printf error/warning functions 134/head
authorPiotr Dymacz <pepe2k@gmail.com>
Sat, 31 Dec 2016 11:41:17 +0000 (12:41 +0100)
committerPiotr Dymacz <pepe2k@gmail.com>
Sat, 31 Dec 2016 11:41:17 +0000 (12:41 +0100)
32 files changed:
u-boot/board/ar7240/common/ar7240_s26_phy.c
u-boot/board/ar7240/common/athrs17_phy.c
u-boot/board/ar7240/common/athrs27_phy.c
u-boot/board/ar7240/common/qca-eth-953x.c
u-boot/board/ar7240/common/spi_flash.c
u-boot/common/cmd_bootm.c
u-boot/common/cmd_custom.c
u-boot/common/cmd_flash.c
u-boot/common/cmd_itest.c
u-boot/common/cmd_load.c
u-boot/common/cmd_mem.c
u-boot/common/cmd_net.c
u-boot/common/cmd_nvedit.c
u-boot/common/cmd_qcaclk.c
u-boot/common/console.c
u-boot/common/env_common.c
u-boot/common/env_flash.c
u-boot/common/flash.c
u-boot/common/hush.c
u-boot/common/main.c
u-boot/cpu/mips/ar7240/ag7240.c
u-boot/cpu/mips/ar7240/ag934x.c
u-boot/cpu/mips/cpu.c
u-boot/httpd/httpd.c
u-boot/include/common.h
u-boot/lib_mips/board.c
u-boot/net/bootp.c
u-boot/net/eth.c
u-boot/net/httpd.c
u-boot/net/net.c
u-boot/net/sntp.c
u-boot/net/tftp.c

index 455596bddefa1561446106b9cec077dbfcef90ed..8be4ca11a58f7658bd768d31391492ee5820f871 100644 (file)
@@ -584,7 +584,7 @@ int athrs26_phy_speed(int ethUnit){
                                case 2:
                                        return(_1000BASET);
                                default:
-                                       printf("## Error: unknown eth speed!\n");
+                                       printf_err("unknown eth speed!\n");
                        }
                }
        }
@@ -794,7 +794,7 @@ unsigned int s26_rd_phy(unsigned int phy_addr, unsigned int reg_addr){
                i++;
 
                if(i > 824)     {
-                       printf("## Error: MDIO_BUSY!\n");
+                       printf_err("MDIO_BUSY!\n");
                        break;
                }
 
@@ -826,7 +826,7 @@ void s26_wr_phy(unsigned int phy_addr, unsigned int reg_addr, unsigned int write
                i++;
 
                if(i > 824)     {
-                       printf("## Error: MDIO_BUSY!\n");
+                       printf_err("MDIO_BUSY!\n");
                        break;
                }
 
index 40fe37ffbd66b7860a12b9a8abf9fd7b1642b34b..82bb763d558cd4feda857d9afce293e0869a11c2 100644 (file)
@@ -240,7 +240,6 @@ int athrs17_phy_setup(int ethUnit){
                        timeout--;\r
                        \r
                        if(timeout <= 0){\r
-                               printf("## Error: negotiation timed out on ethernet port: %d\n", phyUnit);\r
                                break;\r
                        }\r
                }\r
index 4bae6b877b42ece8d880a82f073d6f3a5a12492f..fb2196d17dda5b25e783eecd28f5e48769e00cda 100644 (file)
@@ -524,7 +524,7 @@ int athrs27_phy_speed(int ethUnit, int phyUnit){
                                        phySpeed = _1000BASET;
                                        break;
                                default:
-                                       printf("## Error: unknown eth speed!\n");
+                                       printf_err("unknown eth speed!\n");
                        }
                }
 
@@ -717,7 +717,7 @@ unsigned int s27_rd_phy(unsigned int phy_addr, unsigned int reg_addr){
                i++;
 
                if(i > 824)     {
-                       printf("## Error: MDIO_BUSY!\n");
+                       printf_err("MDIO_BUSY!\n");
                        break;
                }
 
@@ -749,7 +749,7 @@ void s27_wr_phy(unsigned int phy_addr, unsigned int reg_addr, unsigned int write
                i++;
 
                if(i > 824)     {
-                       printf("## Error: MDIO_BUSY!\n");
+                       printf_err("MDIO_BUSY!\n");
                        break;
                }
 
index 18723cf244b635957116b600a3046380ea68130a..a3c9e3fa89ae051d7617786543a6ec56e3248cfa 100644 (file)
@@ -99,8 +99,6 @@ ath_gmac_send(struct eth_device *dev, volatile void *packet, int length)
                if (!ath_gmac_tx_owned_by_dma(f))
                        break;
        }
-       if (i == MAX_WAIT)
-               printf("Tx Timed out\n");
 
        f->pkt_start_addr = 0;
        f->pkt_size = 0;
@@ -177,7 +175,6 @@ void ath_gmac_mii_setup(ath_gmac_mac_t *mac)
        ath_reg_wr(SWITCH_CLOCK_SPARE_ADDRESS, 0x231);
        //ath_reg_wr(SWITCH_CLOCK_SPARE_ADDRESS, 0x520);
        if ((mac->mac_unit == 1)) {
-               //printf("Honey Bee ---->  MAC 1 S27 PHY *\n");
                ath_reg_wr(ATH_ETH_CFG, ETH_CFG_ETH_RXDV_DELAY_SET(3) |
                                        ETH_CFG_ETH_RXD_DELAY_SET(3)|
                                        ETH_CFG_RGMII_GE0_SET(1));
@@ -194,8 +191,6 @@ void ath_gmac_mii_setup(ath_gmac_mac_t *mac)
        }
 
        if (is_vir_phy()) {
-               //printf("Honey Bee ---->VIR PHY*\n");
-
                ath_reg_wr(ATH_ETH_CFG, ETH_CFG_ETH_RXDV_DELAY_SET(3) |
                                        ETH_CFG_ETH_RXD_DELAY_SET(3)|
                                        ETH_CFG_RGMII_GE0_SET(1));
@@ -211,7 +206,6 @@ void ath_gmac_mii_setup(ath_gmac_mac_t *mac)
        }
        if (is_s27()) {
                mgmt_cfg_val = 2;
-               //printf("Scorpion ---->S27 PHY*\n");
                ath_reg_wr(ETH_CFG_ADDRESS, ETH_CFG_MII_GE0_SET(1)|
                                         ETH_CFG_MII_GE0_SLAVE_SET(1));
                udelay(1000);
@@ -255,11 +249,6 @@ static void ath_gmac_hw_start(ath_gmac_mac_t *mac)
        ath_gmac_reg_wr(mac, ATH_MAC_FIFO_CFG_5, 0x7ffff);
 
        ath_gmac_reg_wr(mac, ATH_MAC_FIFO_CFG_3, 0x1f00140);
-
-       //printf(": cfg1 %#x cfg2 %#x\n", ath_gmac_reg_rd(mac, ATH_MAC_CFG1),
-       //              ath_gmac_reg_rd(mac, ATH_MAC_CFG2));
-
-
 }
 
 static int ath_gmac_check_link(ath_gmac_mac_t *mac)
@@ -297,7 +286,6 @@ static int ath_gmac_check_link(ath_gmac_mac_t *mac)
                        break;
 
                default:
-                       printf("Invalid speed detected\n");
                        return 0;
        }
 
@@ -307,8 +295,6 @@ static int ath_gmac_check_link(ath_gmac_mac_t *mac)
        mac->duplex = duplex;
        mac->speed = speed;
 
-       printf("dup %d speed %d\n", duplex, speed);
-
        ath_gmac_set_mac_duplex(mac,duplex);
 
        return 1;
@@ -358,7 +344,6 @@ static int ath_gmac_alloc_fifo(int ndesc, ath_gmac_desc_t ** fifo)
        size += CFG_CACHELINE_SIZE - 1;
 
        if ((p = malloc(size)) == NULL) {
-               //printf("Cant allocate fifos\n");
                return -1;
        }
 
@@ -439,7 +424,6 @@ athr_mgmt_init(void)
 
        ath_reg_wr(GPIO_OUT_FUNCTION4_ADDRESS, rddata);
 #endif
-       //printf ("%s ::done\n",__func__);
 }
 
 int ath_gmac_enet_initialize(bd_t * bis)
@@ -448,8 +432,6 @@ int ath_gmac_enet_initialize(bd_t * bis)
        u32 mask, mac_h, mac_l;
        int i;
 
-       //printf("%s...\n", __func__);
-
        /* Switch Analog and digital reset seq */
        mask = ATH_RESET_GE1_PHY |  ATH_RESET_GE0_PHY;
        ath_reg_rmw_set(RST_RESET_ADDRESS, mask);
@@ -499,9 +481,6 @@ int ath_gmac_enet_initialize(bd_t * bis)
                if(!i) {
                        mask = (ATH_RESET_GE0_MAC | ATH_RESET_GE1_MAC | ATH_RESET_GE0_MDIO | ATH_RESET_GE1_MDIO);
 
-
-                       //printf("%s: reset mask:%x \n", __func__, mask);
-
                        ath_reg_rmw_set(RST_RESET_ADDRESS, mask);
                        udelay(1000 * 100);
 
@@ -529,19 +508,16 @@ int ath_gmac_enet_initialize(bd_t * bis)
 
                if (ath_gmac_macs[i]->mac_unit == 0) { /* WAN Phy */
 #ifdef  CFG_ATHRS27_PHY
-                       //printf("S27 reg init\n");
                        athrs27_reg_init();
                        mask = ATH_RESET_GE0_MAC;
                         ath_reg_rmw_clear(RST_RESET_ADDRESS, mask);
 #endif
 
 #ifdef CONFIG_VIR_PHY
-                       //printf("VIRPhy reg init \n");
                        athr_vir_reg_init();
 #endif
                } else {
 #ifdef  CFG_ATHRS27_PHY
-                       //printf("S27 reg init\n");
                        athrs27_reg_init_lan();
                        mask = ATH_RESET_GE1_MAC;
                         ath_reg_rmw_clear(RST_RESET_ADDRESS, mask);
@@ -567,7 +543,6 @@ int ath_gmac_enet_initialize(bd_t * bis)
 
 
        ath_gmac_phy_setup(ath_gmac_macs[i]->mac_unit);
-               //printf("%s up\n",dev[i]->name);
        }
 
 
@@ -594,9 +569,6 @@ ath_gmac_miiphy_read(char *devname, uint32_t phy_addr, uint8_t reg, uint16_t *da
                rddata = ath_gmac_reg_rd(mac, ATH_MII_MGMT_IND) & 0x1;
        }while(rddata && --ii);
 
-       if (ii == 0)
-               printf("ERROR:%s:%d transaction failed\n",__func__,__LINE__);
-
 
        ath_gmac_reg_wr(mac, ATH_MII_MGMT_CMD, 0x0);
        ath_gmac_reg_wr(mac, ATH_MII_MGMT_ADDRESS, addr);
@@ -608,9 +580,6 @@ ath_gmac_miiphy_read(char *devname, uint32_t phy_addr, uint8_t reg, uint16_t *da
                rddata = ath_gmac_reg_rd(mac, ATH_MII_MGMT_IND) & 0x1;
        }while(rddata && --ii);
 
-       if(ii==0)
-               printf("Error!!! Leave ath_gmac_miiphy_read without polling correct status!\n");
-
        val = ath_gmac_reg_rd(mac, ATH_MII_MGMT_STATUS);
        ath_gmac_reg_wr(mac, ATH_MII_MGMT_CMD, 0x0);
 
@@ -638,9 +607,6 @@ ath_gmac_miiphy_write(char *devname, uint32_t phy_addr, uint8_t reg, uint16_t da
                rddata = ath_gmac_reg_rd(mac, ATH_MII_MGMT_IND) & 0x1;
        } while (rddata && --ii);
 
-       if (ii == 0)
-               printf("ERROR:%s:%d transaction failed\n",__func__,__LINE__);
-
        ath_gmac_reg_wr(mac, ATH_MII_MGMT_ADDRESS, addr);
        ath_gmac_reg_wr(mac, ATH_MII_MGMT_CTRL, data);
 
@@ -648,9 +614,6 @@ ath_gmac_miiphy_write(char *devname, uint32_t phy_addr, uint8_t reg, uint16_t da
                rddata = ath_gmac_reg_rd(mac, ATH_MII_MGMT_IND) & 0x1;
        } while (rddata && --ii);
 
-       if (ii == 0)
-               printf("Error!!! Leave ath_gmac_miiphy_write without polling correct status!\n");
-       
        return 0; 
 }
 //#endif /* CONFIG_CMD_MII */
index 21954db5ad27081a82a16d88511ccafebaf2c550..b16b8cd7bed3f34aa14133fabf1a0bb61c54c1e4 100644 (file)
@@ -57,7 +57,7 @@ u32 flash_init(void)
                jedec_id = qca_sf_jedec_id(bank);
 
                if (jedec_id == 0) {
-                       printf("## Error: SPI NOR FLASH chip in bank #%d\n"
+                       printf_err("SPI NOR FLASH chip in bank #%d\n"
                                   "   is not responding, skipping\n\n", bank + 1);
                        continue;
                }
@@ -73,7 +73,7 @@ u32 flash_init(void)
                                info->sector_size = sfdp_ss;
                                info->erase_cmd   = sfdp_ec;
 
-                               printf("** Warning: SPI NOR FLASH in bank #%d is\n"
+                               printf_wrn("SPI NOR FLASH in bank #%d is\n"
                                           "   unknown, JEDEC ID: 0x%06X\n\n", bank + 1, jedec_id);
 
                                printf("   Information provided in SFDP:\n"
@@ -95,7 +95,7 @@ u32 flash_init(void)
                                        #error "Not supported CONFIG_DEFAULT_FLASH_SIZE_IN_MB value!"
                                #endif
 
-                               printf("## Error: SPI NOR FLASH chip in bank #%d\n"
+                               printf_err("SPI NOR FLASH chip in bank #%d\n"
                                           "   is unknown, JEDEC ID: 0x%06X, will\n"
                                           "   use fixed/predefined size: ", bank + 1, jedec_id);
                                print_size(info->size, "\n\n");
index 000ad3cf4cc24e4ff3590defa0677f7138ed11b3..c848308aad2c8307ef9beaa5ff9d291bbeba2986 100644 (file)
@@ -433,13 +433,13 @@ int do_bootm(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        case TPL_IH_VERSION_V2:
        case TPL_IH_VERSION_V3:
        default:
-               puts("## Error: unsupported image header\n");
+               printf_err("unsupported image header\n");
                return 1;
        }
 
        /* Always verify header CRC */
        if (ih_header_crc(hdr, tpl_type) != 0) {
-               puts("## Error: header checksum mismatch!\n");
+               printf_err("header checksum mismatch!\n");
                return 1;
        }
 
@@ -451,7 +451,7 @@ int do_bootm(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        }
 
        if (ih_data_crc(data, hdr, tpl_type, verify) != 0) {
-               puts("## Error: data checksum mismatch!\n");
+               printf_err("data checksum mismatch!\n");
                return 1;
        }
 
@@ -462,7 +462,7 @@ int do_bootm(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 
        /* We support only MIPS */
        if (hdr->ih_arch != IH_CPU_MIPS) {
-               puts("## Error: unsupported architecture!\n");
+               printf_err("unsupported architecture!\n");
                return 1;
        }
 
@@ -481,7 +481,7 @@ int do_bootm(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 
                break;
        default:
-               puts("## Error: unsupported image type!\n");
+               printf_err("unsupported image type!\n");
                return 1;
        }
 
@@ -523,15 +523,15 @@ int do_bootm(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                /* TODO: more verbose LZMA errors */
                if (i != LZMA_RESULT_OK) {
                        puts("ERROR\n");
-                       printf("## Error: LZMA error '%d'!\n", i);
+                       printf_err("LZMA error '%d'!\n", i);
                        return 1;
                }
 
                puts("OK!\n");
                break;
        default:
-               printf("## Error: unsupported compression type '%s'!\n",
-                       ih_comp_type(hdr->ih_comp));
+               printf_err("unsupported compression type '%s'!\n",
+                          ih_comp_type(hdr->ih_comp));
 
                return 1;
        }
@@ -603,13 +603,13 @@ int do_iminfo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        case TPL_IH_VERSION_V2:
        case TPL_IH_VERSION_V3:
        default:
-               puts("## Error: unsupported image header\n");
+               printf_err("unsupported image header\n");
                return 1;
        }
 
        /* Always verify header CRC */
        if (ih_header_crc(hdr, tpl_type) != 0) {
-               puts("## Error: header checksum mismatch!\n");
+               printf_err("header checksum mismatch!\n");
                return 1;
        }
 
@@ -621,7 +621,7 @@ int do_iminfo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        }
 
        if (ih_data_crc(data, hdr, tpl_type, 1) != 0) {
-               puts("## Error: data checksum mismatch!\n");
+               printf_err("data checksum mismatch!\n");
                return 1;
        }
 
index fd2c3b2604eb7d5f8390a06e9e792b11afc203a8..a9e7efa7f9bdf814fa5be81192b44e72ec5d43eb 100644 (file)
@@ -78,7 +78,7 @@ int do_set_mac(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]){
        }
 
        if(j != 5){
-               puts("## Error: given MAC address has wrong format (should be: xx:xx:xx:xx:xx:xx)!\n");
+               printf_err("given MAC address has wrong format (should be: xx:xx:xx:xx:xx:xx)!\n");
                return(1);
        }
 
@@ -86,7 +86,7 @@ int do_set_mac(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]){
        data_pointer = (unsigned char *)CONFIG_LOADADDR;
 
        if(!data_pointer){
-               puts("## Error: couldn't allocate RAM for data block backup!\n");
+               printf_err("couldn't allocate RAM for data block backup!\n");
                return(1);
        }
 
index b992f9911e4990c56f88f5396e5a495d9fa1f6de..fea96d7ffeda0b4c499f5a96e416e84c9437cf7b 100644 (file)
@@ -180,7 +180,7 @@ static int addr_spec(char *arg1, char *arg2, ulong *addr_first, ulong *addr_last
 
                if(!found){
                        /* error, addres not in flash */
-                       printf("## Error: end address (0x%08lx) not in FLASH!\n", *addr_last);
+                       printf_err("end address (0x%08lx) not in FLASH!\n", *addr_last);
                        return(-1);
                }
 
@@ -240,14 +240,14 @@ static int flash_fill_sect_ranges(ulong addr_first, ulong addr_last, int *s_firs
                                if(addr_last > b_end){
                                        s_last[bank] = s_end;
                                } else {
-                                       puts("## Error: end address not on sector boundary\n");
+                                       printf_err("end address not on sector boundary\n");
                                        rcode = 1;
                                        break;
                                }
                        }
 
                        if(s_last[bank] < s_first[bank]){
-                               puts("## Error: end sector precedes start sector\n");
+                               printf_err("end sector precedes start sector\n");
                                rcode = 1;
                                break;
                        }
@@ -256,11 +256,11 @@ static int flash_fill_sect_ranges(ulong addr_first, ulong addr_last, int *s_firs
                        addr_first = (sect == s_end) ? b_end + 1 : info->start[sect + 1];
                        (*s_count) += s_last[bank] - s_first[bank] + 1;
                } else if(addr_first >= info->start[0] && addr_first < b_end){
-                       puts("## Error: start address not on sector boundary\n");
+                       printf_err("start address not on sector boundary\n");
                        rcode = 1;
                        break;
                } else if(s_last[bank] >= 0){
-                       puts("## Error: cannot span across banks when they are mapped in reverse order\n");
+                       printf_err("cannot span across banks when they are mapped in reverse order\n");
                        rcode = 1;
                        break;
                }
@@ -292,7 +292,7 @@ int do_flerase(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]){
 
        if((n = abbrev_spec(argv[1], &info, &sect_first, &sect_last)) != 0){
                if(n < 0){
-                       puts("## Error: bad sector spec\n");
+                       printf_err("bad sector spec\n");
                        return(1);
                }
                printf("Erase FLASH sectors %d-%d in bank #%d ", sect_first, sect_last, (info - flash_info) + 1);
@@ -309,7 +309,7 @@ int do_flerase(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]){
                bank = simple_strtoul(argv[2], NULL, 16);
 
                if((bank < 1) || (bank > CFG_MAX_FLASH_BANKS)){
-                       printf("## Error: only FLASH banks #1...#%d supported\n", CFG_MAX_FLASH_BANKS);
+                       printf_err("only FLASH banks #1...#%d supported\n", CFG_MAX_FLASH_BANKS);
                        return(1);
                }
 
@@ -320,7 +320,7 @@ int do_flerase(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]){
        }
 
        if(addr_spec(argv[1], argv[2], &addr_first, &addr_last) < 0){
-               printf("## Error: bad address format\n");
+               printf_err("bad address format\n");
                return(1);
        }
 
@@ -353,7 +353,7 @@ int flash_sect_erase(ulong addr_first, ulong addr_last){
                }
                printf("Erased sectors: %d\n\n", erased);
        } else if(rcode == 0){
-               puts("## Error: start and/or end address not on sector boundary\n");
+               printf_err("start and/or end address not on sector boundary\n");
                rcode = 1;
        }
        return(rcode);
index 75148d4c456685690bb6b9e36cb4803a2680cc13..e61d23cb450f2783709d96e8d6ae334115530587 100644 (file)
@@ -131,7 +131,7 @@ int do_setexpr(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                value = a % b;
                break;
        default:
-               printf("## Error: invalid op\n");
+               printf_err("invalid op\n");
                return 1;
        }
 
@@ -271,7 +271,7 @@ static int binary_test(char *op, char *arg1, char *arg2, int w)
                }
        }
 
-       printf("## Error: unknown operator '%s'\n", op);
+       printf_err("unknown operator '%s'\n", op);
 
        /* Op code not found */
        return 0;
@@ -304,7 +304,7 @@ int do_itest(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                break;
        case -1:
        default:
-               puts("## Error: invalid data width specifier\n");
+               printf_err("invalid data width specifier\n");
                value = 0;
                break;
        }
index f5baaa7ca775dd87d590790eaf623ad4ef504de2..4556d8905b1fa0e37fc48b753037fc69bf2c267b 100644 (file)
@@ -114,8 +114,8 @@ int do_load_serial(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                }
 
                if(i == N_BAUDRATES){
-                       printf("## Error: baudrate %d bps is not supported, will use current: %d bps\n",
-                                       load_baudrate, current_baudrate);
+                       printf_err("baudrate %d bps is not supported, will use current: %d bps\n",
+                                  load_baudrate, current_baudrate);
                } else {
                        switch_baudrate(load_baudrate, 0);
                }
@@ -139,7 +139,7 @@ int do_load_serial(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        }
 
        if(addr == ~0){
-               printf("## Error: S-Record download aborted!\n");
+               printf_err("S-Record download aborted!\n");
                rcode = 1;
        }
 
@@ -308,8 +308,8 @@ int do_save_serial(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                }
 
                if(i == N_BAUDRATES){
-                       printf("## Error: baudrate %d bps is not supported, will use current: %d bps\n",
-                                       save_baudrate, current_baudrate);
+                       printf_err("baudrate %d bps is not supported, will use current: %d bps\n",
+                                  save_baudrate, current_baudrate);
                } else {
                        switch_baudrate(save_baudrate, 0);
                }
@@ -323,7 +323,7 @@ int do_save_serial(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        }
 
        if(save_serial(offset, size)){
-               printf("## Error: S-Record upload aborted!\n");
+               printf_err("S-Record upload aborted!\n");
        } else {
                printf("\nS-Record upload complete!\n");
        }
@@ -476,13 +476,13 @@ int do_load_serial_bin(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        }
 
        if(address == 0){
-               printf("## Error: destination address can't be 0x0!\n");
+               printf_err("destination address can't be 0x0!\n");
                return 1;
        }
 
        /* don't allow to write directly to FLASH (that will need erase before!) */
        if(addr2info(address) != NULL){
-               printf("## Error: destination address in FLASH is not allowed!\n");
+               printf_err("destination address in FLASH is not allowed!\n");
                return 1;
        }
 
@@ -502,8 +502,8 @@ int do_load_serial_bin(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                }
 
                if(i == N_BAUDRATES){
-                       printf("## Error: baudrate %d bps is not supported, will use current: %d bps\n",
-                                       load_baudrate, current_baudrate);
+                       printf_err("baudrate %d bps is not supported, will use current: %d bps\n",
+                                  load_baudrate, current_baudrate);
                } else {
                        switch_baudrate(load_baudrate, 0);
                }
@@ -527,7 +527,8 @@ int do_load_serial_bin(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                sprintf(buf, "%X", size_dl);
                setenv("filesize", buf);
        } else {
-               printf("\n## Error: downloaded data size is zero!\n");
+               puts("\n");
+               printf_err("downloaded data size is zero!\n");
                rcode = 1;
        }
 
@@ -1064,7 +1065,8 @@ static ulong load_serial_ymodem(ulong address)
                        memcpy((char *)(store_addr), ymodemBuf, res);
                }
        } else {
-               printf("\n## Error: %s\n", xyzModem_error(err));
+               puts("\n");
+               printf_err("%s\n", xyzModem_error(err));
        }
 
        xyzModem_stream_close(&err);
index 33fb04da6be9053f3dbee7117d0c46887ba18c97..d1eaba4a181c27188ec95704b9186205003607ec 100644 (file)
@@ -113,8 +113,8 @@ int do_mem_crc32(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        } else {
                vcrc = simple_strtoul(*av++, NULL, 16);
                if (vcrc != crc) {
-                       printf("## Error: CRC32 checksum for data at 0x%08lX ~ 0x%08lX: 0x%08lX (not 0x%08lX!)\n",
-                               addr, addr + length - 1, crc, vcrc);
+                       printf_err("CRC32 checksum for data at 0x%08lX ~ 0x%08lX: 0x%08lX (not 0x%08lX!)\n",
+                                  addr, addr + length - 1, crc, vcrc);
 
                        return 1;
                }
@@ -319,7 +319,7 @@ int do_mem_cp(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        count = simple_strtoul(argv[3], NULL, 16);
 
        if (count == 0) {
-               puts("## Error: zero length?\n");
+               printf_err("zero length?\n");
                return 1;
        }
 
@@ -414,14 +414,14 @@ int do_mem_mtest(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                end = (ulong *)CFG_MEMTEST_END;
 
        if ((uint)start >= (uint)end) {
-               puts("## Error: end address must be bigger than start address!\n");
+               printf_err("end address must be bigger than start address!\n");
                return 1;
        }
 
        if (((uint)start < (uint)CFG_MEMTEST_START) ||
            ((uint)end   > (uint)CFG_MEMTEST_END)) {
-               printf("## Error: start and end addresses should be in 0x%08X...0x%08X range!\n",
-                       (uint)CFG_MEMTEST_START, (uint)CFG_MEMTEST_END);
+               printf_err("start and end addresses should be in 0x%08X...0x%08X range!\n",
+                          (uint)CFG_MEMTEST_START, (uint)CFG_MEMTEST_END);
 
                return 1;
        }
@@ -474,16 +474,16 @@ int do_mem_mtest(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                                readback = *addr;
 
                                if (readback != val)
-                                       printf("## Error (data line): expected 0x%08lX, found 0x%08lX\n",
-                                               val, readback);
+                                       printf_err("(data line): expected 0x%08lX, found 0x%08lX\n",
+                                                  val, readback);
 
                                *addr = ~val;
                                *dummy = val;
                                readback = *addr;
 
                                if (readback != ~val)
-                                       printf("## Error (data line): expected 0x%08lX, found 0x%08lX\n",
-                                               ~val, readback);
+                                       printf_err("(data line): expected 0x%08lX, found 0x%08lX\n",
+                                                  ~val, readback);
                        }
                }
 
@@ -548,8 +548,9 @@ int do_mem_mtest(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                        temp = start[offset];
 
                        if (temp != pattern) {
-                               printf("\n## Error: address bit stuck high @ 0x%.8lX, expected 0x%.8lX, found 0x%.8lX\n",
-                                       (ulong)&start[offset], pattern, temp);
+                               puts("\n");
+                               printf_err("address bit stuck high @ 0x%.8lX, expected 0x%.8lX, found 0x%.8lX\n",
+                                          (ulong)&start[offset], pattern, temp);
 
                                return 1;
                        }
@@ -564,8 +565,9 @@ int do_mem_mtest(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                                temp = start[offset];
 
                                if ((temp != pattern) && (offset != test_offset)) {
-                                       printf("\n## Error: address bit stuck low or shorted @ 0x%.8lX, expected 0x%.8lX, found 0x%.8lX\n",
-                                               (ulong)&start[offset], pattern, temp);
+                                       puts("\n");
+                                       printf_err("address bit stuck low or shorted @ 0x%.8lX, expected 0x%.8lX, found 0x%.8lX\n",
+                                                  (ulong)&start[offset], pattern, temp);
 
                                        return 1;
                                }
@@ -597,8 +599,9 @@ int do_mem_mtest(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                        temp = start[offset];
 
                        if (temp != pattern) {
-                               printf("\n## Error (read/write) @ 0x%.8lX: expected 0x%.8lX, found 0x%.8lX)\n",
-                                       (ulong)&start[offset], pattern, temp);
+                               puts("\n");
+                               printf_err("(read/write) @ 0x%.8lX: expected 0x%.8lX, found 0x%.8lX)\n",
+                                          (ulong)&start[offset], pattern, temp);
 
                                return 1;
                        }
@@ -613,8 +616,9 @@ int do_mem_mtest(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                        temp = start[offset];
 
                        if (temp != anti_pattern) {
-                               printf("\n## Error (read/write): @ 0x%.8lX: expected 0x%.8lX, found 0x%.8lX)\n",
-                                       (ulong)&start[offset], anti_pattern, temp);
+                               puts("\n");
+                               printf_err("(read/write): @ 0x%.8lX: expected 0x%.8lX, found 0x%.8lX)\n",
+                                          (ulong)&start[offset], anti_pattern, temp);
 
                                return 1;
                        }
@@ -644,8 +648,9 @@ int do_mem_mtest(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                        readback = *addr;
 
                        if (readback != val) {
-                               printf("\n## Error @ 0x%08X: found %08lX, expected %08lX\n",
-                                       (uint)addr, readback, val);
+                               puts("\n");
+                               printf_err("@ 0x%08X: found %08lX, expected %08lX\n",
+                                          (uint)addr, readback, val);
 
                                rcode = 1;
                        }
index a9d0cc15f34d1acaea8bcd5ccd0c67efdc34fb5f..f02dbaf01128ab178db7f5a80fceb70ea86b95e5 100644 (file)
@@ -210,7 +210,8 @@ int do_ping(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]){
        }
 
        if(NetLoop(PING) < 0){
-               printf("\n## Error: ping failed, host %s is not alive!\n\n", argv[1]);
+               puts("\n");
+               printf_err("ping failed, host %s is not alive!\n\n", argv[1]);
                return(1);
        }
 
@@ -233,7 +234,7 @@ int do_sntp(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]){
        } else {
                NetNtpServerIP = string_to_ip(argv[1]);
                if(NetNtpServerIP == 0){
-                       printf("## Error: bad SNTP server IP address\n");
+                       printf_err("bad SNTP server IP address\n");
                        return(1);
                }
        }
@@ -247,7 +248,7 @@ int do_sntp(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]){
        }
 
        if(NetLoop(SNTP) < 0){
-               printf("## Error: SNTP host %s not responding\n", argv[1]);
+               printf_err("SNTP host %s not responding\n", argv[1]);
                return(1);
        }
 
index 7a198d72eb635e02d4f6c95dc450e4d30897c00c..fa735a2facdc76a99ee7447d8247dc50141c3088 100644 (file)
@@ -146,7 +146,7 @@ int do_printenv(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]){
                        break;
                }
                if(k < 0){
-                       printf("## Error: \"%s\" not defined\n", name);
+                       printf_err("'%s' not defined\n", name);
                        rcode++;
                }
        }
@@ -202,7 +202,7 @@ int _do_setenv(int flag, int argc, char *argv[]){
 
                if(console != -1){
                        if(argc < 3){ /* Cannot delete it! */
-                               printf("## Error: can't delete \"%s\"\n", name);
+                               printf_err("can't delete '%s'\n", name);
                                return(1);
                        }
 
@@ -232,8 +232,8 @@ int _do_setenv(int flag, int argc, char *argv[]){
                        }
 
                        if(i == N_BAUDRATES){
-                               printf("## Error: baudrate %d bps is not supported,\n", baudrate);
-                               printf("          choose one from the list:\n\n");
+                               printf_err("baudrate %d bps is not supported,\n"
+                                          "          choose one from the list:\n\n", baudrate);
                                for(i = 0; i < N_BAUDRATES; ++i){
                                        printf("- %7d bps%s\n", baudrate_table[i], baudrate_table[i] == gd->baudrate ? " [current]" : "");
                                }
@@ -314,7 +314,7 @@ int _do_setenv(int flag, int argc, char *argv[]){
        }
 
        if(len > (&env_data[ENV_SIZE] - env)){
-               printf("## Error: environment overflow, \"%s\" deleted\n", name);
+               printf_err("environment overflow, '%s' deleted\n", name);
                return(1);
        }
 
index fae1cdf186d9b2ca24b2012dc4f9828f6c2fdb9d..b0e33b0a2bedc16e1bb4ceb7d0057c86d7cac701 100644 (file)
@@ -160,8 +160,7 @@ int do_set_clk(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 
 #ifndef CONFIG_QCA_GPIO_OC_RECOVERY_BTN
                puts("\n");
-               puts("** Warning:");
-               puts("   your device does not support O/C revovery mode!\n");
+               printf_wrn("\n   your device does not support O/C revovery mode!\n");
 #endif
 
                puts("\n");
@@ -170,7 +169,7 @@ int do_set_clk(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                i = simple_strtoul(argv[1], NULL, 10);
 
                if (i > clk_profiles_cnt || i < 1) {
-                       printf("## Error: selected profile should be in range 1..%d!\n\n",
+                       printf_err("selected profile should be in range 1..%d!\n\n",
                                   clk_profiles_cnt);
                        return 1;
                }
@@ -203,7 +202,7 @@ int do_set_clk(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                                CONFIG_QCA_PLL_IN_FLASH_BLOCK_SIZE);
 
                if (run_command(buf, 0) < 0) {
-                       puts("## Error: could not make data backup in RAM!\n\n");
+                       printf_err("could not make data backup in RAM!\n\n");
                        return 1;
                }
 
@@ -234,7 +233,7 @@ int do_set_clk(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                                CONFIG_QCA_PLL_IN_FLASH_BLOCK_SIZE);
 
                if (run_command(buf, 0) < 0) {
-                       puts("## Error: could not erase FLASH and copy data back from RAM!\n\n");
+                       printf_err("could not erase FLASH and copy data back from RAM!\n\n");
                        return 1;
                }
 
@@ -254,8 +253,7 @@ int do_set_clk(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        #endif
 #else
                puts("\n");
-               puts("** Warning:");
-               puts("   your device does not support O/C revovery mode!\n");
+               printf_wrn("\n   your device does not support O/C revovery mode!\n");
 #endif /* CONFIG_QCA_GPIO_OC_RECOVERY_BTN */
 
                puts("\n");
@@ -282,7 +280,7 @@ int do_clear_clk(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                                CONFIG_QCA_PLL_IN_FLASH_BLOCK_SIZE);
 
                if (run_command(buf, 0) < 0) {
-                       puts("## Error: could not make data backup in RAM!\n\n");
+                       printf_err("could not make data backup in RAM!\n\n");
                        return 1;
                }
 
@@ -304,11 +302,11 @@ int do_clear_clk(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                                CONFIG_QCA_PLL_IN_FLASH_BLOCK_SIZE);
 
                if (run_command(buf, 0) < 0) {
-                       puts("## Error: could not erase FLASH and copy data back from RAM!\n\n");
+                       printf_err("could not erase FLASH and copy data back from RAM!\n\n");
                        return 1;
                }
        } else {
-               puts("** Warning: clock configuration is not stored in FLASH!\n\n");
+               printf_wrn("clock configuration is not stored in FLASH!\n\n");
                return 1;
        }
 
index 8d0f72080d2bf5c9264bfceac2e453c80f4fb53e..0ce11d6dde79a08919b5dad6ec6ded1049dc5f8e 100644 (file)
@@ -209,7 +209,6 @@ void puts(const char *s){
 
 void printf(const char *fmt, ...){
        va_list args;
-       //uint i;
        char printbuffer[CFG_PBSIZE];
 
        va_start(args, fmt);
@@ -217,28 +216,44 @@ void printf(const char *fmt, ...){
        /* For this to work, printbuffer must be larger than
         * anything we ever want to print.
         */
-       //i = vsprintf(printbuffer, fmt, args);
        vsprintf(printbuffer, fmt, args);
        va_end(args);
 
        /* Print the string */
        puts(printbuffer);
 }
-#if 0
-void vprintf(const char *fmt, va_list args){
-       //uint i;
+
+void printf_err(const char *fmt, ...)
+{
+       va_list args;
        char printbuffer[CFG_PBSIZE];
 
-       /* For this to work, printbuffer must be larger than
-        * anything we ever want to print.
-        */
-       //i = vsprintf(printbuffer, fmt, args);
+       va_start(args, fmt);
+
+       puts("## Error: ");
+
        vsprintf(printbuffer, fmt, args);
+       va_end(args);
 
-       /* Print the string */
        puts(printbuffer);
 }
-#endif
+
+void printf_wrn(const char *fmt, ...)
+{
+       va_list args;
+
+       char printbuffer[CFG_PBSIZE];
+
+       va_start(args, fmt);
+
+       puts("** Warning: ");
+
+       vsprintf(printbuffer, fmt, args);
+       va_end(args);
+
+       puts(printbuffer);
+}
+
 /* test if ctrl-c was pressed */
 static int ctrlc_disabled = 0; /* see disable_ctrl() */
 static int ctrlc_was_pressed = 0;
index 9e9e58e3e95fb09baf506fd7fc51b7cdabcfe151..722add9c06ae79f49062b2155311fd62b7b4296b 100644 (file)
@@ -202,12 +202,12 @@ void env_relocate(void)
 
        if (gd->env_valid == 0) {
 #if !defined(CFG_ENV_IS_NOWHERE)
-               puts("** Warning: bad env CRC, using default,\n"
-                        "   use 'saveenv' to save it in FLASH\n\n");
+               printf_wrn("bad env CRC, using default,\n"
+                          "   use 'saveenv' to save it in FLASH\n\n");
 #endif
 
                if (sizeof(default_environment) > ENV_SIZE) {
-                       puts("## Error: default env is too big!\n");
+                       printf_err("default env is too big!\n");
                        return;
                }
 
index 54913d252fb32bb110c79283275f5808f8b2d083..34ba997e978d0b6487349df2a480c0fdc334f880 100644 (file)
@@ -144,7 +144,7 @@ int saveenv(void){
 
        if(up_data){
                if((saved_data = malloc(up_data)) == NULL){
-                       printf("## Error: unable to save the rest of sector (%ld)\n", up_data);
+                       printf_err("unable to save the rest of sector (%ld)\n", up_data);
                        goto Done;
                }
 
@@ -291,7 +291,7 @@ void env_relocate_spec(void){
        }
 
        if(gd->env_valid == 2){
-               puts("** Warning: some problems detected reading environment, recovered successfully\n");
+               printf_wrn("some problems detected reading environment, recovered successfully\n");
        }
        #endif /* CFG_ENV_ADDR_REDUND */
 
index 4e92b2e2e0d18f1ff007493b49af946d60166c05..ee8e01ae75a950e95e8bf0525f949b7b09142c8e 100644 (file)
@@ -151,28 +151,28 @@ void flash_perror(int err)
        case ERR_OK:
                break;
        case ERR_TIMOUT:
-               puts("## Error: timeout writing to FLASH\n");
+               printf_err("timeout writing to FLASH\n");
                break;
        case ERR_NOT_ERASED:
-               puts("## Error: FLASH not erased\n");
+               printf_err("FLASH not erased\n");
                break;
        case ERR_INVAL:
-               puts("## Error: outside available FLASH\n");
+               printf_err("outside available FLASH\n");
                break;
        case ERR_ALIGN:
-               puts("## Error: start and/or end address not on sector boundary\n");
+               printf_err("start and/or end address not on sector boundary\n");
                break;
        case ERR_UNKNOWN_FLASH_VENDOR:
-               puts("## Error: unknown vendor of FLASH\n");
+               printf_err("unknown vendor of FLASH\n");
                break;
        case ERR_UNKNOWN_FLASH_TYPE:
-               puts("## Error: unknown type of FLASH\n");
+               printf_err("unknown type of FLASH\n");
                break;
        case ERR_PROG_ERROR:
-               puts("## Error: general FLASH programming error\n");
+               printf_err("general FLASH programming error\n");
                break;
        default:
-               printf("## Error: %s[%d] FIXME: rc=%d\n", __FILE__, __LINE__, err);
+               printf_err("%s[%d] FIXME: rc=%d\n", __FILE__, __LINE__, err);
                break;
        }
 }
index 8d9edd9970d4f2385b3ba146af86857eb0974729..0b0e7d074035f5dbc169a66401c882321965345e 100644 (file)
@@ -226,7 +226,7 @@ static inline void debug_printf(const char *format, ...) {
 #define final_printf debug_printf
 
 static void syntax_err(void) {
-       printf("## Error: syntax error!\n");
+       printf_err("syntax error!\n");
 }
 
 static void *xmalloc(size_t size);
@@ -571,13 +571,13 @@ static int run_pipe_real(struct pipe *pi) {
                 * "help;flinfo" must not execute
                 */
                if (strchr(child->argv[i], ';')) {
-                       printf("## Error: unknown command '%s' - try 'help' or use 'run' command\n", child->argv[i]);
+                       printf_err("unknown command '%s' - try 'help' or use 'run' command\n", child->argv[i]);
                        return -1;
                }
 
                /* Look up command in command table */
                if ((cmdtp = find_cmd(child->argv[i])) == NULL) {
-                       printf("## Error: unknown command '%s' - try 'help'\n", child->argv[i]);
+                       printf_err("unknown command '%s' - try 'help'\n", child->argv[i]);
                        return -1; /* give up after bad command */
                } else {
                        int rcode;
@@ -587,7 +587,7 @@ static int run_pipe_real(struct pipe *pi) {
                        /* avoid "bootd" recursion */
                        if (cmdtp->cmd == do_bootd) {
                                if (flag & CMD_FLAG_BOOTD) {
-                                       printf ("## Error: 'bootd' recursion detected!\n");
+                                       printf_err("'bootd' recursion detected!\n");
                                        return -1;
                                } else {
                                        flag |= CMD_FLAG_BOOTD;
@@ -833,7 +833,7 @@ static int set_local_var(const char *s, int flg_export) {
        name = strdup(s);
 
        if (getenv(name) != NULL) {
-               printf("## Error: there is a global environment variable with the same name!\n");
+               printf_err("there is a global environment variable with the same name!\n");
                free(name);
                return -1;
        }
@@ -861,7 +861,7 @@ static int set_local_var(const char *s, int flg_export) {
                                result++;
                } else {
                        if (cur->flg_read_only) {
-                               error_msg("%s: readonly variable", name);
+                               printf_err("%s: readonly variable", name);
                                result = -1;
                        } else {
                                if (flg_export > 0 || cur->flg_export > 1)
@@ -1361,7 +1361,7 @@ int parse_stream_outer(struct in_str *inp, int flag) {
                                code = 0;
                                /* XXX hackish way to not allow exit from main loop */
                                if (inp->peek == file_peek) {
-                                       printf("## Error: exit not allowed from main input shell!\n");
+                                       printf_err("exit not allowed from main input shell!\n");
                                        continue;
                                }
                                break;
@@ -1444,7 +1444,7 @@ static void *xmalloc(size_t size) {
        void *p = NULL;
 
        if (!(p = malloc(size))) {
-               printf("## Error: memory not allocated!\n");
+               printf_err("memory not allocated!\n");
                for (;;)
                        ;
        }
@@ -1455,7 +1455,7 @@ static void *xrealloc(void *ptr, size_t size) {
        void *p = NULL;
 
        if (!(p = realloc(ptr, size))) {
-               printf("## Error: memory not allocated!\n");
+               printf_err("memory not allocated!\n");
                for (;;)
                        ;
        }
index 9150820fe047ebe5581f1e6870d330b49e6a2932..6237d154cda007a80acaa03e8b2b949446063fcf 100644 (file)
@@ -388,7 +388,7 @@ int parse_line(char *line, char *argv[])
                *line++ = '\0';
        }
 
-       printf("## Error: too many args (max. %d)\n", CFG_MAXARGS);
+       printf_err("too many args (max. %d)\n", CFG_MAXARGS);
 
        return nargs;
 }
@@ -540,7 +540,7 @@ int run_command(const char *cmd, int flag){
                return -1;
 
        if (strlen(cmd) >= CFG_CBSIZE) {
-               puts("## Error: command too long!\n");
+               printf_err("command too long!\n");
                return -1;
        }
 
@@ -585,7 +585,8 @@ int run_command(const char *cmd, int flag){
 
                /* Look up command in command table */
                if ((cmdtp = find_cmd(argv[0])) == NULL) {
-                       printf("## Error: unknown command '%s' - try 'help'\n\n", argv[0]);
+                       printf_err("unknown command '%s' - try 'help'\n", argv[0]);
+                       puts("\n");
 
                        /* Give up after bad command */
                        rc = -1;
@@ -629,7 +630,7 @@ int do_run(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
                char *arg;
 
                if ((arg = getenv(argv[i])) == NULL) {
-                       printf("## Error: '%s' not defined\n", argv[i]);
+                       printf_err("'%s' not defined\n", argv[i]);
                        return 1;
                }
 
index b63cee347504fbc41079401b16c1aa5d4febf87d..16a67aa47a21b8c186a7851a7f1040b68d3fd652 100644 (file)
@@ -65,9 +65,8 @@ static int ag7240_send(struct eth_device *dev, volatile void *packet, int length
                }
        }
 
-       if (i == MAX_WAIT) {
-               printf("Tx Timed out\n");
-       }
+       if (i == MAX_WAIT)
+               printf_err("TX timeout\n");
 
        f->pkt_start_addr = 0;
        f->pkt_size = 0;
@@ -340,7 +339,7 @@ static int ag7240_check_link(ag7240_mac_t *mac)
 
        default:
                if((s != NULL) && (strcmp(s, "nc") != 0)){
-                       printf("## Error: invalid speed detected\n");
+                       printf_err("invalid speed detected\n");
                }
                return 0;
        }
@@ -405,7 +404,7 @@ static int ag7240_alloc_fifo(int ndesc, ag7240_desc_t ** fifo)
        size += CFG_CACHELINE_SIZE - 1;
 
        if ((p = malloc(size)) == NULL) {
-               printf("Cant allocate fifos\n");
+               printf_err("can't allocate fifos\n");
                return -1;
        }
 
@@ -495,12 +494,12 @@ int ag7240_enet_initialize(bd_t * bis)
        for (i = 0; i < CFG_AG7240_NMACS; i++) {
 
                if ((dev[i] = (struct eth_device *) malloc(sizeof(struct eth_device))) == NULL) {
-                       puts("## Error: malloc failed\n");
+                       printf_err("malloc failed\n");
                        return 0;
                }
 
                if ((ag7240_macs[i] = (ag7240_mac_t *) malloc(sizeof(ag7240_mac_t))) == NULL) {
-                       puts("## Error: malloc failed\n");
+                       printf_err("malloc failed\n");
                        return 0;
                }
 
@@ -650,9 +649,6 @@ uint16_t ag7240_miiphy_read(char *devname, uint32_t phy_addr, uint8_t reg)
                rddata = ag7240_reg_rd(mac, AG7240_MII_MGMT_IND) & 0x1;
        } while (rddata && --ii);
 
-       if (ii == 0)
-               printf("ERROR:%s:%d transaction failed\n", __func__, __LINE__);
-
        ag7240_reg_wr(mac, AG7240_MII_MGMT_CMD, 0x0);
        ag7240_reg_wr(mac, AG7240_MII_MGMT_ADDRESS, addr);
        ag7240_reg_wr(mac, AG7240_MII_MGMT_CMD, AG7240_MGMT_CMD_READ);
@@ -662,9 +658,6 @@ uint16_t ag7240_miiphy_read(char *devname, uint32_t phy_addr, uint8_t reg)
                rddata = ag7240_reg_rd(mac, AG7240_MII_MGMT_IND) & 0x1;
        } while (rddata && --ii);
 
-       if (ii == 0)
-               printf("ERROR! Leave ag7240_miiphy_read without polling correct status!\n");
-
        val = ag7240_reg_rd(mac, AG7240_MII_MGMT_STATUS);
        ag7240_reg_wr(mac, AG7240_MII_MGMT_CMD, 0x0);
 
@@ -687,16 +680,10 @@ void ag7240_miiphy_write(char *devname, uint32_t phy_addr, uint8_t reg, uint16_t
                rddata = ag7240_reg_rd(mac, AG7240_MII_MGMT_IND) & 0x1;
        } while (rddata && --ii);
 
-       if (ii == 0)
-               printf("ERROR:%s:%d transaction failed\n", __func__, __LINE__);
-
        ag7240_reg_wr(mac, AG7240_MII_MGMT_ADDRESS, addr);
        ag7240_reg_wr(mac, AG7240_MII_MGMT_CTRL, data);
 
        do {
                rddata = ag7240_reg_rd(mac, AG7240_MII_MGMT_IND) & 0x1;
        } while (rddata && --ii);
-
-       if (ii == 0)
-               printf("ERROR! Leave ag7240_miiphy_write without polling correct status!\n");
 }
index 850c29bceef7e10b4933f8f9f0f6a6608ee97286..5bdd578a106d35c3e1670956ab44c9312f2f315f 100644 (file)
@@ -402,7 +402,7 @@ static int ag7240_check_link(ag7240_mac_t *mac)
 
                default:
                        if ((s != NULL) && (strcmp(s, "nc") != 0)) {
-                               printf("## Error: invalid speed detected\n");
+                               printf_err("invalid speed detected\n");
                        }
                        return 0;
        }
@@ -462,7 +462,7 @@ static int ag7240_alloc_fifo(int ndesc, ag7240_desc_t ** fifo)
        size += CFG_CACHELINE_SIZE - 1;
 
        if ((p = malloc(size)) == NULL) {
-               printf("## Error: cant allocate fifos\n");
+               printf_err("can't allocate fifos\n");
                return -1;
        }
 
index f8eeec80823e781342f00bd1c53ed60094ea8c54..687c2468c1c92d255ccb0b8af286d5da804239c0 100644 (file)
@@ -19,7 +19,8 @@ int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        full_reset();
 
        /* After full chip reset we should not reach next step... */
-       printf("\n## Error: RESET FAILED!\n");
+       puts("\n");
+       printf_err("RESET FAILED!\n");
 
        return 0;
 }
index 1303e79eb00a8dff646d2636e03a54d213655825..447dda7b923835c9cbbdc57b6ee0e6ebd77a2dff 100644 (file)
@@ -130,7 +130,7 @@ static int httpd_findandstore_firstchunk(void){
 
                        if(end){
 #if defined(WEBFAILSAFE_DISABLE_UBOOT_UPGRADE)
-                               printf("## Error: U-Boot upgrade is not allowed on this board!\n");
+                               printf_err("U-Boot upgrade is not allowed on this board!\n");
                                webfailsafe_upload_failed = 1;
 #else
                                webfailsafe_upgrade_type = WEBFAILSAFE_UPGRADE_TYPE_UBOOT;
@@ -142,7 +142,7 @@ static int httpd_findandstore_firstchunk(void){
 
                                if(end){
 #if defined(WEBFAILSAFE_DISABLE_ART_UPGRADE)
-                                       printf("## Error: U-Boot upgrade is not allowed on this board!\n");
+                                       printf_err("U-Boot upgrade is not allowed on this board!\n");
                                        webfailsafe_upload_failed = 1;
 #else
                                        printf("Upgrade type: ART\n");
@@ -155,14 +155,14 @@ static int httpd_findandstore_firstchunk(void){
                                        // if we don't know the flash type, we won't allow to update ART,
                                        // because we don't know flash size
                                        if(info->flash_id == FLASH_CUSTOM){
-                                               printf("## Error: unknown FLASH type, can't update ART!\n");
+                                               printf_err("unknown FLASH type, can't update ART!\n");
                                                webfailsafe_upload_failed = 1;
                                        }
 #endif
 #endif /* if defined(WEBFAILSAFE_DISABLE_ART_UPGRADE) */
                                } else {
 
-                                       printf("## Error: input name not found!\n");
+                                       printf_err("input name not found!\n");
                                        return(0);
 
                                }
@@ -195,19 +195,19 @@ static int httpd_findandstore_firstchunk(void){
                                // U-Boot
                                if((webfailsafe_upgrade_type == WEBFAILSAFE_UPGRADE_TYPE_UBOOT) && (hs->upload_total > CONFIG_MAX_UBOOT_SIZE)){
 
-                                       printf("## Error: file too big!\n");
+                                       printf_err("file too big!\n");
                                        webfailsafe_upload_failed = 1;
 
                                // ART
                                } else if((webfailsafe_upgrade_type == WEBFAILSAFE_UPGRADE_TYPE_ART) && (hs->upload_total != WEBFAILSAFE_UPLOAD_ART_SIZE_IN_BYTES)){
 
-                                       printf("## Error: wrong file size, should be: %d bytes!\n", WEBFAILSAFE_UPLOAD_ART_SIZE_IN_BYTES);
+                                       printf_err("wrong file size, should be: %d bytes!\n", WEBFAILSAFE_UPLOAD_ART_SIZE_IN_BYTES);
                                        webfailsafe_upload_failed = 1;
 
                                // firmware can't exceed: (FLASH_SIZE -  WEBFAILSAFE_UPLOAD_LIMITED_AREA_IN_BYTES)
                                } else if(hs->upload_total > (info->size - WEBFAILSAFE_UPLOAD_LIMITED_AREA_IN_BYTES)){
 
-                                       printf("## Error: file too big!\n");
+                                       printf_err("file too big!\n");
                                        webfailsafe_upload_failed = 1;
 
                                }
@@ -227,7 +227,7 @@ static int httpd_findandstore_firstchunk(void){
                        }
 
                } else {
-                       printf("## Error: couldn't find start of data!\n");
+                       printf_err("couldn't find start of data!\n");
                }
 
        }
@@ -306,7 +306,7 @@ void httpd_appcall(void){
                                        }
 
                                        if(i != 0){
-                                               printf("## Error: request file name too long!\n");
+                                               printf_err("request file name too long!\n");
                                                httpd_state_reset();
                                                uip_abort();
                                                return;
@@ -321,7 +321,7 @@ void httpd_appcall(void){
                                        } else {
                                                // check if we have requested file
                                                if(!fs_open((const char *)&uip_appdata[4], &fsfile)){
-                                                       printf("## Error: file not found!\n");
+                                                       printf_err("file not found!\n");
                                                        fs_open(file_404_html.name, &fsfile);
                                                }
                                        }
@@ -373,14 +373,14 @@ void httpd_appcall(void){
 #endif
 
                                                } else {
-                                                       printf("## Error: couldn't find \"Content-Length\"!\n");
+                                                       printf_err("couldn't find 'Content-Length'!\n");
                                                        httpd_state_reset();
                                                        uip_abort();
                                                        return;
                                                }
 
                                        } else {
-                                               printf("## Error: couldn't find \"Content-Length\"!\n");
+                                               printf_err("couldn't find 'Content-Length'!\n");
                                                httpd_state_reset();
                                                uip_abort();
                                                return;
@@ -388,7 +388,7 @@ void httpd_appcall(void){
 
                                        // we don't support very small files (< 10 KB)
                                        if(hs->upload_total < 10240){
-                                               printf("## Error: request for upload < 10 KB data!\n");
+                                               printf_err("request for upload < 10 KB data!\n");
                                                httpd_state_reset();
                                                uip_abort();
                                                return;
@@ -427,21 +427,21 @@ void httpd_appcall(void){
 #endif
 
                                                        } else {
-                                                               printf("## Error: couldn't allocate memory for boundary!\n");
+                                                               printf_err("couldn't allocate memory for boundary!\n");
                                                                httpd_state_reset();
                                                                uip_abort();
                                                                return;
                                                        }
 
                                                } else {
-                                                       printf("## Error: couldn't find boundary!\n");
+                                                       printf_err("couldn't find boundary!\n");
                                                        httpd_state_reset();
                                                        uip_abort();
                                                        return;
                                                }
 
                                        } else {
-                                               printf("## Error: couldn't find boundary!\n");
+                                               printf_err("couldn't find boundary!\n");
                                                httpd_state_reset();
                                                uip_abort();
                                                return;
@@ -458,7 +458,7 @@ void httpd_appcall(void){
                                        webfailsafe_data_pointer = (u8_t *)CONFIG_LOADADDR;
 
                                        if(!webfailsafe_data_pointer){
-                                               printf("## Error: couldn't allocate RAM for data!\n");
+                                               printf_err("couldn't allocate RAM for data!\n");
                                                httpd_state_reset();
                                                uip_abort();
                                                return;
@@ -544,7 +544,7 @@ void httpd_appcall(void){
                                        if(!data_start_found){
 
                                                if(!httpd_findandstore_firstchunk()){
-                                                       printf("## Error: couldn't find start of data in next packet!\n");
+                                                       printf_err("couldn't find start of data in next packet!\n");
                                                        httpd_state_reset();
                                                        uip_abort();
                                                        return;
index 610da1289d5d1bbe9903555de5a9c9dbf5f8be4f..6db3a567ed79a9214f233d85bfeb60d7a4544c8c 100644 (file)
@@ -548,6 +548,8 @@ int tstc(void);
 void   putc(const char c);
 void   puts(const char *s);
 void   printf(const char *fmt, ...);
+void   printf_err(const char *fmt, ...);
+void   printf_wrn(const char *fmt, ...);
 //void vprintf(const char *fmt, va_list args);
 
 /* stderr */
index 166397dd69f4b946031cb3493266dce18f9f5a30..32da3c35c64a0880451baf0955b3943f18ca927a 100644 (file)
@@ -74,7 +74,7 @@ void *sbrk(ptrdiff_t increment)
        ulong new = old + increment;
 
        if ((new < mem_malloc_start) || (new > mem_malloc_end)) {
-               printf("## Error: sbrk: out of memory "
+               printf_err("sbrk: out of memory "
                        "(%d requested > %d available)\n",
                        increment, mem_malloc_end - old);
 
@@ -125,7 +125,7 @@ static int init_func_ram(void)
        if ((gd->ram_size = dram_init()) > 0)
                return 0;
 
-       puts("## Error on RAM initialization!\n");
+       printf_err("on RAM initialization!\n");
        return 1;
 }
 #endif
index 2c1277d54bf2d49f89c73a9421d9219d6c726088..3620948f2174c004fa2f05c3b3cdfc5a7ef3357c 100644 (file)
@@ -117,8 +117,8 @@ static void BootpCopyNetParams(Bootp_t *bp)
 static int truncate_sz(const char *name, int maxlen, int curlen)
 {
        if (curlen >= maxlen) {
-               printf("** Warning: '%s' is too long (%d - max: %d) - truncated\n",
-                      name, curlen, maxlen);
+               printf_wrn("'%s' is too long (%d - max: %d) - truncated\n",
+                          name, curlen, maxlen);
 
                curlen = maxlen - 1;
        }
@@ -379,7 +379,8 @@ static void BootpTimeout(void)
        bd_t *bd = gd->bd;
 
        if (BootpTry >= TIMEOUT_COUNT) {
-               puts("\n## Error: retry count exceeded, starting again!\n\n");
+               puts("\n");
+               printf_err("retry count exceeded, starting again!\n\n");
                NetStartAgain();
        } else {
                NetSetTimeout(TIMEOUT * CFG_HZ, BootpTimeout);
@@ -860,7 +861,7 @@ static void DhcpOptionsProcess(uchar *popt, Bootp_t *bp)
                                 * Tru64 Unix) it seems mind bogglingly crazy
                                 * to me
                                 */
-                               printf("** Warning: using vendor optional boot file\n");
+                               printf_wrn("using vendor optional boot file\n");
                                memcpy(bp->bp_file, popt + 2, size);
                                bp->bp_file[size] = '\0';
                        }
@@ -870,7 +871,7 @@ static void DhcpOptionsProcess(uchar *popt, Bootp_t *bp)
                        if (dhcp_vendorex_proc(popt))
                                break;
 #endif
-                       printf("** Warning: unhandled DHCP option in OFFER/ACK: %d\n", *popt);
+                       printf_wrn("unhandled DHCP option in OFFER/ACK: %d\n", *popt);
                        break;
                }
 
@@ -1063,7 +1064,7 @@ static void DhcpHandler(uchar *pkt, unsigned dest, unsigned src, unsigned len)
 
                break;
        default:
-               puts("## Error: DHCP in INVALID STATE\n");
+               printf_err("DHCP in INVALID STATE\n");
                break;
        }
 }
index 875fbb33724ff69fe82127439c372fb0e9269489..685b33ddba6cf15df9411bb7047fdf7eabdf129c 100644 (file)
@@ -132,7 +132,7 @@ int eth_initialize(bd_t *bis){
 #endif
 
        if(!eth_devices){
-               puts("## Error: no ethernet found\n");
+               printf_err("no ethernet found\n");
        } else {
                struct eth_device *dev = eth_devices;
                char *ethprime = getenv("ethprime");
index 6f9c4a2a363c3f24ba900827e6441fe0eaee1748..7bcc79a1b0f4200d3e835b0e5b5ce702abeca76b 100644 (file)
@@ -70,7 +70,7 @@ int do_http_upgrade(const ulong size, const int upgrade_type){
                                        backup_size - size);
 
                        if(!run_command(buf, 0)){
-                               printf("## Error: couldn't backup FLASH data before U-Boot image upgrade!\n");
+                               printf_err("couldn't backup FLASH data before U-Boot image upgrade!\n");
                                return(-1);
                        }
                }
@@ -160,7 +160,7 @@ int do_http_progress(const int state){
                        break;
 
                case WEBFAILSAFE_PROGRESS_UPGRADE_FAILED:
-                       printf("## Error: HTTP ugrade failed!\n\n");
+                       printf_err("HTTP ugrade failed!\n\n");
 
                        // blink LED fast for 4 sec
                        for(i = 0; i < 80; ++i){
index 4e30c8b4334f0b6e21d9849a4208f7f110a2b071..84b5fd76314758b5487348814c90c6312352f146 100644 (file)
@@ -226,7 +226,7 @@ void ArpRequest(void){
 
        if((NetArpWaitPacketIP & NetOurSubnetMask) != (NetOurIP & NetOurSubnetMask)){
                if(NetOurGatewayIP == 0){
-                       puts("** Warning: gatewayip needed but not set\n");
+                       printf_wrn("gatewayip needed but not set\n");
                        NetArpWaitReplyIP = NetArpWaitPacketIP;
                } else {
                        NetArpWaitReplyIP = NetOurGatewayIP;
@@ -254,7 +254,7 @@ void ArpTimeoutCheck(void){
                NetArpWaitTry++;
 
                if(NetArpWaitTry >= ARP_TIMEOUT_COUNT){
-                       puts("## Error: ARP retry count exceeded, starting again\n");
+                       printf_err("ARP retry count exceeded, starting again\n");
                        NetArpWaitTry = 0;
                        NetStartAgain();
                } else {
@@ -866,7 +866,7 @@ void NetReceive(volatile uchar * inpkt, int len){
                        arp = (ARP_t *)ip;
 
                        if(len < ARP_HDR_SIZE){
-                               printf("## Error: bad length %d < %d\n", len, ARP_HDR_SIZE);
+                               printf_err("bad length %d < %d\n", len, ARP_HDR_SIZE);
                                return;
                        }
 
@@ -946,7 +946,7 @@ void NetReceive(volatile uchar * inpkt, int len){
                                        return;
                                default:
 #ifdef ET_DEBUG
-                                       printf("## Error: unexpected ARP opcode 0x%x\n", ntohs(arp->ar_op));
+                                       printf_err("unexpected ARP opcode 0x%x\n", ntohs(arp->ar_op));
 #endif
                                        return;
                        }
@@ -958,12 +958,12 @@ void NetReceive(volatile uchar * inpkt, int len){
 #endif
                        arp = (ARP_t *)ip;
                        if(len < ARP_HDR_SIZE){
-                               printf("## Error: bad length %d < %d\n", len, ARP_HDR_SIZE);
+                               printf_err("bad length %d < %d\n", len, ARP_HDR_SIZE);
                                return;
                        }
 
                        if((ntohs(arp->ar_op) != RARPOP_REPLY) || (ntohs(arp->ar_hrd) != ARP_ETHER) || (ntohs(arp->ar_pro) != PROT_IP) || (arp->ar_hln != 6) || (arp->ar_pln != 4)){
-                               puts("## Error: invalid RARP header\n");
+                               printf_err("invalid RARP header\n");
                        } else {
                                NetCopyIP(&NetOurIP, &arp->ar_data[16]);
                                if(NetServerIP == 0){
@@ -985,7 +985,7 @@ void NetReceive(volatile uchar * inpkt, int len){
                        }
 
                        if(len < ntohs(ip->ip_len)){
-                               printf("## Error: len bad %d < %d\n", len, ntohs(ip->ip_len));
+                               printf_err("len bad %d < %d\n", len, ntohs(ip->ip_len));
                                return;
                        }
 
@@ -1003,7 +1003,8 @@ void NetReceive(volatile uchar * inpkt, int len){
 
                        if(!NetCksumOk((uchar *)ip, IP_HDR_SIZE_NO_UDP / 2)){
 #ifdef ET_DEBUG
-                               puts("\n## Error: checksum bad\n");
+                               puts("\n");
+                               printf_err("checksum bad\n");
 #endif
                                return;
                        }
@@ -1097,7 +1098,7 @@ void NetReceive(volatile uchar * inpkt, int len){
                                }
 
                                if((xsum != 0x00000000) && (xsum != 0x0000ffff)){
-                                       printf("## Error: UDP wrong checksum %08x %08x\n", xsum, ntohs(ip->udp_xsum));
+                                       printf_err("UDP wrong checksum %08x %08x\n", xsum, ntohs(ip->udp_xsum));
                                        return;
                                }
                        }
@@ -1122,7 +1123,7 @@ static int net_check_prereq(proto_t protocol){
 #if defined(CONFIG_CMD_PING)
                case PING:
                        if(NetPingIP == 0){
-                               puts("## Error: ping address not given\n");
+                               printf_err("ping address not given\n");
                                return(1);
                        }
                        goto common;
@@ -1130,7 +1131,7 @@ static int net_check_prereq(proto_t protocol){
 #if defined(CONFIG_CMD_SNTP)
                case SNTP:
                        if(NetNtpServerIP == 0){
-                               puts("## Error: NTP server address not given\n");
+                               printf_err("NTP server address not given\n");
                                return(1);
                        }
                        goto common;
@@ -1141,14 +1142,14 @@ static int net_check_prereq(proto_t protocol){
                case NETCONS:
                case TFTP:
                        if(NetServerIP == 0){
-                               puts("## Error: serverip not set\n");
+                               printf_err("serverip not set\n");
                                return(1);
                        }
 #if defined(CONFIG_CMD_PING) || defined(CONFIG_CMD_SNTP)
                        common:
 #endif
                        if(NetOurIP == 0){
-                               puts("## Error: ipaddr not set\n");
+                               printf_err("ipaddr not set\n");
                                return(1);
                        }
                        /* Fall through */
@@ -1164,20 +1165,20 @@ static int net_check_prereq(proto_t protocol){
 
                                switch(num){
                                        case -1:
-                                               puts("## Error: no ethernet found\n");
+                                               printf_err("no ethernet found\n");
                                                return(1);
                                        case 0:
-                                               puts("## Error: ethaddr not set\n");
+                                               printf_err("ethaddr not set\n");
                                                break;
                                        default:
-                                               printf("## Error: eth%daddr not set\n", num);
+                                               printf_err("eth%daddr not set\n", num);
                                                break;
                                }
 
                                NetStartAgain();
                                return(2);
 #else
-                               puts("## Error: ethaddr not set\n");
+                               printf_err("ethaddr not set\n");
                                return(1);
 #endif
                        }
@@ -1478,7 +1479,7 @@ int NetLoopHttpd(void){
 
        if(ethinit_attempt > 0){
                eth_halt();
-               printf("## Error: couldn't initialize eth (cable disconnected?)!\n\n");
+               printf_err("couldn't initialize eth (cable disconnected?)!\n\n");
                return(-1);
        }
 
index af832ffdda74391bb0a7eb3d2dca245ee651bf61..1fa99140413fb6d700da1c92d18116e321618869 100644 (file)
@@ -46,7 +46,7 @@ static void SntpSend(void){
 }
 
 static void SntpTimeout(void){
-       puts("## Error: timeout\n");
+       printf_err("timeout\n");
        NetState = NETLOOP_FAIL;
 
        return;
index afa322ff5404661062ebd4d523e6c72e8b98fbf3..4b9855aa318f3b0827047dc0c64c797582f338d6 100644 (file)
@@ -249,7 +249,7 @@ static void TftpHandler(uchar * pkt, unsigned dest, unsigned src, unsigned len){
 
        #ifdef ET_DEBUG
                        if(TftpState == STATE_RRQ){
-                               puts("## Error: server did not acknowledge timeout option!\n");
+                               printf_err("server did not acknowledge timeout option!\n");
                        }
        #endif
 
@@ -262,7 +262,8 @@ static void TftpHandler(uchar * pkt, unsigned dest, unsigned src, unsigned len){
                                TftpBlockWrapOffset = 0;
 
                                if(TftpBlock != 1){     /* Assertion */
-                                       printf("\n## Error: first block is not block 1 (%ld), starting again!\n\n", TftpBlock);
+                                       puts("\n");
+                                       printf_err("first block is not block 1 (%ld), starting again!\n\n", TftpBlock);
                                        NetStartAgain();
                                        break;
                                }
@@ -298,7 +299,8 @@ static void TftpHandler(uchar * pkt, unsigned dest, unsigned src, unsigned len){
                        break;
 
                case TFTP_ERROR:
-                       printf("\n## Error: '%s' (%d), starting again!\n\n", pkt + 2, ntohs(*(ushort *)pkt));
+                       puts("\n");
+                       printf_err("'%s' (%d), starting again!\n\n", pkt + 2, ntohs(*(ushort *)pkt));
                        NetStartAgain();
                        break;
        }
@@ -308,7 +310,8 @@ static void TftpTimeout(void){
        bd_t *bd = gd->bd;
 
        if(++TftpTimeoutCount > TIMEOUT_COUNT){
-               puts("\n\n## Error: retry count exceeded, starting again!\n\n");
+               puts("\n\n");
+               printf_err("retry count exceeded, starting again!\n\n");
                NetStartAgain();
        } else {
                puts("T ");
@@ -328,7 +331,7 @@ void TftpStart(void){
                sprintf(default_filename, "%02lX%02lX%02lX%02lX.img", NetOurIP & 0xFF, (NetOurIP >> 8) & 0xFF,  (NetOurIP >> 16) & 0xFF, (NetOurIP >> 24) & 0xFF);
                tftp_filename = default_filename;
 
-               printf("** Warning: no boot file name, using: '%s'\n", tftp_filename);
+               printf_wrn("no boot file name, using: '%s'\n", tftp_filename);
        } else {
                tftp_filename = BootFile;
        }