* [U-Boot] [PATCH 0/4] nand: davinci: enable driver model for NAND
@ 2019-06-06 15:49 Bartosz Golaszewski
2019-06-06 15:49 ` [U-Boot] [PATCH 1/4] nand: davinci: make davinci_nand_init() static Bartosz Golaszewski
` (4 more replies)
0 siblings, 5 replies; 10+ messages in thread
From: Bartosz Golaszewski @ 2019-06-06 15:49 UTC (permalink / raw)
To: u-boot
From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
This series enables the driver model for NAND on davinci da850 boards.
The first patch is a simple tweak for an unnecessarily exported function.
The second patch extends the NAND driver to support both legacy and
driver-model users. For now we don't parse the device-tree as it's a
bit complicated on da850, namely: the nand node is a child of the
aemif node for which we don't have a driver in u-boot (unlike on linux
where the aemif driver populates all its subnodes). In order for the
nand device to be probed, we're adding a dummy node to the u-boot dts
extensions with an appropriate compatible.
Two last patches enable driver model for NAND on da850-lcdk and da850-evm.
We don't enable the driver model in SPL as first: the patches enabling
CONFIG_SPL_DM are still waiting to be merged, and second: the
nand_spl_simple driver used by davinci SPL doesn't support driver model
users. This is planned for future series once some basic support is
merged.
Bartosz Golaszewski (4):
nand: davinci: make davinci_nand_init() static
nand: davinci: add support for driver model
davinci: omapl138-lcdk: enable driver model for NAND
davinci: da850-evm: enable driver model for NAND
arch/arm/dts/da850-evm-u-boot.dtsi | 4 ++
arch/arm/dts/da850-lcdk-u-boot.dtsi | 4 ++
arch/arm/include/asm/ti-common/davinci_nand.h | 2 -
configs/da850evm_defconfig | 1 +
configs/da850evm_direct_nor_defconfig | 1 +
configs/da850evm_nand_defconfig | 1 +
configs/omapl138_lcdk_defconfig | 1 +
drivers/mtd/nand/raw/davinci_nand.c | 48 ++++++++++++++++++-
include/configs/da850evm.h | 4 ++
include/configs/omapl138_lcdk.h | 4 ++
10 files changed, 66 insertions(+), 4 deletions(-)
--
2.21.0
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH 1/4] nand: davinci: make davinci_nand_init() static
2019-06-06 15:49 [U-Boot] [PATCH 0/4] nand: davinci: enable driver model for NAND Bartosz Golaszewski
@ 2019-06-06 15:49 ` Bartosz Golaszewski
2019-06-06 15:49 ` [U-Boot] [PATCH 2/4] nand: davinci: add support for driver model Bartosz Golaszewski
` (3 subsequent siblings)
4 siblings, 0 replies; 10+ messages in thread
From: Bartosz Golaszewski @ 2019-06-06 15:49 UTC (permalink / raw)
To: u-boot
From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
This function is only used within the driver itself. No need
to export it.
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
arch/arm/include/asm/ti-common/davinci_nand.h | 2 --
drivers/mtd/nand/raw/davinci_nand.c | 2 +-
2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/arch/arm/include/asm/ti-common/davinci_nand.h b/arch/arm/include/asm/ti-common/davinci_nand.h
index e26381c7fd..28842c3b15 100644
--- a/arch/arm/include/asm/ti-common/davinci_nand.h
+++ b/arch/arm/include/asm/ti-common/davinci_nand.h
@@ -95,6 +95,4 @@ struct davinci_emif_regs {
#define DAVINCI_ABCR_ASIZE_16BIT 1
#define DAVINCI_ABCR_ASIZE_8BIT 0
-void davinci_nand_init(struct nand_chip *nand);
-
#endif
diff --git a/drivers/mtd/nand/raw/davinci_nand.c b/drivers/mtd/nand/raw/davinci_nand.c
index cfa9b535c8..e1c4498cb9 100644
--- a/drivers/mtd/nand/raw/davinci_nand.c
+++ b/drivers/mtd/nand/raw/davinci_nand.c
@@ -730,7 +730,7 @@ static int nand_davinci_dev_ready(struct mtd_info *mtd)
return __raw_readl(&davinci_emif_regs->nandfsr) & 0x1;
}
-void davinci_nand_init(struct nand_chip *nand)
+static void davinci_nand_init(struct nand_chip *nand)
{
#if defined CONFIG_KEYSTONE_RBL_NAND
int i;
--
2.21.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH 2/4] nand: davinci: add support for driver model
2019-06-06 15:49 [U-Boot] [PATCH 0/4] nand: davinci: enable driver model for NAND Bartosz Golaszewski
2019-06-06 15:49 ` [U-Boot] [PATCH 1/4] nand: davinci: make davinci_nand_init() static Bartosz Golaszewski
@ 2019-06-06 15:49 ` Bartosz Golaszewski
2019-06-06 15:49 ` [U-Boot] [PATCH 3/4] davinci: omapl138-lcdk: enable driver model for NAND Bartosz Golaszewski
` (2 subsequent siblings)
4 siblings, 0 replies; 10+ messages in thread
From: Bartosz Golaszewski @ 2019-06-06 15:49 UTC (permalink / raw)
To: u-boot
From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Extend the davinci NAND driver to support the driver model. For now this
doesn't add any device-tree parsing due to the fact that we can't access
the actual nand node on the device-tree - it's a subnode of the aemif
device and we don't have an aemif driver on davinci at the moment.
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
drivers/mtd/nand/raw/davinci_nand.c | 46 ++++++++++++++++++++++++++++-
1 file changed, 45 insertions(+), 1 deletion(-)
diff --git a/drivers/mtd/nand/raw/davinci_nand.c b/drivers/mtd/nand/raw/davinci_nand.c
index e1c4498cb9..33c2f16be8 100644
--- a/drivers/mtd/nand/raw/davinci_nand.c
+++ b/drivers/mtd/nand/raw/davinci_nand.c
@@ -31,6 +31,7 @@
#include <common.h>
#include <asm/io.h>
#include <nand.h>
+#include <dm/uclass.h>
#include <asm/ti-common/davinci_nand.h>
/* Definitions for 4-bit hardware ECC */
@@ -785,10 +786,53 @@ static void davinci_nand_init(struct nand_chip *nand)
nand->dev_ready = nand_davinci_dev_ready;
}
-int board_nand_init(struct nand_chip *chip) __attribute__((weak));
+#ifdef CONFIG_SYS_NAND_SELF_INIT
+static int davinci_nand_probe(struct udevice *dev)
+{
+ struct nand_chip *nand = dev_get_priv(dev);
+ struct mtd_info *mtd = nand_to_mtd(nand);
+ int ret;
+
+ nand->IO_ADDR_R = (void __iomem *)CONFIG_SYS_NAND_BASE;
+ nand->IO_ADDR_W = (void __iomem *)CONFIG_SYS_NAND_BASE;
+
+ davinci_nand_init(nand);
+
+ ret = nand_scan(mtd, CONFIG_SYS_NAND_MAX_CHIPS);
+ if (ret)
+ return ret;
+
+ return nand_register(0, mtd);
+}
+
+static const struct udevice_id davinci_nand_ids[] = {
+ { .compatible = "ti,davinci-nand" },
+ { }
+};
+
+U_BOOT_DRIVER(davinci_nand) = {
+ .name = "davinci-nand",
+ .id = UCLASS_MTD,
+ .of_match = davinci_nand_ids,
+ .probe = davinci_nand_probe,
+ .priv_auto_alloc_size = sizeof(struct nand_chip),
+};
+
+void board_nand_init(void)
+{
+ struct udevice *dev;
+ int ret;
+ ret = uclass_get_device_by_driver(UCLASS_MTD,
+ DM_GET_DRIVER(davinci_nand), &dev);
+ if (ret && ret != -ENODEV)
+ pr_err("Failed to initialize %s: %d\n", dev->name, ret);
+}
+#else
+int board_nand_init(struct nand_chip *chip) __attribute__((weak));
int board_nand_init(struct nand_chip *chip)
{
davinci_nand_init(chip);
return 0;
}
+#endif /* CONFIG_SYS_NAND_SELF_INIT */
--
2.21.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH 3/4] davinci: omapl138-lcdk: enable driver model for NAND
2019-06-06 15:49 [U-Boot] [PATCH 0/4] nand: davinci: enable driver model for NAND Bartosz Golaszewski
2019-06-06 15:49 ` [U-Boot] [PATCH 1/4] nand: davinci: make davinci_nand_init() static Bartosz Golaszewski
2019-06-06 15:49 ` [U-Boot] [PATCH 2/4] nand: davinci: add support for driver model Bartosz Golaszewski
@ 2019-06-06 15:49 ` Bartosz Golaszewski
2019-06-06 15:50 ` [U-Boot] [PATCH 4/4] davinci: da850-evm: " Bartosz Golaszewski
2019-06-06 15:58 ` [U-Boot] [PATCH 0/4] nand: davinci: " Adam Ford
4 siblings, 0 replies; 10+ messages in thread
From: Bartosz Golaszewski @ 2019-06-06 15:49 UTC (permalink / raw)
To: u-boot
From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Enable the driver-model on da850-lcdk. We need to add a dummy nand node
to the device tree, as the real nand node is a sub-node of the aemif
device.
On linux the aemif driver populates all its child nodes, but we can't do
it in u-boot currently.
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
arch/arm/dts/da850-lcdk-u-boot.dtsi | 4 ++++
configs/omapl138_lcdk_defconfig | 1 +
include/configs/omapl138_lcdk.h | 4 ++++
3 files changed, 9 insertions(+)
diff --git a/arch/arm/dts/da850-lcdk-u-boot.dtsi b/arch/arm/dts/da850-lcdk-u-boot.dtsi
index 80dda8ef58..541f4ca200 100644
--- a/arch/arm/dts/da850-lcdk-u-boot.dtsi
+++ b/arch/arm/dts/da850-lcdk-u-boot.dtsi
@@ -9,4 +9,8 @@
aliases {
i2c0 = &i2c0;
};
+
+ nand {
+ compatible = "ti,davinci-nand";
+ };
};
diff --git a/configs/omapl138_lcdk_defconfig b/configs/omapl138_lcdk_defconfig
index 48f251ebb8..94609f9a34 100644
--- a/configs/omapl138_lcdk_defconfig
+++ b/configs/omapl138_lcdk_defconfig
@@ -39,6 +39,7 @@ CONFIG_DM_I2C=y
CONFIG_DM_I2C_COMPAT=y
CONFIG_SYS_I2C_DAVINCI=y
CONFIG_DM_MMC=y
+CONFIG_MTD=y
CONFIG_NAND=y
CONFIG_NAND_DAVINCI=y
CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
diff --git a/include/configs/omapl138_lcdk.h b/include/configs/omapl138_lcdk.h
index da615e5063..a4dc060634 100644
--- a/include/configs/omapl138_lcdk.h
+++ b/include/configs/omapl138_lcdk.h
@@ -176,6 +176,10 @@
#define CONFIG_SPL_NAND_DRIVERS
#define CONFIG_SPL_NAND_ECC
#define CONFIG_SPL_NAND_LOAD
+
+#ifndef CONFIG_SPL_BUILD
+#define CONFIG_SYS_NAND_SELF_INIT
+#endif
#endif
#ifdef CONFIG_SYS_USE_NOR
--
2.21.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH 4/4] davinci: da850-evm: enable driver model for NAND
2019-06-06 15:49 [U-Boot] [PATCH 0/4] nand: davinci: enable driver model for NAND Bartosz Golaszewski
` (2 preceding siblings ...)
2019-06-06 15:49 ` [U-Boot] [PATCH 3/4] davinci: omapl138-lcdk: enable driver model for NAND Bartosz Golaszewski
@ 2019-06-06 15:50 ` Bartosz Golaszewski
2019-06-07 19:58 ` Adam Ford
2019-06-06 15:58 ` [U-Boot] [PATCH 0/4] nand: davinci: " Adam Ford
4 siblings, 1 reply; 10+ messages in thread
From: Bartosz Golaszewski @ 2019-06-06 15:50 UTC (permalink / raw)
To: u-boot
From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Enable the driver-model on da850-evm. We need to add a dummy nand node
to the device tree, as the real nand node is a sub-node of the aemif
device.
On linux the aemif driver populates all its child nodes, but we can't do
it in u-boot currently.
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
arch/arm/dts/da850-evm-u-boot.dtsi | 4 ++++
configs/da850evm_defconfig | 1 +
configs/da850evm_direct_nor_defconfig | 1 +
configs/da850evm_nand_defconfig | 1 +
include/configs/da850evm.h | 4 ++++
5 files changed, 11 insertions(+)
diff --git a/arch/arm/dts/da850-evm-u-boot.dtsi b/arch/arm/dts/da850-evm-u-boot.dtsi
index 1683f3472e..d9e8b9926a 100644
--- a/arch/arm/dts/da850-evm-u-boot.dtsi
+++ b/arch/arm/dts/da850-evm-u-boot.dtsi
@@ -10,6 +10,10 @@
soc at 1c00000 {
u-boot,dm-spl;
};
+
+ nand {
+ compatible = "ti,davinci-nand";
+ };
};
&flash {
diff --git a/configs/da850evm_defconfig b/configs/da850evm_defconfig
index c095058282..8a891eb8aa 100644
--- a/configs/da850evm_defconfig
+++ b/configs/da850evm_defconfig
@@ -52,6 +52,7 @@ CONFIG_DA8XX_GPIO=y
CONFIG_DM_I2C=y
CONFIG_SYS_I2C_DAVINCI=y
CONFIG_DM_MMC=y
+CONFIG_MTD=y
CONFIG_MTD_DEVICE=y
CONFIG_DM_SPI_FLASH=y
CONFIG_SPI_FLASH=y
diff --git a/configs/da850evm_direct_nor_defconfig b/configs/da850evm_direct_nor_defconfig
index 166e77b8e3..85c96f9951 100644
--- a/configs/da850evm_direct_nor_defconfig
+++ b/configs/da850evm_direct_nor_defconfig
@@ -42,6 +42,7 @@ CONFIG_DA8XX_GPIO=y
CONFIG_DM_I2C=y
CONFIG_SYS_I2C_DAVINCI=y
# CONFIG_MMC is not set
+CONFIG_MTD=y
CONFIG_MTD_NOR_FLASH=y
CONFIG_FLASH_CFI_DRIVER=y
CONFIG_SYS_FLASH_PROTECTION=y
diff --git a/configs/da850evm_nand_defconfig b/configs/da850evm_nand_defconfig
index 7271016346..187087768f 100644
--- a/configs/da850evm_nand_defconfig
+++ b/configs/da850evm_nand_defconfig
@@ -49,6 +49,7 @@ CONFIG_DM_GPIO=y
CONFIG_DA8XX_GPIO=y
CONFIG_DM_I2C=y
CONFIG_DM_MMC=y
+CONFIG_MTD=y
CONFIG_NAND=y
CONFIG_NAND_DAVINCI=y
CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
diff --git a/include/configs/da850evm.h b/include/configs/da850evm.h
index ccdac0abec..b8556adbb1 100644
--- a/include/configs/da850evm.h
+++ b/include/configs/da850evm.h
@@ -182,6 +182,10 @@
#define CONFIG_SPL_NAND_DRIVERS
#define CONFIG_SPL_NAND_ECC
#define CONFIG_SPL_NAND_LOAD
+
+#ifndef CONFIG_SPL_BUILD
+#define CONFIG_SYS_NAND_SELF_INIT
+#endif
#endif
/*
--
2.21.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH 0/4] nand: davinci: enable driver model for NAND
2019-06-06 15:49 [U-Boot] [PATCH 0/4] nand: davinci: enable driver model for NAND Bartosz Golaszewski
` (3 preceding siblings ...)
2019-06-06 15:50 ` [U-Boot] [PATCH 4/4] davinci: da850-evm: " Bartosz Golaszewski
@ 2019-06-06 15:58 ` Adam Ford
2019-06-07 8:16 ` Bartosz Golaszewski
4 siblings, 1 reply; 10+ messages in thread
From: Adam Ford @ 2019-06-06 15:58 UTC (permalink / raw)
To: u-boot
On Thu, Jun 6, 2019 at 10:50 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
>
> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>
> This series enables the driver model for NAND on davinci da850 boards.
>
> The first patch is a simple tweak for an unnecessarily exported function.
>
> The second patch extends the NAND driver to support both legacy and
> driver-model users. For now we don't parse the device-tree as it's a
> bit complicated on da850, namely: the nand node is a child of the
> aemif node for which we don't have a driver in u-boot (unlike on linux
> where the aemif driver populates all its subnodes). In order for the
> nand device to be probed, we're adding a dummy node to the u-boot dts
> extensions with an appropriate compatible.
>
> Two last patches enable driver model for NAND on da850-lcdk and da850-evm.
> We don't enable the driver model in SPL as first: the patches enabling
> CONFIG_SPL_DM are still waiting to be merged, and second: the
> nand_spl_simple driver used by davinci SPL doesn't support driver model
> users. This is planned for future series once some basic support is
> merged.
What happens when the board is booting SPL from NAND? Will it still
work as expected? I know the da850-evm has at least one configuration
which this is intended to boot from NAND instead of the default SPI
flash.
adam
>
> Bartosz Golaszewski (4):
> nand: davinci: make davinci_nand_init() static
> nand: davinci: add support for driver model
> davinci: omapl138-lcdk: enable driver model for NAND
> davinci: da850-evm: enable driver model for NAND
>
> arch/arm/dts/da850-evm-u-boot.dtsi | 4 ++
> arch/arm/dts/da850-lcdk-u-boot.dtsi | 4 ++
> arch/arm/include/asm/ti-common/davinci_nand.h | 2 -
> configs/da850evm_defconfig | 1 +
> configs/da850evm_direct_nor_defconfig | 1 +
> configs/da850evm_nand_defconfig | 1 +
> configs/omapl138_lcdk_defconfig | 1 +
> drivers/mtd/nand/raw/davinci_nand.c | 48 ++++++++++++++++++-
> include/configs/da850evm.h | 4 ++
> include/configs/omapl138_lcdk.h | 4 ++
> 10 files changed, 66 insertions(+), 4 deletions(-)
>
> --
> 2.21.0
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH 0/4] nand: davinci: enable driver model for NAND
2019-06-06 15:58 ` [U-Boot] [PATCH 0/4] nand: davinci: " Adam Ford
@ 2019-06-07 8:16 ` Bartosz Golaszewski
2019-07-03 13:01 ` Bartosz Golaszewski
0 siblings, 1 reply; 10+ messages in thread
From: Bartosz Golaszewski @ 2019-06-07 8:16 UTC (permalink / raw)
To: u-boot
czw., 6 cze 2019 o 17:58 Adam Ford <aford173@gmail.com> napisał(a):
>
> On Thu, Jun 6, 2019 at 10:50 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
> >
> > From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> >
> > This series enables the driver model for NAND on davinci da850 boards.
> >
> > The first patch is a simple tweak for an unnecessarily exported function.
> >
> > The second patch extends the NAND driver to support both legacy and
> > driver-model users. For now we don't parse the device-tree as it's a
> > bit complicated on da850, namely: the nand node is a child of the
> > aemif node for which we don't have a driver in u-boot (unlike on linux
> > where the aemif driver populates all its subnodes). In order for the
> > nand device to be probed, we're adding a dummy node to the u-boot dts
> > extensions with an appropriate compatible.
> >
> > Two last patches enable driver model for NAND on da850-lcdk and da850-evm.
> > We don't enable the driver model in SPL as first: the patches enabling
> > CONFIG_SPL_DM are still waiting to be merged, and second: the
> > nand_spl_simple driver used by davinci SPL doesn't support driver model
> > users. This is planned for future series once some basic support is
> > merged.
>
> What happens when the board is booting SPL from NAND? Will it still
> work as expected? I know the da850-evm has at least one configuration
> which this is intended to boot from NAND instead of the default SPI
> flash.
>
The driver works just like before in SPL. The support for the driver
model is added incrementally. In fact I tested it on da850-lcdk with
SPL loading u-boot from NAND.
On da850-evm we could probably enable driver-model in SPL as well for
NAND, but I prefer to do it at once for both boards.
Bart
> adam
>
> >
> > Bartosz Golaszewski (4):
> > nand: davinci: make davinci_nand_init() static
> > nand: davinci: add support for driver model
> > davinci: omapl138-lcdk: enable driver model for NAND
> > davinci: da850-evm: enable driver model for NAND
> >
> > arch/arm/dts/da850-evm-u-boot.dtsi | 4 ++
> > arch/arm/dts/da850-lcdk-u-boot.dtsi | 4 ++
> > arch/arm/include/asm/ti-common/davinci_nand.h | 2 -
> > configs/da850evm_defconfig | 1 +
> > configs/da850evm_direct_nor_defconfig | 1 +
> > configs/da850evm_nand_defconfig | 1 +
> > configs/omapl138_lcdk_defconfig | 1 +
> > drivers/mtd/nand/raw/davinci_nand.c | 48 ++++++++++++++++++-
> > include/configs/da850evm.h | 4 ++
> > include/configs/omapl138_lcdk.h | 4 ++
> > 10 files changed, 66 insertions(+), 4 deletions(-)
> >
> > --
> > 2.21.0
> >
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH 4/4] davinci: da850-evm: enable driver model for NAND
2019-06-06 15:50 ` [U-Boot] [PATCH 4/4] davinci: da850-evm: " Bartosz Golaszewski
@ 2019-06-07 19:58 ` Adam Ford
0 siblings, 0 replies; 10+ messages in thread
From: Adam Ford @ 2019-06-07 19:58 UTC (permalink / raw)
To: u-boot
On Thu, Jun 6, 2019 at 10:50 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
>
> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>
> Enable the driver-model on da850-evm. We need to add a dummy nand node
> to the device tree, as the real nand node is a sub-node of the aemif
> device.
>
> On linux the aemif driver populates all its child nodes, but we can't do
> it in u-boot currently.
>
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
For the whole series...
Tested-by: Adam Ford <aford173@gmail.com> #da850-evm
> ---
> arch/arm/dts/da850-evm-u-boot.dtsi | 4 ++++
> configs/da850evm_defconfig | 1 +
> configs/da850evm_direct_nor_defconfig | 1 +
> configs/da850evm_nand_defconfig | 1 +
> include/configs/da850evm.h | 4 ++++
> 5 files changed, 11 insertions(+)
>
> diff --git a/arch/arm/dts/da850-evm-u-boot.dtsi b/arch/arm/dts/da850-evm-u-boot.dtsi
> index 1683f3472e..d9e8b9926a 100644
> --- a/arch/arm/dts/da850-evm-u-boot.dtsi
> +++ b/arch/arm/dts/da850-evm-u-boot.dtsi
> @@ -10,6 +10,10 @@
> soc at 1c00000 {
> u-boot,dm-spl;
> };
> +
> + nand {
> + compatible = "ti,davinci-nand";
> + };
> };
>
> &flash {
> diff --git a/configs/da850evm_defconfig b/configs/da850evm_defconfig
> index c095058282..8a891eb8aa 100644
> --- a/configs/da850evm_defconfig
> +++ b/configs/da850evm_defconfig
> @@ -52,6 +52,7 @@ CONFIG_DA8XX_GPIO=y
> CONFIG_DM_I2C=y
> CONFIG_SYS_I2C_DAVINCI=y
> CONFIG_DM_MMC=y
> +CONFIG_MTD=y
> CONFIG_MTD_DEVICE=y
> CONFIG_DM_SPI_FLASH=y
> CONFIG_SPI_FLASH=y
> diff --git a/configs/da850evm_direct_nor_defconfig b/configs/da850evm_direct_nor_defconfig
> index 166e77b8e3..85c96f9951 100644
> --- a/configs/da850evm_direct_nor_defconfig
> +++ b/configs/da850evm_direct_nor_defconfig
> @@ -42,6 +42,7 @@ CONFIG_DA8XX_GPIO=y
> CONFIG_DM_I2C=y
> CONFIG_SYS_I2C_DAVINCI=y
> # CONFIG_MMC is not set
> +CONFIG_MTD=y
> CONFIG_MTD_NOR_FLASH=y
> CONFIG_FLASH_CFI_DRIVER=y
> CONFIG_SYS_FLASH_PROTECTION=y
> diff --git a/configs/da850evm_nand_defconfig b/configs/da850evm_nand_defconfig
> index 7271016346..187087768f 100644
> --- a/configs/da850evm_nand_defconfig
> +++ b/configs/da850evm_nand_defconfig
> @@ -49,6 +49,7 @@ CONFIG_DM_GPIO=y
> CONFIG_DA8XX_GPIO=y
> CONFIG_DM_I2C=y
> CONFIG_DM_MMC=y
> +CONFIG_MTD=y
> CONFIG_NAND=y
> CONFIG_NAND_DAVINCI=y
> CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
> diff --git a/include/configs/da850evm.h b/include/configs/da850evm.h
> index ccdac0abec..b8556adbb1 100644
> --- a/include/configs/da850evm.h
> +++ b/include/configs/da850evm.h
> @@ -182,6 +182,10 @@
> #define CONFIG_SPL_NAND_DRIVERS
> #define CONFIG_SPL_NAND_ECC
> #define CONFIG_SPL_NAND_LOAD
> +
> +#ifndef CONFIG_SPL_BUILD
> +#define CONFIG_SYS_NAND_SELF_INIT
> +#endif
> #endif
>
> /*
> --
> 2.21.0
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH 0/4] nand: davinci: enable driver model for NAND
2019-06-07 8:16 ` Bartosz Golaszewski
@ 2019-07-03 13:01 ` Bartosz Golaszewski
2019-07-03 13:10 ` Tom Rini
0 siblings, 1 reply; 10+ messages in thread
From: Bartosz Golaszewski @ 2019-07-03 13:01 UTC (permalink / raw)
To: u-boot
pt., 7 cze 2019 o 10:16 Bartosz Golaszewski <brgl@bgdev.pl> napisał(a):
>
> czw., 6 cze 2019 o 17:58 Adam Ford <aford173@gmail.com> napisał(a):
> >
> > On Thu, Jun 6, 2019 at 10:50 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
> > >
> > > From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> > >
> > > This series enables the driver model for NAND on davinci da850 boards.
> > >
> > > The first patch is a simple tweak for an unnecessarily exported function.
> > >
> > > The second patch extends the NAND driver to support both legacy and
> > > driver-model users. For now we don't parse the device-tree as it's a
> > > bit complicated on da850, namely: the nand node is a child of the
> > > aemif node for which we don't have a driver in u-boot (unlike on linux
> > > where the aemif driver populates all its subnodes). In order for the
> > > nand device to be probed, we're adding a dummy node to the u-boot dts
> > > extensions with an appropriate compatible.
> > >
> > > Two last patches enable driver model for NAND on da850-lcdk and da850-evm.
> > > We don't enable the driver model in SPL as first: the patches enabling
> > > CONFIG_SPL_DM are still waiting to be merged, and second: the
> > > nand_spl_simple driver used by davinci SPL doesn't support driver model
> > > users. This is planned for future series once some basic support is
> > > merged.
> >
> > What happens when the board is booting SPL from NAND? Will it still
> > work as expected? I know the da850-evm has at least one configuration
> > which this is intended to boot from NAND instead of the default SPI
> > flash.
> >
>
> The driver works just like before in SPL. The support for the driver
> model is added incrementally. In fact I tested it on da850-lcdk with
> SPL loading u-boot from NAND.
>
> On da850-evm we could probably enable driver-model in SPL as well for
> NAND, but I prefer to do it at once for both boards.
>
> Bart
>
> > adam
> >
> > >
> > > Bartosz Golaszewski (4):
> > > nand: davinci: make davinci_nand_init() static
> > > nand: davinci: add support for driver model
> > > davinci: omapl138-lcdk: enable driver model for NAND
> > > davinci: da850-evm: enable driver model for NAND
> > >
> > > arch/arm/dts/da850-evm-u-boot.dtsi | 4 ++
> > > arch/arm/dts/da850-lcdk-u-boot.dtsi | 4 ++
> > > arch/arm/include/asm/ti-common/davinci_nand.h | 2 -
> > > configs/da850evm_defconfig | 1 +
> > > configs/da850evm_direct_nor_defconfig | 1 +
> > > configs/da850evm_nand_defconfig | 1 +
> > > configs/omapl138_lcdk_defconfig | 1 +
> > > drivers/mtd/nand/raw/davinci_nand.c | 48 ++++++++++++++++++-
> > > include/configs/da850evm.h | 4 ++
> > > include/configs/omapl138_lcdk.h | 4 ++
> > > 10 files changed, 66 insertions(+), 4 deletions(-)
> > >
> > > --
> > > 2.21.0
> > >
Hi Tom,
can you pick up this series?
Bart
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH 0/4] nand: davinci: enable driver model for NAND
2019-07-03 13:01 ` Bartosz Golaszewski
@ 2019-07-03 13:10 ` Tom Rini
0 siblings, 0 replies; 10+ messages in thread
From: Tom Rini @ 2019-07-03 13:10 UTC (permalink / raw)
To: u-boot
On Wed, Jul 03, 2019 at 03:01:15PM +0200, Bartosz Golaszewski wrote:
> pt., 7 cze 2019 o 10:16 Bartosz Golaszewski <brgl@bgdev.pl> napisał(a):
> >
> > czw., 6 cze 2019 o 17:58 Adam Ford <aford173@gmail.com> napisał(a):
> > >
> > > On Thu, Jun 6, 2019 at 10:50 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
> > > >
> > > > From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> > > >
> > > > This series enables the driver model for NAND on davinci da850 boards.
> > > >
> > > > The first patch is a simple tweak for an unnecessarily exported function.
> > > >
> > > > The second patch extends the NAND driver to support both legacy and
> > > > driver-model users. For now we don't parse the device-tree as it's a
> > > > bit complicated on da850, namely: the nand node is a child of the
> > > > aemif node for which we don't have a driver in u-boot (unlike on linux
> > > > where the aemif driver populates all its subnodes). In order for the
> > > > nand device to be probed, we're adding a dummy node to the u-boot dts
> > > > extensions with an appropriate compatible.
> > > >
> > > > Two last patches enable driver model for NAND on da850-lcdk and da850-evm.
> > > > We don't enable the driver model in SPL as first: the patches enabling
> > > > CONFIG_SPL_DM are still waiting to be merged, and second: the
> > > > nand_spl_simple driver used by davinci SPL doesn't support driver model
> > > > users. This is planned for future series once some basic support is
> > > > merged.
> > >
> > > What happens when the board is booting SPL from NAND? Will it still
> > > work as expected? I know the da850-evm has at least one configuration
> > > which this is intended to boot from NAND instead of the default SPI
> > > flash.
> > >
> >
> > The driver works just like before in SPL. The support for the driver
> > model is added incrementally. In fact I tested it on da850-lcdk with
> > SPL loading u-boot from NAND.
> >
> > On da850-evm we could probably enable driver-model in SPL as well for
> > NAND, but I prefer to do it at once for both boards.
> >
> > Bart
> >
> > > adam
> > >
> > > >
> > > > Bartosz Golaszewski (4):
> > > > nand: davinci: make davinci_nand_init() static
> > > > nand: davinci: add support for driver model
> > > > davinci: omapl138-lcdk: enable driver model for NAND
> > > > davinci: da850-evm: enable driver model for NAND
> > > >
> > > > arch/arm/dts/da850-evm-u-boot.dtsi | 4 ++
> > > > arch/arm/dts/da850-lcdk-u-boot.dtsi | 4 ++
> > > > arch/arm/include/asm/ti-common/davinci_nand.h | 2 -
> > > > configs/da850evm_defconfig | 1 +
> > > > configs/da850evm_direct_nor_defconfig | 1 +
> > > > configs/da850evm_nand_defconfig | 1 +
> > > > configs/omapl138_lcdk_defconfig | 1 +
> > > > drivers/mtd/nand/raw/davinci_nand.c | 48 ++++++++++++++++++-
> > > > include/configs/da850evm.h | 4 ++
> > > > include/configs/omapl138_lcdk.h | 4 ++
> > > > 10 files changed, 66 insertions(+), 4 deletions(-)
> > > >
> > > > --
> > > > 2.21.0
> > > >
>
> Hi Tom,
>
> can you pick up this series?
Post-release, yes, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190703/440bc541/attachment.sig>
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2019-07-03 13:10 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-06 15:49 [U-Boot] [PATCH 0/4] nand: davinci: enable driver model for NAND Bartosz Golaszewski
2019-06-06 15:49 ` [U-Boot] [PATCH 1/4] nand: davinci: make davinci_nand_init() static Bartosz Golaszewski
2019-06-06 15:49 ` [U-Boot] [PATCH 2/4] nand: davinci: add support for driver model Bartosz Golaszewski
2019-06-06 15:49 ` [U-Boot] [PATCH 3/4] davinci: omapl138-lcdk: enable driver model for NAND Bartosz Golaszewski
2019-06-06 15:50 ` [U-Boot] [PATCH 4/4] davinci: da850-evm: " Bartosz Golaszewski
2019-06-07 19:58 ` Adam Ford
2019-06-06 15:58 ` [U-Boot] [PATCH 0/4] nand: davinci: " Adam Ford
2019-06-07 8:16 ` Bartosz Golaszewski
2019-07-03 13:01 ` Bartosz Golaszewski
2019-07-03 13:10 ` Tom Rini
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.