diff options
author | Tom Rini <trini@konsulko.com> | 2021-02-08 10:55:28 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-02-08 10:55:28 -0500 |
commit | a10d06add73ec0bd9e93b4b517fa2068ef1ca132 (patch) | |
tree | d2680808bc08a9f2e2a46b100c4d5fbd0812aedd /board/keymile/common/common.c | |
parent | 88262788fe8b82935648797d17250439e1fa0739 (diff) | |
parent | 5e7a207ebf8501b4ab1c6a081b7b806698ce0f6d (diff) | |
download | u-boot-a10d06add73ec0bd9e93b4b517fa2068ef1ca132.tar.gz u-boot-a10d06add73ec0bd9e93b4b517fa2068ef1ca132.tar.xz u-boot-a10d06add73ec0bd9e93b4b517fa2068ef1ca132.zip |
Merge git://git.denx.de/u-boot-fsl-qoriq
Layerscape: Enable gpio
Bug fixes & updates related to dspi, qspi, pciep, SVR mask,
stream-id, env variables, mdio for LAyerscape Platforms
Add SATA, network variant 1, 2 support on sl28
powerpc: T1042: drop CONFIG_VIDEO, Add kmcent2 board supporrt, keymile
Bug fixes and updates for keymile, Kontron
Diffstat (limited to 'board/keymile/common/common.c')
-rw-r--r-- | board/keymile/common/common.c | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c index df507e2790..9c482d8454 100644 --- a/board/keymile/common/common.c +++ b/board/keymile/common/common.c @@ -41,7 +41,6 @@ DECLARE_GLOBAL_DATA_PTR; */ int set_km_env(void) { - uchar buf[32]; unsigned int pnvramaddr; unsigned int pram; unsigned int varaddr; @@ -49,10 +48,9 @@ int set_km_env(void) char *p; unsigned long rootfssize = 0; - pnvramaddr = gd->ram_size - CONFIG_KM_RESERVED_PRAM - CONFIG_KM_PHRAM - - CONFIG_KM_PNVRAM; - sprintf((char *)buf, "0x%x", pnvramaddr); - env_set("pnvramaddr", (char *)buf); + pnvramaddr = CONFIG_SYS_SDRAM_BASE + gd->ram_size - + CONFIG_KM_RESERVED_PRAM - CONFIG_KM_PHRAM - CONFIG_KM_PNVRAM; + env_set_hex("pnvramaddr", pnvramaddr); /* try to read rootfssize (ram image) from environment */ p = env_get("rootfssize"); @@ -60,16 +58,14 @@ int set_km_env(void) strict_strtoul(p, 16, &rootfssize); pram = (rootfssize + CONFIG_KM_RESERVED_PRAM + CONFIG_KM_PHRAM + CONFIG_KM_PNVRAM) / 0x400; - sprintf((char *)buf, "0x%x", pram); - env_set("pram", (char *)buf); + env_set_ulong("pram", pram); - varaddr = gd->ram_size - CONFIG_KM_RESERVED_PRAM - CONFIG_KM_PHRAM; - sprintf((char *)buf, "0x%x", varaddr); - env_set("varaddr", (char *)buf); + varaddr = CONFIG_SYS_SDRAM_BASE + gd->ram_size - + CONFIG_KM_RESERVED_PRAM - CONFIG_KM_PHRAM; + env_set_hex("varaddr", varaddr); kernelmem = gd->ram_size - 0x400 * pram; - sprintf((char *)buf, "0x%x", kernelmem); - env_set("kernelmem", (char *)buf); + env_set_hex("kernelmem", kernelmem); return 0; } @@ -243,7 +239,6 @@ static int do_checkboardidhwk(struct cmd_tbl *cmdtp, int flag, int argc, p = env_get("hwkey"); if (p) rc = strict_strtoul(p, 16, &envhwkey); - if (rc != 0) { printf("strict_strtoul returns error: %d", rc); return rc; @@ -305,15 +300,11 @@ static int do_checkboardidhwk(struct cmd_tbl *cmdtp, int flag, int argc, * set the values in environment variables. */ if (bid == ivmbid && hwkey == ivmhwkey) { - char buf[10]; - found = 1; envbid = bid; envhwkey = hwkey; - sprintf(buf, "%lx", bid); - env_set("boardid", buf); - sprintf(buf, "%lx", hwkey); - env_set("hwkey", buf); + env_set_hex("boardid", bid); + env_set_hex("hwkey", hwkey); } } /* end while( ! found ) */ } |