OMAP3EVM: net_chip uses CS5 not CS6
PATCH 1/1 OMAP3EVM: net_chip uses CS5 not CS6
--- board/omap3/evm/evm.c | 16 ++++++++-------- include/asm-arm/arch-omap3/cpu.h | 5 +++-- 2 files changed, 11 insertions(+), 10 deletions(-)
board/omap3/evm/evm.c +8 -8
@@ -92,17 +92,17 @@ void set_muxconf_regs(void)static void setup_net_chip (void ) {gpio_t *gpio3_base = (gpio_t *)OMAP34XX_GPIO3_BASE ; -gpmc_csx_t *gpmc_cs6_base = (gpmc_csx_t *)GPMC_CONFIG_CS6_BASE ; +gpmc_csx_t *gpmc_cs5_base = (gpmc_csx_t *)GPMC_CONFIG_CS5_BASE ;ctrl_t *ctrl_base = (ctrl_t *)OMAP34XX_CTRL_BASE ;/* Configure GPMC registers */ -writel (NET_GPMC_CONFIG1 , &gpmc_cs6_base->config1); -writel (NET_GPMC_CONFIG2 , &gpmc_cs6_base->config2); -writel (NET_GPMC_CONFIG3 , &gpmc_cs6_base->config3); -writel (NET_GPMC_CONFIG4 , &gpmc_cs6_base->config4); -writel (NET_GPMC_CONFIG5 , &gpmc_cs6_base->config5); -writel (NET_GPMC_CONFIG6 , &gpmc_cs6_base->config6); -writel (NET_GPMC_CONFIG7 , &gpmc_cs6_base->config7); +writel (NET_GPMC_CONFIG1 , &gpmc_cs5_base->config1); +writel (NET_GPMC_CONFIG2 , &gpmc_cs5_base->config2); +writel (NET_GPMC_CONFIG3 , &gpmc_cs5_base->config3); +writel (NET_GPMC_CONFIG4 , &gpmc_cs5_base->config4); +writel (NET_GPMC_CONFIG5 , &gpmc_cs5_base->config5); +writel (NET_GPMC_CONFIG6 , &gpmc_cs5_base->config6); +writel (NET_GPMC_CONFIG7 , &gpmc_cs5_base->config7);/* Enable off mode for NWE in PADCONF_GPMC_NWE register */ writew (readw (&ctrl_base ->gpmc_nwe) |0x0E00 , &ctrl_base->gpmc_nwe);
include/asm-arm/arch-omap3/cpu.h +3 -2
@@ -84,9 +84,10 @@ typedef struct ctrl_id {/* GPMC CS3/cs4/cs6 not avaliable */ #define GPMC_BASE (OMAP34XX_GPMC_BASE)#define GPMC_CONFIG_CS0 0x60 -#define GPMC_CONFIG_CS6 0x150 +#define GPMC_CONFIG_CS5 0x150 +#define GPMC_CONFIG_CS0_BASE (GPMC_BASE + GPMC_CONFIG_CS0) -#define GPMC_CONFIG_CS6_BASE (GPMC_BASE + GPMC_CONFIG_CS6) +#define GPMC_CONFIG_CS5_BASE (GPMC_BASE + GPMC_CONFIG_CS5)#define GPMC_CONFIG_WP 0x10#define GPMC_CONFIG_WIDTH 0x30
Signature · 1 line
1.6.3.rc4.29.g8146
PATCH 1/1 OMAP3EVM: net_chip uses CS5 not CS6
Quoted 1 line · Matthias Ludwig
Signed-off-by Matthias Ludwig <[email protected]>
Matthias: Thanks for fixing this!
Mani: Can we get your ack as EVM maintainer?
Many thanks and best regards
Dirk
Quoted 52 lines
--- board/omap3/evm/evm.c | 16 ++++++++-------- include/asm-arm/arch-omap3/cpu.h | 5 +++-- 2 files changed, 11 insertions(+), 10 deletions(-)board/omap3/evm/evm.c +8
-8@@ -92,17 +92,17 @@ void set_muxconf_regs(void)static void setup_net_chip (void ) {gpio_t *gpio3_base = (gpio_t *)OMAP34XX_GPIO3_BASE ; -gpmc_csx_t *gpmc_cs6_base = (gpmc_csx_t *)GPMC_CONFIG_CS6_BASE ; +gpmc_csx_t *gpmc_cs5_base = (gpmc_csx_t *)GPMC_CONFIG_CS5_BASE ;ctrl_t *ctrl_base = (ctrl_t *)OMAP34XX_CTRL_BASE ;/* Configure GPMC registers */ -writel (NET_GPMC_CONFIG1 , &gpmc_cs6_base->config1); -writel (NET_GPMC_CONFIG2 , &gpmc_cs6_base->config2); -writel (NET_GPMC_CONFIG3 , &gpmc_cs6_base->config3); -writel (NET_GPMC_CONFIG4 , &gpmc_cs6_base->config4); -writel (NET_GPMC_CONFIG5 , &gpmc_cs6_base->config5); -writel (NET_GPMC_CONFIG6 , &gpmc_cs6_base->config6); -writel (NET_GPMC_CONFIG7 , &gpmc_cs6_base->config7); +writel (NET_GPMC_CONFIG1 , &gpmc_cs5_base->config1); +writel (NET_GPMC_CONFIG2 , &gpmc_cs5_base->config2); +writel (NET_GPMC_CONFIG3 , &gpmc_cs5_base->config3); +writel (NET_GPMC_CONFIG4 , &gpmc_cs5_base->config4); +writel (NET_GPMC_CONFIG5 , &gpmc_cs5_base->config5); +writel (NET_GPMC_CONFIG6 , &gpmc_cs5_base->config6); +writel (NET_GPMC_CONFIG7 , &gpmc_cs5_base->config7);/* Enable off mode for NWE in PADCONF_GPMC_NWE register */ writew (readw (&ctrl_base ->gpmc_nwe) |0x0E00 , &ctrl_base->gpmc_nwe);include/asm-arm/arch-omap3/cpu.h +3
-2@@ -84,9 +84,10 @@ typedef struct ctrl_id {/* GPMC CS3/cs4/cs6 not avaliable */ #define GPMC_BASE (OMAP34XX_GPMC_BASE)#define GPMC_CONFIG_CS0 0x60 -#define GPMC_CONFIG_CS6 0x150 +#define GPMC_CONFIG_CS5 0x150 +#define GPMC_CONFIG_CS0_BASE (GPMC_BASE + GPMC_CONFIG_CS0) -#define GPMC_CONFIG_CS6_BASE (GPMC_BASE + GPMC_CONFIG_CS6) +#define GPMC_CONFIG_CS5_BASE (GPMC_BASE + GPMC_CONFIG_CS5)#define GPMC_CONFIG_WP 0x10#define GPMC_CONFIG_WIDTH 0x30
Pillai
PATCH 1/1 OMAP3EVM: net_chip uses CS5 not CS6
Quoted 9 lines
-----Original Message-----
From: Dirk Behme [mailto:dirk.behme at googlemail.com]
Sent: Wednesday, May 06, 2009 8:25 PM
To: Matthias Ludwig; Pillai, Manikandan
Cc: u-boot at lists.denx.de
Subject: Re: [PATCH] OMAP3EVM:net_chipuses CS5 not CS6
Quoted 4 lines
Quoted 1 line · Matthias Ludwig
Signed-off-by Matthias Ludwig <[email protected]>Matthias: Thanks for fixing this!
[Pillai, Manikandan] not sure why this change in the Chip select
Quoted 61 lines
Mani: Can we get your ack as EVM maintainer?
Many thanks and best regards
Dirk
include/asm-arm/arch-
Quoted 36 lines
--- board/omap3/evm/evm.c | 16 ++++++++-------- include/asm-arm/arch-omap3/cpu.h | 5 +++-- 2 files changed, 11 insertions(+), 10 deletions(-)board/omap3/evm/evm.c +8
-8@@ -92,17 +92,17 @@ void set_muxconf_regs(void)static void setup_net_chip (void ) {gpio_t *gpio3_base = (gpio_t *)OMAP34XX_GPIO3_BASE ; -gpmc_csx_t *gpmc_cs6_base = (gpmc_csx_t *)GPMC_CONFIG_CS6_BASE ; +gpmc_csx_t *gpmc_cs5_base = (gpmc_csx_t *)GPMC_CONFIG_CS5_BASE ;ctrl_t *ctrl_base = (ctrl_t *)OMAP34XX_CTRL_BASE ;/* Configure GPMC registers */ -writel (NET_GPMC_CONFIG1 , &gpmc_cs6_base->config1); -writel (NET_GPMC_CONFIG2 , &gpmc_cs6_base->config2); -writel (NET_GPMC_CONFIG3 , &gpmc_cs6_base->config3); -writel (NET_GPMC_CONFIG4 , &gpmc_cs6_base->config4); -writel (NET_GPMC_CONFIG5 , &gpmc_cs6_base->config5); -writel (NET_GPMC_CONFIG6 , &gpmc_cs6_base->config6); -writel (NET_GPMC_CONFIG7 , &gpmc_cs6_base->config7); +writel (NET_GPMC_CONFIG1 , &gpmc_cs5_base->config1); +writel (NET_GPMC_CONFIG2 , &gpmc_cs5_base->config2); +writel (NET_GPMC_CONFIG3 , &gpmc_cs5_base->config3); +writel (NET_GPMC_CONFIG4 , &gpmc_cs5_base->config4); +writel (NET_GPMC_CONFIG5 , &gpmc_cs5_base->config5); +writel (NET_GPMC_CONFIG6 , &gpmc_cs5_base->config6); +writel (NET_GPMC_CONFIG7 , &gpmc_cs5_base->config7);/* Enable off mode for NWE in PADCONF_GPMC_NWE register */ writew (readw (&ctrl_base ->gpmc_nwe) |0x0E00 , &ctrl_base->gpmc_nwe);include/asm-arm/arch- renamed from include/asm-arm/arch-omap3/cpu.h +0
-0
omap3/cpu.hQuoted 16 lines
index c544e0c..a4ce45a 100644
include/asm-arm/arch-omap3/cpu.h +3
-2@@ -84,9 +84,10 @@ typedef struct ctrl_id {/* GPMC CS3/cs4/cs6 not avaliable */ #define GPMC_BASE (OMAP34XX_GPMC_BASE)#define GPMC_CONFIG_CS0 0x60 -#define GPMC_CONFIG_CS6 0x150 +#define GPMC_CONFIG_CS5 0x150 +#define GPMC_CONFIG_CS0_BASE (GPMC_BASE + GPMC_CONFIG_CS0) -#define GPMC_CONFIG_CS6_BASE (GPMC_BASE + GPMC_CONFIG_CS6) +#define GPMC_CONFIG_CS5_BASE (GPMC_BASE + GPMC_CONFIG_CS5)#define GPMC_CONFIG_WP 0x10#define GPMC_CONFIG_WIDTH 0x30
PATCH 1/1 OMAP3EVM: net_chip uses CS5 not CS6
This is not really a change. The cs configuration was correct, but not the naming of it.
OMAP34XX_GPMC_BASE (0x6e000000) + 0x150 = base address of configuration registers for GPMC-CS5 not GPMC-CS6.
best regards,
Matthias
Quoted 77 lines · Manikandan
Quoted 9 lines
-----Original Message-----
From: Dirk Behme [mailto:dirk.behme at googlemail.com]
Sent: Wednesday, May 06, 2009 8:25 PM
To: Matthias Ludwig; Pillai, Manikandan
Cc: u-boot at lists.denx.de
Subject: Re: [PATCH] OMAP3EVM:net_chipuses CS5 not CS6Quoted 4 lines
Quoted 1 line · Matthias Ludwig
Signed-off-by Matthias Ludwig <[email protected]>Matthias: Thanks for fixing this!
[Pillai, Manikandan] not sure why this change in the Chip select
Quoted 61 lines
Mani: Can we get your ack as EVM maintainer?
Many thanks and best regards
Dirk
include/asm-arm/arch-
Quoted 36 lines
--- board/omap3/evm/evm.c | 16 ++++++++-------- include/asm-arm/arch-omap3/cpu.h | 5 +++-- 2 files changed, 11 insertions(+), 10 deletions(-)board/omap3/evm/evm.c +8
-8@@ -92,17 +92,17 @@ void set_muxconf_regs(void)static void setup_net_chip (void ) {gpio_t *gpio3_base = (gpio_t *)OMAP34XX_GPIO3_BASE ; -gpmc_csx_t *gpmc_cs6_base = (gpmc_csx_t *)GPMC_CONFIG_CS6_BASE ; +gpmc_csx_t *gpmc_cs5_base = (gpmc_csx_t *)GPMC_CONFIG_CS5_BASE ;ctrl_t *ctrl_base = (ctrl_t *)OMAP34XX_CTRL_BASE ;/* Configure GPMC registers */ -writel (NET_GPMC_CONFIG1 , &gpmc_cs6_base->config1); -writel (NET_GPMC_CONFIG2 , &gpmc_cs6_base->config2); -writel (NET_GPMC_CONFIG3 , &gpmc_cs6_base->config3); -writel (NET_GPMC_CONFIG4 , &gpmc_cs6_base->config4); -writel (NET_GPMC_CONFIG5 , &gpmc_cs6_base->config5); -writel (NET_GPMC_CONFIG6 , &gpmc_cs6_base->config6); -writel (NET_GPMC_CONFIG7 , &gpmc_cs6_base->config7); +writel (NET_GPMC_CONFIG1 , &gpmc_cs5_base->config1); +writel (NET_GPMC_CONFIG2 , &gpmc_cs5_base->config2); +writel (NET_GPMC_CONFIG3 , &gpmc_cs5_base->config3); +writel (NET_GPMC_CONFIG4 , &gpmc_cs5_base->config4); +writel (NET_GPMC_CONFIG5 , &gpmc_cs5_base->config5); +writel (NET_GPMC_CONFIG6 , &gpmc_cs5_base->config6); +writel (NET_GPMC_CONFIG7 , &gpmc_cs5_base->config7);/* Enable off mode for NWE in PADCONF_GPMC_NWE register */ writew (readw (&ctrl_base ->gpmc_nwe) |0x0E00 , &ctrl_base->gpmc_nwe);include/asm-arm/arch- renamed from include/asm-arm/arch-omap3/cpu.h +0
-0
omap3/cpu.hQuoted 16 lines
index c544e0c..a4ce45a 100644
include/asm-arm/arch-omap3/cpu.h +3
-2@@ -84,9 +84,10 @@ typedef struct ctrl_id {/* GPMC CS3/cs4/cs6 not avaliable */ #define GPMC_BASE (OMAP34XX_GPMC_BASE)#define GPMC_CONFIG_CS0 0x60 -#define GPMC_CONFIG_CS6 0x150 +#define GPMC_CONFIG_CS5 0x150 +#define GPMC_CONFIG_CS0_BASE (GPMC_BASE + GPMC_CONFIG_CS0) -#define GPMC_CONFIG_CS6_BASE (GPMC_BASE + GPMC_CONFIG_CS6) +#define GPMC_CONFIG_CS5_BASE (GPMC_BASE + GPMC_CONFIG_CS5)#define GPMC_CONFIG_WP 0x10#define GPMC_CONFIG_WIDTH 0x30
Signature · 4 lines
Matthias Ludwig, Software Development Ultratronik Entwicklungs GmbH, Gewerbestrasse 52, 82211 Herrsching, Germany http://www.ultratronik.de Tel: +49 8152 3709-356 Fax: +49 8152 5183 Registergericht Muenchen, HRB 55584
Pillai
PATCH 1/1 OMAP3EVM: net_chip uses CS5 not CS6
ACKed
Quoted 102 lines
-----Original Message-----
From: Matthias Ludwig [mailto:mludwig at ultratronik.de]
Sent: Thursday, May 07, 2009 12:42 PM
To: Pillai, Manikandan
Cc: Dirk Behme; u-boot at lists.denx.de
Subject: Re: [PATCH] OMAP3EVM:net_chipuses CS5 not CS6This is not really a change. The cs configuration was correct, but not the naming of it.
OMAP34XX_GPMC_BASE(0x6e000000) +0x150= base address of configuration registers for GPMC-CS5 not GPMC-CS6.best regards,
MatthiasQuoted 55 lines · Manikandan
Quoted 9 lines
-----Original Message-----
From: Dirk Behme [mailto:dirk.behme at googlemail.com]
Sent: Wednesday, May 06, 2009 8:25 PM
To: Matthias Ludwig; Pillai, Manikandan
Cc: u-boot at lists.denx.de
Subject: Re: [PATCH] OMAP3EVM:net_chipuses CS5 not CS6Quoted 4 lines
Quoted 1 line · Matthias Ludwig
Signed-off-by Matthias Ludwig <[email protected]>Matthias: Thanks for fixing this!
[Pillai, Manikandan] not sure why this change in the Chip select
Quoted 40 lines
Mani: Can we get your ack as EVM maintainer?
Many thanks and best regards
Dirk
Quoted 33 lines
--- board/omap3/evm/evm.c | 16 ++++++++-------- include/asm-arm/arch-omap3/cpu.h | 5 +++-- 2 files changed, 11 insertions(+), 10 deletions(-)board/omap3/evm/evm.c +8
-8@@ -92,17 +92,17 @@ void set_muxconf_regs(void)static void setup_net_chip (void ) {gpio_t *gpio3_base = (gpio_t *)OMAP34XX_GPIO3_BASE ; -gpmc_csx_t *gpmc_cs6_base = (gpmc_csx_t *)GPMC_CONFIG_CS6_BASE ; +gpmc_csx_t *gpmc_cs5_base = (gpmc_csx_t *)GPMC_CONFIG_CS5_BASE ;ctrl_t *ctrl_base = (ctrl_t *)OMAP34XX_CTRL_BASE ;/* Configure GPMC registers */ -writel (NET_GPMC_CONFIG1 , &gpmc_cs6_base->config1); -writel (NET_GPMC_CONFIG2 , &gpmc_cs6_base->config2); -writel (NET_GPMC_CONFIG3 , &gpmc_cs6_base->config3); -writel (NET_GPMC_CONFIG4 , &gpmc_cs6_base->config4); -writel (NET_GPMC_CONFIG5 , &gpmc_cs6_base->config5); -writel (NET_GPMC_CONFIG6 , &gpmc_cs6_base->config6); -writel (NET_GPMC_CONFIG7 , &gpmc_cs6_base->config7); +writel (NET_GPMC_CONFIG1 , &gpmc_cs5_base->config1); +writel (NET_GPMC_CONFIG2 , &gpmc_cs5_base->config2); +writel (NET_GPMC_CONFIG3 , &gpmc_cs5_base->config3); +writel (NET_GPMC_CONFIG4 , &gpmc_cs5_base->config4); +writel (NET_GPMC_CONFIG5 , &gpmc_cs5_base->config5); +writel (NET_GPMC_CONFIG6 , &gpmc_cs5_base->config6); +writel (NET_GPMC_CONFIG7 , &gpmc_cs5_base->config7);Quoted 23 lines
Quoted 2 lines
board/omap3/evm/evm.c void set_muxconf_regs(void) · line 108
Quoted 2 lines
board/omap3/evm/evm.c +0
-0/* Enable off mode for NWE in PADCONF_GPMC_NWE register */ writew(readw(&ctrl_base ->gpmc_nwe) | 0x0E00, &ctrl_base-
gpmc_nwe);Quoted 19 lines
include/asm-arm/arch-
Quoted 1 line
include/asm-arm/arch- renamed from include/asm-arm/arch-omap3/cpu.h +0
-0
omap3/cpu.hQuoted 16 lines
index c544e0c..a4ce45a 100644
include/asm-arm/arch-omap3/cpu.h +3
-2@@ -84,9 +84,10 @@ typedef struct ctrl_id {/* GPMC CS3/cs4/cs6 not avaliable */ #define GPMC_BASE (OMAP34XX_GPMC_BASE)#define GPMC_CONFIG_CS0 0x60 -#define GPMC_CONFIG_CS6 0x150 +#define GPMC_CONFIG_CS5 0x150 +#define GPMC_CONFIG_CS0_BASE (GPMC_BASE + GPMC_CONFIG_CS0) -#define GPMC_CONFIG_CS6_BASE (GPMC_BASE + GPMC_CONFIG_CS6) +#define GPMC_CONFIG_CS5_BASE (GPMC_BASE + GPMC_CONFIG_CS5)#define GPMC_CONFIG_WP 0x10#define GPMC_CONFIG_WIDTH 0x30--
Matthias Ludwig, Software Development
Ultratronik Entwicklungs GmbH, Gewerbestrasse 52, 82211 Herrsching, Germany
http://www.ultratronik.de Tel: +49 8152 3709-356 Fax: +49 8152 5183 Registergericht Muenchen, HRB 55584
PATCH 1/1 OMAP3EVM: net_chip uses CS5 not CS6
In reply to Matthias LudwigDear Matthias Ludwig,
Quoted 5 lines · In message <[email protected]> you wrote:
This is not really a change. The cs configuration was correct, but not the naming of it.
OMAP34XX_GPMC_BASE(0x6e000000) +0x150= base address of configuration registers for GPMC-CS5 not GPMC-CS6.
Can we please get rid of all this crap with register offsets and device accesses through pointers using base address plus offset?
Please provide proper C structs!
Best regards,
Wolfgang Denk
Signature · 4 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de "Wish not to seem, but to be, the best." - Aeschylus
PATCH 1/1 OMAP3EVM: net_chip uses CS5 not CS6
Dear Wolfgang,
Quoted 6 lines · Wolfgang Denk
Dear Matthias Ludwig,
Quoted 3 lines · In message <[email protected]> you wrote:
This is not really a change. The cs configuration was correct, but not the naming of it.
Quoted 7 lines
Quoted 2 lines
OMAP34XX_GPMC_BASE(0x6e000000) +0x150= base address of configuration registers for GPMC-CS5 not GPMC-CS6.Can we please get rid of all this crap with register offsets and device accesses through pointers using base address plus offset?
Please provide proper C structs!
Would you like to have a look to the code snippet visible in Matthias' patch
http://lists.denx.de/pipermail/u-boot/2009-May/052157.html
?
It's my understanding that what's in code
writel(NET_GPMC_CONFIG1, &gpmc_cs5_base->config1);
is what you want? I.e. as I understand it, the code is correct (we use C structs), and the style Matthias used above you complain about was just for patch explanation (to make it easier understandable).
Sorry if I missed something, just correct then ;)
Best regards
Dirk
PATCH 1/1 OMAP3EVM: net_chip uses CS5 not CS6
Dear Dirk,
Quoted 9 lines · In message <[email protected]> you wrote:
Quoted 2 lines
Please provide proper C structs!
Would you like to have a look to the code snippet visible in Matthias' patch
http://lists.denx.de/pipermail/u-boot/2009-May/052157.html
?
Done.
Quoted 5 lines
It's my understanding that what's in code
writel(NET_GPMC_CONFIG1, &gpmc_cs5_base->config1);is what you want? I.e. as I understand it, the code is correct (we use
It is only part of what I want to see. There are still deficiencies.
Yes, we have a struct gpmc_csx, that's good.
Note though that using such typedef's not in line with the Coding Style, which says: "It's a _mistake_ to use typedef for structures and pointers." Also, checkpatch.pl complains about this.
The next problem is that the entries in these structs are declared as "unsigned int", which just happens to work by chance. "u32" would be more reliable.
Finally, and this is what I really compalin about, is that there is no big structure which includes all the blocks that make up the CPU into one big structure (as it's done for example for PowerPC systems in the include/asm-ppc/*immap* files) - you still use code like
gpmc_csx_t *gpmc_cs5_base = (gpmc_csx_t *)GPMC_CONFIG_CS5_BASE;
to locate each of the individual C structs in the memory map; instead, onle one single pointer to the internal memory should be needed.
Quoted 1 line
Sorry if I missed something, just correct then ;)
Done. Thanks.
Best regards,
Wolfgang Denk
Signature · 7 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Winners never talk about glorious victories. That's because they're
the ones who see what the battlefield looks like afterwards. It's
only the losers who have glorious victories.
- Terry Pratchett, _Small Gods_PATCH 1/1 OMAP3EVM: net_chip uses CS5 not CS6
Quoted 4 lines · Wolfgang Denk
Finally, and this is what I really compalin about, is that there is no big structure which includes all the blocks that make up the CPU into one big structure (as it's done for example for PowerPC systems in the
include/asm-ppc/*immap*files) - you still use code like
Those immap structs are a huge pain to maintain (or to verify the correctness of), loaded with ifdeffery and magic numbers describing reserved spans. We should not be emulating them.
We used to have them in Linux, and got rid of them.
-Scott
PATCH 1/1 OMAP3EVM: net_chip uses CS5 not CS6
Dear Scott,
Quoted 9 lines · In message <[email protected]> you wrote:
Quoted 4 lines · Wolfgang Denk
Finally, and this is what I really compalin about, is that there is no big structure which includes all the blocks that make up the CPU into one big structure (as it's done for example for PowerPC systems in the
include/asm-ppc/*immap*files) - you still use code likeThose immap structs are a huge pain to maintain (or to verify the correctness of), loaded with ifdeffery and magic numbers describing reserved spans. We should not be emulating them.
Well, #define'ing long lists of register offsets is not easier to maintain or verify, and you don't have any typechecking by the compiler.
Quoted 1 line
We used to have them in Linux, and got rid of them.
Hm... Seems I have missed this change... What's things like
struct qe_immap __iomem *qe_immr
or
cpm2_map_t __iomem *cpm2_immr
or
immap_t __iomem *mpc8xx_immr
then? Or what replaced the "immr" structs?
Best regards,
Wolfgang Denk
Signature · 8 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The manager will be continually amazed that policies he took for com-
mon knowledge are totally unknown by some member of his team. Since
his fundamental job is to keep everybody going in the same direction,
his chief daily task will be communication, not decision-making.
- Fred Brooks, "The Mythical Man Month"PATCH 1/1 OMAP3EVM: net_chip uses CS5 not CS6
Quoted 8 lines · Wolfgang Denk
Dear Scott,
Quoted 5 lines · In message <[email protected]> you wrote:
Quoted 4 lines · Wolfgang Denk
Finally, and this is what I really compalin about, is that there is no big structure which includes all the blocks that make up the CPU into one big structure (as it's done for example for PowerPC systems in the
include/asm-ppc/*immap*files) - you still use code like
Quoted 6 lines
Quoted 3 lines
Those immap structs are a huge pain to maintain (or to verify the correctness of), loaded with ifdeffery and magic numbers describing reserved spans. We should not be emulating them.
Well, #define'ing long lists of register offsets is not easier to maintain or verify,
IMHO it is; you can just compare to the manual rather than have offsets be screwed up if something is missing, out of order, or the wrong size.
That's countered by the typechecking and ease of use of structs, though.
Quoted 2 lines
and you don't have any typechecking by the
compiler.
It doesn't have to be all one or the other. Use structs to describe individual blocks (provided they're not too sparsely populated), but define block addresses rather than huge structs consisting of sub-blocks and empty space. And let the details be flexible at the author/maintainer's discretion, rather than a rigid rule.
Quoted 11 lines
Quoted 1 line
We used to have them in Linux, and got rid of them.
Hm... Seems I have missed this change... What's things like
struct
qe_immap__iomem*qe_immr
orcpm2_map_t __iomem *cpm2_immror
immap_t__iomem*mpc8xx_immrthen?
Legacy stuff that hasn't been fully cleaned up. There used to be immap structs for 83xx and 85xx back in arch/ppc IIRC.
Quoted 1 line
Or what replaced the "immr" structs?
The device tree, mainly. But #defines can work for u-boot.
-Scott
PATCH 1/1 OMAP3EVM: net_chip uses CS5 not CS6
Dear Scott Wood,
Quoted 4 lines · In message <[email protected]> you wrote:
Quoted 2 lines
Or what replaced the "immr" structs?
The device tree, mainly...
Right, of course.
Quoted 1 line
... But #defines can work for u-boot.
Of course they _can_ work. But they can easily fail (as we just see in this patch), and we don't have typechecking. So until DT's are omnipresent, let's use structs in U-Boot, please.
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de When in doubt, mumble; when in trouble, delegate; when in charge, ponder. -- James H. Boren
PATCH 1/1 OMAP3EVM: net_chip uses CS5 not CS6
Quoted 6 lines · Wolfgang Denk
Dear Scott Wood,
Quoted 2 lines · In message <[email protected]> you wrote:
Quoted 1 line
Or what replaced the "immr" structs?
The device tree, mainly...
Quoted 7 lines
Right, of course.
Quoted 1 line
... But #defines can work for u-boot.
Of course they _can_ work. But they can easily fail (as we just see in this patch), and we don't have typechecking. So until DT's are omnipresent, let's use structs in U-Boot, please.
You *do* have typechecking as long as the individual blocks are described with structs.
We could take immap to extremes by defining one big 4GiB struct that shows where memory, immr, flash, desired PCI bars, FPGAs, etc. are -- but that would be silly. IMHO, so is doing it at the immr level. :-)
How would you deal with blocks being at different locations in different chips? It's a lot easier to ifdef (or have the config file specify) a couple addresses than to ifdef the locations of fields in a struct, especially when you have more than a couple variations.
-Scott
PATCH 1/1 OMAP3EVM: net_chip uses CS5 not CS6
Hi,
Quoted 18 lines
Quoted 6 lines · Wolfgang Denk
Dear Scott Wood,
Quoted 2 lines · In message <[email protected]> you wrote:
Quoted 1 line
Or what replaced the "immr" structs?
The device tree, mainly...
Quoted 7 lines
Right, of course.
Quoted 1 line
... But #defines can work for u-boot.
Of course they _can_ work. But they can easily fail (as we just see in this patch), and we don't have typechecking. So until DT's are omnipresent, let's use structs in U-Boot, please.
You *do* have typechecking as long as the individual blocks are described with structs.
Quoted 8 lines
We could take immap to extremes by defining one big 4GiB struct that shows where memory, immr, flash, desired PCI bars, FPGAs, etc. are -- but that would be silly. IMHO, so is doing it at the immr level. :-)
How would you deal with blocks being at different locations in different chips? It's a lot easier to ifdef (or have the config file specify) a couple addresses than to ifdef the locations of fields in a struct, especially when you have more than a couple variations.
For what its worth, I'm with Scott here. Structures for register blocks is very nice and should be mandated and it seems they are maintainable. Locations of individual blocks (or number of incarnations thereof) seem to change frequently and thus tend to be less friendly to "whole internal address space" structures. So the latter may better be mapped by single defines. The correctness of them is easily validated and an incorrect value will immediatley be discovered.
Cheers
Detlev
Signature · 7 lines
config LGUEST
If unsure, say N. If curious, say M. If masochistic, say Y.
-- linux/drivers/lguest/Kconfig
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.dePATCH 1/1 OMAP3EVM: net_chip uses CS5 not CS6
Hi,
Quoted 26 lines · Detlev Zundel
Hi,
Quoted 15 lines
Quoted 11 lines · Wolfgang Denk
Dear Scott Wood,
Quoted 2 lines · In message <[email protected]> you wrote:
Quoted 1 line
Or what replaced the "immr" structs?
The device tree, mainly...
Right, of course.
Quoted 1 line
... But #defines can work for u-boot.
Of course they _can_ work. But they can easily fail (as we just see in this patch), and we don't have typechecking. So until DT's are omnipresent, let's use structs in U-Boot, please.
You *do* have typechecking as long as the individual blocks are described with structs.
Quoted 8 lines
We could take immap to extremes by defining one big 4GiB struct that shows where memory, immr, flash, desired PCI bars, FPGAs, etc. are -- but that would be silly. IMHO, so is doing it at the immr level. :-)
How would you deal with blocks being at different locations in different chips? It's a lot easier to ifdef (or have the config file specify) a couple addresses than to ifdef the locations of fields in a struct, especially when you have more than a couple variations.
Quoted 7 lines
For what its worth, I'm with Scott here. Structures for register blocks is very nice and should be mandated and it seems they are maintainable. Locations of individual blocks (or number of incarnations thereof) seem to change frequently and thus tend to be less friendly to "whole internal address space" structures. So the latter may better be mapped by single defines. The correctness of them is easily validated and an incorrect value will immediatley be discovered.
I tend to agree with Scott and Detlev, too. At least from practical point of view
http://www.ti.com/litv/pdf/spruf98b
(attention: ~40MB) ;)
Best regards
Dirk
PATCH 1/1 OMAP3EVM: net_chip uses CS5 not CS6
In reply to Wolfgang DenkWolfgang, Dirk,
cause for this patch was originally the plan to bring my company's new omap3-based platform into U-Boot. As we do use other CS for a network chip this patch was intended to be the starting point (otherwise our patchset will not apply).
I can prepare a big #define -> c_struct patch for omap next week. The only problem i see, my following patches will be rebased onto that and will only apply after the transition #define -> c_struct is done.
If this is ok for you i will submit this mid/end of next week.
best regards,
Matthias
Quoted 59 lines · Wolfgang Denk
Dear Dirk,
Quoted 9 lines · In message <[email protected]> you wrote:
Quoted 2 lines
Please provide proper C structs!
Would you like to have a look to the code snippet visible in Matthias' patch
http://lists.denx.de/pipermail/u-boot/2009-May/052157.html
?
Done.
Quoted 5 lines
It's my understanding that what's in code
writel(NET_GPMC_CONFIG1, &gpmc_cs5_base->config1);is what you want? I.e. as I understand it, the code is correct (we use
It is only part of what I want to see. There are still deficiencies.
Yes, we have a struct
gpmc_csx, that's good.Note though that using such typedef's not in line with the Coding Style, which says: "It's a _mistake_ to use typedef for structures and pointers." Also, checkpatch.pl complains about this.
The next problem is that the entries in these structs are declared as "unsigned int", which just happens to work by chance. "u32" would be more reliable.
Finally, and this is what I really compalin about, is that there is no big structure which includes all the blocks that make up the CPU into one big structure (as it's done for example for PowerPC systems in the
include/asm-ppc/*immap*files) - you still use code like
gpmc_csx_t*gpmc_cs5_base= (gpmc_csx_t*)GPMC_CONFIG_CS5_BASE;to locate each of the individual C structs in the memory map; instead, onle one single pointer to the internal memory should be needed.
Quoted 1 line
Sorry if I missed something, just correct then ;)
Done. Thanks.
Best regards,
Wolfgang Denk
Signature · 7 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Winners never talk about glorious victories. That's because they're the ones who see what the battlefield looks like afterwards. It's only the losers who have glorious victories. - Terry Pratchett, _Small Gods_
Signature · 4 lines
Matthias Ludwig, Software Development Ultratronik Entwicklungs GmbH, Gewerbestrasse 52, 82211 Herrsching, Germany http://www.ultratronik.de Tel: +49 8152 3709-356 Fax: +49 8152 5183 Registergericht Muenchen, HRB 55584
PATCH 1/1 OMAP3EVM: net_chip uses CS5 not CS6
Dear Matthias,
Quoted 11 lines · In message <[email protected]> you wrote:
cause for this patch was originally the plan to bring my company's new omap3-based platform into U-Boot. As we do use other CS for a network chip this patch was intended to be the starting point (otherwise our patchset will not apply).
I can prepare a big #define ->
c_structpatch for omap next week. The only problem i see, my following patches will be rebased onto that and will only apply after the transition #define ->c_structis done.If this is ok for you i will submit this mid/end of next week.
It's fine with me.
Best regards,
Wolfgang Denk
Signature · 6 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
I have yet to add the ESP-driver to the kernel to read the mind of
the user... - Linus Torvalds in
<[email protected]>PATCH 1/1 OMAP3EVM: net_chip uses CS5 not CS6
In reply to Matthias LudwigDear Matthias,
Quoted 7 lines · Matthias Ludwig
Wolfgang, Dirk,
cause for this patch was originally the plan to bring my company's new omap3-based platform into U-Boot. As we do use other CS for a network chip this patch was intended to be the starting point (otherwise our patchset will not apply).
Quoted 5 lines
I can prepare a big #define ->
c_structpatch for omap next week. The only problem i see, my following patches will be rebased onto that and will only apply after the transition #define ->c_structis done.If this is ok for you i will submit this mid/end of next week.
If you do it for all OMAP3 boards currently in mainline and don't break anything, I'm fine with this, too.
Many thanks
Dirk
Quoted 56 lines · Wolfgang Denk
Quoted 54 lines
Dear Dirk,
Quoted 7 lines · In message <[email protected]> you wrote:
Quoted 1 line
Please provide proper C structs!
Would you like to have a look to the code snippet visible in Matthias' patch
http://lists.denx.de/pipermail/u-boot/2009-May/052157.html
?
Done.
Quoted 5 lines
It's my understanding that what's in code
writel(NET_GPMC_CONFIG1, &gpmc_cs5_base->config1);is what you want? I.e. as I understand it, the code is correct (we use
It is only part of what I want to see. There are still deficiencies.
Yes, we have a struct
gpmc_csx, that's good.Note though that using such typedef's not in line with the Coding Style, which says: "It's a _mistake_ to use typedef for structures and pointers." Also, checkpatch.pl complains about this.
The next problem is that the entries in these structs are declared as "unsigned int", which just happens to work by chance. "u32" would be more reliable.
Finally, and this is what I really compalin about, is that there is no big structure which includes all the blocks that make up the CPU into one big structure (as it's done for example for PowerPC systems in the
include/asm-ppc/*immap*files) - you still use code like
gpmc_csx_t*gpmc_cs5_base= (gpmc_csx_t*)GPMC_CONFIG_CS5_BASE;to locate each of the individual C structs in the memory map; instead, onle one single pointer to the internal memory should be needed.
Quoted 1 line
Sorry if I missed something, just correct then ;)
Done. Thanks.
Best regards,
Wolfgang Denk
Signature · 7 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Winners never talk about glorious victories. That's because they're the ones who see what the battlefield looks like afterwards. It's only the losers who have glorious victories. - Terry Pratchett, _Small Gods_
PATCH 1/1 OMAP3EVM: net_chip uses CS5 not CS6
In reply to Matthias LudwigQuoted 5 lines · Matthias Ludwig
This is not really a change. The cs configuration was correct, but not the naming of it.
OMAP34XX_GPMC_BASE(0x6e000000) +0x150= base address of configuration registers for GPMC-CS5 not GPMC-CS6.
so please fix the comment
Best Regards,
J.