Skip to contentSkip to conversation

feature additions and fixes for da850

PATCH Superseded nagabhushana.netagunte at ti.com 6 participants 40 messages Aug 2, 2011 – Sep 15, 2011

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

cover feature additions and fixes for da850

From: Nagabhushana Netagunte <[email protected]>

These are some of the patches which add features like NOR support and a couple of fixes. Sending them as a series since some of them have some build dependency.

Manjunathappa, Prakash (2):
da850: add support for Spectrum Digital AM18xx EVM
da850: pass board revision info to kernel

Nagabhushana Netagunte (9):
da850: indicate cache usage disable in config file
da850: add NOR boot mode support
da850: modify the U-Boot prompt string
da850: add support to read mac address from spi flash
da850: add support to wake up DSP during board init
da850: read MAC address from I2C EEPROM on AM18xx EVM
da850: fix the channel number for EMAC teardown init
da850: modifications for Logic PD Rev.3 AM18xx EVM
da850: print DDR frequency from u-boot

Sudhakar Rajashekhara (1):
da8xx: add support for multiple PLL controllers

 arch/arm/cpu/arm926ejs/davinci/cpu.c         |   30 +++--
 arch/arm/include/asm/arch-davinci/hardware.h |   30 ++++-
 board/davinci/da8xxevm/da850evm.c            |  201 ++++++++++++++++++++++++++
 drivers/net/davinci_emac.c                   |    4 +-
 include/configs/da850evm.h                   |   26 ++++-
 5 files changed, 273 insertions(+), 18 deletions(-)
#1 lore raw

PATCH 1/12 da850: indicate cache usage disable in config file

From: Nagabhushana Netagunte <[email protected]>

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

---
 include/configs/da850evm.h |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
include/configs/da850evm.h +3 -0
index bbb5a9b..fdcc6e3 100644
@@ -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
Signature · 1 line
1.6.2.4
#2 lore raw

PATCH 1/12 da850: indicate cache usage disable in config file

Dear nagabhushana.netagunte at ti.com,

Quoted 6 lines · In message <[email protected]>…

From: Nagabhushana Netagunte <[email protected]>

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

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
Some people march to the beat of a different drummer. And some people
tango!
#3 lore raw

PATCH 1/12 da850: indicate cache usage disable in config file

Quoted 10 lines · Wolfgang Denk

Dear nagabhushana.netagunte at ti.com,

Quoted 6 lines · In message <[email protected]>…

From: Nagabhushana Netagunte <[email protected]>

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,

Quoted 8 lines

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,

Signature · 3 lines
Laurence Withers, <[email protected]>                http://www.guralp.com/
Direct tel:+447753988197 or tel:+443333408643               Software Engineer
General support queries: <[email protected]>         CMG-DCM CMG-EAM CMG-NAM
#4 lore raw

PATCH 1/12 da850: indicate cache usage disable in config file

Hi Laurence,

Thanks for the info about cache coherency issues with DAVINCI EMAC. I will make appropriate changes to commit message.

Thanks,
Nag

Quoted 30 lines · Laurence Withers
Quoted 10 lines · Wolfgang Denk

Dear nagabhushana.netagunte at ti.com,

Quoted 6 lines · In message <[email protected]>…

From: Nagabhushana Netagunte <[email protected]>

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,

Quoted 8 lines

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,

Signature · 3 lines
Laurence Withers, <[email protected]>                http://www.guralp.com/
Direct tel:+447753988197 or tel:+443333408643               Software Engineer
General support queries: <[email protected]>         CMG-DCM CMG-EAM CMG-NAM
#5 lore raw

PATCH 1/12 da850: indicate cache usage disable in config file

In reply to Wolfgang Denk

Thanks Denk for comments.

I will add appropriate reasons in commit message and resubmit the patch.

Regards,
Nag

Quoted 30 lines · Wolfgang Denk

Dear nagabhushana.netagunte at ti.com,

Quoted 6 lines · In message <[email protected]>…

From: Nagabhushana Netagunte <[email protected]>

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

Signature · 3 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 Some people march to the beat of a different drummer. And some people tango!
#6 lore raw

PATCH 2/12 da8xx: add support for multiple PLL controllers

In reply to nagabhushana.netagunte at ti.com

From: Sudhakar Rajashekhara <[email protected]>

Modify clk_get() function in cpu file to work for
multiple PLL controllers.

---
 arch/arm/cpu/arm926ejs/davinci/cpu.c         |   30 ++++++++++++++++---------
 arch/arm/include/asm/arch-davinci/hardware.h |    4 ++-
 2 files changed, 22 insertions(+), 12 deletions(-)
arch/arm/cpu/arm926ejs/davinci/cpu.c +19 -11
index 8b57205..b705dfd 100644
@@ -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;
arch/arm/include/asm/arch-davinci/hardware.h +3 -1
index df3f549..4627da3 100644
@@ -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()
Signature · 1 line
1.6.2.4
#7 lore raw

PATCH 3/12 da850: add NOR boot mode support

In reply to nagabhushana.netagunte at ti.com

From: Nagabhushana Netagunte <[email protected]>

Add an option to use NOR boot mode in configuration file and correspanding pin-mux support in board file.

---
 board/davinci/da8xxevm/da850evm.c |   51 +++++++++++++++++++++++++++++++++++++
 include/configs/da850evm.h        |   19 +++++++++++++
 2 files changed, 70 insertions(+), 0 deletions(-)
board/davinci/da8xxevm/da850evm.c +51 -0
index 73eaa48..d3d965c 100644
@@ -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
 };
 
include/configs/da850evm.h +19 -0
index fdcc6e3..53d63ab 100644
@@ -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
Signature · 1 line
1.6.2.4
#8 lore raw

PATCH 3/12 da850: add NOR boot mode support

Dear nagabhushana.netagunte at ti.com,

Quoted 7 lines · In message <[email protected]>…

From: Nagabhushana Netagunte <[email protected]>

Add an option to use NOR boot mode in configuration file and correspanding pin-mux support in board file.

...

include/configs/da850evm.h line 32

Quoted 4 lines

#define CONFIG_DRIVER_TI_EMAC
#define CONFIG_USE_SPIFLASH

include/configs/da850evm.h +2 -0
+#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.

include/configs/da850evm.h line 136

Quoted 9 lines

/*
* SoC Configuration

include/configs/da850evm.h +3 -0
@@ -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.

include/configs/da850evm.h line 143

Quoted 3 lines
include/configs/da850evm.h +3 -0
+#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

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: [email protected]
A list is only as strong as its weakest link.            -- Don Knuth
#9 lore raw

PATCH 3/12 da850: add NOR boot mode support

Hi Denk,

Thanks for comments. My response is in-lined.

Regards,
Nag

Quoted 10 lines · Wolfgang Denk

Dear nagabhushana.netagunte at ti.com,

Quoted 7 lines · In message <[email protected]>…

From: Nagabhushana Netagunte <[email protected]>

Add an option to use NOR boot mode in configuration file and correspanding pin-mux support in board file.

Quoted 8 lines

...

include/configs/da850evm.h line 32

Quoted 4 lines

#define CONFIG_DRIVER_TI_EMAC
#define CONFIG_USE_SPIFLASH

include/configs/da850evm.h +2 -0
+#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.

Quoted 3 lines

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.

Quoted 12 lines

include/configs/da850evm.h line 136

Quoted 9 lines

/*
* SoC Configuration

include/configs/da850evm.h +3 -0
@@ -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.

Quoted 7 lines

include/configs/da850evm.h line 143

Quoted 3 lines
include/configs/da850evm.h +3 -0
+#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.

Quoted 10 lines

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
A list is only as strong as its weakest link.            -- Don Knuth
#10 lore raw

PATCH 3/12 da850: add NOR boot mode support

Hi Nag,

[...]

Quoted 11 lines
Quoted 10 lines

include/configs/da850evm.h line 143

Quoted 3 lines
include/configs/da850evm.h +3 -0
+#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.

Quoted 3 lines

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

Signature · 9 lines
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
#11 lore raw

PATCH 3/12 da850: add NOR boot mode support

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

Quoted 32 lines · Detlev Zundel

Hi Nag,

[...]

Quoted 11 lines
Quoted 10 lines

include/configs/da850evm.h line 143

Quoted 3 lines
include/configs/da850evm.h +3 -0
+#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.

Quoted 3 lines

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

#12 lore raw

PATCH 4/12 da850: modify the U-Boot prompt string

In reply to nagabhushana.netagunte at ti.com

From: Nagabhushana Netagunte <[email protected]>

Modify U-Boot prompt string from "DA850-evm >" to "U-Boot >".

---
 include/configs/da850evm.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
include/configs/da850evm.h +1 -1
index 53d63ab..de22ffa 100644
@@ -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 */
Signature · 1 line
1.6.2.4
#13 lore raw

PATCH 5/12 da850: add support to read mac address from spi flash

In reply to nagabhushana.netagunte at ti.com

From: Nagabhushana Netagunte <[email protected]>

add misc_int_r function to read the mac address from SPI flash if env variable ethaddr is not set.

---
 board/davinci/da8xxevm/da850evm.c |   66 +++++++++++++++++++++++++++++++++++++
 include/configs/da850evm.h        |    1 +
 2 files changed, 67 insertions(+), 0 deletions(-)
board/davinci/da8xxevm/da850evm.c +66 -0
index d3d965c..ffded78 100644
@@ -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;
+}
include/configs/da850evm.h +1 -0
index de22ffa..ede428b 100644
@@ -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	*/
Signature · 1 line
1.6.2.4
#14 lore raw

PATCH 5/12 da850: add support to read mac address from spi flash

Dear nagabhushana.netagunte at ti.com,

Quoted 11 lines · In message <[email protected]>…

From: Nagabhushana Netagunte <[email protected]>

add misc_int_r function to read the mac address from SPI flash if env variable ethaddr is not set.

---
 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

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
Diplomacy is the art of saying "nice doggy" until you can find a rock.
#15 lore raw

PATCH 5/12 da850: add support to read mac address from spi flash

Denk,

Sorry for missing upstream syntax here, will follow relevant rules.

Regards,
Nag

Quoted 35 lines · Wolfgang Denk

Dear nagabhushana.netagunte at ti.com,

Quoted 11 lines · In message <[email protected]>…

From: Nagabhushana Netagunte <[email protected]>

add misc_int_r function to read the mac address from SPI flash if env variable ethaddr is not set.

---
 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

Signature · 3 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 Diplomacy is the art of saying "nice doggy" until you can find a rock.
#16 lore raw

PATCH 5/12 da850: add support to read mac address from spi flash

In reply to nagabhushana.netagunte at ti.com

Dear nagabhushana.netagunte at ti.com,

Quoted 7 lines · In message <[email protected]>…

From: Nagabhushana Netagunte <[email protected]>

add misc_int_r function to read the mac address from SPI flash if env variable ethaddr is not set.

...

board/davinci/da8xxevm/da850evm.c int board_eth_init(bd_t *bis) · line 423

Quoted 5 lines
board/davinci/da8xxevm/da850evm.c +5 -0
+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.

board/davinci/da8xxevm/da850evm.c int board_eth_init(bd_t *bis) · line 434

Quoted 7 lines
board/davinci/da8xxevm/da850evm.c +7 -0
+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.

board/davinci/da8xxevm/da850evm.c int board_eth_init(bd_t *bis) · line 447

Quoted 2 lines
board/davinci/da8xxevm/da850evm.c +2 -0
+		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

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
The flow chart is a most thoroughly oversold piece of  program  docu-
mentation.              -- Frederick Brooks, "The Mythical Man Month"
#17 lore raw

PATCH 5/12 da850: add support to read mac address from spi flash

Denk,

Thanks for your response.

My response is in-lined.

Regards,
Nag

Quoted 19 lines · Wolfgang Denk

Dear nagabhushana.netagunte at ti.com,

Quoted 7 lines · In message <[email protected]>…

From: Nagabhushana Netagunte <[email protected]>

add misc_int_r function to read the mac address from SPI flash if env variable ethaddr is not set.

...

board/davinci/da8xxevm/da850evm.c int board_eth_init(bd_t *bis) · line 423

Quoted 5 lines
board/davinci/da8xxevm/da850evm.c +5 -0
+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.

Quoted 10 lines

board/davinci/da8xxevm/da850evm.c int board_eth_init(bd_t *bis) · line 434

Quoted 7 lines
board/davinci/da8xxevm/da850evm.c +7 -0
+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.

Quoted 5 lines

board/davinci/da8xxevm/da850evm.c int board_eth_init(bd_t *bis) · line 447

Quoted 2 lines
board/davinci/da8xxevm/da850evm.c +2 -0
+		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.

Quoted 11 lines

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 The flow chart is a most thoroughly oversold piece of  program  docu-
mentation.              -- Frederick Brooks, "The Mythical Man Month"
#18 lore raw

PATCH 6/12 da850: add support to wake up DSP during board init

In reply to nagabhushana.netagunte at ti.com

From: Nagabhushana Netagunte <[email protected]>

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'.

---
 arch/arm/include/asm/arch-davinci/hardware.h |    5 ++
 board/davinci/da8xxevm/da850evm.c            |   54 ++++++++++++++++++++++++++
 2 files changed, 59 insertions(+), 0 deletions(-)
arch/arm/include/asm/arch-davinci/hardware.h +5 -0
index 4627da3..5498042 100644
@@ -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)
board/davinci/da8xxevm/da850evm.c +54 -0

65 lines not on this page · raw message

Signature · 1 line
1.6.2.4
#19 lore raw

PATCH 6/12 da850: add support to wake up DSP during board init

Dear nagabhushana.netagunte at ti.com,

Quoted 5 lines · In message <[email protected]>…

From: Nagabhushana Netagunte <[email protected]>

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

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
2000 pounds of chinese soup                               = 1 Won Ton
#20 lore raw

PATCH 6/12 da850: add support to wake up DSP during board init

Denk,

Thanks for the suggestion, will incorporate the changes suggested.

Regards,
Nag

Quoted 21 lines · Wolfgang Denk

Dear nagabhushana.netagunte at ti.com,

Quoted 5 lines · In message <[email protected]>…

From: Nagabhushana Netagunte <[email protected]>

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

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
2000 pounds of chinese soup                               = 1 Won Ton
#21 lore raw

PATCH 7/12 da850: add support for Spectrum Digital AM18xx EVM

In reply to nagabhushana.netagunte at ti.com

From: Manjunathappa, Prakash <[email protected]>

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.

---
 include/configs/da850evm.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
include/configs/da850evm.h +1 -0
index ede428b..05d2aba 100644
@@ -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)
Signature · 1 line
1.6.2.4
#22 lore raw

PATCH 8/12 da850: pass board revision info to kernel

In reply to nagabhushana.netagunte at ti.com

From: Manjunathappa, Prakash <[email protected]>

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.

---
 board/davinci/da8xxevm/da850evm.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
board/davinci/da8xxevm/da850evm.c +8 -0
index 86c6777..eb9c915 100644
@@ -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;
 }
 
Signature · 1 line
1.6.2.4
#23 lore raw

PATCH 8/12 da850: pass board revision info to kernel

Dear nagabhushana.netagunte at ti.com,

Quoted 4 lines · In message <[email protected]>…

From: Manjunathappa, Prakash <[email protected]>

The Spectrum Digital AM18xx EVM contains I2C EEPROM compared da850/omap-l138 Logic PD EVMs. ...

Sorry, I cannot parse this. Please reformulate.

board/davinci/da8xxevm/da850evm.c u32 get_board_rev(void) · line 223

Quoted 4 lines
board/davinci/da8xxevm/da850evm.c +4 -0
+	/* 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.

board/davinci/da8xxevm/da850evm.c u32 get_board_rev(void) · line 226

Quoted 2 lines
board/davinci/da8xxevm/da850evm.c +2 -0
+	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

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
What the gods would destroy they first submit to  an  IEEE  standards
committee.
#24 lore raw

PATCH 8/12 da850: pass board revision info to kernel

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

Quoted 31 lines · Wolfgang Denk

Dear nagabhushana.netagunte at ti.com,

Quoted 4 lines · In message <[email protected]>…

From: Manjunathappa, Prakash <[email protected]>

The Spectrum Digital AM18xx EVM contains I2C EEPROM compared da850/omap-l138 Logic PD EVMs. ...

Sorry, I cannot parse this. Please reformulate.

board/davinci/da8xxevm/da850evm.c u32 get_board_rev(void) · line 223

Quoted 4 lines
board/davinci/da8xxevm/da850evm.c +4 -0
+	/* 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.

board/davinci/da8xxevm/da850evm.c u32 get_board_rev(void) · line 226

Quoted 2 lines
board/davinci/da8xxevm/da850evm.c +2 -0
+	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

Signature · 3 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 What the gods would destroy they first submit to  an  IEEE  standards committee.
#25 lore raw

PATCH 9/12 da850: read MAC address from I2C EEPROM on AM18xx EVM

In reply to nagabhushana.netagunte at ti.com

From: Nagabhushana Netagunte <[email protected]>

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.

---
 board/davinci/da8xxevm/da850evm.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)
board/davinci/da8xxevm/da850evm.c +10 -4
index eb9c915..64ff566 100644
@@ -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");
Signature · 1 line
1.6.2.4
#26 lore raw

PATCH 9/12 da850: read MAC address from I2C EEPROM on AM18xx EVM

Dear nagabhushana.netagunte at ti.com,

Quoted 4 lines · In message <[email protected]>…

From: Nagabhushana Netagunte <[email protected]>

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.

Quoted 5 lines
board/davinci/da8xxevm/da850evm.c +0 -4
 	if (!eth_getenv_enetaddr("ethaddr", enetaddr)) {
-		/* Set Ethernet MAC address from EEPROM */
-		ret = get_mac_addr_spi(addr);
-		if (ret != 0)
-			return -EINVAL;

board/davinci/da8xxevm/da850evm.c int misc_init_r(void) · line 506

Quoted 10 lines
board/davinci/da8xxevm/da850evm.c +10 -0
+		/* 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

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
"Spock, did you see the looks on their faces?"
"Yes, Captain, a sort of vacant contentment."
#27 lore raw

PATCH 9/12 da850: read MAC address from I2C EEPROM on AM18xx EVM

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

Quoted 40 lines · Wolfgang Denk

Dear nagabhushana.netagunte at ti.com,

Quoted 4 lines · In message <[email protected]>…

From: Nagabhushana Netagunte <[email protected]>

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.

Quoted 5 lines
board/davinci/da8xxevm/da850evm.c +0 -4
 	if (!eth_getenv_enetaddr("ethaddr", enetaddr)) {
-		/* Set Ethernet MAC address from EEPROM */
-		ret = get_mac_addr_spi(addr);
-		if (ret != 0)
-			return -EINVAL;

board/davinci/da8xxevm/da850evm.c int misc_init_r(void) · line 506

Quoted 10 lines
board/davinci/da8xxevm/da850evm.c +10 -0
+		/* 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

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 "Spock, did you see the looks on their faces?"
"Yes, Captain, a sort of vacant contentment."
#28 lore raw

PATCH 9/12 da850: read MAC address from I2C EEPROM on AM18xx EVM

In reply to Wolfgang Denk

Denk,

I comments are in-lined.

Regards,
Nag

Quoted 19 lines · Wolfgang Denk

Dear nagabhushana.netagunte at ti.com,

Quoted 4 lines · In message <[email protected]>…

From: Nagabhushana Netagunte <[email protected]>

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.

Quoted 9 lines
board/davinci/da8xxevm/da850evm.c +4 -4
 	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);
Quoted 8 lines

board/davinci/da8xxevm/da850evm.c int misc_init_r(void) · line 506

Quoted 6 lines
board/davinci/da8xxevm/da850evm.c +6 -0
+		} 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.

Quoted 2 lines

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.

Quoted 11 lines

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 "Spock, did you see the looks on their faces?"
"Yes, Captain, a sort of vacant contentment."
#29 lore raw

PATCH 10/12 da850: fix the channel number for EMAC teardown init

In reply to nagabhushana.netagunte at ti.com

From: Nagabhushana Netagunte <[email protected]>

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.

---
 drivers/net/davinci_emac.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/davinci_emac.c +2 -2
index 66c0d13..c0b8929 100644
@@ -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
Signature · 1 line
1.6.2.4
#30 lore raw

PATCH 11/12 da850: modifications for Logic PD Rev.3 AM18xx EVM

In reply to nagabhushana.netagunte at ti.com

From: Nagabhushana Netagunte <[email protected]>

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.

---
 arch/arm/include/asm/arch-davinci/hardware.h |    5 ++++-
 board/davinci/da8xxevm/da850evm.c            |   15 +++++++++++++++
 2 files changed, 19 insertions(+), 1 deletions(-)
arch/arm/include/asm/arch-davinci/hardware.h +4 -1
index 5498042..fda8203 100644
@@ -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)
board/davinci/da8xxevm/da850evm.c +15 -0
index 64ff566..a0b4425 100644
@@ -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;
Signature · 1 line
1.6.2.4
#31 lore raw

PATCH 11/12 da850: modifications for Logic PD Rev.3 AM18xx EVM

Dear nagabhushana.netagunte at ti.com,

Quoted 12 lines · In message <[email protected]>…

From: Nagabhushana Netagunte <[email protected]>

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.

---
 arch/arm/include/asm/arch-davinci/hardware.h |    5 ++++-
 board/davinci/da8xxevm/da850evm.c            |   15 +++++++++++++++
 2 files changed, 19 insertions(+), 1 deletions(-)

...

board/davinci/da8xxevm/da850evm.c int board_init(void) · line 293

Quoted 11 lines
board/davinci/da8xxevm/da850evm.c +11 -0
+#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

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
"If that makes any sense to you, you have a big problem."
                                  -- C. Durance, Computer Science 234
#32 lore raw

PATCH 11/12 da850: modifications for Logic PD Rev.3 AM18xx EVM

Denk,
Thanks a lot for comments. I will incorporate changes suggested by you.

Regards,
Nag

Quoted 41 lines · Wolfgang Denk

Dear nagabhushana.netagunte at ti.com,

Quoted 12 lines · In message <[email protected]>…

From: Nagabhushana Netagunte <[email protected]>

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.

---
 arch/arm/include/asm/arch-davinci/hardware.h |    5 ++++-
 board/davinci/da8xxevm/da850evm.c            |   15 +++++++++++++++
 2 files changed, 19 insertions(+), 1 deletions(-)

...

board/davinci/da8xxevm/da850evm.c int board_init(void)

Quoted 10 lines
board/davinci/da8xxevm/da850evm.c +10 -0
+#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

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 "If that makes any sense to you, you have a big problem."
                                  -- C. Durance, Computer Science 234
#33 lore raw

PATCH 12/12 da850: print DDR frequency from u-boot

In reply to nagabhushana.netagunte at ti.com

From: Nagabhushana Netagunte <[email protected]>

Print DDR frequency when u-boot is coming up. Function is added in hardware.h to find which PLL clock is used.

---
 arch/arm/include/asm/arch-davinci/hardware.h |   16 ++++++++++++++--
 board/davinci/da8xxevm/da850evm.c            |    1 +
 2 files changed, 15 insertions(+), 2 deletions(-)
arch/arm/include/asm/arch-davinci/hardware.h +14 -2
index fda8203..e0473c9 100644
@@ -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 */
board/davinci/da8xxevm/da850evm.c +1 -0
index a0b4425..3a4f041 100644
@@ -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 */
Signature · 1 line
1.6.2.4
#34 lore raw

PATCH 12/12 da850: print DDR frequency from u-boot

Dear nagabhushana.netagunte at ti.com,

Quoted 4 lines · In message <[email protected]>…

From: Nagabhushana Netagunte <[email protected]>

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

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
"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
#35 lore raw

PATCH 12/12 da850: print DDR frequency from 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

Quoted 21 lines · Wolfgang Denk

Dear nagabhushana.netagunte at ti.com,

Quoted 4 lines · In message <[email protected]>…

From: Nagabhushana Netagunte <[email protected]>

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

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 "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
#36 lore raw

PATCH 12/12 da850: print DDR frequency from u-boot

Hi Nag,

Quoted 3 lines

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

Signature · 7 lines
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
#37 lore raw

PATCH 12/12 da850: print DDR frequency from 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

Quoted 32 lines · Detlev Zundel

Hi Nag,

Quoted 3 lines

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

#38 lore raw

PATCH 12/12 da850: print DDR frequency from u-boot

Quoted 1 line · Nagabhushana
Quoted 1 line

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.

Quoted 7 lines
Quoted 7 lines

[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

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-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================
#39 lore raw

PATCH 12/12 da850: print DDR frequency from u-boot

Hi Stefano,

Quoted 6 lines · Nagabhushana
Quoted 2 lines
Quoted 2 lines

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...

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines

[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

Quoted 6 lines
Quoted 3 lines
Quoted 3 lines

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

Signature · 6 lines
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