* [PATCH] imx_spi: drop non usefull ifdef enum imx_spi_devtype and arround cpu_is_xx @ 2011-08-11 15:30 Jean-Christophe PLAGNIOL-VILLARD 2011-08-11 15:55 ` [PATCH v2] imx_spi: drop non usefull ifdef Jean-Christophe PLAGNIOL-VILLARD 0 siblings, 1 reply; 7+ messages in thread From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-08-11 15:30 UTC (permalink / raw) To: barebox Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> --- drivers/spi/imx_spi.c | 18 ++---------------- 1 files changed, 2 insertions(+), 16 deletions(-) diff --git a/drivers/spi/imx_spi.c b/drivers/spi/imx_spi.c index 6dc41b9..f54f5b8 100644 --- a/drivers/spi/imx_spi.c +++ b/drivers/spi/imx_spi.c @@ -90,24 +90,12 @@ #define CSPI_2_3_STAT_RR (1 << 3) enum imx_spi_devtype { -#ifdef CONFIG_DRIVER_SPI_IMX1 SPI_IMX_VER_IMX1, -#endif -#ifdef CONFIG_DRIVER_SPI_IMX_0_0 SPI_IMX_VER_0_0, -#endif -#ifdef CONFIG_DRIVER_SPI_IMX_0_4 SPI_IMX_VER_0_4, -#endif -#ifdef CONFIG_DRIVER_SPI_IMX_0_5 SPI_IMX_VER_0_5, -#endif -#ifdef CONFIG_DRIVER_SPI_IMX_0_7 SPI_IMX_VER_0_7, -#endif -#ifdef CONFIG_DRIVER_SPI_IMX_2_3 SPI_IMX_VER_2_3, -#endif }; struct imx_spi { @@ -368,14 +356,12 @@ static int imx_spi_probe(struct device_d *dev) master->num_chipselect = pdata->num_chipselect; imx->cs_array = pdata->chipselect; -#ifdef CONFIG_DRIVER_SPI_IMX_0_0 if (cpu_is_mx27()) version = SPI_IMX_VER_0_0; -#endif -#ifdef CONFIG_DRIVER_SPI_IMX_2_3 + if (cpu_is_mx51() || cpu_is_mx53()) version = SPI_IMX_VER_2_3; -#endif + imx->chipselect = spi_imx_devtype_data[version].chipselect; imx->xchg_single = spi_imx_devtype_data[version].xchg_single; imx->init = spi_imx_devtype_data[version].init; -- 1.7.5.4 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2] imx_spi: drop non usefull ifdef 2011-08-11 15:30 [PATCH] imx_spi: drop non usefull ifdef enum imx_spi_devtype and arround cpu_is_xx Jean-Christophe PLAGNIOL-VILLARD @ 2011-08-11 15:55 ` Jean-Christophe PLAGNIOL-VILLARD 2011-08-12 6:42 ` Sascha Hauer 0 siblings, 1 reply; 7+ messages in thread From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-08-11 15:55 UTC (permalink / raw) To: barebox drop CONFIG_DRIVER_SPI_IMX_<version> this will not reduce barebox size as the compiler will do for us Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> --- drivers/spi/Kconfig | 12 +-------- drivers/spi/imx_spi.c | 63 +++++++++--------------------------------------- 2 files changed, 13 insertions(+), 62 deletions(-) diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig index 9ab03f6..b48f9aa 100644 --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig @@ -6,17 +6,7 @@ config SPI config DRIVER_SPI_IMX bool "i.MX SPI Master driver" - depends on ARCH_IMX + depends on ARCH_IMX && (ARCH_IMX27 || ARCH_IMX51 || ARCH_IMX53) depends on SPI -config DRIVER_SPI_IMX_0_0 - bool - depends on ARCH_IMX27 - default y - -config DRIVER_SPI_IMX_2_3 - bool - depends on ARCH_IMX51 || ARCH_IMX53 - default y - endmenu diff --git a/drivers/spi/imx_spi.c b/drivers/spi/imx_spi.c index 6dc41b9..0e2ea7e 100644 --- a/drivers/spi/imx_spi.c +++ b/drivers/spi/imx_spi.c @@ -90,24 +90,12 @@ #define CSPI_2_3_STAT_RR (1 << 3) enum imx_spi_devtype { -#ifdef CONFIG_DRIVER_SPI_IMX1 SPI_IMX_VER_IMX1, -#endif -#ifdef CONFIG_DRIVER_SPI_IMX_0_0 SPI_IMX_VER_0_0, -#endif -#ifdef CONFIG_DRIVER_SPI_IMX_0_4 SPI_IMX_VER_0_4, -#endif -#ifdef CONFIG_DRIVER_SPI_IMX_0_5 SPI_IMX_VER_0_5, -#endif -#ifdef CONFIG_DRIVER_SPI_IMX_0_7 SPI_IMX_VER_0_7, -#endif -#ifdef CONFIG_DRIVER_SPI_IMX_2_3 SPI_IMX_VER_2_3, -#endif }; struct imx_spi { @@ -120,12 +108,6 @@ struct imx_spi { void (*init)(struct imx_spi *imx); }; -struct spi_imx_devtype_data { - unsigned int (*xchg_single)(struct imx_spi *imx, u32 data); - void (*chipselect)(struct spi_device *spi, int active); - void (*init)(struct imx_spi *imx); -}; - static int imx_spi_setup(struct spi_device *spi) { debug("%s mode 0x%08x bits_per_word: %d speed: %d\n", @@ -134,7 +116,6 @@ static int imx_spi_setup(struct spi_device *spi) return 0; } -#ifdef CONFIG_DRIVER_SPI_IMX_0_0 static unsigned int cspi_0_0_xchg_single(struct imx_spi *imx, unsigned int data) { void __iomem *base = imx->regs; @@ -204,9 +185,7 @@ static void cspi_0_0_init(struct imx_spi *imx) readl(base + CSPI_0_0_RXDATA); writel(0, base + CSPI_0_0_INT); } -#endif -#ifdef CONFIG_DRIVER_SPI_IMX_2_3 static unsigned int cspi_2_3_xchg_single(struct imx_spi *imx, unsigned int data) { void __iomem *base = imx->regs; @@ -308,7 +287,6 @@ static void cspi_2_3_chipselect(struct spi_device *spi, int is_active) static void cspi_2_3_init(struct imx_spi *imx) { } -#endif static int imx_spi_transfer(struct spi_device *spi, struct spi_message *mesg) { @@ -334,29 +312,11 @@ static int imx_spi_transfer(struct spi_device *spi, struct spi_message *mesg) return 0; } -static struct spi_imx_devtype_data spi_imx_devtype_data[] = { -#ifdef CONFIG_DRIVER_SPI_IMX_0_0 - [SPI_IMX_VER_0_0] = { - .chipselect = cspi_0_0_chipselect, - .xchg_single = cspi_0_0_xchg_single, - .init = cspi_0_0_init, - }, -#endif -#ifdef CONFIG_DRIVER_SPI_IMX_2_3 - [SPI_IMX_VER_2_3] = { - .chipselect = cspi_2_3_chipselect, - .xchg_single = cspi_2_3_xchg_single, - .init = cspi_2_3_init, - }, -#endif -}; - static int imx_spi_probe(struct device_d *dev) { struct spi_master *master; struct imx_spi *imx; struct spi_imx_master *pdata = dev->platform_data; - enum imx_spi_devtype version; imx = xzalloc(sizeof(*imx)); @@ -368,17 +328,18 @@ static int imx_spi_probe(struct device_d *dev) master->num_chipselect = pdata->num_chipselect; imx->cs_array = pdata->chipselect; -#ifdef CONFIG_DRIVER_SPI_IMX_0_0 - if (cpu_is_mx27()) - version = SPI_IMX_VER_0_0; -#endif -#ifdef CONFIG_DRIVER_SPI_IMX_2_3 - if (cpu_is_mx51() || cpu_is_mx53()) - version = SPI_IMX_VER_2_3; -#endif - imx->chipselect = spi_imx_devtype_data[version].chipselect; - imx->xchg_single = spi_imx_devtype_data[version].xchg_single; - imx->init = spi_imx_devtype_data[version].init; + if (cpu_is_mx27()) { + imx->chipselect = cspi_0_0_chipselect; + imx->xchg_single = cspi_0_0_xchg_single; + imx->init = cspi_0_0_init; + } + + if (cpu_is_mx51() || cpu_is_mx53()) { + imx->chipselect = cspi_2_3_chipselect; + imx->xchg_single = cspi_2_3_xchg_single; + imx->init = cspi_2_3_init; + } + imx->regs = dev_request_mem_region(dev, 0); imx->init(imx); -- 1.7.5.4 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] imx_spi: drop non usefull ifdef 2011-08-11 15:55 ` [PATCH v2] imx_spi: drop non usefull ifdef Jean-Christophe PLAGNIOL-VILLARD @ 2011-08-12 6:42 ` Sascha Hauer 2011-08-12 9:36 ` Jean-Christophe PLAGNIOL-VILLARD 0 siblings, 1 reply; 7+ messages in thread From: Sascha Hauer @ 2011-08-12 6:42 UTC (permalink / raw) To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox On Thu, Aug 11, 2011 at 05:55:24PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote: > drop CONFIG_DRIVER_SPI_IMX_<version> > > this will not reduce barebox size as the compiler will do for us > > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> > --- > drivers/spi/Kconfig | 12 +-------- > drivers/spi/imx_spi.c | 63 +++++++++--------------------------------------- > 2 files changed, 13 insertions(+), 62 deletions(-) > > diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig > index 9ab03f6..b48f9aa 100644 > --- a/drivers/spi/Kconfig > +++ b/drivers/spi/Kconfig > @@ -6,17 +6,7 @@ config SPI > > config DRIVER_SPI_IMX > bool "i.MX SPI Master driver" > - depends on ARCH_IMX > + depends on ARCH_IMX && (ARCH_IMX27 || ARCH_IMX51 || ARCH_IMX53) > depends on SPI > > -config DRIVER_SPI_IMX_0_0 > - bool > - depends on ARCH_IMX27 > - default y > - > -config DRIVER_SPI_IMX_2_3 > - bool > - depends on ARCH_IMX51 || ARCH_IMX53 > - default y > - > endmenu > diff --git a/drivers/spi/imx_spi.c b/drivers/spi/imx_spi.c > index 6dc41b9..0e2ea7e 100644 > --- a/drivers/spi/imx_spi.c > +++ b/drivers/spi/imx_spi.c > @@ -90,24 +90,12 @@ > #define CSPI_2_3_STAT_RR (1 << 3) > > enum imx_spi_devtype { > -#ifdef CONFIG_DRIVER_SPI_IMX1 > SPI_IMX_VER_IMX1, > -#endif > -#ifdef CONFIG_DRIVER_SPI_IMX_0_0 > SPI_IMX_VER_0_0, > -#endif > -#ifdef CONFIG_DRIVER_SPI_IMX_0_4 > SPI_IMX_VER_0_4, > -#endif > -#ifdef CONFIG_DRIVER_SPI_IMX_0_5 > SPI_IMX_VER_0_5, > -#endif > -#ifdef CONFIG_DRIVER_SPI_IMX_0_7 > SPI_IMX_VER_0_7, > -#endif > -#ifdef CONFIG_DRIVER_SPI_IMX_2_3 > SPI_IMX_VER_2_3, > -#endif > }; We can get rid of this enumaration... > > struct imx_spi { > @@ -120,12 +108,6 @@ struct imx_spi { > void (*init)(struct imx_spi *imx); > }; > > -struct spi_imx_devtype_data { > - unsigned int (*xchg_single)(struct imx_spi *imx, u32 data); > - void (*chipselect)(struct spi_device *spi, int active); > - void (*init)(struct imx_spi *imx); > -}; but please keep this struct. > - > static int imx_spi_setup(struct spi_device *spi) > { > debug("%s mode 0x%08x bits_per_word: %d speed: %d\n", > @@ -134,7 +116,6 @@ static int imx_spi_setup(struct spi_device *spi) > return 0; > } > > -#ifdef CONFIG_DRIVER_SPI_IMX_0_0 > static unsigned int cspi_0_0_xchg_single(struct imx_spi *imx, unsigned int data) > { > void __iomem *base = imx->regs; > @@ -204,9 +185,7 @@ static void cspi_0_0_init(struct imx_spi *imx) > readl(base + CSPI_0_0_RXDATA); > writel(0, base + CSPI_0_0_INT); > } > -#endif > > -#ifdef CONFIG_DRIVER_SPI_IMX_2_3 > static unsigned int cspi_2_3_xchg_single(struct imx_spi *imx, unsigned int data) > { > void __iomem *base = imx->regs; > @@ -308,7 +287,6 @@ static void cspi_2_3_chipselect(struct spi_device *spi, int is_active) > static void cspi_2_3_init(struct imx_spi *imx) > { > } > -#endif > > static int imx_spi_transfer(struct spi_device *spi, struct spi_message *mesg) > { > @@ -334,29 +312,11 @@ static int imx_spi_transfer(struct spi_device *spi, struct spi_message *mesg) > return 0; > } > > -static struct spi_imx_devtype_data spi_imx_devtype_data[] = { > -#ifdef CONFIG_DRIVER_SPI_IMX_0_0 > - [SPI_IMX_VER_0_0] = { > - .chipselect = cspi_0_0_chipselect, > - .xchg_single = cspi_0_0_xchg_single, > - .init = cspi_0_0_init, > - }, > -#endif > -#ifdef CONFIG_DRIVER_SPI_IMX_2_3 > - [SPI_IMX_VER_2_3] = { > - .chipselect = cspi_2_3_chipselect, > - .xchg_single = cspi_2_3_xchg_single, > - .init = cspi_2_3_init, > - }, > -#endif > -}; This can be turned from an array to imx*_spi_devtype_data, > - imx->chipselect = spi_imx_devtype_data[version].chipselect; > - imx->xchg_single = spi_imx_devtype_data[version].xchg_single; > - imx->init = spi_imx_devtype_data[version].init; > + if (cpu_is_mx27()) { > + imx->chipselect = cspi_0_0_chipselect; > + imx->xchg_single = cspi_0_0_xchg_single; > + imx->init = cspi_0_0_init; > + } > + > + if (cpu_is_mx51() || cpu_is_mx53()) { > + imx->chipselect = cspi_2_3_chipselect; > + imx->xchg_single = cspi_2_3_xchg_single; > + imx->init = cspi_2_3_init; > + } Please keep structs to the SoC specific data. We might want to add device tree support in the future, then we'll need pointers to SoC specific data. Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] imx_spi: drop non usefull ifdef 2011-08-12 6:42 ` Sascha Hauer @ 2011-08-12 9:36 ` Jean-Christophe PLAGNIOL-VILLARD 2011-08-12 12:10 ` Sascha Hauer 0 siblings, 1 reply; 7+ messages in thread From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-08-12 9:36 UTC (permalink / raw) To: Sascha Hauer; +Cc: barebox On 08:42 Fri 12 Aug , Sascha Hauer wrote: > On Thu, Aug 11, 2011 at 05:55:24PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote: > > drop CONFIG_DRIVER_SPI_IMX_<version> > > > > this will not reduce barebox size as the compiler will do for us > > > > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> > > --- > > drivers/spi/Kconfig | 12 +-------- > > drivers/spi/imx_spi.c | 63 +++++++++--------------------------------------- > > 2 files changed, 13 insertions(+), 62 deletions(-) > > > > diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig > > index 9ab03f6..b48f9aa 100644 > > --- a/drivers/spi/Kconfig > > +++ b/drivers/spi/Kconfig > > @@ -6,17 +6,7 @@ config SPI > > > > config DRIVER_SPI_IMX > > bool "i.MX SPI Master driver" > > - depends on ARCH_IMX > > + depends on ARCH_IMX && (ARCH_IMX27 || ARCH_IMX51 || ARCH_IMX53) > > depends on SPI > > > > -config DRIVER_SPI_IMX_0_0 > > - bool > > - depends on ARCH_IMX27 > > - default y > > - > > -config DRIVER_SPI_IMX_2_3 > > - bool > > - depends on ARCH_IMX51 || ARCH_IMX53 > > - default y > > - > > endmenu > > diff --git a/drivers/spi/imx_spi.c b/drivers/spi/imx_spi.c > > index 6dc41b9..0e2ea7e 100644 > > --- a/drivers/spi/imx_spi.c > > +++ b/drivers/spi/imx_spi.c > > @@ -90,24 +90,12 @@ > > #define CSPI_2_3_STAT_RR (1 << 3) > > > > enum imx_spi_devtype { > > -#ifdef CONFIG_DRIVER_SPI_IMX1 > > SPI_IMX_VER_IMX1, > > -#endif > > -#ifdef CONFIG_DRIVER_SPI_IMX_0_0 > > SPI_IMX_VER_0_0, > > -#endif > > -#ifdef CONFIG_DRIVER_SPI_IMX_0_4 > > SPI_IMX_VER_0_4, > > -#endif > > -#ifdef CONFIG_DRIVER_SPI_IMX_0_5 > > SPI_IMX_VER_0_5, > > -#endif > > -#ifdef CONFIG_DRIVER_SPI_IMX_0_7 > > SPI_IMX_VER_0_7, > > -#endif > > -#ifdef CONFIG_DRIVER_SPI_IMX_2_3 > > SPI_IMX_VER_2_3, > > -#endif > > }; > > We can get rid of this enumaration... I think I've done it > > > > > struct imx_spi { > > @@ -120,12 +108,6 @@ struct imx_spi { > > void (*init)(struct imx_spi *imx); > > }; > > > > -struct spi_imx_devtype_data { > > - unsigned int (*xchg_single)(struct imx_spi *imx, u32 data); > > - void (*chipselect)(struct spi_device *spi, int active); > > - void (*init)(struct imx_spi *imx); > > -}; > > but please keep this struct. > > > - > > static int imx_spi_setup(struct spi_device *spi) > > { > > debug("%s mode 0x%08x bits_per_word: %d speed: %d\n", > > @@ -134,7 +116,6 @@ static int imx_spi_setup(struct spi_device *spi) > > return 0; > > } > > > > -#ifdef CONFIG_DRIVER_SPI_IMX_0_0 > > static unsigned int cspi_0_0_xchg_single(struct imx_spi *imx, unsigned int data) > > { > > void __iomem *base = imx->regs; > > @@ -204,9 +185,7 @@ static void cspi_0_0_init(struct imx_spi *imx) > > readl(base + CSPI_0_0_RXDATA); > > writel(0, base + CSPI_0_0_INT); > > } > > -#endif > > > > -#ifdef CONFIG_DRIVER_SPI_IMX_2_3 > > static unsigned int cspi_2_3_xchg_single(struct imx_spi *imx, unsigned int data) > > { > > void __iomem *base = imx->regs; > > @@ -308,7 +287,6 @@ static void cspi_2_3_chipselect(struct spi_device *spi, int is_active) > > static void cspi_2_3_init(struct imx_spi *imx) > > { > > } > > -#endif > > > > static int imx_spi_transfer(struct spi_device *spi, struct spi_message *mesg) > > { > > @@ -334,29 +312,11 @@ static int imx_spi_transfer(struct spi_device *spi, struct spi_message *mesg) > > return 0; > > } > > > > -static struct spi_imx_devtype_data spi_imx_devtype_data[] = { > > -#ifdef CONFIG_DRIVER_SPI_IMX_0_0 > > - [SPI_IMX_VER_0_0] = { > > - .chipselect = cspi_0_0_chipselect, > > - .xchg_single = cspi_0_0_xchg_single, > > - .init = cspi_0_0_init, > > - }, > > -#endif > > -#ifdef CONFIG_DRIVER_SPI_IMX_2_3 > > - [SPI_IMX_VER_2_3] = { > > - .chipselect = cspi_2_3_chipselect, > > - .xchg_single = cspi_2_3_xchg_single, > > - .init = cspi_2_3_init, > > - }, > > -#endif > > -}; > > This can be turned from an array to imx*_spi_devtype_data, > > > - imx->chipselect = spi_imx_devtype_data[version].chipselect; > > - imx->xchg_single = spi_imx_devtype_data[version].xchg_single; > > - imx->init = spi_imx_devtype_data[version].init; > > + if (cpu_is_mx27()) { > > + imx->chipselect = cspi_0_0_chipselect; > > + imx->xchg_single = cspi_0_0_xchg_single; > > + imx->init = cspi_0_0_init; > > + } > > + > > + if (cpu_is_mx51() || cpu_is_mx53()) { > > + imx->chipselect = cspi_2_3_chipselect; > > + imx->xchg_single = cspi_2_3_xchg_single; > > + imx->init = cspi_2_3_init; > > + } > > Please keep structs to the SoC specific data. We might want to add > device tree support in the future, then we'll need pointers to > SoC specific data. DT in barebox? So so it will increase the size a lot not sure it's really usefull Best Regards, J. _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] imx_spi: drop non usefull ifdef 2011-08-12 9:36 ` Jean-Christophe PLAGNIOL-VILLARD @ 2011-08-12 12:10 ` Sascha Hauer 2011-08-12 12:49 ` Jean-Christophe PLAGNIOL-VILLARD 0 siblings, 1 reply; 7+ messages in thread From: Sascha Hauer @ 2011-08-12 12:10 UTC (permalink / raw) To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox On Fri, Aug 12, 2011 at 11:36:35AM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote: > On 08:42 Fri 12 Aug , Sascha Hauer wrote: > > On Thu, Aug 11, 2011 at 05:55:24PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote: > > > drop CONFIG_DRIVER_SPI_IMX_<version> > > > > > > + if (cpu_is_mx51() || cpu_is_mx53()) { > > > + imx->chipselect = cspi_2_3_chipselect; > > > + imx->xchg_single = cspi_2_3_xchg_single; > > > + imx->init = cspi_2_3_init; > > > + } > > > > Please keep structs to the SoC specific data. We might want to add > > device tree support in the future, then we'll need pointers to > > SoC specific data. > > DT in barebox? > > So so it will increase the size a lot not sure it's really usefull We'll need limited device tree support anyway soon. When Shawn continues I won't be able to boot my boards soon without OF. Then I at least want to be able to adjust the command line (which is embedded in the device tree) Of course this adds to the binary size, but it's not huge. I'm currently experimenting with this and so far it looks promising. Anyway, it will be completely optional for people who don't want it. Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] imx_spi: drop non usefull ifdef 2011-08-12 12:10 ` Sascha Hauer @ 2011-08-12 12:49 ` Jean-Christophe PLAGNIOL-VILLARD 2011-08-12 17:23 ` Sascha Hauer 0 siblings, 1 reply; 7+ messages in thread From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-08-12 12:49 UTC (permalink / raw) To: Sascha Hauer; +Cc: barebox On 14:10 Fri 12 Aug , Sascha Hauer wrote: > On Fri, Aug 12, 2011 at 11:36:35AM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote: > > On 08:42 Fri 12 Aug , Sascha Hauer wrote: > > > On Thu, Aug 11, 2011 at 05:55:24PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote: > > > > drop CONFIG_DRIVER_SPI_IMX_<version> > > > > > > > > + if (cpu_is_mx51() || cpu_is_mx53()) { > > > > + imx->chipselect = cspi_2_3_chipselect; > > > > + imx->xchg_single = cspi_2_3_xchg_single; > > > > + imx->init = cspi_2_3_init; > > > > + } > > > > > > Please keep structs to the SoC specific data. We might want to add > > > device tree support in the future, then we'll need pointers to > > > SoC specific data. > > > > DT in barebox? > > > > So so it will increase the size a lot not sure it's really usefull > > We'll need limited device tree support anyway soon. When Shawn continues > I won't be able to boot my boards soon without OF. Then I at least want > to be able to adjust the command line (which is embedded in the device > tree) > > Of course this adds to the binary size, but it's not huge. I'm currently > experimenting with this and so far it looks promising. Anyway, it will > be completely optional for people who don't want it. I take a look too but my key point is do we nned the DT for internal use Best Regards, J. _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] imx_spi: drop non usefull ifdef 2011-08-12 12:49 ` Jean-Christophe PLAGNIOL-VILLARD @ 2011-08-12 17:23 ` Sascha Hauer 0 siblings, 0 replies; 7+ messages in thread From: Sascha Hauer @ 2011-08-12 17:23 UTC (permalink / raw) To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox On Fri, Aug 12, 2011 at 02:49:21PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote: > On 14:10 Fri 12 Aug , Sascha Hauer wrote: > > On Fri, Aug 12, 2011 at 11:36:35AM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote: > > > On 08:42 Fri 12 Aug , Sascha Hauer wrote: > > > > On Thu, Aug 11, 2011 at 05:55:24PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote: > > > > > drop CONFIG_DRIVER_SPI_IMX_<version> > > > > > > > > > > + if (cpu_is_mx51() || cpu_is_mx53()) { > > > > > + imx->chipselect = cspi_2_3_chipselect; > > > > > + imx->xchg_single = cspi_2_3_xchg_single; > > > > > + imx->init = cspi_2_3_init; > > > > > + } > > > > > > > > Please keep structs to the SoC specific data. We might want to add > > > > device tree support in the future, then we'll need pointers to > > > > SoC specific data. > > > > > > DT in barebox? > > > > > > So so it will increase the size a lot not sure it's really usefull > > > > We'll need limited device tree support anyway soon. When Shawn continues > > I won't be able to boot my boards soon without OF. Then I at least want > > to be able to adjust the command line (which is embedded in the device > > tree) > > > > Of course this adds to the binary size, but it's not huge. I'm currently > > experimenting with this and so far it looks promising. Anyway, it will > > be completely optional for people who don't want it. > I take a look too but my key point is do we nned the DT for internal use No we don't. But then again, in the dt there is also the description for nand/nor partitions and maybe MAC addresses. It's quite painful to keep these in sync with barebox when there's no association between the device tree and the barebox devices. I think the most additional code for is needed to be able to get basic OF suppport (dump the tree, update bootargs and memory parameters). Integrating it fully into barebox is only a small step then. But let's see, as said, I'm in early experimental stage. Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2011-08-12 17:23 UTC | newest] Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2011-08-11 15:30 [PATCH] imx_spi: drop non usefull ifdef enum imx_spi_devtype and arround cpu_is_xx Jean-Christophe PLAGNIOL-VILLARD 2011-08-11 15:55 ` [PATCH v2] imx_spi: drop non usefull ifdef Jean-Christophe PLAGNIOL-VILLARD 2011-08-12 6:42 ` Sascha Hauer 2011-08-12 9:36 ` Jean-Christophe PLAGNIOL-VILLARD 2011-08-12 12:10 ` Sascha Hauer 2011-08-12 12:49 ` Jean-Christophe PLAGNIOL-VILLARD 2011-08-12 17:23 ` Sascha Hauer
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox