* [U-Boot] [PATCH 01/12] da850: indicate cache usage disable in config file
2011-08-02 15:43 [U-Boot] [PATCH 00/12] feature additions and fixes for da850 nagabhushana.netagunte at ti.com
@ 2011-08-02 15:43 ` nagabhushana.netagunte at ti.com
2011-08-02 16:06 ` Wolfgang Denk
2011-08-02 15:43 ` [U-Boot] [PATCH 02/12] da8xx: add support for multiple PLL controllers nagabhushana.netagunte at ti.com
` (10 subsequent siblings)
11 siblings, 1 reply; 40+ messages in thread
From: nagabhushana.netagunte at ti.com @ 2011-08-02 15:43 UTC (permalink / raw)
To: u-boot
From: Nagabhushana Netagunte <nagabhushana.netagunte@ti.com>
As per new cache management framework, if the caches are not used
in u-boot, it needs to be explicitly indicated through macros in
config file. da850 doesnt support I-CACHE, D-CACHE or L2-CACHE
usage in u-boot which is indicated by the following macro definitions,
1. CONFIG_SYS_ICACHE_OFF
2. CONFIG_SYS_DCACHE_OFF
3. CONFIG_SYS_L2CACHE_OFF
Signed-off-by: Nagabhushana Netagunte <nagabhushana.netagunte@ti.com>
---
include/configs/da850evm.h | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/include/configs/da850evm.h b/include/configs/da850evm.h
index bbb5a9b..fdcc6e3 100644
--- a/include/configs/da850evm.h
+++ b/include/configs/da850evm.h
@@ -42,6 +42,9 @@
#define CONFIG_SYS_HZ 1000
#define CONFIG_SKIP_LOWLEVEL_INIT
#define CONFIG_SYS_TEXT_BASE 0xc1080000
+#define CONFIG_SYS_ICACHE_OFF
+#define CONFIG_SYS_DCACHE_OFF
+#define CONFIG_SYS_L2CACHE_OFF
/*
* Memory Info
--
1.6.2.4
^ permalink raw reply related [flat|nested] 40+ messages in thread* [U-Boot] [PATCH 01/12] da850: indicate cache usage disable in config file
2011-08-02 15:43 ` [U-Boot] [PATCH 01/12] da850: indicate cache usage disable in config file nagabhushana.netagunte at ti.com
@ 2011-08-02 16:06 ` Wolfgang Denk
2011-08-02 19:37 ` Laurence Withers
2011-08-09 13:54 ` Netagunte, Nagabhushana
0 siblings, 2 replies; 40+ messages in thread
From: Wolfgang Denk @ 2011-08-02 16:06 UTC (permalink / raw)
To: u-boot
Dear nagabhushana.netagunte at ti.com,
In message <1312299792-16415-2-git-send-email-nagabhushana.netagunte@ti.com> you wrote:
> From: Nagabhushana Netagunte <nagabhushana.netagunte@ti.com>
>
> As per new cache management framework, if the caches are not used
> in u-boot, it needs to be explicitly indicated through macros in
> config file. da850 doesnt support I-CACHE, D-CACHE or L2-CACHE
> usage in u-boot which is indicated by the following macro definitions,
What exactly does this mean? Does it mean that
1) the hardware does not have working caches, so there is no chance to
ever add such support in software?
2) the hardware does have working caches, but this current software
support is simple / incomplete, and cache support will be added
later?
3) ... ?
Best regards,
Wolfgang Denk
--
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
Some people march to the beat of a different drummer. And some people
tango!
^ permalink raw reply [flat|nested] 40+ messages in thread
* [U-Boot] [PATCH 01/12] da850: indicate cache usage disable in config file
2011-08-02 16:06 ` Wolfgang Denk
@ 2011-08-02 19:37 ` Laurence Withers
2011-08-09 13:44 ` Netagunte, Nagabhushana
2011-08-09 13:54 ` Netagunte, Nagabhushana
1 sibling, 1 reply; 40+ messages in thread
From: Laurence Withers @ 2011-08-02 19:37 UTC (permalink / raw)
To: u-boot
On Tue, Aug 02, 2011 at 06:06:42PM +0200, Wolfgang Denk wrote:
> Dear nagabhushana.netagunte at ti.com,
>
> In message <1312299792-16415-2-git-send-email-nagabhushana.netagunte@ti.com> you wrote:
> > From: Nagabhushana Netagunte <nagabhushana.netagunte@ti.com>
> >
> > As per new cache management framework, if the caches are not used
> > in u-boot, it needs to be explicitly indicated through macros in
> > config file. da850 doesnt support I-CACHE, D-CACHE or L2-CACHE
> > usage in u-boot which is indicated by the following macro definitions,
>
> What exactly does this mean? Does it mean that
>
> 1) the hardware does not have working caches, so there is no chance to
> ever add such support in software?
>
> 2) the hardware does have working caches, but this current software
> support is simple / incomplete, and cache support will be added
> later?
I am also working on a U-Boot port to a DA850-based board, and I can confirm
that both I-cache and D-cache do work correctly. However, there are cache
coherency issues when using the Ethernet driver (DaVinci EMAC). There may
also be other drivers that fail similarly.
If driver issues are the reason for disabling the caches then the commit
message should reflect this.
Bye for now,
--
Laurence Withers, <lwithers@guralp.com> http://www.guralp.com/
Direct tel:+447753988197 or tel:+443333408643 Software Engineer
General support queries: <support@guralp.com> CMG-DCM CMG-EAM CMG-NAM
^ permalink raw reply [flat|nested] 40+ messages in thread
* [U-Boot] [PATCH 01/12] da850: indicate cache usage disable in config file
2011-08-02 19:37 ` Laurence Withers
@ 2011-08-09 13:44 ` Netagunte, Nagabhushana
0 siblings, 0 replies; 40+ messages in thread
From: Netagunte, Nagabhushana @ 2011-08-09 13:44 UTC (permalink / raw)
To: u-boot
Hi Laurence,
Thanks for the info about cache coherency issues with DAVINCI EMAC.
I will make appropriate changes to commit message.
Thanks,
Nag
On Wed, Aug 03, 2011 at 01:07:36, Laurence Withers wrote:
> On Tue, Aug 02, 2011 at 06:06:42PM +0200, Wolfgang Denk wrote:
> > Dear nagabhushana.netagunte at ti.com,
> >
> > In message <1312299792-16415-2-git-send-email-nagabhushana.netagunte@ti.com> you wrote:
> > > From: Nagabhushana Netagunte <nagabhushana.netagunte@ti.com>
> > >
> > > As per new cache management framework, if the caches are not used in
> > > u-boot, it needs to be explicitly indicated through macros in config
> > > file. da850 doesnt support I-CACHE, D-CACHE or L2-CACHE usage in
> > > u-boot which is indicated by the following macro definitions,
> >
> > What exactly does this mean? Does it mean that
> >
> > 1) the hardware does not have working caches, so there is no chance to
> > ever add such support in software?
> >
> > 2) the hardware does have working caches, but this current software
> > support is simple / incomplete, and cache support will be added
> > later?
>
> I am also working on a U-Boot port to a DA850-based board, and I can confirm that both I-cache and D-cache do work correctly. However, there are cache coherency issues when using the Ethernet driver (DaVinci EMAC). There may also be other drivers that fail similarly.
>
> If driver issues are the reason for disabling the caches then the commit message should reflect this.
>
> Bye for now,
> --
> Laurence Withers, <lwithers@guralp.com> http://www.guralp.com/
> Direct tel:+447753988197 or tel:+443333408643 Software Engineer
> General support queries: <support@guralp.com> CMG-DCM CMG-EAM CMG-NAM
>
^ permalink raw reply [flat|nested] 40+ messages in thread
* [U-Boot] [PATCH 01/12] da850: indicate cache usage disable in config file
2011-08-02 16:06 ` Wolfgang Denk
2011-08-02 19:37 ` Laurence Withers
@ 2011-08-09 13:54 ` Netagunte, Nagabhushana
1 sibling, 0 replies; 40+ messages in thread
From: Netagunte, Nagabhushana @ 2011-08-09 13:54 UTC (permalink / raw)
To: u-boot
Thanks Denk for comments.
I will add appropriate reasons in commit message and resubmit the patch.
Regards,
Nag
On Tue, Aug 02, 2011 at 21:36:42, Wolfgang Denk wrote:
> Dear nagabhushana.netagunte at ti.com,
>
> In message <1312299792-16415-2-git-send-email-nagabhushana.netagunte@ti.com> you wrote:
> > From: Nagabhushana Netagunte <nagabhushana.netagunte@ti.com>
> >
> > As per new cache management framework, if the caches are not used in
> > u-boot, it needs to be explicitly indicated through macros in config
> > file. da850 doesnt support I-CACHE, D-CACHE or L2-CACHE usage in
> > u-boot which is indicated by the following macro definitions,
>
> What exactly does this mean? Does it mean that
>
> 1) the hardware does not have working caches, so there is no chance to
> ever add such support in software?
>
> 2) the hardware does have working caches, but this current software
> support is simple / incomplete, and cache support will be added
> later?
>
> 3) ... ?
>
> Best regards,
>
> Wolfgang Denk
>
> --
> 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 Some people march to the beat of a different drummer. And some people tango!
>
^ permalink raw reply [flat|nested] 40+ messages in thread
* [U-Boot] [PATCH 02/12] da8xx: add support for multiple PLL controllers
2011-08-02 15:43 [U-Boot] [PATCH 00/12] feature additions and fixes for da850 nagabhushana.netagunte at ti.com
2011-08-02 15:43 ` [U-Boot] [PATCH 01/12] da850: indicate cache usage disable in config file nagabhushana.netagunte at ti.com
@ 2011-08-02 15:43 ` nagabhushana.netagunte at ti.com
2011-08-02 15:43 ` [U-Boot] [PATCH 03/12] da850: add NOR boot mode support nagabhushana.netagunte at ti.com
` (9 subsequent siblings)
11 siblings, 0 replies; 40+ messages in thread
From: nagabhushana.netagunte at ti.com @ 2011-08-02 15:43 UTC (permalink / raw)
To: u-boot
From: Sudhakar Rajashekhara <sudhakar.raj@ti.com>
Modify clk_get() function in cpu file to work for
multiple PLL controllers.
Signed-off-by: Sudhakar Rajashekhara <sudhakar.raj@ti.com>
Signed-off-by: Nagabhushana Netagunte <nagabhushana.netagunte@ti.com>
---
arch/arm/cpu/arm926ejs/davinci/cpu.c | 30 ++++++++++++++++---------
arch/arm/include/asm/arch-davinci/hardware.h | 4 ++-
2 files changed, 22 insertions(+), 12 deletions(-)
diff --git a/arch/arm/cpu/arm926ejs/davinci/cpu.c b/arch/arm/cpu/arm926ejs/davinci/cpu.c
index 8b57205..b705dfd 100644
--- a/arch/arm/cpu/arm926ejs/davinci/cpu.c
+++ b/arch/arm/cpu/arm926ejs/davinci/cpu.c
@@ -37,6 +37,7 @@
#define PLLC_PLLDIV4 0x160
#define PLLC_PLLDIV5 0x164
#define PLLC_PLLDIV6 0x168
+#define PLLC_PLLDIV7 0x16c
#define PLLC_PLLDIV8 0x170
#define PLLC_PLLDIV9 0x174
@@ -61,11 +62,9 @@
#endif
#ifdef CONFIG_SOC_DA8XX
-const dv_reg * const sysdiv[7] = {
- &davinci_pllc_regs->plldiv1, &davinci_pllc_regs->plldiv2,
- &davinci_pllc_regs->plldiv3, &davinci_pllc_regs->plldiv4,
- &davinci_pllc_regs->plldiv5, &davinci_pllc_regs->plldiv6,
- &davinci_pllc_regs->plldiv7
+unsigned int sysdiv[9] = {
+ PLLC_PLLDIV1, PLLC_PLLDIV2, PLLC_PLLDIV3, PLLC_PLLDIV4, PLLC_PLLDIV5,
+ PLLC_PLLDIV6, PLLC_PLLDIV7, PLLC_PLLDIV8, PLLC_PLLDIV9
};
int clk_get(enum davinci_clk_ids id)
@@ -74,19 +73,27 @@ int clk_get(enum davinci_clk_ids id)
int pllm;
int post_div;
int pll_out;
+ unsigned int pll_base;
pll_out = CONFIG_SYS_OSCIN_FREQ;
if (id == DAVINCI_AUXCLK_CLKID)
goto out;
+ if ((id >> 16) == 1)
+ pll_base = (unsigned int)davinci_pllc1_regs;
+ else
+ pll_base = (unsigned int)davinci_pllc0_regs;
+
+ id &= 0xFFFF;
+
/*
* Lets keep this simple. Combining operations can result in
* unexpected approximations
*/
- pre_div = (readl(&davinci_pllc_regs->prediv) &
- DAVINCI_PLLC_DIV_MASK) + 1;
- pllm = readl(&davinci_pllc_regs->pllm) + 1;
+ pre_div = (readl(pll_base + PLLC_PREDIV) &
+ DAVINCI_PLLC_DIV_MASK) + 1;
+ pllm = readl(pll_base + PLLC_PLLM) + 1;
pll_out /= pre_div;
pll_out *= pllm;
@@ -94,15 +101,16 @@ int clk_get(enum davinci_clk_ids id)
if (id == DAVINCI_PLLM_CLKID)
goto out;
- post_div = (readl(&davinci_pllc_regs->postdiv) &
- DAVINCI_PLLC_DIV_MASK) + 1;
+ post_div = (readl(pll_base + PLLC_POSTDIV) &
+ DAVINCI_PLLC_DIV_MASK) + 1;
pll_out /= post_div;
if (id == DAVINCI_PLLC_CLKID)
goto out;
- pll_out /= (readl(sysdiv[id - 1]) & DAVINCI_PLLC_DIV_MASK) + 1;
+ pll_out /= (readl(pll_base + sysdiv[id - 1]) &
+ DAVINCI_PLLC_DIV_MASK) + 1;
out:
return pll_out;
diff --git a/arch/arm/include/asm/arch-davinci/hardware.h b/arch/arm/include/asm/arch-davinci/hardware.h
index df3f549..4627da3 100644
--- a/arch/arm/include/asm/arch-davinci/hardware.h
+++ b/arch/arm/include/asm/arch-davinci/hardware.h
@@ -129,6 +129,7 @@ typedef volatile unsigned int * dv_reg_p;
#define DAVINCI_TIMER1_BASE 0x01c21000
#define DAVINCI_WDOG_BASE 0x01c21000
#define DAVINCI_PLL_CNTRL0_BASE 0x01c11000
+#define DAVINCI_PLL_CNTRL1_BASE 0x01e1a000
#define DAVINCI_PSC0_BASE 0x01c10000
#define DAVINCI_PSC1_BASE 0x01e27000
#define DAVINCI_SPI0_BASE 0x01c41000
@@ -367,7 +368,8 @@ struct davinci_pllc_regs {
dv_reg emucnt1;
};
-#define davinci_pllc_regs ((struct davinci_pllc_regs *)DAVINCI_PLL_CNTRL0_BASE)
+#define davinci_pllc0_regs ((struct davinci_pllc_regs *)DAVINCI_PLL_CNTRL0_BASE)
+#define davinci_pllc1_regs ((struct davinci_pllc_regs *)DAVINCI_PLL_CNTRL1_BASE)
#define DAVINCI_PLLC_DIV_MASK 0x1f
#define ASYNC3 get_async3_src()
--
1.6.2.4
^ permalink raw reply related [flat|nested] 40+ messages in thread* [U-Boot] [PATCH 03/12] da850: add NOR boot mode support
2011-08-02 15:43 [U-Boot] [PATCH 00/12] feature additions and fixes for da850 nagabhushana.netagunte at ti.com
2011-08-02 15:43 ` [U-Boot] [PATCH 01/12] da850: indicate cache usage disable in config file nagabhushana.netagunte at ti.com
2011-08-02 15:43 ` [U-Boot] [PATCH 02/12] da8xx: add support for multiple PLL controllers nagabhushana.netagunte at ti.com
@ 2011-08-02 15:43 ` nagabhushana.netagunte at ti.com
2011-08-02 16:12 ` Wolfgang Denk
2011-08-02 15:43 ` [U-Boot] [PATCH 04/12] da850: modify the U-Boot prompt string nagabhushana.netagunte at ti.com
` (8 subsequent siblings)
11 siblings, 1 reply; 40+ messages in thread
From: nagabhushana.netagunte at ti.com @ 2011-08-02 15:43 UTC (permalink / raw)
To: u-boot
From: Nagabhushana Netagunte <nagabhushana.netagunte@ti.com>
Add an option to use NOR boot mode in configuration file and
correspanding pin-mux support in board file.
Signed-off-by: Sudhakar Rajashekhara <sudhakar.raj@ti.com>
Signed-off-by: Nagabhushana Netagunte <nagabhushana.netagunte@ti.com>
---
board/davinci/da8xxevm/da850evm.c | 51 +++++++++++++++++++++++++++++++++++++
include/configs/da850evm.h | 19 +++++++++++++
2 files changed, 70 insertions(+), 0 deletions(-)
diff --git a/board/davinci/da8xxevm/da850evm.c b/board/davinci/da8xxevm/da850evm.c
index 73eaa48..d3d965c 100644
--- a/board/davinci/da8xxevm/da850evm.c
+++ b/board/davinci/da8xxevm/da850evm.c
@@ -105,6 +105,55 @@ const struct pinmux_config nand_pins[] = {
{ pinmux(12), 1, 5 },
{ pinmux(12), 1, 6 }
};
+#elif defined(CONFIG_USE_NOR)
+/* NOR pin muxer settings */
+const struct pinmux_config nor_pins[] = {
+ { pinmux(5), 1, 6 },
+ { pinmux(6), 1, 6 },
+ { pinmux(7), 1, 0 },
+ { pinmux(7), 1, 4 },
+ { pinmux(7), 1, 5 },
+ { pinmux(8), 1, 0 },
+ { pinmux(8), 1, 1 },
+ { pinmux(8), 1, 2 },
+ { pinmux(8), 1, 3 },
+ { pinmux(8), 1, 4 },
+ { pinmux(8), 1, 5 },
+ { pinmux(8), 1, 6 },
+ { pinmux(8), 1, 7 },
+ { pinmux(9), 1, 0 },
+ { pinmux(9), 1, 1 },
+ { pinmux(9), 1, 2 },
+ { pinmux(9), 1, 3 },
+ { pinmux(9), 1, 4 },
+ { pinmux(9), 1, 5 },
+ { pinmux(9), 1, 6 },
+ { pinmux(9), 1, 7 },
+ { pinmux(10), 1, 0 },
+ { pinmux(10), 1, 1 },
+ { pinmux(10), 1, 2 },
+ { pinmux(10), 1, 3 },
+ { pinmux(10), 1, 4 },
+ { pinmux(10), 1, 5 },
+ { pinmux(10), 1, 6 },
+ { pinmux(10), 1, 7 },
+ { pinmux(11), 1, 0 },
+ { pinmux(11), 1, 1 },
+ { pinmux(11), 1, 2 },
+ { pinmux(11), 1, 3 },
+ { pinmux(11), 1, 4 },
+ { pinmux(11), 1, 5 },
+ { pinmux(11), 1, 6 },
+ { pinmux(11), 1, 7 },
+ { pinmux(12), 1, 0 },
+ { pinmux(12), 1, 1 },
+ { pinmux(12), 1, 2 },
+ { pinmux(12), 1, 3 },
+ { pinmux(12), 1, 4 },
+ { pinmux(12), 1, 5 },
+ { pinmux(12), 1, 6 },
+ { pinmux(12), 1, 7 }
+};
#endif
#ifdef CONFIG_DRIVER_TI_EMAC_USE_RMII
@@ -122,6 +171,8 @@ static const struct pinmux_resource pinmuxes[] = {
PINMUX_ITEM(i2c_pins),
#ifdef CONFIG_NAND_DAVINCI
PINMUX_ITEM(nand_pins),
+#elif defined(CONFIG_USE_NOR)
+ PINMUX_ITEM(nor_pins),
#endif
};
diff --git a/include/configs/da850evm.h b/include/configs/da850evm.h
index fdcc6e3..53d63ab 100644
--- a/include/configs/da850evm.h
+++ b/include/configs/da850evm.h
@@ -28,6 +28,8 @@
*/
#define CONFIG_DRIVER_TI_EMAC
#define CONFIG_USE_SPIFLASH
+#undef CONFIG_USE_NAND
+#undef CONFIG_USE_NOR
/*
* SoC Configuration
@@ -129,6 +131,23 @@
#define CONFIG_NET_MULTI
#endif
+#ifdef CONFIG_USE_NOR
+#define CONFIG_ENV_IS_IN_FLASH
+#undef CONFIG_SYS_NO_FLASH
+#define CONFIG_FLASH_CFI_DRIVER
+#define CONFIG_SYS_FLASH_CFI
+#define CONFIG_SYS_FLASH_PROTECTION
+#define CONFIG_SYS_MAX_FLASH_BANKS 1 /* max number of flash banks */
+#define CONFIG_SYS_FLASH_SECT_SZ (128 << 10) /* 128KB */
+#define CONFIG_ENV_OFFSET (CONFIG_SYS_FLASH_SECT_SZ * 3)
+#define CONFIG_ENV_SIZE (128 << 10)
+#define CONFIG_SYS_FLASH_BASE DAVINCI_ASYNC_EMIF_DATA_CE2_BASE
+#define PHYS_FLASH_SIZE (8 << 20) /* Flash size 8MB */
+#define CONFIG_SYS_MAX_FLASH_SECT ((PHYS_FLASH_SIZE/CONFIG_SYS_FLASH_SECT_SZ)\
+ + 3)
+#define CONFIG_ENV_SECT_SIZE CONFIG_SYS_FLASH_SECT_SZ
+#endif
+
#ifdef CONFIG_USE_SPIFLASH
#undef CONFIG_ENV_IS_IN_FLASH
#undef CONFIG_ENV_IS_IN_NAND
--
1.6.2.4
^ permalink raw reply related [flat|nested] 40+ messages in thread* [U-Boot] [PATCH 03/12] da850: add NOR boot mode support
2011-08-02 15:43 ` [U-Boot] [PATCH 03/12] da850: add NOR boot mode support nagabhushana.netagunte at ti.com
@ 2011-08-02 16:12 ` Wolfgang Denk
2011-08-09 14:03 ` Netagunte, Nagabhushana
0 siblings, 1 reply; 40+ messages in thread
From: Wolfgang Denk @ 2011-08-02 16:12 UTC (permalink / raw)
To: u-boot
Dear nagabhushana.netagunte at ti.com,
In message <1312299792-16415-4-git-send-email-nagabhushana.netagunte@ti.com> you wrote:
> From: Nagabhushana Netagunte <nagabhushana.netagunte@ti.com>
>
> Add an option to use NOR boot mode in configuration file and
> correspanding pin-mux support in board file.
>
> Signed-off-by: Sudhakar Rajashekhara <sudhakar.raj@ti.com>
> Signed-off-by: Nagabhushana Netagunte <nagabhushana.netagunte@ti.com>
...
> #define CONFIG_DRIVER_TI_EMAC
> #define CONFIG_USE_SPIFLASH
> +#undef CONFIG_USE_NAND
> +#undef CONFIG_USE_NOR
Please do not undef what is not defined anyway. If you want to add
comments to the user, then use C comments for this purpose.
Also, please note that none of the CONFIG_ options listed here
(CONFIG_DRIVER_TI_EMAC, CONFIG_USE_SPIFLASH, CONFIG_USE_NAND, or
CONFIG_USE_NOR) are documented. Please add appropriate documentation
to the README file.
> /*
> * SoC Configuration
> @@ -129,6 +131,23 @@
> #define CONFIG_NET_MULTI
> #endif
>
> +#ifdef CONFIG_USE_NOR
> +#define CONFIG_ENV_IS_IN_FLASH
> +#undef CONFIG_SYS_NO_FLASH
Please do not undef what is not defined anyway. Please fix globally.
> +#define CONFIG_SYS_FLASH_SECT_SZ (128 << 10) /* 128KB */
> +#define CONFIG_ENV_OFFSET (CONFIG_SYS_FLASH_SECT_SZ * 3)
> +#define CONFIG_ENV_SIZE (128 << 10)
Are you absolutely sure that you need 128 KiB of environment data?
Keep in mind that such a big environment will _considerably_ slow down
booting - and in all practical situations I have seen so far the
actual environment size was in the order of a few KiB only - I don;t
even remember any board with more than 10 KiB.
Best regards,
Wolfgang Denk
--
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@denx.de
A list is only as strong as its weakest link. -- Don Knuth
^ permalink raw reply [flat|nested] 40+ messages in thread
* [U-Boot] [PATCH 03/12] da850: add NOR boot mode support
2011-08-02 16:12 ` Wolfgang Denk
@ 2011-08-09 14:03 ` Netagunte, Nagabhushana
2011-08-10 10:50 ` Detlev Zundel
0 siblings, 1 reply; 40+ messages in thread
From: Netagunte, Nagabhushana @ 2011-08-09 14:03 UTC (permalink / raw)
To: u-boot
Hi Denk,
Thanks for comments. My response is in-lined.
Regards,
Nag
On Tue, Aug 02, 2011 at 21:42:28, Wolfgang Denk wrote:
> Dear nagabhushana.netagunte at ti.com,
>
> In message <1312299792-16415-4-git-send-email-nagabhushana.netagunte@ti.com> you wrote:
> > From: Nagabhushana Netagunte <nagabhushana.netagunte@ti.com>
> >
> > Add an option to use NOR boot mode in configuration file and
> > correspanding pin-mux support in board file.
> >
> > Signed-off-by: Sudhakar Rajashekhara <sudhakar.raj@ti.com>
> > Signed-off-by: Nagabhushana Netagunte <nagabhushana.netagunte@ti.com>
> ...
> > #define CONFIG_DRIVER_TI_EMAC
> > #define CONFIG_USE_SPIFLASH
> > +#undef CONFIG_USE_NAND
> > +#undef CONFIG_USE_NOR
>
> Please do not undef what is not defined anyway. If you want to add comments to the user, then use C comments for this purpose.
>
Will do that.
> Also, please note that none of the CONFIG_ options listed here (CONFIG_DRIVER_TI_EMAC, CONFIG_USE_SPIFLASH, CONFIG_USE_NAND, or
> CONFIG_USE_NOR) are documented. Please add appropriate documentation to the README file.
>
Will add a new patch to add appropriate documentation.
> > /*
> > * SoC Configuration
> > @@ -129,6 +131,23 @@
> > #define CONFIG_NET_MULTI
> > #endif
> >
> > +#ifdef CONFIG_USE_NOR
> > +#define CONFIG_ENV_IS_IN_FLASH
> > +#undef CONFIG_SYS_NO_FLASH
>
> Please do not undef what is not defined anyway. Please fix globally.
>
> > +#define CONFIG_SYS_FLASH_SECT_SZ (128 << 10) /* 128KB */
> > +#define CONFIG_ENV_OFFSET (CONFIG_SYS_FLASH_SECT_SZ * 3)
> > +#define CONFIG_ENV_SIZE (128 << 10)
>
> Are you absolutely sure that you need 128 KiB of environment data?
> Keep in mind that such a big environment will _considerably_ slow down booting - and in all practical situations I have seen so far the actual environment size was in the order of a few KiB only - I don;t even remember any board with more than 10 KiB.
>
I agree with you that 128 KiB is huge. It is 128KiB because sector size for
NOR flash is 128KiB. So, decision was to reserve one complete sector for ENV
Data.
> Best regards,
>
> Wolfgang Denk
>
> --
> 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
> A list is only as strong as its weakest link. -- Don Knuth
>
^ permalink raw reply [flat|nested] 40+ messages in thread
* [U-Boot] [PATCH 03/12] da850: add NOR boot mode support
2011-08-09 14:03 ` Netagunte, Nagabhushana
@ 2011-08-10 10:50 ` Detlev Zundel
2011-08-17 12:43 ` Netagunte, Nagabhushana
0 siblings, 1 reply; 40+ messages in thread
From: Detlev Zundel @ 2011-08-10 10:50 UTC (permalink / raw)
To: u-boot
Hi Nag,
[...]
>> > +#define CONFIG_SYS_FLASH_SECT_SZ (128 << 10) /* 128KB */
>> > +#define CONFIG_ENV_OFFSET (CONFIG_SYS_FLASH_SECT_SZ * 3)
>> > +#define CONFIG_ENV_SIZE (128 << 10)
>>
>> Are you absolutely sure that you need 128 KiB of environment data?
>> Keep in mind that such a big environment will _considerably_ slow
>> down booting - and in all practical situations I have seen so far
>> the actual environment size was in the order of a few KiB only - I
>> don;t even remember any board with more than 10 KiB.
>>
>
> I agree with you that 128 KiB is huge. It is 128KiB because sector size for
> NOR flash is 128KiB. So, decision was to reserve one complete sector for ENV
> Data.
It's pretty common to have such large sectors. So using one sector for
the environment is of course pretty common. From the sector size
however we use only a fraction for the _actual_ data, as the environment
functions have a runtime dependency on the size of the environment
_data_ (think about calculating the CRC). So if you simply reduce the
environment (data) size, you will get faster runtime practically for
free. So keep the flash layout but reduce the environment size.
Cheers
Detlev
--
The GNU GPL makes sense in terms of its purpose: freedom and social
solidarity. Trying to understand it in terms of the goals and values of
open source is like trying understand a CD drive's retractable drawer as
a cupholder. You can use it for that, but that is not what it was
designed for. -- Richard Stallman
--
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.de
^ permalink raw reply [flat|nested] 40+ messages in thread
* [U-Boot] [PATCH 03/12] da850: add NOR boot mode support
2011-08-10 10:50 ` Detlev Zundel
@ 2011-08-17 12:43 ` Netagunte, Nagabhushana
0 siblings, 0 replies; 40+ messages in thread
From: Netagunte, Nagabhushana @ 2011-08-17 12:43 UTC (permalink / raw)
To: u-boot
Hi Detlev,
Thanks for your valuable and detailed comments, they make sense. I will make appropriate changes and reduce the env size.
Best Regards,
-Nag
On Wed, Aug 10, 2011 at 16:20:51, Detlev Zundel wrote:
> Hi Nag,
>
> [...]
>
> >> > +#define CONFIG_SYS_FLASH_SECT_SZ (128 << 10) /* 128KB */
> >> > +#define CONFIG_ENV_OFFSET (CONFIG_SYS_FLASH_SECT_SZ * 3)
> >> > +#define CONFIG_ENV_SIZE (128 << 10)
> >>
> >> Are you absolutely sure that you need 128 KiB of environment data?
> >> Keep in mind that such a big environment will _considerably_ slow
> >> down booting - and in all practical situations I have seen so far the
> >> actual environment size was in the order of a few KiB only - I don;t
> >> even remember any board with more than 10 KiB.
> >>
> >
> > I agree with you that 128 KiB is huge. It is 128KiB because sector
> > size for NOR flash is 128KiB. So, decision was to reserve one complete
> > sector for ENV Data.
>
> It's pretty common to have such large sectors. So using one sector for the environment is of course pretty common. From the sector size however we use only a fraction for the _actual_ data, as the environment functions have a runtime dependency on the size of the environment _data_ (think about calculating the CRC). So if you simply reduce the environment (data) size, you will get faster runtime practically for free. So keep the flash layout but reduce the environment size.
>
> Cheers
> Detlev
>
> --
> The GNU GPL makes sense in terms of its purpose: freedom and social solidarity. Trying to understand it in terms of the goals and values of open source is like trying understand a CD drive's retractable drawer as a cupholder. You can use it for that, but that is not what it was
> designed for. -- Richard Stallman
> --
> 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.de
>
^ permalink raw reply [flat|nested] 40+ messages in thread
* [U-Boot] [PATCH 04/12] da850: modify the U-Boot prompt string
2011-08-02 15:43 [U-Boot] [PATCH 00/12] feature additions and fixes for da850 nagabhushana.netagunte at ti.com
` (2 preceding siblings ...)
2011-08-02 15:43 ` [U-Boot] [PATCH 03/12] da850: add NOR boot mode support nagabhushana.netagunte at ti.com
@ 2011-08-02 15:43 ` nagabhushana.netagunte at ti.com
2011-08-02 15:43 ` [U-Boot] [PATCH 05/12] da850: add support to read mac address from spi flash nagabhushana.netagunte at ti.com
` (7 subsequent siblings)
11 siblings, 0 replies; 40+ messages in thread
From: nagabhushana.netagunte at ti.com @ 2011-08-02 15:43 UTC (permalink / raw)
To: u-boot
From: Nagabhushana Netagunte <nagabhushana.netagunte@ti.com>
Modify U-Boot prompt string from "DA850-evm >" to "U-Boot >".
Signed-off-by: Sudhakar Rajashekhara <sudhakar.raj@ti.com>
Signed-off-by: Nagabhushana Netagunte <nagabhushana.netagunte@ti.com>
---
include/configs/da850evm.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/include/configs/da850evm.h b/include/configs/da850evm.h
index 53d63ab..de22ffa 100644
--- a/include/configs/da850evm.h
+++ b/include/configs/da850evm.h
@@ -162,7 +162,7 @@
* U-Boot general configuration
*/
#define CONFIG_BOOTFILE "uImage" /* Boot file name */
-#define CONFIG_SYS_PROMPT "DA850-evm > " /* Command Prompt */
+#define CONFIG_SYS_PROMPT "U-Boot > " /* Command Prompt */
#define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */
#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16)
#define CONFIG_SYS_MAXARGS 16 /* max number of command args */
--
1.6.2.4
^ permalink raw reply related [flat|nested] 40+ messages in thread* [U-Boot] [PATCH 05/12] da850: add support to read mac address from spi flash
2011-08-02 15:43 [U-Boot] [PATCH 00/12] feature additions and fixes for da850 nagabhushana.netagunte at ti.com
` (3 preceding siblings ...)
2011-08-02 15:43 ` [U-Boot] [PATCH 04/12] da850: modify the U-Boot prompt string nagabhushana.netagunte at ti.com
@ 2011-08-02 15:43 ` nagabhushana.netagunte at ti.com
2011-08-02 16:20 ` Wolfgang Denk
2011-08-02 16:23 ` Wolfgang Denk
2011-08-02 15:43 ` [U-Boot] [PATCH 06/12] da850: add support to wake up DSP during board init nagabhushana.netagunte at ti.com
` (6 subsequent siblings)
11 siblings, 2 replies; 40+ messages in thread
From: nagabhushana.netagunte at ti.com @ 2011-08-02 15:43 UTC (permalink / raw)
To: u-boot
From: Nagabhushana Netagunte <nagabhushana.netagunte@ti.com>
add misc_int_r function to read the mac address from SPI flash
if env variable ethaddr is not set.
Signed-off-by: Prakash PM <prakash.pm@ti.com>
Signed-off-by: Nagabhushana Netagunte <nagabhushana.netagunte@ti.com>
---
board/davinci/da8xxevm/da850evm.c | 66 +++++++++++++++++++++++++++++++++++++
include/configs/da850evm.h | 1 +
2 files changed, 67 insertions(+), 0 deletions(-)
diff --git a/board/davinci/da8xxevm/da850evm.c b/board/davinci/da8xxevm/da850evm.c
index d3d965c..ffded78 100644
--- a/board/davinci/da8xxevm/da850evm.c
+++ b/board/davinci/da8xxevm/da850evm.c
@@ -25,10 +25,13 @@
#include <i2c.h>
#include <net.h>
#include <netdev.h>
+#include <spi.h>
+#include <spi_flash.h>
#include <asm/arch/hardware.h>
#include <asm/arch/emif_defs.h>
#include <asm/arch/emac_defs.h>
#include <asm/io.h>
+#include <asm/errno.h>
#include <asm/arch/davinci_misc.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -384,4 +387,67 @@ int board_eth_init(bd_t *bis)
return 0;
}
+
#endif /* CONFIG_DRIVER_TI_EMAC */
+
+#define CFG_MAC_ADDR_SPI_BUS 0
+#define CFG_MAC_ADDR_SPI_CS 0
+#define CFG_MAC_ADDR_SPI_MAX_HZ CONFIG_SF_DEFAULT_SPEED
+#define CFG_MAC_ADDR_SPI_MODE SPI_MODE_3
+
+#define CFG_MAC_ADDR_OFFSET (flash->size - SZ_64K)
+
+static int get_mac_addr_spi(u8 *addr)
+{
+ int ret;
+ struct spi_flash *flash;
+
+ flash = spi_flash_probe(CFG_MAC_ADDR_SPI_BUS, CFG_MAC_ADDR_SPI_CS,
+ CFG_MAC_ADDR_SPI_MAX_HZ, CFG_MAC_ADDR_SPI_MODE);
+ if (!flash) {
+ printf(" Error - unable to probe SPI flash.\n");
+ ret = -1;
+ goto err_probe;
+ }
+
+ ret = spi_flash_read(flash, CFG_MAC_ADDR_OFFSET, 6, addr);
+ if (ret) {
+ printf("Error - unable to read MAC address from SPI flash.\n");
+ goto err_read;
+ }
+
+err_read:
+ /* cannot call free currently since the free function calls free() for
+ * spi_flash structure though it is not directly allocated through
+ * malloc()
+ */
+err_probe:
+ return ret;
+}
+
+int misc_init_r(void)
+{
+ uint8_t addr[10];
+ uchar enetaddr[6];
+ int ret;
+
+ printf("ARM Clock : %d Hz\n", clk_get(DAVINCI_ARM_CLKID));
+
+ if (!eth_getenv_enetaddr("ethaddr", enetaddr)) {
+ /* Set Ethernet MAC address from EEPROM */
+ ret = get_mac_addr_spi(addr);
+ if (ret != 0)
+ return -EINVAL;
+
+ if (is_multicast_ether_addr(addr) || is_zero_ether_addr(addr)) {
+ printf("Invalid MAC address read.\n");
+ return -EINVAL;
+ }
+ sprintf((char *)enetaddr, "%02x:%02x:%02x:%02x:%02x:%02x",
+ addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]);
+
+ eth_setenv_enetaddr("ethaddr", enetaddr);
+ }
+
+ return 0;
+}
diff --git a/include/configs/da850evm.h b/include/configs/da850evm.h
index de22ffa..ede428b 100644
--- a/include/configs/da850evm.h
+++ b/include/configs/da850evm.h
@@ -161,6 +161,7 @@
/*
* U-Boot general configuration
*/
+#define CONFIG_MISC_INIT_R
#define CONFIG_BOOTFILE "uImage" /* Boot file name */
#define CONFIG_SYS_PROMPT "U-Boot > " /* Command Prompt */
#define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */
--
1.6.2.4
^ permalink raw reply related [flat|nested] 40+ messages in thread* [U-Boot] [PATCH 05/12] da850: add support to read mac address from spi flash
2011-08-02 15:43 ` [U-Boot] [PATCH 05/12] da850: add support to read mac address from spi flash nagabhushana.netagunte at ti.com
@ 2011-08-02 16:20 ` Wolfgang Denk
2011-08-09 14:05 ` Netagunte, Nagabhushana
2011-08-02 16:23 ` Wolfgang Denk
1 sibling, 1 reply; 40+ messages in thread
From: Wolfgang Denk @ 2011-08-02 16:20 UTC (permalink / raw)
To: u-boot
Dear nagabhushana.netagunte at ti.com,
In message <1312299792-16415-6-git-send-email-nagabhushana.netagunte@ti.com> you wrote:
> From: Nagabhushana Netagunte <nagabhushana.netagunte@ti.com>
>
> add misc_int_r function to read the mac address from SPI flash
> if env variable ethaddr is not set.
>
> Signed-off-by: Prakash PM <prakash.pm@ti.com>
> Signed-off-by: Nagabhushana Netagunte <nagabhushana.netagunte@ti.com>
> ---
> board/davinci/da8xxevm/da850evm.c | 66 +++++++++++++++++++++++++++++++++++++
> include/configs/da850evm.h | 1 +
> 2 files changed, 67 insertions(+), 0 deletions(-)
Ummm... I remember I have seent his code before. Right:
http://article.gmane.org/gmane.comp.boot-loaders.u-boot/104458
So this is a repost, but you do not mark it as such (no "v2" or
similar in the Subject), nor do you provide any kind of change log or
explanations what has been changed compared to the previous version.
Please follow the rules when posting patches! Nobody here on the list
has the time and resources to compare different patch versions just
because the poster does not bother to provide the mandatory
information. Normally, all such patches are simply NAKed !
Best regards,
Wolfgang Denk
--
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
Diplomacy is the art of saying "nice doggy" until you can find a rock.
^ permalink raw reply [flat|nested] 40+ messages in thread
* [U-Boot] [PATCH 05/12] da850: add support to read mac address from spi flash
2011-08-02 16:20 ` Wolfgang Denk
@ 2011-08-09 14:05 ` Netagunte, Nagabhushana
0 siblings, 0 replies; 40+ messages in thread
From: Netagunte, Nagabhushana @ 2011-08-09 14:05 UTC (permalink / raw)
To: u-boot
Denk,
Sorry for missing upstream syntax here, will follow relevant rules.
Regards,
Nag
On Tue, Aug 02, 2011 at 21:50:02, Wolfgang Denk wrote:
> Dear nagabhushana.netagunte at ti.com,
>
> In message <1312299792-16415-6-git-send-email-nagabhushana.netagunte@ti.com> you wrote:
> > From: Nagabhushana Netagunte <nagabhushana.netagunte@ti.com>
> >
> > add misc_int_r function to read the mac address from SPI flash if env
> > variable ethaddr is not set.
> >
> > Signed-off-by: Prakash PM <prakash.pm@ti.com>
> > Signed-off-by: Nagabhushana Netagunte <nagabhushana.netagunte@ti.com>
> > ---
> > board/davinci/da8xxevm/da850evm.c | 66 +++++++++++++++++++++++++++++++++++++
> > include/configs/da850evm.h | 1 +
> > 2 files changed, 67 insertions(+), 0 deletions(-)
>
> Ummm... I remember I have seent his code before. Right:
>
> http://article.gmane.org/gmane.comp.boot-loaders.u-boot/104458
>
>
> So this is a repost, but you do not mark it as such (no "v2" or similar in the Subject), nor do you provide any kind of change log or explanations what has been changed compared to the previous version.
>
>
> Please follow the rules when posting patches! Nobody here on the list has the time and resources to compare different patch versions just because the poster does not bother to provide the mandatory information. Normally, all such patches are simply NAKed !
>
>
> Best regards,
>
> Wolfgang Denk
>
> --
> 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 Diplomacy is the art of saying "nice doggy" until you can find a rock.
>
^ permalink raw reply [flat|nested] 40+ messages in thread
* [U-Boot] [PATCH 05/12] da850: add support to read mac address from spi flash
2011-08-02 15:43 ` [U-Boot] [PATCH 05/12] da850: add support to read mac address from spi flash nagabhushana.netagunte at ti.com
2011-08-02 16:20 ` Wolfgang Denk
@ 2011-08-02 16:23 ` Wolfgang Denk
2011-08-09 14:08 ` Netagunte, Nagabhushana
1 sibling, 1 reply; 40+ messages in thread
From: Wolfgang Denk @ 2011-08-02 16:23 UTC (permalink / raw)
To: u-boot
Dear nagabhushana.netagunte at ti.com,
In message <1312299792-16415-6-git-send-email-nagabhushana.netagunte@ti.com> you wrote:
> From: Nagabhushana Netagunte <nagabhushana.netagunte@ti.com>
>
> add misc_int_r function to read the mac address from SPI flash
> if env variable ethaddr is not set.
>
> Signed-off-by: Prakash PM <prakash.pm@ti.com>
> Signed-off-by: Nagabhushana Netagunte <nagabhushana.netagunte@ti.com>
...
> +err_read:
> + /* cannot call free currently since the free function calls free() for
> + * spi_flash structure though it is not directly allocated through
> + * malloc()
> + */
Incorrect multiline comment style.
> +int misc_init_r(void)
> +{
> + uint8_t addr[10];
> + uchar enetaddr[6];
> + int ret;
> +
> + printf("ARM Clock : %d Hz\n", clk_get(DAVINCI_ARM_CLKID));
Please do not add unneeded output to the a;lways printed boot
messages. If you want tto provide this information to the user then
add it as part of the "clock" command.
> + sprintf((char *)enetaddr, "%02x:%02x:%02x:%02x:%02x:%02x",
> + addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]);
Why don't you simply use "%pM" here?
Best regards,
Wolfgang Denk
--
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 flow chart is a most thoroughly oversold piece of program docu-
mentation. -- Frederick Brooks, "The Mythical Man Month"
^ permalink raw reply [flat|nested] 40+ messages in thread* [U-Boot] [PATCH 05/12] da850: add support to read mac address from spi flash
2011-08-02 16:23 ` Wolfgang Denk
@ 2011-08-09 14:08 ` Netagunte, Nagabhushana
0 siblings, 0 replies; 40+ messages in thread
From: Netagunte, Nagabhushana @ 2011-08-09 14:08 UTC (permalink / raw)
To: u-boot
Denk,
Thanks for your response.
My response is in-lined.
Regards,
Nag
On Tue, Aug 02, 2011 at 21:53:42, Wolfgang Denk wrote:
> Dear nagabhushana.netagunte at ti.com,
>
> In message <1312299792-16415-6-git-send-email-nagabhushana.netagunte@ti.com> you wrote:
> > From: Nagabhushana Netagunte <nagabhushana.netagunte@ti.com>
> >
> > add misc_int_r function to read the mac address from SPI flash if env
> > variable ethaddr is not set.
> >
> > Signed-off-by: Prakash PM <prakash.pm@ti.com>
> > Signed-off-by: Nagabhushana Netagunte <nagabhushana.netagunte@ti.com>
> ...
> > +err_read:
> > + /* cannot call free currently since the free function calls free() for
> > + * spi_flash structure though it is not directly allocated through
> > + * malloc()
> > + */
>
> Incorrect multiline comment style.
>
> > +int misc_init_r(void)
> > +{
> > + uint8_t addr[10];
> > + uchar enetaddr[6];
> > + int ret;
> > +
> > + printf("ARM Clock : %d Hz\n", clk_get(DAVINCI_ARM_CLKID));
>
> Please do not add unneeded output to the a;lways printed boot messages. If you want tto provide this information to the user then add it as part of the "clock" command.
>
Agree with you. It will be great if you can point me to the command you are referring to as I failed to locate the same.
> > + sprintf((char *)enetaddr, "%02x:%02x:%02x:%02x:%02x:%02x",
> > + addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]);
>
> Why don't you simply use "%pM" here?
>
Will make suggested change.
>
> Best regards,
>
> Wolfgang Denk
>
> --
> 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 flow chart is a most thoroughly oversold piece of program docu-
> mentation. -- Frederick Brooks, "The Mythical Man Month"
>
^ permalink raw reply [flat|nested] 40+ messages in thread
* [U-Boot] [PATCH 06/12] da850: add support to wake up DSP during board init
2011-08-02 15:43 [U-Boot] [PATCH 00/12] feature additions and fixes for da850 nagabhushana.netagunte at ti.com
` (4 preceding siblings ...)
2011-08-02 15:43 ` [U-Boot] [PATCH 05/12] da850: add support to read mac address from spi flash nagabhushana.netagunte at ti.com
@ 2011-08-02 15:43 ` nagabhushana.netagunte at ti.com
2011-08-02 16:25 ` Wolfgang Denk
2011-08-02 15:43 ` [U-Boot] [PATCH 07/12] da850: add support for Spectrum Digital AM18xx EVM nagabhushana.netagunte at ti.com
` (5 subsequent siblings)
11 siblings, 1 reply; 40+ messages in thread
From: nagabhushana.netagunte at ti.com @ 2011-08-02 15:43 UTC (permalink / raw)
To: u-boot
From: Nagabhushana Netagunte <nagabhushana.netagunte@ti.com>
Add support for DSP wake-up by default on DA850/OMAP-L138
during board initialization. To prevent DSP from being woken up,
set the environment variable dspwake to 'no'.
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Nagabhushana Netagunte <nagabhushana.netagunte@ti.com>
---
arch/arm/include/asm/arch-davinci/hardware.h | 5 ++
board/davinci/da8xxevm/da850evm.c | 54 ++++++++++++++++++++++++++
2 files changed, 59 insertions(+), 0 deletions(-)
diff --git a/arch/arm/include/asm/arch-davinci/hardware.h b/arch/arm/include/asm/arch-davinci/hardware.h
index 4627da3..5498042 100644
--- a/arch/arm/include/asm/arch-davinci/hardware.h
+++ b/arch/arm/include/asm/arch-davinci/hardware.h
@@ -151,7 +151,12 @@ typedef volatile unsigned int * dv_reg_p;
#define DAVINCI_DDR_EMIF_DATA_BASE 0xc0000000
#define DAVINCI_INTC_BASE 0xfffee000
#define DAVINCI_BOOTCFG_BASE 0x01c14000
+#define DAVINCI_L3CBARAM_BASE 0x80000000
#define JTAG_ID_REG (DAVINCI_BOOTCFG_BASE + 0x18)
+#define CHIP_REV_ID_REG (DAVINCI_BOOTCFG_BASE + 0x24)
+#define HOST1CFG (DAVINCI_BOOTCFG_BASE + 0x44)
+#define PSC0_MDCTL (DAVINCI_PSC0_BASE + 0xa00)
+
#define GPIO_BANK2_REG_DIR_ADDR (DAVINCI_GPIO_BASE + 0x38)
#define GPIO_BANK2_REG_OPDATA_ADDR (DAVINCI_GPIO_BASE + 0x3c)
diff --git a/board/davinci/da8xxevm/da850evm.c b/board/davinci/da8xxevm/da850evm.c
index ffded78..86c6777 100644
--- a/board/davinci/da8xxevm/da850evm.c
+++ b/board/davinci/da8xxevm/da850evm.c
@@ -425,6 +425,58 @@ err_probe:
return ret;
}
+void dsp_lpsc_on(unsigned domain, unsigned int id)
+{
+ dv_reg_p mdstat, mdctl, ptstat, ptcmd;
+ struct davinci_psc_regs *psc_regs;
+
+ psc_regs = davinci_psc0_regs;
+ mdstat = &psc_regs->psc0.mdstat[id];
+ mdctl = &psc_regs->psc0.mdctl[id];
+ ptstat = &psc_regs->ptstat;
+ ptcmd = &psc_regs->ptcmd;
+
+ while (*ptstat & (0x1 << domain))
+ ;
+
+ if ((*mdstat & 0x1f) == 0x03)
+ return; /* Already on and enabled */
+
+ *mdctl |= 0x03;
+
+ *ptcmd = 0x1 << domain;
+
+ while (*ptstat & (0x1 << domain))
+ ;
+ while ((*mdstat & 0x1f) != 0x03)
+ ; /* Probably an overkill... */
+}
+
+static void dspwake(void)
+{
+ unsigned *resetvect = (unsigned *)DAVINCI_L3CBARAM_BASE;
+ u32 val;
+
+ /* if the device is ARM only, return */
+ if ((readl(CHIP_REV_ID_REG) & 0x3f) == 0x10)
+ return;
+
+ if (!strcmp(getenv("dspwake"), "no"))
+ return;
+
+ *resetvect++ = 0x1E000; /* DSP Idle */
+ /* clear out the next 10 words as NOP */
+ memset(resetvect, 0, sizeof(unsigned) *10);
+
+ /* setup the DSP reset vector */
+ writel(DAVINCI_L3CBARAM_BASE, HOST1CFG);
+
+ dsp_lpsc_on(1, DAVINCI_LPSC_GEM);
+ val = readl(PSC0_MDCTL + (15 * 4));
+ val |= 0x100;
+ writel(val, (PSC0_MDCTL + (15 * 4)));
+}
+
int misc_init_r(void)
{
uint8_t addr[10];
@@ -449,5 +501,7 @@ int misc_init_r(void)
eth_setenv_enetaddr("ethaddr", enetaddr);
}
+ dspwake();
+
return 0;
}
--
1.6.2.4
^ permalink raw reply related [flat|nested] 40+ messages in thread* [U-Boot] [PATCH 06/12] da850: add support to wake up DSP during board init
2011-08-02 15:43 ` [U-Boot] [PATCH 06/12] da850: add support to wake up DSP during board init nagabhushana.netagunte at ti.com
@ 2011-08-02 16:25 ` Wolfgang Denk
2011-08-09 14:10 ` Netagunte, Nagabhushana
0 siblings, 1 reply; 40+ messages in thread
From: Wolfgang Denk @ 2011-08-02 16:25 UTC (permalink / raw)
To: u-boot
Dear nagabhushana.netagunte at ti.com,
In message <1312299792-16415-7-git-send-email-nagabhushana.netagunte@ti.com> you wrote:
> From: Nagabhushana Netagunte <nagabhushana.netagunte@ti.com>
>
> Add support for DSP wake-up by default on DA850/OMAP-L138
> during board initialization. To prevent DSP from being woken up,
> set the environment variable dspwake to 'no'.
Instead of inventing new (and undocumented) environment settings, I
recommend to use the "hwconfig" variable for this purpose.
Best regards,
Wolfgang Denk
--
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
2000 pounds of chinese soup = 1 Won Ton
^ permalink raw reply [flat|nested] 40+ messages in thread
* [U-Boot] [PATCH 06/12] da850: add support to wake up DSP during board init
2011-08-02 16:25 ` Wolfgang Denk
@ 2011-08-09 14:10 ` Netagunte, Nagabhushana
0 siblings, 0 replies; 40+ messages in thread
From: Netagunte, Nagabhushana @ 2011-08-09 14:10 UTC (permalink / raw)
To: u-boot
Denk,
Thanks for the suggestion, will incorporate the changes suggested.
Regards,
Nag
On Tue, Aug 02, 2011 at 21:55:11, Wolfgang Denk wrote:
> Dear nagabhushana.netagunte at ti.com,
>
> In message <1312299792-16415-7-git-send-email-nagabhushana.netagunte@ti.com> you wrote:
> > From: Nagabhushana Netagunte <nagabhushana.netagunte@ti.com>
> >
> > Add support for DSP wake-up by default on DA850/OMAP-L138 during board
> > initialization. To prevent DSP from being woken up, set the
> > environment variable dspwake to 'no'.
>
> Instead of inventing new (and undocumented) environment settings, I recommend to use the "hwconfig" variable for this purpose.
>
> Best regards,
>
> Wolfgang Denk
>
> --
> 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
> 2000 pounds of chinese soup = 1 Won Ton
>
^ permalink raw reply [flat|nested] 40+ messages in thread
* [U-Boot] [PATCH 07/12] da850: add support for Spectrum Digital AM18xx EVM
2011-08-02 15:43 [U-Boot] [PATCH 00/12] feature additions and fixes for da850 nagabhushana.netagunte at ti.com
` (5 preceding siblings ...)
2011-08-02 15:43 ` [U-Boot] [PATCH 06/12] da850: add support to wake up DSP during board init nagabhushana.netagunte at ti.com
@ 2011-08-02 15:43 ` nagabhushana.netagunte at ti.com
2011-08-02 15:43 ` [U-Boot] [PATCH 08/12] da850: pass board revision info to kernel nagabhushana.netagunte at ti.com
` (4 subsequent siblings)
11 siblings, 0 replies; 40+ messages in thread
From: nagabhushana.netagunte at ti.com @ 2011-08-02 15:43 UTC (permalink / raw)
To: u-boot
From: Manjunathappa, Prakash <prakash.pm@ti.com>
The AM18xx EVM contains winbond SPI flash instead of ST SPI flash in
comparison with logic PD da850/omap-l138 EVM. So enable configuration
to look for winbond flash.
Signed-off-by: Manjunathappa, Prakash <prakash.pm@ti.com>
Signed-off-by: Nagabhushana Netagunte <nagabhushana.netagunte@ti.com>
---
include/configs/da850evm.h | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/include/configs/da850evm.h b/include/configs/da850evm.h
index ede428b..05d2aba 100644
--- a/include/configs/da850evm.h
+++ b/include/configs/da850evm.h
@@ -80,6 +80,7 @@
#define CONFIG_SPI
#define CONFIG_SPI_FLASH
#define CONFIG_SPI_FLASH_STMICRO
+#define CONFIG_SPI_FLASH_WINBOND
#define CONFIG_DAVINCI_SPI
#define CONFIG_SYS_SPI_BASE DAVINCI_SPI1_BASE
#define CONFIG_SYS_SPI_CLK clk_get(DAVINCI_SPI1_CLKID)
--
1.6.2.4
^ permalink raw reply related [flat|nested] 40+ messages in thread* [U-Boot] [PATCH 08/12] da850: pass board revision info to kernel
2011-08-02 15:43 [U-Boot] [PATCH 00/12] feature additions and fixes for da850 nagabhushana.netagunte at ti.com
` (6 preceding siblings ...)
2011-08-02 15:43 ` [U-Boot] [PATCH 07/12] da850: add support for Spectrum Digital AM18xx EVM nagabhushana.netagunte at ti.com
@ 2011-08-02 15:43 ` nagabhushana.netagunte at ti.com
2011-08-02 16:27 ` Wolfgang Denk
2011-08-02 15:43 ` [U-Boot] [PATCH 09/12] da850: read MAC address from I2C EEPROM on AM18xx EVM nagabhushana.netagunte at ti.com
` (3 subsequent siblings)
11 siblings, 1 reply; 40+ messages in thread
From: nagabhushana.netagunte at ti.com @ 2011-08-02 15:43 UTC (permalink / raw)
To: u-boot
From: Manjunathappa, Prakash <prakash.pm@ti.com>
The Spectrum Digital AM18xx EVM contains I2C EEPROM compared
da850/omap-l138 Logic PD EVMs. This information is used to differentiate
the EVMs and is passed to kernel via second byte of ATAG_REVISION.
Signed-off-by: Manjunathappa, Prakash <prakash.pm@ti.com>
Signed-off-by: Nagabhushana Netagunte <nagabhushana.netagunte@ti.com>
---
board/davinci/da8xxevm/da850evm.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/board/davinci/da8xxevm/da850evm.c b/board/davinci/da8xxevm/da850evm.c
index 86c6777..eb9c915 100644
--- a/board/davinci/da8xxevm/da850evm.c
+++ b/board/davinci/da8xxevm/da850evm.c
@@ -217,6 +217,14 @@ u32 get_board_rev(void)
else if (maxcpuclk >= 372000000)
rev = 1;
+ /* Spectrum Digital AM18xx EVM contains I2C EEPROM compared
+ da850/omap-l138 Logic PD EVMs. This information is used to
+ differentiate the EVMs and is passed to kernel via second
+ byte of ATAG_REVISION. */
+
+ if (i2c_probe(0x50) == 0)
+ rev |= 0x100;
+
return rev;
}
--
1.6.2.4
^ permalink raw reply related [flat|nested] 40+ messages in thread* [U-Boot] [PATCH 08/12] da850: pass board revision info to kernel
2011-08-02 15:43 ` [U-Boot] [PATCH 08/12] da850: pass board revision info to kernel nagabhushana.netagunte at ti.com
@ 2011-08-02 16:27 ` Wolfgang Denk
2011-08-09 13:52 ` Netagunte, Nagabhushana
0 siblings, 1 reply; 40+ messages in thread
From: Wolfgang Denk @ 2011-08-02 16:27 UTC (permalink / raw)
To: u-boot
Dear nagabhushana.netagunte at ti.com,
In message <1312299792-16415-9-git-send-email-nagabhushana.netagunte@ti.com> you wrote:
> From: Manjunathappa, Prakash <prakash.pm@ti.com>
>
> The Spectrum Digital AM18xx EVM contains I2C EEPROM compared
> da850/omap-l138 Logic PD EVMs. ...
Sorry, I cannot parse this. Please reformulate.
> + /* Spectrum Digital AM18xx EVM contains I2C EEPROM compared
> + da850/omap-l138 Logic PD EVMs. This information is used to
> + differentiate the EVMs and is passed to kernel via second
> + byte of ATAG_REVISION. */
Incorrect multiline comment style.
> + if (i2c_probe(0x50) == 0)
> + rev |= 0x100;
Would it not be better to provide #defines instead of these hardwired
magic numbers (both address and mask)?
Best regards,
Wolfgang Denk
--
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
What the gods would destroy they first submit to an IEEE standards
committee.
^ permalink raw reply [flat|nested] 40+ messages in thread
* [U-Boot] [PATCH 08/12] da850: pass board revision info to kernel
2011-08-02 16:27 ` Wolfgang Denk
@ 2011-08-09 13:52 ` Netagunte, Nagabhushana
0 siblings, 0 replies; 40+ messages in thread
From: Netagunte, Nagabhushana @ 2011-08-09 13:52 UTC (permalink / raw)
To: u-boot
Hi Denk,
Thanks for comments.
Agree with you. We need to find a better way to find about board revision than the current method which depends on presence of i2c EEPROM on the board.
I will drop this patch also from this series. I will device a better patch
And submit later.
Thanks,
Nag
On Tue, Aug 02, 2011 at 21:57:32, Wolfgang Denk wrote:
> Dear nagabhushana.netagunte at ti.com,
>
> In message <1312299792-16415-9-git-send-email-nagabhushana.netagunte@ti.com> you wrote:
> > From: Manjunathappa, Prakash <prakash.pm@ti.com>
> >
> > The Spectrum Digital AM18xx EVM contains I2C EEPROM compared
> > da850/omap-l138 Logic PD EVMs. ...
>
> Sorry, I cannot parse this. Please reformulate.
>
> > + /* Spectrum Digital AM18xx EVM contains I2C EEPROM compared
> > + da850/omap-l138 Logic PD EVMs. This information is used to
> > + differentiate the EVMs and is passed to kernel via second
> > + byte of ATAG_REVISION. */
>
> Incorrect multiline comment style.
>
> > + if (i2c_probe(0x50) == 0)
> > + rev |= 0x100;
>
> Would it not be better to provide #defines instead of these hardwired magic numbers (both address and mask)?
>
> Best regards,
>
> Wolfgang Denk
>
> --
> 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 What the gods would destroy they first submit to an IEEE standards committee.
>
^ permalink raw reply [flat|nested] 40+ messages in thread
* [U-Boot] [PATCH 09/12] da850: read MAC address from I2C EEPROM on AM18xx EVM
2011-08-02 15:43 [U-Boot] [PATCH 00/12] feature additions and fixes for da850 nagabhushana.netagunte at ti.com
` (7 preceding siblings ...)
2011-08-02 15:43 ` [U-Boot] [PATCH 08/12] da850: pass board revision info to kernel nagabhushana.netagunte at ti.com
@ 2011-08-02 15:43 ` nagabhushana.netagunte at ti.com
2011-08-02 16:30 ` Wolfgang Denk
2011-08-02 15:43 ` [U-Boot] [PATCH 10/12] da850: fix the channel number for EMAC teardown init nagabhushana.netagunte at ti.com
` (2 subsequent siblings)
11 siblings, 1 reply; 40+ messages in thread
From: nagabhushana.netagunte at ti.com @ 2011-08-02 15:43 UTC (permalink / raw)
To: u-boot
From: Nagabhushana Netagunte <nagabhushana.netagunte@ti.com>
The AM18xx EVM contains MAC address in I2C EEPROM compared
da850/omap-l138 Logic PD EVM which maintains in SPI flash. So this
patch tries to read MAC address from I2C EEPROM, in failure case reads
from SPI flash assuming board to be da850/omap-l138 Logic PDS EVM.
Signed-off-by: Manjunathappa, Prakash <prakash.pm@ti.com>
Signed-off-by: Nagabhushana Netagunte <nagabhushana.netagunte@ti.com>
---
board/davinci/da8xxevm/da850evm.c | 14 ++++++++++----
1 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/board/davinci/da8xxevm/da850evm.c b/board/davinci/da8xxevm/da850evm.c
index eb9c915..64ff566 100644
--- a/board/davinci/da8xxevm/da850evm.c
+++ b/board/davinci/da8xxevm/da850evm.c
@@ -494,10 +494,16 @@ int misc_init_r(void)
printf("ARM Clock : %d Hz\n", clk_get(DAVINCI_ARM_CLKID));
if (!eth_getenv_enetaddr("ethaddr", enetaddr)) {
- /* Set Ethernet MAC address from EEPROM */
- ret = get_mac_addr_spi(addr);
- if (ret != 0)
- return -EINVAL;
+ /* Read Ethernet MAC address from EEPROM */
+ if (dvevm_read_mac_address(addr)) {
+ /* Set Ethernet MAC address from EEPROM */
+ davinci_sync_env_enetaddr(addr);
+ } else {
+ /* Set Ethernet MAC address from SPI flash */
+ ret = get_mac_addr_spi(addr);
+ if (ret != 0)
+ return -EINVAL;
+ }
if (is_multicast_ether_addr(addr) || is_zero_ether_addr(addr)) {
printf("Invalid MAC address read.\n");
--
1.6.2.4
^ permalink raw reply related [flat|nested] 40+ messages in thread* [U-Boot] [PATCH 09/12] da850: read MAC address from I2C EEPROM on AM18xx EVM
2011-08-02 15:43 ` [U-Boot] [PATCH 09/12] da850: read MAC address from I2C EEPROM on AM18xx EVM nagabhushana.netagunte at ti.com
@ 2011-08-02 16:30 ` Wolfgang Denk
2011-08-09 13:47 ` Netagunte, Nagabhushana
2011-09-15 10:50 ` Netagunte, Nagabhushana
0 siblings, 2 replies; 40+ messages in thread
From: Wolfgang Denk @ 2011-08-02 16:30 UTC (permalink / raw)
To: u-boot
Dear nagabhushana.netagunte at ti.com,
In message <1312299792-16415-10-git-send-email-nagabhushana.netagunte@ti.com> you wrote:
> From: Nagabhushana Netagunte <nagabhushana.netagunte@ti.com>
>
> The AM18xx EVM contains MAC address in I2C EEPROM compared
> da850/omap-l138 Logic PD EVM which maintains in SPI flash. ...
Sorry, I cannot parse this. Please reformulate.
> if (!eth_getenv_enetaddr("ethaddr", enetaddr)) {
> - /* Set Ethernet MAC address from EEPROM */
> - ret = get_mac_addr_spi(addr);
> - if (ret != 0)
> - return -EINVAL;
> + /* Read Ethernet MAC address from EEPROM */
> + if (dvevm_read_mac_address(addr)) {
> + /* Set Ethernet MAC address from EEPROM */
> + davinci_sync_env_enetaddr(addr);
> + } else {
> + /* Set Ethernet MAC address from SPI flash */
> + ret = get_mac_addr_spi(addr);
> + if (ret != 0)
> + return -EINVAL;
> + }
This is a pretty bad idea, as it will slow down booting and may cause
undefined behaviour if anybody decides to put an EEPROm on a board
where you assume there is none.
Please find a different way to test which board you have (or provide a
separate configuration). Implement this test just once, in early init
code, so that not each and every driver or feature as to test this
himself again and again.
Best regards,
Wolfgang Denk
--
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
"Spock, did you see the looks on their faces?"
"Yes, Captain, a sort of vacant contentment."
^ permalink raw reply [flat|nested] 40+ messages in thread* [U-Boot] [PATCH 09/12] da850: read MAC address from I2C EEPROM on AM18xx EVM
2011-08-02 16:30 ` Wolfgang Denk
@ 2011-08-09 13:47 ` Netagunte, Nagabhushana
2011-09-15 10:50 ` Netagunte, Nagabhushana
1 sibling, 0 replies; 40+ messages in thread
From: Netagunte, Nagabhushana @ 2011-08-09 13:47 UTC (permalink / raw)
To: u-boot
Denk,
Thanks for comments.
I agree with you that booting will slowdown with added calls.
I will drop this patch from this series. I will device effective
Patch later and submit.
Regards,
Nag
On Tue, Aug 02, 2011 at 22:00:36, Wolfgang Denk wrote:
> Dear nagabhushana.netagunte at ti.com,
>
> In message <1312299792-16415-10-git-send-email-nagabhushana.netagunte@ti.com> you wrote:
> > From: Nagabhushana Netagunte <nagabhushana.netagunte@ti.com>
> >
> > The AM18xx EVM contains MAC address in I2C EEPROM compared
> > da850/omap-l138 Logic PD EVM which maintains in SPI flash. ...
>
> Sorry, I cannot parse this. Please reformulate.
>
> > if (!eth_getenv_enetaddr("ethaddr", enetaddr)) {
> > - /* Set Ethernet MAC address from EEPROM */
> > - ret = get_mac_addr_spi(addr);
> > - if (ret != 0)
> > - return -EINVAL;
> > + /* Read Ethernet MAC address from EEPROM */
> > + if (dvevm_read_mac_address(addr)) {
> > + /* Set Ethernet MAC address from EEPROM */
> > + davinci_sync_env_enetaddr(addr);
> > + } else {
> > + /* Set Ethernet MAC address from SPI flash */
> > + ret = get_mac_addr_spi(addr);
> > + if (ret != 0)
> > + return -EINVAL;
> > + }
>
> This is a pretty bad idea, as it will slow down booting and may cause undefined behaviour if anybody decides to put an EEPROm on a board where you assume there is none.
>
> Please find a different way to test which board you have (or provide a separate configuration). Implement this test just once, in early init code, so that not each and every driver or feature as to test this himself again and again.
>
> Best regards,
>
> Wolfgang Denk
>
> --
> 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 "Spock, did you see the looks on their faces?"
> "Yes, Captain, a sort of vacant contentment."
>
^ permalink raw reply [flat|nested] 40+ messages in thread* [U-Boot] [PATCH 09/12] da850: read MAC address from I2C EEPROM on AM18xx EVM
2011-08-02 16:30 ` Wolfgang Denk
2011-08-09 13:47 ` Netagunte, Nagabhushana
@ 2011-09-15 10:50 ` Netagunte, Nagabhushana
1 sibling, 0 replies; 40+ messages in thread
From: Netagunte, Nagabhushana @ 2011-09-15 10:50 UTC (permalink / raw)
To: u-boot
Denk,
I comments are in-lined.
Regards,
Nag
On Tue, Aug 02, 2011 at 22:00:36, Wolfgang Denk wrote:
> Dear nagabhushana.netagunte at ti.com,
>
> In message <1312299792-16415-10-git-send-email-nagabhushana.netagunte@ti.com> you wrote:
> > From: Nagabhushana Netagunte <nagabhushana.netagunte@ti.com>
> >
> > The AM18xx EVM contains MAC address in I2C EEPROM compared
> > da850/omap-l138 Logic PD EVM which maintains in SPI flash. ...
>
> Sorry, I cannot parse this. Please reformulate.
>
> > if (!eth_getenv_enetaddr("ethaddr", enetaddr)) {
> > - /* Set Ethernet MAC address from EEPROM */
> > - ret = get_mac_addr_spi(addr);
> > - if (ret != 0)
> > - return -EINVAL;
> > + /* Read Ethernet MAC address from EEPROM */
> > + if (dvevm_read_mac_address(addr)) {
> > + /* Set Ethernet MAC address from EEPROM */
> > + davinci_sync_env_enetaddr(addr);
> > + } else {
> > + /* Set Ethernet MAC address from SPI flash */
> > + ret = get_mac_addr_spi(addr);
> > + if (ret != 0)
> > + return -EINVAL;
> > + }
>
> This is a pretty bad idea, as it will slow down booting and may cause undefined behaviour if anybody decides to put an EEPROm on a board where you assume there is none.
I understand the concern. I will introduce new config file based on board (manufacturer). Then, based on configuration, can I access EEPROM to read MAC address? OR do you think we should not read MAC address from EEPROM at all? Your suggestions will be helpful.
>
> Please find a different way to test which board you have (or provide a separate configuration). Implement this test just once, in early init code, so that not each and every driver or feature as to test this himself again and again.
Since we can't figure out board type by any other means, I will try to introduce new config files for each board type.
>
> Best regards,
>
> Wolfgang Denk
>
> --
> 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 "Spock, did you see the looks on their faces?"
> "Yes, Captain, a sort of vacant contentment."
>
^ permalink raw reply [flat|nested] 40+ messages in thread
* [U-Boot] [PATCH 10/12] da850: fix the channel number for EMAC teardown init
2011-08-02 15:43 [U-Boot] [PATCH 00/12] feature additions and fixes for da850 nagabhushana.netagunte at ti.com
` (8 preceding siblings ...)
2011-08-02 15:43 ` [U-Boot] [PATCH 09/12] da850: read MAC address from I2C EEPROM on AM18xx EVM nagabhushana.netagunte at ti.com
@ 2011-08-02 15:43 ` nagabhushana.netagunte at ti.com
2011-08-02 15:43 ` [U-Boot] [PATCH 11/12] da850: modifications for Logic PD Rev.3 AM18xx EVM nagabhushana.netagunte at ti.com
2011-08-02 15:43 ` [U-Boot] [PATCH 12/12] da850: print DDR frequency from u-boot nagabhushana.netagunte at ti.com
11 siblings, 0 replies; 40+ messages in thread
From: nagabhushana.netagunte at ti.com @ 2011-08-02 15:43 UTC (permalink / raw)
To: u-boot
From: Nagabhushana Netagunte <nagabhushana.netagunte@ti.com>
TX and RX channel numbers programmed as '1' during EMAC
teardown initialization is wrong. This patch fixes the
same by setting channel number to '0' which is used by U-boot.
Signed-off-by: Sugumar Natarajan <sugumar@ti.com>
Signed-off-by: Nagabhushana Netagunte <nagabhushana.netagunte@ti.com>
---
drivers/net/davinci_emac.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c
index 66c0d13..c0b8929 100644
--- a/drivers/net/davinci_emac.c
+++ b/drivers/net/davinci_emac.c
@@ -457,7 +457,7 @@ static void davinci_eth_ch_teardown(int ch)
if (ch == EMAC_CH_TX) {
/* Init TX channel teardown */
- writel(1, &adap_emac->TXTEARDOWN);
+ writel(0, &adap_emac->TXTEARDOWN);
do {
/*
* Wait here for Tx teardown completion interrupt to
@@ -476,7 +476,7 @@ static void davinci_eth_ch_teardown(int ch)
writel(0, &adap_emac->TX0HDP);
} else {
/* Init RX channel teardown */
- writel(1, &adap_emac->RXTEARDOWN);
+ writel(0, &adap_emac->RXTEARDOWN);
do {
/*
* Wait here for Rx teardown completion interrupt to
--
1.6.2.4
^ permalink raw reply related [flat|nested] 40+ messages in thread* [U-Boot] [PATCH 11/12] da850: modifications for Logic PD Rev.3 AM18xx EVM
2011-08-02 15:43 [U-Boot] [PATCH 00/12] feature additions and fixes for da850 nagabhushana.netagunte at ti.com
` (9 preceding siblings ...)
2011-08-02 15:43 ` [U-Boot] [PATCH 10/12] da850: fix the channel number for EMAC teardown init nagabhushana.netagunte at ti.com
@ 2011-08-02 15:43 ` nagabhushana.netagunte at ti.com
2011-08-02 16:32 ` Wolfgang Denk
2011-08-02 15:43 ` [U-Boot] [PATCH 12/12] da850: print DDR frequency from u-boot nagabhushana.netagunte at ti.com
11 siblings, 1 reply; 40+ messages in thread
From: nagabhushana.netagunte at ti.com @ 2011-08-02 15:43 UTC (permalink / raw)
To: u-boot
From: Nagabhushana Netagunte <nagabhushana.netagunte@ti.com>
AHCLKR/UART1_RTS/GP0[11] pin needs to be configured for
NOR to work on Rev.3 EVM. When GP0[11] is low,
the SD0 interface will not work, but NOR flash will.
Signed-off-by: Rajashekhara, Sudhakar <sudhakar.raj@ti.com>
Signed-off-by: Nagabhushana Netagunte <nagabhushana.netagunte@ti.com>
---
arch/arm/include/asm/arch-davinci/hardware.h | 5 ++++-
board/davinci/da8xxevm/da850evm.c | 15 +++++++++++++++
2 files changed, 19 insertions(+), 1 deletions(-)
diff --git a/arch/arm/include/asm/arch-davinci/hardware.h b/arch/arm/include/asm/arch-davinci/hardware.h
index 5498042..fda8203 100644
--- a/arch/arm/include/asm/arch-davinci/hardware.h
+++ b/arch/arm/include/asm/arch-davinci/hardware.h
@@ -157,7 +157,10 @@ typedef volatile unsigned int * dv_reg_p;
#define HOST1CFG (DAVINCI_BOOTCFG_BASE + 0x44)
#define PSC0_MDCTL (DAVINCI_PSC0_BASE + 0xa00)
-
+#define GPIO_BANK0_REG_DIR_ADDR (DAVINCI_GPIO_BASE + 0x10)
+#define GPIO_BANK0_REG_OPDATA_ADDR (DAVINCI_GPIO_BASE + 0x14)
+#define GPIO_BANK0_REG_SET_ADDR (DAVINCI_GPIO_BASE + 0x18)
+#define GPIO_BANK0_REG_CLR_ADDR (DAVINCI_GPIO_BASE + 0x1c)
#define GPIO_BANK2_REG_DIR_ADDR (DAVINCI_GPIO_BASE + 0x38)
#define GPIO_BANK2_REG_OPDATA_ADDR (DAVINCI_GPIO_BASE + 0x3c)
#define GPIO_BANK2_REG_SET_ADDR (DAVINCI_GPIO_BASE + 0x40)
diff --git a/board/davinci/da8xxevm/da850evm.c b/board/davinci/da8xxevm/da850evm.c
index 64ff566..a0b4425 100644
--- a/board/davinci/da8xxevm/da850evm.c
+++ b/board/davinci/da8xxevm/da850evm.c
@@ -111,6 +111,8 @@ const struct pinmux_config nand_pins[] = {
#elif defined(CONFIG_USE_NOR)
/* NOR pin muxer settings */
const struct pinmux_config nor_pins[] = {
+ /* GP0[11] is required for NOR to work on Rev 3 EVMs */
+ { pinmux(0), 8, 4 }, /* GP0[11] */
{ pinmux(5), 1, 6 },
{ pinmux(6), 1, 6 },
{ pinmux(7), 1, 0 },
@@ -230,6 +232,7 @@ u32 get_board_rev(void)
int board_init(void)
{
+ u32 val;
#ifndef CONFIG_USE_IRQ
irq_init();
#endif
@@ -277,6 +280,18 @@ int board_init(void)
if (davinci_configure_pin_mux_items(pinmuxes, ARRAY_SIZE(pinmuxes)))
return 1;
+#ifdef CONFIG_USE_NOR
+ /* Set the GPIO direction as output */
+ val = readl(GPIO_BANK0_REG_DIR_ADDR);
+ val &= ~(0x01 << 11);
+ writel(val, GPIO_BANK0_REG_DIR_ADDR);
+
+ /* Set the output as low */
+ val = readl(GPIO_BANK0_REG_SET_ADDR);
+ val |= (0x01 << 11);
+ writel(val, GPIO_BANK0_REG_CLR_ADDR);
+#endif
+
#ifdef CONFIG_DRIVER_TI_EMAC
if (davinci_configure_pin_mux(emac_pins, ARRAY_SIZE(emac_pins)) != 0)
return 1;
--
1.6.2.4
^ permalink raw reply related [flat|nested] 40+ messages in thread* [U-Boot] [PATCH 11/12] da850: modifications for Logic PD Rev.3 AM18xx EVM
2011-08-02 15:43 ` [U-Boot] [PATCH 11/12] da850: modifications for Logic PD Rev.3 AM18xx EVM nagabhushana.netagunte at ti.com
@ 2011-08-02 16:32 ` Wolfgang Denk
2011-08-09 13:45 ` Netagunte, Nagabhushana
0 siblings, 1 reply; 40+ messages in thread
From: Wolfgang Denk @ 2011-08-02 16:32 UTC (permalink / raw)
To: u-boot
Dear nagabhushana.netagunte at ti.com,
In message <1312299792-16415-12-git-send-email-nagabhushana.netagunte@ti.com> you wrote:
> From: Nagabhushana Netagunte <nagabhushana.netagunte@ti.com>
>
> AHCLKR/UART1_RTS/GP0[11] pin needs to be configured for
> NOR to work on Rev.3 EVM. When GP0[11] is low,
> the SD0 interface will not work, but NOR flash will.
>
> Signed-off-by: Rajashekhara, Sudhakar <sudhakar.raj@ti.com>
> Signed-off-by: Nagabhushana Netagunte <nagabhushana.netagunte@ti.com>
> ---
> arch/arm/include/asm/arch-davinci/hardware.h | 5 ++++-
> board/davinci/da8xxevm/da850evm.c | 15 +++++++++++++++
> 2 files changed, 19 insertions(+), 1 deletions(-)
...
> +#ifdef CONFIG_USE_NOR
> + /* Set the GPIO direction as output */
> + val = readl(GPIO_BANK0_REG_DIR_ADDR);
> + val &= ~(0x01 << 11);
> + writel(val, GPIO_BANK0_REG_DIR_ADDR);
> +
> + /* Set the output as low */
> + val = readl(GPIO_BANK0_REG_SET_ADDR);
> + val |= (0x01 << 11);
> + writel(val, GPIO_BANK0_REG_CLR_ADDR);
> +#endif
Please use standard clrbits / setbits macros instead.
Best regards,
Wolfgang Denk
--
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
"If that makes any sense to you, you have a big problem."
-- C. Durance, Computer Science 234
^ permalink raw reply [flat|nested] 40+ messages in thread* [U-Boot] [PATCH 11/12] da850: modifications for Logic PD Rev.3 AM18xx EVM
2011-08-02 16:32 ` Wolfgang Denk
@ 2011-08-09 13:45 ` Netagunte, Nagabhushana
0 siblings, 0 replies; 40+ messages in thread
From: Netagunte, Nagabhushana @ 2011-08-09 13:45 UTC (permalink / raw)
To: u-boot
Denk,
Thanks a lot for comments. I will incorporate changes suggested by you.
Regards,
Nag
On Tue, Aug 02, 2011 at 22:02:12, Wolfgang Denk wrote:
> Dear nagabhushana.netagunte at ti.com,
>
> In message <1312299792-16415-12-git-send-email-nagabhushana.netagunte@ti.com> you wrote:
> > From: Nagabhushana Netagunte <nagabhushana.netagunte@ti.com>
> >
> > AHCLKR/UART1_RTS/GP0[11] pin needs to be configured for NOR to work on
> > Rev.3 EVM. When GP0[11] is low, the SD0 interface will not work, but
> > NOR flash will.
> >
> > Signed-off-by: Rajashekhara, Sudhakar <sudhakar.raj@ti.com>
> > Signed-off-by: Nagabhushana Netagunte <nagabhushana.netagunte@ti.com>
> > ---
> > arch/arm/include/asm/arch-davinci/hardware.h | 5 ++++-
> > board/davinci/da8xxevm/da850evm.c | 15 +++++++++++++++
> > 2 files changed, 19 insertions(+), 1 deletions(-)
> ...
> > +#ifdef CONFIG_USE_NOR
> > + /* Set the GPIO direction as output */
> > + val = readl(GPIO_BANK0_REG_DIR_ADDR);
> > + val &= ~(0x01 << 11);
> > + writel(val, GPIO_BANK0_REG_DIR_ADDR);
> > +
> > + /* Set the output as low */
> > + val = readl(GPIO_BANK0_REG_SET_ADDR);
> > + val |= (0x01 << 11);
> > + writel(val, GPIO_BANK0_REG_CLR_ADDR); #endif
>
> Please use standard clrbits / setbits macros instead.
>
>
>
> Best regards,
>
> Wolfgang Denk
>
> --
> 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 "If that makes any sense to you, you have a big problem."
> -- C. Durance, Computer Science 234
>
^ permalink raw reply [flat|nested] 40+ messages in thread
* [U-Boot] [PATCH 12/12] da850: print DDR frequency from u-boot
2011-08-02 15:43 [U-Boot] [PATCH 00/12] feature additions and fixes for da850 nagabhushana.netagunte at ti.com
` (10 preceding siblings ...)
2011-08-02 15:43 ` [U-Boot] [PATCH 11/12] da850: modifications for Logic PD Rev.3 AM18xx EVM nagabhushana.netagunte at ti.com
@ 2011-08-02 15:43 ` nagabhushana.netagunte at ti.com
2011-08-02 16:33 ` Wolfgang Denk
11 siblings, 1 reply; 40+ messages in thread
From: nagabhushana.netagunte at ti.com @ 2011-08-02 15:43 UTC (permalink / raw)
To: u-boot
From: Nagabhushana Netagunte <nagabhushana.netagunte@ti.com>
Print DDR frequency when u-boot is coming up. Function
is added in hardware.h to find which PLL clock is used.
Signed-off-by: Rajashekhara, Sudhakar <sudhakar.raj@ti.com>
Signed-off-by: Nagabhushana Netagunte <nagabhushana.netagunte@ti.com>
---
arch/arm/include/asm/arch-davinci/hardware.h | 16 ++++++++++++++--
board/davinci/da8xxevm/da850evm.c | 1 +
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/arch/arm/include/asm/arch-davinci/hardware.h b/arch/arm/include/asm/arch-davinci/hardware.h
index fda8203..e0473c9 100644
--- a/arch/arm/include/asm/arch-davinci/hardware.h
+++ b/arch/arm/include/asm/arch-davinci/hardware.h
@@ -35,7 +35,7 @@
#include <config.h>
#include <asm/sizes.h>
-
+#include <asm/io.h>
#define REG(addr) (*(volatile unsigned int *)(addr))
#define REG_P(addr) ((volatile unsigned int *)(addr))
@@ -381,8 +381,14 @@ struct davinci_pllc_regs {
#define DAVINCI_PLLC_DIV_MASK 0x1f
#define ASYNC3 get_async3_src()
-#define PLL1_SYSCLK2 ((1 << 16) | 0x2)
+#define EMIFB get_emifb_src()
+
+#define PLL1_PLLM ((1 << 16) | DAVINCI_PLLM_CLKID)
+#define PLL1_SYSCLK1 ((1 << 16) | 0x1)
+#define PLL1_SYSCLK2 ((1 << 16) | 0x2)
#define DAVINCI_SPI1_CLKID (cpu_is_da830() ? 2 : ASYNC3)
+#define DAVINCI_DDR_CLKID EMIFB
+
/* Clock IDs */
enum davinci_clk_ids {
DAVINCI_SPI0_CLKID = 2,
@@ -486,6 +492,12 @@ static inline int get_async3_src(void)
PLL1_SYSCLK2 : 2;
}
+static inline int get_emifb_src(void)
+{
+ return (readl(&davinci_syscfg_regs->cfgchip3) & 0x80) ?
+ PLL1_PLLM : PLL1_SYSCLK1;
+}
+
#endif /* CONFIG_SOC_DA8XX */
#endif /* __ASM_ARCH_HARDWARE_H */
diff --git a/board/davinci/da8xxevm/da850evm.c b/board/davinci/da8xxevm/da850evm.c
index a0b4425..3a4f041 100644
--- a/board/davinci/da8xxevm/da850evm.c
+++ b/board/davinci/da8xxevm/da850evm.c
@@ -507,6 +507,7 @@ int misc_init_r(void)
int ret;
printf("ARM Clock : %d Hz\n", clk_get(DAVINCI_ARM_CLKID));
+ printf("DDR Clock : %d Hz\n", clk_get(DAVINCI_DDR_CLKID)/2);
if (!eth_getenv_enetaddr("ethaddr", enetaddr)) {
/* Read Ethernet MAC address from EEPROM */
--
1.6.2.4
^ permalink raw reply related [flat|nested] 40+ messages in thread* [U-Boot] [PATCH 12/12] da850: print DDR frequency from u-boot
2011-08-02 15:43 ` [U-Boot] [PATCH 12/12] da850: print DDR frequency from u-boot nagabhushana.netagunte at ti.com
@ 2011-08-02 16:33 ` Wolfgang Denk
2011-08-09 13:40 ` Netagunte, Nagabhushana
0 siblings, 1 reply; 40+ messages in thread
From: Wolfgang Denk @ 2011-08-02 16:33 UTC (permalink / raw)
To: u-boot
Dear nagabhushana.netagunte at ti.com,
In message <1312299792-16415-13-git-send-email-nagabhushana.netagunte@ti.com> you wrote:
> From: Nagabhushana Netagunte <nagabhushana.netagunte@ti.com>
>
> Print DDR frequency when u-boot is coming up. Function
> is added in hardware.h to find which PLL clock is used.
Please don;t add needless output to the standard boot messages. You
can add this as part of the "clock" command if you consider the
information to be useful to your users.
Best regards,
Wolfgang Denk
--
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 dislike companies that have a we-are-the-high-priests-of-hardware-
so-you'll-like-what-we-give-you attitude. I like commodity markets in
which iron-and-silicon hawkers know that they exist to provide fast
toys for software types like me to play with..." - Eric S. Raymond
^ permalink raw reply [flat|nested] 40+ messages in thread
* [U-Boot] [PATCH 12/12] da850: print DDR frequency from u-boot
2011-08-02 16:33 ` Wolfgang Denk
@ 2011-08-09 13:40 ` Netagunte, Nagabhushana
2011-08-10 10:47 ` Detlev Zundel
0 siblings, 1 reply; 40+ messages in thread
From: Netagunte, Nagabhushana @ 2011-08-09 13:40 UTC (permalink / raw)
To: u-boot
Hi Denk,
Thanks for the comments. It's a very good suggestion to add it as part of
Command. Unfortunately, I am unable to locate the 'Clock' command source.
I would greatly appreciate if you can point it for me.
Thanks,
Nag
On Tue, Aug 02, 2011 at 22:03:26, Wolfgang Denk wrote:
> Dear nagabhushana.netagunte at ti.com,
>
> In message <1312299792-16415-13-git-send-email-nagabhushana.netagunte@ti.com> you wrote:
> > From: Nagabhushana Netagunte <nagabhushana.netagunte@ti.com>
> >
> > Print DDR frequency when u-boot is coming up. Function is added in
> > hardware.h to find which PLL clock is used.
>
> Please don;t add needless output to the standard boot messages. You can add this as part of the "clock" command if you consider the information to be useful to your users.
>
> Best regards,
>
> Wolfgang Denk
>
> --
> 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 dislike companies that have a we-are-the-high-priests-of-hardware-
> so-you'll-like-what-we-give-you attitude. I like commodity markets in which iron-and-silicon hawkers know that they exist to provide fast
> toys for software types like me to play with..." - Eric S. Raymond
>
^ permalink raw reply [flat|nested] 40+ messages in thread
* [U-Boot] [PATCH 12/12] da850: print DDR frequency from u-boot
2011-08-09 13:40 ` Netagunte, Nagabhushana
@ 2011-08-10 10:47 ` Detlev Zundel
2011-08-17 12:47 ` Netagunte, Nagabhushana
0 siblings, 1 reply; 40+ messages in thread
From: Detlev Zundel @ 2011-08-10 10:47 UTC (permalink / raw)
To: u-boot
Hi Nag,
> Thanks for the comments. It's a very good suggestion to add it as part of
> Command. Unfortunately, I am unable to locate the 'Clock' command source.
> I would greatly appreciate if you can point it for me.
"git grep -A 2 U_BOOT_CMD' is your friend.
Actually as far as I can see, there is no single generic command but
"clockinfo" (e.g. arch/arm/cpu/arm1136/mx35/generic.c) and "clocks"
(e.g. arch/powerpc/cpu/mpc83xx/speed.c).
Maybe we should use this opportunity to align them? So what example
should we follow? Hm, oldest code wins, so here we go:
[dzu at pollux u-boot-testing (master)]$ for f in arch/arm/cpu/arm1136/mx35/generic.c arch/arm/cpu/armv7/mx5/clock.c arch/powerpc/cpu/mpc512x/speed.c arch/powerpc/cpu/mpc83xx/speed.c ; do git describe --contains `git log --follow --pretty=format:%H $f | tail -1` ; done
v2011.03-rc1~2^2~36
v2010.03-rc1~35
v1.3.0-rc4~69^2~1
U-Boot-1_1_3~20^2~7
So PowerPC wins ;) I.e. please use "clocks" as the command name, and
I'd appreciate it if you send a patch changing the mx35 and mx5 code.
Cheers
Detlev
--
Be careful in casting out your devil 'lest you cast out the best thing
about you.
-- Friedrich Nietzsche
--
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.de
^ permalink raw reply [flat|nested] 40+ messages in thread* [U-Boot] [PATCH 12/12] da850: print DDR frequency from u-boot
2011-08-10 10:47 ` Detlev Zundel
@ 2011-08-17 12:47 ` Netagunte, Nagabhushana
2011-08-17 15:37 ` Stefano Babic
0 siblings, 1 reply; 40+ messages in thread
From: Netagunte, Nagabhushana @ 2011-08-17 12:47 UTC (permalink / raw)
To: u-boot
Detlev,
Thanks for detailed explanation. I will make appropriate patches
And send them separately(not as part of ongoing series). Even though
I love to make patches for mx35 and mx5 base, I am afraid I may not
Able to find time. But, I will do my best.
Thanks again for comments!
Nag
On Wed, Aug 10, 2011 at 16:17:30, Detlev Zundel wrote:
> Hi Nag,
>
> > Thanks for the comments. It's a very good suggestion to add it as part
> > of Command. Unfortunately, I am unable to locate the 'Clock' command source.
> > I would greatly appreciate if you can point it for me.
>
> "git grep -A 2 U_BOOT_CMD' is your friend.
>
> Actually as far as I can see, there is no single generic command but "clockinfo" (e.g. arch/arm/cpu/arm1136/mx35/generic.c) and "clocks"
> (e.g. arch/powerpc/cpu/mpc83xx/speed.c).
>
> Maybe we should use this opportunity to align them? So what example should we follow? Hm, oldest code wins, so here we go:
>
> [dzu at pollux u-boot-testing (master)]$ for f in arch/arm/cpu/arm1136/mx35/generic.c arch/arm/cpu/armv7/mx5/clock.c arch/powerpc/cpu/mpc512x/speed.c arch/powerpc/cpu/mpc83xx/speed.c ; do git describe --contains `git log --follow --pretty=format:%H $f | tail -1` ; done
> v2011.03-rc1~2^2~36
> v2010.03-rc1~35
> v1.3.0-rc4~69^2~1
> U-Boot-1_1_3~20^2~7
>
> So PowerPC wins ;) I.e. please use "clocks" as the command name, and I'd appreciate it if you send a patch changing the mx35 and mx5 code.
>
> Cheers
> Detlev
>
> --
> Be careful in casting out your devil 'lest you cast out the best thing about you.
> -- Friedrich Nietzsche
> --
> 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.de
>
^ permalink raw reply [flat|nested] 40+ messages in thread
* [U-Boot] [PATCH 12/12] da850: print DDR frequency from u-boot
2011-08-17 12:47 ` Netagunte, Nagabhushana
@ 2011-08-17 15:37 ` Stefano Babic
2011-08-17 15:48 ` Detlev Zundel
0 siblings, 1 reply; 40+ messages in thread
From: Stefano Babic @ 2011-08-17 15:37 UTC (permalink / raw)
To: u-boot
On 08/17/2011 02:47 PM, Netagunte, Nagabhushana wrote:
>> Maybe we should use this opportunity to align them? So what example should we follow? Hm, oldest code wins, so here we go:
Never heard about this rule, but I agree it makes no sense to have
differen commands.
>> [dzu at pollux u-boot-testing (master)]$ for f in arch/arm/cpu/arm1136/mx35/generic.c arch/arm/cpu/armv7/mx5/clock.c arch/powerpc/cpu/mpc512x/speed.c arch/powerpc/cpu/mpc83xx/speed.c ; do git describe --contains `git log --follow --pretty=format:%H $f | tail -1` ; done
>> v2011.03-rc1~2^2~36
>> v2010.03-rc1~35
>> v1.3.0-rc4~69^2~1
>> U-Boot-1_1_3~20^2~7
>>
>> So PowerPC wins ;) I.e. please use "clocks" as the command name, and I'd appreciate it if you send a patch changing the mx35 and mx5 code.
No luck here for i.MX ;-). I will send the patch to change the command
name for i.MX.
Regards,
Stefano
--
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================
^ permalink raw reply [flat|nested] 40+ messages in thread
* [U-Boot] [PATCH 12/12] da850: print DDR frequency from u-boot
2011-08-17 15:37 ` Stefano Babic
@ 2011-08-17 15:48 ` Detlev Zundel
0 siblings, 0 replies; 40+ messages in thread
From: Detlev Zundel @ 2011-08-17 15:48 UTC (permalink / raw)
To: u-boot
Hi Stefano,
> On 08/17/2011 02:47 PM, Netagunte, Nagabhushana wrote:
>>> Maybe we should use this opportunity to align them? So what
>>> example should we follow? Hm, oldest code wins, so here we go:
>
> Never heard about this rule, but I agree it makes no sense to have
> differen commands.
You never heard about the principle of least surprise? Commands doing
the same thing should be called by the same name...
>>> [dzu at pollux u-boot-testing (master)]$ for f in
>>> arch/arm/cpu/arm1136/mx35/generic.c arch/arm/cpu/armv7/mx5/clock.c
>>> arch/powerpc/cpu/mpc512x/speed.c arch/powerpc/cpu/mpc83xx/speed.c ;
>>> do git describe --contains `git log --follow --pretty=format:%H $f
>>> | tail -1` ; done
>>> v2011.03-rc1~2^2~36
>>> v2010.03-rc1~35
>>> v1.3.0-rc4~69^2~1
>>> U-Boot-1_1_3~20^2~7
>>>
>>> So PowerPC wins ;) I.e. please use "clocks" as the command name,
>>> and I'd appreciate it if you send a patch changing the mx35 and mx5
>>> code.
>
> No luck here for i.MX ;-). I will send the patch to change the command
> name for i.MX.
Thanks in advance! I really hope that this command was never widely
used so we don't need to keep an deprecated alias for some time...
/me ducks and runs
Cheers
Detlev
--
There are two hard things in computer science: cache invalidation,
naming things, and off-by-one errors.
--
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.de
^ permalink raw reply [flat|nested] 40+ messages in thread