int checkboard (void)
{
- char *s = getenv ("serial#");
+ char buf[64];
+ int i = getenv_f("serial#", buf, sizeof(buf));
- if (!s || strncmp (s, "ELPT860", 7))
+ if ((i < 0) || strncmp(buf, "ELPT860", 7))
printf ("### No HW ID - assuming ELPT860\n");
return (0); /* success */
int checkboard (void)
{
- char *s = getenv ("serial#");
+ char buf[64];
+ int i;
+ int l = getenv_f("serial#", buf, sizeof(buf));
puts ("Board: RRvision ");
- for (; s && *s; ++s) {
- if (*s == ' ')
+ for (i=0; i < l; ++i) {
+ if (buf[i] == ' ')
break;
- putc (*s);
+ putc (buf[i]);
}
putc ('\n');
*/
int checkboard (void)
{
- char *s = getenv ("serial#");
+ char buf[64];
+ int i = getenv_f("serial#", buf, sizeof(buf));
puts ("Board: AcTux-1 rev.");
putc (ACTUX1_BOARDREL + 'A' - 1);
- if (s != NULL) {
- puts (", serial# ");
- puts (s);
+ if (i > 0) {
+ puts(", serial# ");
+ puts(buf);
}
putc ('\n');
*/
int checkboard (void)
{
- char *s = getenv ("serial#");
+ char buf[64];
+ int i = getenv_f("serial#", buf, sizeof(buf));
puts ("Board: AcTux-2 rev.");
putc (ACTUX2_BOARDREL + 'A' - 1);
- if (s != NULL) {
- puts (", serial# ");
- puts (s);
+ if (i > 0) {
+ puts(", serial# ");
+ puts(buf);
}
putc ('\n');
*/
int checkboard (void)
{
- char *s = getenv ("serial#");
+ char buf[64];
+ int i = getenv_f("serial#", buf, sizeof(buf));
puts ("Board: AcTux-3 rev.");
putc (ACTUX3_BOARDREL + 'A' - 1);
- if (s != NULL) {
+ if (i > 0) {
puts (", serial# ");
- puts (s);
+ puts (buf);
}
putc ('\n');
*/
int checkboard(void)
{
- char *s = getenv("serial#");
+ char buf[64];
+ int i = getenv_f("serial#", buf, sizeof(buf));
u8 rev;
rev = in8(CONFIG_SYS_CPLD_BASE + 0);
printf("Board: Acadia - AMCC PPC405EZ Evaluation Board, Rev. %X", rev);
- if (s != NULL) {
+ if (i > 0) {
puts(", serial# ");
- puts(s);
+ puts(buf);
}
putc('\n');
int checkboard(void)
{
- char *s = getenv("serial#");
+ char buf[64];
+ int i = getenv_f("serial#", buf, sizeof(buf));
printf("Board: Bamboo - AMCC PPC440EP Evaluation Board");
- if (s != NULL) {
+ if (i > 0) {
puts(", serial# ");
- puts(s);
+ puts(buf);
}
putc('\n');
int checkboard(void)
{
- char *s = getenv("serial#");
+ char buf[64];
+ int i = getenv_f("serial#", buf, sizeof(buf));
puts("Board: Bluestone Evaluation Board");
- if (s != NULL) {
+ if (i > 0) {
puts(", serial# ");
- puts(s);
+ puts(buf);
}
putc('\n');
*/
int checkboard(void)
{
- char *s = getenv("serial#");
+ char buf[64];
+ int i = getenv_f("serial#", buf, sizeof(buf));
puts("Board: Bubinga - AMCC PPC405EP Evaluation Board");
- if (s != NULL) {
+ if (i > 0) {
puts(", serial# ");
- puts(s);
+ puts(buf);
}
putc('\n');
{
struct board_bcsr *bcsr_data =
(struct board_bcsr *)CONFIG_SYS_BCSR_BASE;
- char *s = getenv("serial#");
+ char buf[64];
+ int i = getenv_f("serial#", buf, sizeof(buf));
if (pvr_460ex()) {
printf("Board: Canyonlands - AMCC PPC460EX Evaluation Board");
printf(", Rev. %X", in_8(&bcsr_data->cpld_rev));
- if (s != NULL) {
+ if (i > 0) {
puts(", serial# ");
- puts(s);
+ puts(buf);
}
putc('\n');
int checkboard(void)
{
- char *s = getenv("serial#");
+ char buf[64];
+ int i = getenv_f("serial#", buf, sizeof(buf));
printf("Board: Ebony - AMCC PPC440GP Evaluation Board");
- if (s != NULL) {
+ if (i > 0) {
puts(", serial# ");
- puts(s);
+ puts(buf);
}
putc('\n');
int checkboard (void)
{
- char *s = getenv("serial#");
+ char buf[64];
+ int i = getenv_f("serial#", buf, sizeof(buf));
printf("Board: Katmai - AMCC 440SPe Evaluation Board");
- if (s != NULL) {
+ if (i > 0) {
puts(", serial# ");
- puts(s);
+ puts(buf);
}
putc('\n');
int checkboard (void)
{
- char *s = getenv("serial#");
+ char buf[64];
+ int i = getenv_f("serial#", buf, sizeof(buf));
if (is_405exr())
printf("Board: Haleakala - AMCC PPC405EXr Evaluation Board");
else
printf("Board: Kilauea - AMCC PPC405EX Evaluation Board");
- if (s != NULL) {
+ if (i > 0) {
puts(", serial# ");
- puts(s);
+ puts(buf);
}
printf(" (CPLD rev. %ld)\n", gd->board_type);
************************************************************************/
int checkboard(void)
{
- char *s = getenv("serial#");
+ char buf[64];
+ int i = getenv_f("serial#", buf, sizeof(buf));
printf("Board: Luan - AMCC PPC440SP Evaluation Board");
- if (s != NULL) {
+ if (i > 0) {
puts(", serial# ");
- puts(s);
+ puts(buf);
}
putc('\n');
int checkboard (void)
{
- char *s = getenv("serial#");
+ char buf[64];
+ int i = getenv_f("serial#", buf, sizeof(buf));
printf("Board: Makalu - AMCC PPC405EX Evaluation Board");
- if (s != NULL) {
+ if (i > 0) {
puts(", serial# ");
- puts(s);
+ puts(buf);
}
putc('\n');
int checkboard (void)
{
- char *s = getenv ("serial#");
+ char buf[64];
+ int i = getenv_f("serial#", buf, sizeof(buf));
printf ("Board: Ocotea - AMCC PPC440GX Evaluation Board");
- if (s != NULL) {
- puts (", serial# ");
- puts (s);
+ if (i > 0) {
+ puts(", serial# ");
+ puts(buf);
}
putc ('\n');
int checkboard(void)
{
- char *s = getenv("serial#");
+ char buf[64];
+ int i = getenv_f("serial#", buf, sizeof(buf));
printf("Board: Redwood - AMCC 460SX Reference Board");
- if (s != NULL) {
+ if (i > 0) {
puts(", serial# ");
- puts(s);
+ puts(buf);
}
putc('\n');
int checkboard(void)
{
- char *s = getenv("serial#");
+ char buf[64];
+ int i = getenv_f("serial#", buf, sizeof(buf));
u8 rev;
u32 clock = get_async_pci_freq();
rev = in_8((void *)(CONFIG_SYS_BCSR_BASE + 0));
printf(", Rev. %X, PCI-Async=%d MHz", rev, clock / 1000000);
- if (s != NULL) {
+ if (i > 0) {
puts(", serial# ");
- puts(s);
+ puts(buf);
}
putc('\n');
*/
int checkboard(void)
{
- char *s = getenv("serial#");
+ char buf[64];
+ int i = getenv_f("serial#", buf, sizeof(buf));
puts("Board: Taihu - AMCC PPC405EP Evaluation Board");
- if (s != NULL) {
+ if (i > 0) {
puts(", serial# ");
- puts(s);
+ puts(buf);
}
putc('\n');
int checkboard (void)
{
- char *s = getenv ("serial#");
+ char buf[64];
+ int i = getenv_f("serial#", buf, sizeof(buf));
printf ("Board: Taishan - AMCC PPC440GX Evaluation Board");
- if (s != NULL) {
- puts (", serial# ");
- puts (s);
+ if (i > 0) {
+ puts(", serial# ");
+ puts(buf);
}
putc ('\n');
*/
int checkboard(void)
{
- char *s = getenv("serial#");
+ char buf[64];
+ int i = getenv_f("serial#", buf, sizeof(buf));
uint pvr = get_pvr();
if (pvr == PVR_405GPR_RB) {
puts("Board: Walnut - AMCC PPC405GP Evaluation Board");
}
- if (s != NULL) {
+ if (i > 0) {
puts(", serial# ");
- puts(s);
+ puts(buf);
}
putc('\n');
int checkboard(void)
{
- char *s = getenv("serial#");
+ char buf[64];
+ int i = getenv_f("serial#", buf, sizeof(buf));
u8 rev;
u32 clock = get_async_pci_freq();
rev = in_8((void *)(CONFIG_SYS_BCSR_BASE + 0));
printf(", Rev. %X, PCI-Async=%d MHz", rev, clock / 1000000);
- if (s != NULL) {
+ if (i > 0) {
puts(", serial# ");
- puts(s);
+ puts(buf);
}
putc('\n');
int checkboard (void)
{
- char *s = getenv("serial#");
+ char buf[64];
+ int i = getenv_f("serial#", buf, sizeof(buf));
printf("Board: Yucca - AMCC 440SPe Evaluation Board");
- if (s != NULL) {
+ if (i > 0) {
puts(", serial# ");
- puts(s);
+ puts(buf);
}
putc('\n');
/** serial number and platform display at startup */
int checkboard (void)
{
- char *s = getenv ("serial#");
- char *e;
+ char buf[64];
+ int l = getenv_f("serial#", buf, sizeof(buf));
/* After a loadace command, the SystemAce control register is left in a wonky state. */
/* this code did not work in board_pre_init */
puts ("Serial#: ");
- if (!s) {
+ if (l < 0) {
printf ("### No HW ID - assuming AMIRIX");
} else {
- for (e = s; *e; ++e) {
- if (*e == ' ')
+ int i;
+
+ for (i = 0; i < l; ++i) {
+ if (buf[i] == ' ') {
+ buf[i] = '\0';
break;
+ }
}
- for (; s < e; ++s) {
- putc (*s);
- }
+ puts(buf);
}
putc ('\n');
phys_size_t initdram (int board_type)
{
- char *s = getenv ("dramsize");
+ char buf[64];
+ int i = getenv_f("dramsize", buf, sizeof(buf));
- if (s != NULL) {
+ if (i > 0) {
+ char *s = buf;
if ((s[0] == '0') && ((s[1] == 'x') || (s[1] == 'X'))) {
s += 2;
}
int checkboard(void)
{
- char tmp[64];
- char *s, *e;
- int i = getenv_f("serial", tmp, sizeof(tmp));
+ char buf[64];
+ int i;
+ int l = getenv_f("serial#", buf, sizeof(buf));
- if (i < 0) {
+ if (l < 0) {
printf("Avnet Virtex4 FX12 with no serial #");
} else {
- for (e = tmp; *e; ++e) {
- if (*e == ' ')
+ printf("Avnet Virtex4 FX12 Minimodul # ");
+ for (i = 0; i < l; ++i) {
+ if (buf[i] == ' ')
break;
+ putc(buf[i]);
}
- printf("Avnet Virtex4 FX12 Minimodul # ");
- for (s = tmp; s < e; ++s)
- putc(*s);
}
putc('\n');
return 0;
int checkboard (void)
{
- unsigned char *s = (unsigned char *)getenv ("serial#");
+ char buf[64];
+ int i;
+ int l = getenv_f("serial#", buf, sizeof(buf));
puts ("Board: TTTech C2MON ");
- for (; s && *s; ++s) {
- if (*s == ' ')
+ for (i = 0; i < l; ++i) {
+ if (buf[i] == ' ')
break;
- putc (*s);
+ putc (buf[i]);
}
putc ('\n');
int checkboard(void)
{
- char *s = getenv("serial#");
+ char buf[64];
+ int i = getenv_f("serial#", buf, sizeof(buf));
puts ("Board: InterControl digsyMTC");
#if defined(CONFIG_DIGSY_REV5)
puts (" rev5");
#endif
- if (s != NULL) {
+ if (i > 0) {
puts(", ");
- puts(s);
+ puts(buf);
}
putc('\n');
int checkboard (void)
{
- char *s = getenv ("serial#");
- char *e;
+ char buf[64];
+ int i;
+ int l = getenv_f("serial#", buf, sizeof(buf));
puts ("Board: ");
gd->board_type = 1; /* 1 = 1SDRAM-Device */
#endif
- if (!s || strncmp (s, "ETX_", 4)) {
+ if (l < 0 || strncmp(buf, "ETX_", 4)) {
puts ("### No HW ID - assuming ETX_094\n");
read_hw_vers ();
return (0);
}
- for (e = s; *e; ++e) {
- if (*e == ' ')
+ for (i = 0; i < l; ++i) {
+ if (buf[i] == ' ')
break;
- }
-
- for (; s < e; ++s) {
- putc (*s);
+ putc(buf[i]);
}
putc ('\n');
*/
int checkboard(void)
{
- char *s = getenv("serial#");
+ char buf[64];
+ int i = getenv_f("serial#", buf, sizeof(buf));
printf("Board: ");
printf("DLVision 10G");
- if (s != NULL) {
+ if (i > 0) {
puts(", serial# ");
- puts(s);
+ puts(buf);
}
puts("\n");
*/
int checkboard(void)
{
+ char buf[64];
+ int i = getenv_f("serial#", buf, sizeof(buf));
ihs_fpga_t *fpga = (ihs_fpga_t *) CONFIG_SYS_FPGA_BASE(0);
- char *s = getenv("serial#");
u16 versions = in_le16(&fpga->versions);
u16 fpga_version = in_le16(&fpga->fpga_version);
u16 fpga_features = in_le16(&fpga->fpga_features);
printf("CATCenter Io");
- if (s != NULL) {
+ if (i > 0) {
puts(", serial# ");
- puts(s);
+ puts(buf);
}
puts("\n ");
*/
int checkboard(void)
{
+ char buf[64];
+ int i = getenv_f("serial#", buf, sizeof(buf));
ihs_fpga_t *fpga = (ihs_fpga_t *) CONFIG_SYS_FPGA_BASE(0);
- char *s = getenv("serial#");
u16 versions = in_le16(&fpga->versions);
u16 fpga_version = in_le16(&fpga->fpga_version);
u16 fpga_features = in_le16(&fpga->fpga_features);
printf("IoCon");
- if (s != NULL) {
+ if (i > 0) {
puts(", serial# ");
- puts(s);
+ puts(buf);
}
puts("\n ");
*/
int checkboard(void)
{
- char *s = getenv("serial#");
+ char buf[64];
+ int i = getenv_f("serial#", buf, sizeof(buf));
u8 channel2_msr = in_8((void *)CONFIG_UART_BASE + 0x26);
u8 channel3_msr = in_8((void *)CONFIG_UART_BASE + 0x36);
u8 channel7_msr = in_8((void *)CONFIG_UART_BASE + 0x76);
break;
}
- if (s != NULL) {
+ if (i > 0) {
puts(", serial# ");
- puts(s);
+ puts(buf);
}
puts("\n ");
int checkboard(void)
{
- char *s = getenv("serial#");
+ char buf[64];
+ int i = getenv_f("serial#", buf, sizeof(buf));
printf("Board: GDPPC440ETX - G&D PPC440EP/GR ETX-module");
- if (s != NULL) {
+ if (i > 0) {
puts(", serial# ");
- puts(s);
+ puts(buf);
}
putc('\n');
int checkboard(void)
{
- char *s = getenv("serial#");
+ char buf[64];
+ int i = getenv_f("serial#", buf, sizeof(buf));
#ifdef CONFIG_DEVCONCENTER
printf("Board: DevCon-Center");
printf("Board: Intip");
#endif
- if (s != NULL) {
+ if (i > 0) {
puts(", serial# ");
- puts(s);
+ puts(buf);
}
putc('\n');
*/
int checkboard(void)
{
- char *s = getenv("serial#");
+ char buf[64];
+ int i = getenv_f("serial#", buf, sizeof(buf));
u16 val = in_le16((void *)CONFIG_FPGA_BASE + 2);
u8 unit_type;
u8 hardware_cpu_ports;
printf("Board: CATCenter Neo");
- if (s != NULL) {
+ if (i > 0) {
puts(", serial# ");
- puts(s);
+ puts(buf);
}
puts("\n ");
/*********************************************************************/
int checkboard (void)
{
- char *str;
+ char buf[64];
+ int i = getenv_f("serial#", buf, sizeof(buf));
puts ("Board: Advent Networks gw8260\n");
- str = getenv ("serial#");
- if (str != NULL) {
- printf ("SN: %s\n", str);
+ if (i > 0) {
+ printf("SN: %s\n", buf);
}
return 0;
}
int checkboard (void)
{
- char *s = getenv ("serial#");
- char *e;
+ char buf[64];
+ int i;
+ int l = getenv_f("serial#", buf, sizeof(buf));
puts ("Board: ");
- if (!s || strncmp (s, "HERMES", 6)) {
+ if (l < 0 || strncmp(buf, "HERMES", 6)) {
puts ("### No HW ID - assuming HERMES-PRO");
} else {
- for (e = s; *e; ++e) {
- if (*e == ' ')
+ for (i = 0; i < l; i++) {
+ if (buf[i] == ' ')
break;
- }
-
- for (; s < e; ++s) {
- putc (*s);
+ putc (buf[i]);
}
}
*/
int checkboard(void)
{
- char *s = getenv("serial#");
+ char buf[64];
+ int i = getenv_f("serial#", buf, sizeof(buf));
#ifdef CONFIG_IXDPG425
puts("Board: IXDPG425 - Intel Network Gateway Reference Platform");
puts("Board: IXDP425 - Intel Development Platform");
#endif
- if (s != NULL) {
+ if (i > 0) {
puts(", serial# ");
- puts(s);
+ puts(buf);
}
putc('\n');
int checkboard(void)
{
- char *s = getenv("serial#");
+ char buf[64];
+ int i = getenv_f("serial#", buf, sizeof(buf));
puts("Board: lwmon5");
- if (s != NULL) {
+ if (i > 0) {
puts(", serial# ");
- puts(s);
+ puts(buf);
}
putc('\n');
int checkboard(void)
{
+ char buf[64];
+ int i = getenv_f("serial#", buf, sizeof(buf));
u32 config0 = read_c0_prid();
- char *s = getenv("serial#");
if ((config0 & 0xff0000) == PRID_COMP_LEGACY
&& (config0 & 0xff00) == PRID_IMP_LX4280) {
}
printf("Board: Micronas VCT " BOARD_NAME BOARD_NAME_ADD);
- if (s != NULL) {
+ if (i > 0) {
puts(", serial# ");
- puts(s);
+ puts(buf);
}
putc('\n');
int checkboard (void)
{
- char *s = getenv ("serial#");
- char *e;
+ char buf[64];
+ int i;
+ int l = getenv_f("serial#", buf, sizeof(buf));
- if (!s || strncmp (s, "ML2", 9)) {
+ if (l < 0 || strncmp(buf, "ML2", 9)) {
printf ("### No HW ID - assuming ML2");
} else {
- for (e = s; *e; ++e) {
- if (*e == ' ')
+ for (i = 0; i < l; i++) {
+ if (buf[i] == ' ')
break;
- }
-
- for (; s < e; ++s) {
- putc (*s);
+ putc(buf[i]);
}
}
-
-
putc ('\n');
return (0);
int checkboard(void)
{
- char *s = getenv("serial#");
+ char buf[64];
+ int i = getenv_f("serial#", buf, sizeof(buf));
printf("Board: ICON");
- if (s != NULL) {
+ if (i > 0) {
puts(", serial# ");
- puts(s);
+ puts(buf);
}
putc('\n');
int checkboard(void)
{
- char *s = getenv("serial#");
+ char buf[64];
+ int i = getenv_f("serial#", buf, sizeof(buf));
printf("Board: PCS440EP");
- if (s != NULL) {
+ if (i > 0) {
puts(", serial# ");
- puts(s);
+ puts(buf);
}
putc('\n');
int checkboard (void)
{
- char *s = getenv ("serial#");
+ char buf[64];
+ int i = getenv_f("serial#", buf, sizeof(buf));
printf ("Board: ALPR");
- if (s != NULL) {
- puts (", serial# ");
- puts (s);
+ if (i > 0) {
+ puts(", serial# ");
+ puts(buf);
}
printf(" (Rev. %d)\n", board_rev());
int checkboard (void)
{
- char *s = getenv("serial#");
+ char buf[64];
+ int i = getenv_f("serial#", buf, sizeof(buf));
printf("Board: %s", CONFIG_SYS_BOARD_NAME);
- if (s != NULL) {
+ if (i > 0) {
puts(", serial# ");
- puts(s);
+ puts(buf);
}
putc('\n');
int checkboard(void)
{
- char *s = getenv("serial#");
+ char buf[64];
+ int i = getenv_f("serial#", buf, sizeof(buf));
printf("Board: P3P440");
- if (s != NULL) {
+ if (i > 0) {
puts(", serial# ");
- puts(s);
+ puts(buf);
}
if (is_monarch()) {
*/
int checkboard(void)
{
- char *s = getenv("serial#");
+ char buf[64];
+ int i = getenv_f("serial#", buf, sizeof(buf));
puts("Board: PDNB3");
- if (s != NULL) {
+ if (i > 0) {
puts(", serial# ");
- puts(s);
+ puts(buf);
}
putc('\n');
*/
int checkboard(void)
{
- char *s = getenv("serial#");
+ char buf[64];
+ int i = getenv_f("serial#", buf, sizeof(buf));
#ifdef DISPLAY_BOARD_INFO
sys_info_t sysinfo;
#endif
puts("Board: Quad100hd");
- if (s != NULL) {
+ if (i > 0) {
puts(", serial# ");
- puts(s);
+ puts(buf);
}
putc('\n');
int checkboard (void)
{
- char *s = getenv ("serial#");
+ char buf[64];
+ int i;
+ int l = getenv_f("serial#", buf, sizeof(buf));
puts ("Board QUANTUM, Serial No: ");
- for (; s && *s; ++s) {
- if (*s == ' ')
+ for (i = 0; i < l; ++i) {
+ if (buf[i] == ' ')
break;
- putc (*s);
+ putc (buf[i]);
}
putc ('\n');
return (0); /* success */
int checkboard (void)
{
- char *s = getenv ("serial#");
+ char buf[64];
+ int i = getenv_f("serial#", buf, sizeof(buf));
- if (!s || strncmp (s, "TQM8", 4)) {
+ if (i < 0 || strncmp(buf, "TQM8", 4)) {
printf ("### No HW ID - assuming RBC823\n");
return (0);
}
- puts (s);
- putc ('\n');
+ puts(buf);
+ putc('\n');
return (0);
}
int checkboard (void)
{
volatile ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
-
- char *src;
+ char buf[64];
int f;
- char *s = getenv("serial#");
+ int i = getenv_f("serial#", buf, sizeof(buf));
+#ifdef CONFIG_PCI
+ char *src;
+#endif
puts("Board: Socrates");
- if (s != NULL) {
+ if (i > 0) {
puts(", serial# ");
- puts(s);
+ puts(buf);
}
putc('\n');
* Return 1 for "SC8xx" type, 0 else.
*/
-int checkboard (void)
+int checkboard(void)
{
- char *s = getenv("serial#");
- int board_type;
+ char buf[64];
+ int i;
+ int l = getenv_f("serial#", buf, sizeof(buf));
+ int board_type;
- if (!s || strncmp(s, "SVM8", 4)) {
- printf ("### No HW ID - assuming SVM SC8xx\n");
- return (0);
- }
+ if (l < 0 || strncmp(buf, "SVM8", 4)) {
+ printf("### No HW ID - assuming SVM SC8xx\n");
+ return (0);
+ }
- board_type = 1;
+ board_type = 1;
- for (; *s; ++s) {
- if (*s == ' ')
- break;
- putc (*s);
- }
+ for (i = 0; i < l; ++i) {
+ if (buf[i] == ' ')
+ break;
+ putc(buf[i]);
+ }
- putc ('\n');
+ putc('\n');
- return (0);
+ return (0);
}
/* ------------------------------------------------------------------------- */
int checkboard(void)
{
- char *s = getenv("serial#");
+ char buf[64];
+ int i = getenv_f("serial#", buf, sizeof(buf));
printf("Board: T3CORP");
- if (s != NULL) {
+ if (i > 0) {
puts(", serial# ");
- puts(s);
+ puts(buf);
}
putc('\n');
*/
int checkboard(void)
{
- char *s = getenv("serial#");
+ char buf[64];
+ int i = getenv_f("serial#", buf, sizeof(buf));
puts("Board: OSK5912");
- if (s != NULL) {
+ if (i > 0) {
puts(", serial# ");
- puts(s);
+ puts(buf);
}
putc('\n');
*/
int checkboard (void)
{
- char str[64];
- int i = getenv_f("serial#", str, sizeof (str));
+ char buf[64];
+ int i = getenv_f("serial#", buf, sizeof(buf));
puts ("Board: ");
- if (!i || strncmp (str, "TQM82", 5)) {
+ if (i < 0 || strncmp(buf, "TQM82", 5)) {
puts ("### No HW ID - assuming TQM8260\n");
return (0);
}
- puts (str);
+ puts (buf);
putc ('\n');
return 0;
static int dump_hwib(void)
{
HWIB_INFO *hw = &hwinf;
+ char buf[64];
+ int i = getenv_f("serial#", buf, sizeof(buf));
volatile immap_t *immr = (immap_t *)CONFIG_SYS_IMMR;
- char *s = getenv("serial#");
+
+ if (i < 0)
+ buf[0] = '\0';
if (hw->OK) {
printf ("HWIB on %x\n", HWIB_INFO_START_ADDR);
- printf ("serial : %s\n", s);
+ printf ("serial : %s\n", buf);
printf ("ethaddr: %s\n", hw->ethaddr);
printf ("FLASH : %x nr:%d\n", hw->flash, hw->flash_nr);
printf ("RAM : %x cs:%d\n", hw->ram, hw->ram_cs);
int cas_latency (void)
{
- char *s = getenv ("serial#");
+ char buf[128];
int casl;
int val;
int i;
casl = CONFIG_DDR_DEFAULT_CL;
- if (s != NULL) {
- if (strncmp(s + strlen (s) - strlen (CASL_STRING1),
+ i = getenv_f("serial#", buf, sizeof(buf));
+
+ if (i >0) {
+ if (strncmp(buf + strlen (buf) - strlen (CASL_STRING1),
CASL_STRING2, strlen (CASL_STRING2)) == 0) {
- val = simple_strtoul (s + strlen (s) - 2, NULL, 10);
+ val = simple_strtoul (buf + strlen (buf) - 2, NULL, 10);
for (i = 0; i < N_CASL; ++i) {
if (val == casl_table[i]) {
int checkboard (void)
{
- char *s = getenv ("serial#");
+ char buf[64];
+ int i = getenv_f("serial#", buf, sizeof(buf));
printf ("Board: %s", CONFIG_BOARDNAME);
- if (s != NULL) {
- puts (", serial# ");
- puts (s);
+ if (i > 0) {
+ puts(", serial# ");
+ puts(buf);
}
putc ('\n');
int checkboard (void)
{
- char *s = getenv ("serial#");
+ char buf[64];
+ int i;
+ int l = getenv_f("serial#", buf, sizeof(buf));
puts ("Board: ");
- if (!s || strncmp (s, "TQM8", 4)) {
+ if (l < 0 || strncmp(buf, "TQM8", 4)) {
puts ("### No HW ID - assuming TQM8xxL\n");
return (0);
}
- if ((*(s + 6) == 'L')) { /* a TQM8xxL type */
+ if ((buf[6] == 'L')) { /* a TQM8xxL type */
gd->board_type = 'L';
}
- if ((*(s + 6) == 'M')) { /* a TQM8xxM type */
+ if ((buf[6] == 'M')) { /* a TQM8xxM type */
gd->board_type = 'M';
}
- if ((*(s + 6) == 'D')) { /* a TQM885D type */
+ if ((buf[6] == 'D')) { /* a TQM885D type */
gd->board_type = 'D';
}
- for (; *s; ++s) {
- if (*s == ' ')
+ for (i = 0; i < l; ++i) {
+ if (buf[i] == ' ')
break;
- putc (*s);
+ putc (buf[i]);
}
#ifdef CONFIG_VIRTLAB2
puts (" (Virtlab2)");
int checkboard(void)
{
char name[] = CONFIG_SYS_BOARD_NAME;
+ char buf[64];
char *s;
+ int i;
#ifdef CONFIG_SYS_FORM_CUSTOM
s = "Custom";
/* Display board specific information */
puts(" ");
- if ((s = getenv("board_rev")))
- printf("Rev %s, ", s);
- if ((s = getenv("serial#")))
- printf("Serial# %s, ", s);
- if ((s = getenv("board_cfg")))
- printf("Cfg %s", s);
+ i = getenv_f("board_rev", buf, sizeof(buf));
+ if (i > 0)
+ printf("Rev %s, ", buf);
+ i = getenv_f("serial#", buf, sizeof(buf));
+ if (i > 0)
+ printf("Serial# %s, ", buf);
+ i = getenv_f("board_cfg", buf, sizeof(buf));
+ if (i > 0)
+ printf("Cfg %s", buf);
puts("\n");
return 0;
int checkboard(void)
{
- char *s;
+ char buf[64];
+ int i;
printf("Board: X-ES %s PMC SBC\n", CONFIG_SYS_BOARD_NAME);
printf(" ");
- s = getenv("board_rev");
- if (s)
- printf("Rev %s, ", s);
- s = getenv("serial#");
- if (s)
- printf("Serial# %s, ", s);
- s = getenv("board_cfg");
- if (s)
- printf("Cfg %s", s);
+ i = getenv_f("board_rev", buf, sizeof(buf));
+ if (i > 0)
+ printf("Rev %s, ", buf);
+ i = getenv_f("serial#", buf, sizeof(buf));
+ if (i > 0)
+ printf("Serial# %s, ", buf);
+ i = getenv_f("board_cfg", buf, sizeof(buf));
+ if (i > 0)
+ printf("Cfg %s", buf);
printf("\n");
return 0;
*/
int checkboard(void)
{
- char *s = getenv("serial#");
+ char buf[64];
+ int i = getenv_f("serial#", buf, sizeof(buf));
puts("Board: Zeus-");
puts(" of BulletEndPoint");
- if (s != NULL) {
+ if (i > 0) {
puts(", serial# ");
- puts(s);
+ puts(buf);
}
putc('\n');