mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-15 19:51:37 +00:00
riscv: jh7110: dram: only read a byte data from eeprom.
only read a byte data from eeprom. Signed-off-by: Samin Guo <samin.guo@starfivetech.com>
This commit is contained in:
parent
dc77fba0b6
commit
97f3b2aaee
1 changed files with 6 additions and 6 deletions
|
@ -14,23 +14,23 @@ DECLARE_GLOBAL_DATA_PTR;
|
|||
int dram_init(void)
|
||||
{
|
||||
int ret;
|
||||
u32 data;
|
||||
u8 data;
|
||||
u32 len;
|
||||
u32 offset;
|
||||
|
||||
data = 0;
|
||||
len = 4;
|
||||
offset = 88; /*offset of memory size stored in eeprom*/
|
||||
len = 1;
|
||||
offset = 91; /*offset of memory size stored in eeprom*/
|
||||
ret = fdtdec_setup_mem_size_base();
|
||||
if (ret)
|
||||
goto err;
|
||||
|
||||
/*read memory size info*/
|
||||
ret = get_data_from_eeprom(offset, len, (u8 *)&data);
|
||||
ret = get_data_from_eeprom(offset, len, &data);
|
||||
if (ret == len)
|
||||
gd->ram_size = (phys_size_t)((hextoul((char *)&data, NULL) & 0xff) << 30);
|
||||
ret = 0;
|
||||
gd->ram_size = ((phys_size_t)hextoul(&data, NULL)) << 30;
|
||||
|
||||
ret = 0;
|
||||
err:
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue