Re: [U-Boot] [PATCH] dm: implement a cfi flash uclass

2015-10-11 Thread Thomas Chou
Hi Bin, On 10/11/2015 01:41 PM, Bin Meng wrote: You can check fdtdec_get_pci_addr() to see how multiple "reg" tuples are decoded. I see. So I will need to decode the cells. cell = fdt_getprop(blob, node, prop_name, &len); Thanks a lot for your help. Best regards, Thomas

Re: [U-Boot] [PATCH] dm: implement a cfi flash uclass

2015-10-10 Thread Bin Meng
Hi Thomas, On Sun, Oct 11, 2015 at 1:16 PM, Thomas Chou wrote: > Hi Simon, > > On 10/09/2015 09:31 PM, Thomas Chou wrote: + ret = uclass_get_device(UCLASS_CFI_FLASH, i, &dev); + if (ret) + return ret; + if (!dev) + return

Re: [U-Boot] [PATCH] dm: implement a cfi flash uclass

2015-10-10 Thread Thomas Chou
Hi Simon, On 10/09/2015 09:31 PM, Thomas Chou wrote: + ret = uclass_get_device(UCLASS_CFI_FLASH, i, &dev); + if (ret) + return ret; + if (!dev) + return -ENODEV; That function will never return a NULL dev, unless it returns an error. It is differen

Re: [U-Boot] [PATCH] dm: implement a cfi flash uclass

2015-10-09 Thread Thomas Chou
Hi Simon, On 10/09/2015 05:36 PM, Simon Glass wrote: Can you create a sandbox driver for this so you can add a test? Yes. I will add a sandbox driver and test later. @@ -348,6 +349,8 @@ static int initr_flash(void) /* update start of FLASH memory*/ #ifdef CONFIG_SYS_FLASH_BASE

Re: [U-Boot] [PATCH] dm: implement a cfi flash uclass

2015-10-09 Thread Simon Glass
Hi Thomas, On 8 October 2015 at 08:34, Thomas Chou wrote: > Implement a cfi flash uclass to work with drivers/mtd/cfi-flash.c. > The flash base address is extracted from device tree, and passed > to cfi_flash_bank_addr(). > > Signed-off-by: Thomas Chou > --- > common/board_r.c |

[U-Boot] [PATCH] dm: implement a cfi flash uclass

2015-10-08 Thread Thomas Chou
Implement a cfi flash uclass to work with drivers/mtd/cfi-flash.c. The flash base address is extracted from device tree, and passed to cfi_flash_bank_addr(). Signed-off-by: Thomas Chou --- common/board_r.c | 3 ++ drivers/mtd/Kconfig| 11 +++ drivers/mtd/Makefile