mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-19 21:51:31 +00:00
Merge git://git.denx.de/u-boot-cfi-flash
This commit is contained in:
commit
282f15804b
1 changed files with 11 additions and 10 deletions
|
@ -2461,27 +2461,28 @@ unsigned long flash_init(void)
|
||||||
#ifdef CONFIG_CFI_FLASH /* for driver model */
|
#ifdef CONFIG_CFI_FLASH /* for driver model */
|
||||||
static int cfi_flash_probe(struct udevice *dev)
|
static int cfi_flash_probe(struct udevice *dev)
|
||||||
{
|
{
|
||||||
void *blob = (void *)gd->fdt_blob;
|
|
||||||
int node = dev_of_offset(dev);
|
|
||||||
const fdt32_t *cell;
|
const fdt32_t *cell;
|
||||||
phys_addr_t addr;
|
int addrc, sizec;
|
||||||
int parent, addrc, sizec;
|
|
||||||
int len, idx;
|
int len, idx;
|
||||||
|
|
||||||
parent = fdt_parent_offset(blob, node);
|
addrc = dev_read_addr_cells(dev);
|
||||||
fdt_support_default_count_cells(blob, parent, &addrc, &sizec);
|
sizec = dev_read_size_cells(dev);
|
||||||
/* decode regs, there may be multiple reg tuples. */
|
|
||||||
cell = fdt_getprop(blob, node, "reg", &len);
|
/* decode regs; there may be multiple reg tuples. */
|
||||||
|
cell = dev_read_prop(dev, "reg", &len);
|
||||||
if (!cell)
|
if (!cell)
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
idx = 0;
|
idx = 0;
|
||||||
len /= sizeof(fdt32_t);
|
len /= sizeof(fdt32_t);
|
||||||
while (idx < len) {
|
while (idx < len) {
|
||||||
addr = fdt_translate_address((void *)blob,
|
phys_addr_t addr;
|
||||||
node, cell + idx);
|
|
||||||
|
addr = dev_translate_address(dev, cell + idx);
|
||||||
|
|
||||||
flash_info[cfi_flash_num_flash_banks].dev = dev;
|
flash_info[cfi_flash_num_flash_banks].dev = dev;
|
||||||
flash_info[cfi_flash_num_flash_banks].base = addr;
|
flash_info[cfi_flash_num_flash_banks].base = addr;
|
||||||
cfi_flash_num_flash_banks++;
|
cfi_flash_num_flash_banks++;
|
||||||
|
|
||||||
idx += addrc + sizec;
|
idx += addrc + sizec;
|
||||||
}
|
}
|
||||||
gd->bd->bi_flashstart = flash_info[0].base;
|
gd->bd->bi_flashstart = flash_info[0].base;
|
||||||
|
|
Loading…
Add table
Reference in a new issue