Skip to contentSkip to conversation

AT91SAM/CAP patches for U-Boot 1.3.4

PATCH Superseded Stelian Pop 6 participants 47 messages May 6, 2008 – May 9, 2008

Subsystems (7)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover AT91SAM/CAP patches for U-Boot 1.3.4

Hi,

The following patches add support for the missing AT91SAM9 boards:
- AT91SAM9261
- AT91SAM9263
- AT91SAM9RL

Additionnaly, they fix a few minor things in the existing AT91SAM9260 and AT91CAP9 ports: dataflash offsets, 8/16 bit NAND support, SPI timings, consistent Linux bootargs.

The second half of the patches (from 12 to 19) adds a driver for the LCD controller on the Atmel boards (except 9260). The driver could probably be adapted, with minimum efforts, to the AVR32 boards.

And finally, the last patch adds support for the revision 'C' of the AT91CAP9 silicon, which needs a special initialisation sequence to switch from the internal RC oscillator to the external 32k clock.

Thanks,

Stelian.

#1 lore raw

PATCH 1/21 AT91CAP9ADK: Handle 8 or 16 bit NAND

---
 board/atmel/at91cap9adk/at91cap9adk.c |    8 ++++++--
 board/atmel/at91cap9adk/nand.c        |    3 +++
 include/configs/at91cap9adk.h         |    1 +
 3 files changed, 10 insertions(+), 2 deletions(-)
board/atmel/at91cap9adk/at91cap9adk.c +6 -2
index 24861ba..ab56f3a 100644
@@ -116,7 +116,12 @@ static void at91cap9_nand_hw_init(void)
 	at91_sys_write(AT91_SMC_MODE(3),
 		       AT91_SMC_READMODE | AT91_SMC_WRITEMODE |
 		       AT91_SMC_EXNWMODE_DISABLE |
-		       AT91_SMC_DBW_8 | AT91_SMC_TDF_(1));
+#ifdef CFG_NAND_DBW_16
+		       AT91_SMC_DBW_16 |
+#else /* CFG_NAND_DBW_8 */
+		       AT91_SMC_DBW_8 |
+#endif
+		       AT91_SMC_TDF_(1));
 
 	at91_sys_write(AT91_PMC_PCER, 1 << AT91CAP9_ID_PIOABCD);
 
@@ -252,7 +257,6 @@ int board_init(void)
 #ifdef CONFIG_USB_OHCI_NEW
 	at91cap9_uhp_hw_init();
 #endif
-
 	return 0;
 }
 
board/atmel/at91cap9adk/nand.c +3 -0
index c72b024..5d49aee 100644
@@ -63,6 +63,9 @@ static void at91cap9adk_nand_hwcontrol(struct mtd_info *mtd, int cmd)
 int board_nand_init(struct nand_chip *nand)
 {
 	nand->eccmode = NAND_ECC_SOFT;
+#ifdef CFG_NAND_DBW_16
+	nand->options = NAND_BUSWIDTH_16;
+#endif
 	nand->hwcontrol = at91cap9adk_nand_hwcontrol;
 	nand->chip_delay = 20;
 
include/configs/at91cap9adk.h +1 -0
index dab21d0..88527a4 100644
@@ -110,6 +110,7 @@
 #define NAND_MAX_CHIPS			1
 #define CFG_MAX_NAND_DEVICE		1
 #define CFG_NAND_BASE			0x40000000
+#define CFG_NAND_DBW_8			1
 
 /* Ethernet */
 #define CONFIG_MACB			1
Signature · 1 line
1.5.3.3
#3 lore raw

PATCH 2/21 AT91CAP9ADK: Normalize SPI timings

In reply to Stelian Pop
---
 include/configs/at91cap9adk.h |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
include/configs/at91cap9adk.h +3 -3
index 88527a4..a648ce0 100644
@@ -94,9 +94,9 @@
 #define CFG_SPI_WRITE_TOUT		(5*CFG_HZ)
 #define CFG_MAX_DATAFLASH_BANKS		1
 #define CFG_DATAFLASH_LOGIC_ADDR_CS0	0xC0000000	/* CS0 */
-#define AT91_SPI_CLK			20000000
-#define DATAFLASH_TCSS			(0xFA << 16)
-#define DATAFLASH_TCHS			(0x8 << 24)
+#define AT91_SPI_CLK			15000000
+#define DATAFLASH_TCSS			(0x1a << 16)
+#define DATAFLASH_TCHS			(0x1 << 24)
 
 /* NOR flash */
 #define CFG_FLASH_CFI			1
Signature · 1 line
1.5.3.3
#4 lore raw

PATCH 2/21 AT91CAP9ADK: Normalize SPI timings

Stelian Pop's patch:

include/configs/at91cap9adk.h line 99

Quoted 8 lines
include/configs/at91cap9adk.h +3 -3
 
-#define AT91_SPI_CLK			20000000
-#define DATAFLASH_TCSS			(0xFA << 16)
-#define DATAFLASH_TCHS			(0x8 << 24)
+#define AT91_SPI_CLK			15000000
+#define DATAFLASH_TCSS			(0x1a << 16)
+#define DATAFLASH_TCHS			(0x1 << 24)

What do you mean by "Normalize SPI timings"?

Why are you replacing 20000000 Hz with 15000000 Hz? Faster would be better as long as the SPI bus operates reliably, right?

Sincerely,

Ken Fuchs

#5 lore raw

PATCH 2/21 AT91CAP9ADK: Normalize SPI timings

Le mardi 06 mai 2008 ? 14:23 -0500, Ken.Fuchs at bench.com a ?crit :

Quoted 13 lines

Stelian Pop's patch:

include/configs/at91cap9adk.h line 99

Quoted 8 lines
include/configs/at91cap9adk.h +3 -3
 
-#define AT91_SPI_CLK			20000000
-#define DATAFLASH_TCSS			(0xFA << 16)
-#define DATAFLASH_TCHS			(0x8 << 24)
+#define AT91_SPI_CLK			15000000
+#define DATAFLASH_TCSS			(0x1a << 16)
+#define DATAFLASH_TCHS			(0x1 << 24)

What do you mean by "Normalize SPI timings"?

Quoted 3 lines

Why are you replacing 20000000 Hz with 15000000 Hz? Faster would be better as long as the SPI bus operates reliably, right?

I used here what the kernel people use. I tend to be more confident in the values used in the kernel (where the code is used by many) than in some random speed picked up from Atmel's example files.

As for TCSS/TCHS, the values comes from Atmel's bootstrap project.

Signature · 1 line
Stelian Pop <[email protected]>
#7 lore raw

PATCH 3/21 AT91CAP9ADK: Normalize BOOTARGS

In reply to Stelian Pop
---
 include/configs/at91cap9adk.h |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
include/configs/at91cap9adk.h +8 -2
index a648ce0..78b2283 100644
@@ -56,8 +56,6 @@
 #define CONFIG_USART3		1	/* USART 3 is DBGU */
 
 #define CONFIG_BOOTDELAY	3
-#define CONFIG_BOOTARGS		"console=ttyS0,115200 " \
-				"root=/dev/mtdblock1 rw rootfstype=jffs2"
 
 /* #define CONFIG_ENV_OVERWRITE	1 */
 
@@ -145,6 +143,10 @@
 #define CFG_ENV_ADDR		(CFG_DATAFLASH_LOGIC_ADDR_CS0 + CFG_ENV_OFFSET)
 #define CFG_ENV_SIZE		0x4200
 #define CONFIG_BOOTCOMMAND	"cp.b 0xC003DE00 0x72000000 0x200040; bootm"
+#define CONFIG_BOOTARGS		"console=ttyS0,115200 " \
+				"root=/dev/mtdblock1 " \
+				"mtdparts=physmap-flash.0:-(nor);at91_nand:-(root) "\
+				"rw rootfstype=jffs2"
 
 #else
 
@@ -155,6 +157,10 @@
 #define CFG_ENV_ADDR		(PHYS_FLASH_1 + CFG_ENV_OFFSET)
 #define CFG_ENV_SIZE		0x4000
 #define CONFIG_BOOTCOMMAND	"cp.b 0x10040000 0x72000000 0x200000; bootm"
+#define CONFIG_BOOTARGS		"console=ttyS0,115200 " \
+				"root=/dev/mtdblock4 " \
+				"mtdparts=physmap-flash.0:16k(bootstrap)ro,16k(env),224k(uboot)ro,-(linux);at91_nand:-(root) "\
+				"rw rootfstype=jffs2"
 
 #endif
 
Signature · 1 line
1.5.3.3
#8 lore raw

PATCH 3/21 AT91CAP9ADK: Normalize BOOTARGS

include/configs/at91cap9adk.h line 162

Quoted 4 lines · In message <[email protected]> you wrote:
include/configs/at91cap9adk.h +3 -0
+#define CONFIG_BOOTARGS		"console=ttyS0,115200 " \
+				"root=/dev/mtdblock4 " \
+				"mtdparts=physmap-flash.0:16k(bootstrap)ro,16k(env),224k(uboot)ro,-(linux);at91_nand:-(root) "\

Please mind the maximum line length.

Please split this up.

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
"Nature is very un-American.  Nature never hurries."
- William George Jordan
#9 lore raw

PATCH 3/21 AT91CAP9ADK: Normalize BOOTARGS

Le mardi 06 mai 2008 ? 21:21 +0200, Wolfgang Denk a ?crit :

Quoted 7 lines

include/configs/at91cap9adk.h line 162

Quoted 4 lines · In message <[email protected]> you wrote:
include/configs/at91cap9adk.h +3 -0
+#define CONFIG_BOOTARGS		"console=ttyS0,115200 " \
+				"root=/dev/mtdblock4 " \
+				"mtdparts=physmap-flash.0:16k(bootstrap)ro,16k(env),224k(uboot)ro,-(linux);at91_nand:-(root) "\

Please mind the maximum line length.

In this particular case (there is only one kernel parameter here:
mtdparts) I'm not sure splitting the line will have some added value.

But anyway, I'll split it up if you want to.

And no need to point to this line in all the config .h files, I know where are my copy and pastes :)

Stelian.

Signature · 1 line
Stelian Pop <[email protected]>
#10 lore raw

PATCH 3/21 AT91CAP9ADK: Normalize BOOTARGS

Quoted 13 lines · Stelian Pop

Le mardi 06 mai 2008 ? 21:21 +0200, Wolfgang Denk a ?crit :

Quoted 7 lines

include/configs/at91cap9adk.h line 162

Quoted 4 lines · In message <[email protected]> you wrote:
include/configs/at91cap9adk.h +3 -0
+#define CONFIG_BOOTARGS		"console=ttyS0,115200 " \
+				"root=/dev/mtdblock4 " \
+				"mtdparts=physmap-flash.0:16k(bootstrap)ro,16k(env),224k(uboot)ro,-(linux);at91_nand:-(root) "\

Please mind the maximum line length.

In this particular case (there is only one kernel parameter here:
mtdparts) I'm not sure splitting the line will have some added value.

Quoted 6 lines

But anyway, I'll split it up if you want to.

And no need to point to this line in all the config .h files, I know where are my copy and pastes :)

Stelian.

Already in the at91 tree
Until you send your next patches I'll keep the currents

Best Regards,
J.

#11 lore raw

PATCH 4/21 AT91CAP9ADK: Fix dataflash offsets in BOOTCMD

In reply to Stelian Pop
---
 include/configs/at91cap9adk.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
include/configs/at91cap9adk.h +1 -1
index 78b2283..ec70618 100644
@@ -142,7 +142,7 @@
 #define CFG_ENV_OFFSET		0x4200
 #define CFG_ENV_ADDR		(CFG_DATAFLASH_LOGIC_ADDR_CS0 + CFG_ENV_OFFSET)
 #define CFG_ENV_SIZE		0x4200
-#define CONFIG_BOOTCOMMAND	"cp.b 0xC003DE00 0x72000000 0x200040; bootm"
+#define CONFIG_BOOTCOMMAND	"cp.b 0xC0042000 0x72000000 0x210000; bootm"
 #define CONFIG_BOOTARGS		"console=ttyS0,115200 " \
 				"root=/dev/mtdblock1 " \
 				"mtdparts=physmap-flash.0:-(nor);at91_nand:-(root) "\
Signature · 1 line
1.5.3.3
#12 lore raw

PATCH 5/21 AT91SAM9260EK: Handle 8 or 16 bit NAND

In reply to Stelian Pop
---
 board/atmel/at91sam9260ek/at91sam9260ek.c |    7 ++++++-
 board/atmel/at91sam9260ek/nand.c          |    3 +++
 include/configs/at91sam9260ek.h           |    1 +
 3 files changed, 10 insertions(+), 1 deletions(-)
board/atmel/at91sam9260ek/at91sam9260ek.c +6 -1
index a55468e..7d325e8 100644
@@ -90,7 +90,12 @@ static void at91sam9260ek_nand_hw_init(void)
 	at91_sys_write(AT91_SMC_MODE(3),
 		       AT91_SMC_READMODE | AT91_SMC_WRITEMODE |
 		       AT91_SMC_EXNWMODE_DISABLE |
-		       AT91_SMC_DBW_8 | AT91_SMC_TDF_(2));
+#ifdef CFG_NAND_DBW_16
+		       AT91_SMC_DBW_16 |
+#else /* CFG_NAND_DBW_8 */
+		       AT91_SMC_DBW_8 |
+#endif
+		       AT91_SMC_TDF_(2));
 
 	at91_sys_write(AT91_PMC_PCER, 1 << AT91SAM9260_ID_PIOC);
 
board/atmel/at91sam9260ek/nand.c +3 -0
index abb788a..a92b105 100644
@@ -68,6 +68,9 @@ static int at91sam9260ek_nand_ready(struct mtd_info *mtd)
 int board_nand_init(struct nand_chip *nand)
 {
 	nand->eccmode = NAND_ECC_SOFT;
+#ifdef CFG_NAND_DBW_16
+	nand->options = NAND_BUSWIDTH_16;
+#endif
 	nand->hwcontrol = at91sam9260ek_nand_hwcontrol;
 	nand->dev_ready = at91sam9260ek_nand_ready;
 	nand->chip_delay = 20;
include/configs/at91sam9260ek.h +1 -0
index 96d1b8d..8d02416 100644
@@ -104,6 +104,7 @@
 #define NAND_MAX_CHIPS			1
 #define CFG_MAX_NAND_DEVICE		1
 #define CFG_NAND_BASE			0x40000000
+#define CFG_NAND_DBW_8			1
 
 /* NOR flash - no real flash on this board */
 #define CFG_NO_FLASH			1
Signature · 1 line
1.5.3.3
#14 lore raw

PATCH 6/21 AT91SAM9260EK: Normalize SPI timings

In reply to Stelian Pop
---
 include/configs/at91sam9260ek.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
include/configs/at91sam9260ek.h +1 -1
index 8d02416..0aac0f5 100644
@@ -96,7 +96,7 @@
 #define CFG_MAX_DATAFLASH_BANKS		2
 #define CFG_DATAFLASH_LOGIC_ADDR_CS0	0xC0000000	/* CS0 */
 #define CFG_DATAFLASH_LOGIC_ADDR_CS1	0xD0000000	/* CS1 */
-#define AT91_SPI_CLK			33000000
+#define AT91_SPI_CLK			15000000
 #define DATAFLASH_TCSS			(0x1a << 16)
 #define DATAFLASH_TCHS			(0x1 << 24)
 
Signature · 1 line
1.5.3.3
#16 lore raw

PATCH 7/21 AT91SAM9260EK: Normalize BOOTARGS

In reply to Stelian Pop
---
 include/configs/at91sam9260ek.h |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)
include/configs/at91sam9260ek.h +12 -2
index 0aac0f5..e25985e 100644
@@ -56,8 +56,6 @@
 #define CONFIG_USART3		1	/* USART 3 is DBGU */
 
 #define CONFIG_BOOTDELAY	3
-#define CONFIG_BOOTARGS		"console=ttyS0,115200 " \
-				"root=/dev/mtdblock0 rw rootfstype=jffs2"
 
 /* #define CONFIG_ENV_OVERWRITE	1 */
 
@@ -144,6 +142,10 @@
 #define CFG_ENV_ADDR		(CFG_DATAFLASH_LOGIC_ADDR_CS0 + CFG_ENV_OFFSET)
 #define CFG_ENV_SIZE		0x4200
 #define CONFIG_BOOTCOMMAND	"cp.b 0xC003DE00 0x22000000 0x200040; bootm"
+#define CONFIG_BOOTARGS		"console=ttyS0,115200 " \
+				"root=/dev/mtdblock0 " \
+				"mtdparts=at91_nand:-(root) "\
+				"rw rootfstype=jffs2"
 
 #elif CFG_USE_DATAFLASH_CS1
 
@@ -154,6 +156,10 @@
 #define CFG_ENV_ADDR		(CFG_DATAFLASH_LOGIC_ADDR_CS1 + CFG_ENV_OFFSET)
 #define CFG_ENV_SIZE		0x4200
 #define CONFIG_BOOTCOMMAND	"cp.b 0xD003DE00 0x22000000 0x200040; bootm"
+#define CONFIG_BOOTARGS		"console=ttyS0,115200 " \
+				"root=/dev/mtdblock0 " \
+				"mtdparts=at91_nand:-(root) "\
+				"rw rootfstype=jffs2"
 
 #else /* CFG_USE_NANDFLASH */
 
@@ -163,6 +169,10 @@
 #define CFG_ENV_OFFSET_REDUND	0x80000
 #define CFG_ENV_SIZE		0x20000		/* 1 sector = 128 kB */
 #define CONFIG_BOOTCOMMAND	"nand read 0x22000000 0xA0000 0x200000; bootm"
+#define CONFIG_BOOTARGS		"console=ttyS0,115200 " \
+				"root=/dev/mtdblock5 " \
+				"mtdparts=at91_nand:128k(bootstrap)ro,256k(uboot)ro,128k(env1)ro,128k(env2)ro,2M(linux),-(root) " \
+				"rw rootfstype=jffs2"
 
 #endif
 
Signature · 1 line
1.5.3.3
#18 lore raw

PATCH 8/21 AT91SAM9260EK: Fix dataflash offsets in BOOTCMD

In reply to Stelian Pop
---
 include/configs/at91sam9260ek.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
include/configs/at91sam9260ek.h +2 -2
index e25985e..f334a53 100644
@@ -141,7 +141,7 @@
 #define CFG_ENV_OFFSET		0x4200
 #define CFG_ENV_ADDR		(CFG_DATAFLASH_LOGIC_ADDR_CS0 + CFG_ENV_OFFSET)
 #define CFG_ENV_SIZE		0x4200
-#define CONFIG_BOOTCOMMAND	"cp.b 0xC003DE00 0x22000000 0x200040; bootm"
+#define CONFIG_BOOTCOMMAND	"cp.b 0xC0042000 0x22000000 0x210000; bootm"
 #define CONFIG_BOOTARGS		"console=ttyS0,115200 " \
 				"root=/dev/mtdblock0 " \
 				"mtdparts=at91_nand:-(root) "\
@@ -155,7 +155,7 @@
 #define CFG_ENV_OFFSET		0x4200
 #define CFG_ENV_ADDR		(CFG_DATAFLASH_LOGIC_ADDR_CS1 + CFG_ENV_OFFSET)
 #define CFG_ENV_SIZE		0x4200
-#define CONFIG_BOOTCOMMAND	"cp.b 0xD003DE00 0x22000000 0x200040; bootm"
+#define CONFIG_BOOTCOMMAND	"cp.b 0xD0042000 0x22000000 0x210000; bootm"
 #define CONFIG_BOOTARGS		"console=ttyS0,115200 " \
 				"root=/dev/mtdblock0 " \
 				"mtdparts=at91_nand:-(root) "\
Signature · 1 line
1.5.3.3
#19 lore raw

PATCH 9/21 AT91SAM9261EK support

In reply to Stelian Pop
---
 MAINTAINERS                                        |    1 +
 MAKEALL                                            |    1 +
 Makefile                                           |    3 +
 board/atmel/at91sam9261ek/Makefile                 |   53 ++++++
 board/atmel/at91sam9261ek/at91sam9261ek.c          |  194 ++++++++++++++++++++
 board/atmel/at91sam9261ek/config.mk                |    1 +
 board/atmel/at91sam9261ek/led.c                    |   78 ++++++++
 board/atmel/at91sam9261ek/nand.c                   |   79 ++++++++
 board/atmel/at91sam9261ek/partition.c              |   38 ++++
 board/atmel/at91sam9261ek/u-boot.lds               |   57 ++++++
 cpu/arm926ejs/at91sam9/usb.c                       |    8 +
 drivers/net/dm9000x.c                              |    2 +
 include/asm-arm/arch-at91sam9/at91sam9261.h        |  105 +++++++++++
 include/asm-arm/arch-at91sam9/at91sam9261_matrix.h |   62 +++++++
 include/asm-arm/arch-at91sam9/hardware.h           |    3 +
 include/configs/at91sam9261ek.h                    |  189 +++++++++++++++++++
 16 files changed, 874 insertions(+), 0 deletions(-)
 create mode 100644 board/atmel/at91sam9261ek/Makefile
 create mode 100644 board/atmel/at91sam9261ek/at91sam9261ek.c
 create mode 100644 board/atmel/at91sam9261ek/config.mk
 create mode 100644 board/atmel/at91sam9261ek/led.c
 create mode 100644 board/atmel/at91sam9261ek/nand.c
 create mode 100644 board/atmel/at91sam9261ek/partition.c
 create mode 100644 board/atmel/at91sam9261ek/u-boot.lds
 create mode 100644 include/asm-arm/arch-at91sam9/at91sam9261.h
 create mode 100644 include/asm-arm/arch-at91sam9/at91sam9261_matrix.h
 create mode 100644 include/configs/at91sam9261ek.h
MAINTAINERS +1 -0
index 58f833c..26f31fd 100644
@@ -538,6 +538,7 @@ Stelian Pop <[email protected]>
 
 	at91cap9adk		ARM926EJS (AT91CAP9 SoC)
 	at91sam9260ek		ARM926EJS (AT91SAM9260 SoC)
+	at91sam9261ek		ARM926EJS (AT91SAM9261 SoC)
 
 Stefan Roese <[email protected]>
 
MAKEALL +1 -0
index 38911ed..251da90 100755
@@ -458,6 +458,7 @@ LIST_ARM9="			\
 	at91cap9adk		\
 	at91rm9200dk		\
 	at91sam9260ek		\
+	at91sam9261ek		\
 	cmc_pu2			\
 	ap920t			\
 	ap922_XA10		\
Makefile +3 -0
index 167a717..5e06ff5 100644
@@ -2326,6 +2326,9 @@ shannon_config	:	unconfig
 at91rm9200dk_config	:	unconfig
 	@$(MKCONFIG) $(@:_config=) arm arm920t at91rm9200dk atmel at91rm9200
 
+at91sam9261ek_config	:	unconfig
+	@$(MKCONFIG) $(@:_config=) arm arm926ejs at91sam9261ek atmel at91sam9
+
 cmc_pu2_config	:	unconfig
 	@$(MKCONFIG) $(@:_config=) arm arm920t cmc_pu2 NULL at91rm9200
 
board/atmel/at91sam9261ek/Makefile new file +53 -0

53 lines not on this page · raw message

board/atmel/at91sam9261ek/at91sam9261ek.c new file +194 -0

194 lines not on this page · raw message

board/atmel/at91sam9261ek/config.mk new file +1 -0
new file mode 100644
index 0000000..ff2cfd1
@@ -0,0 +1 @@
+TEXT_BASE = 0x23f00000
board/atmel/at91sam9261ek/led.c new file +78 -0

78 lines not on this page · raw message

board/atmel/at91sam9261ek/nand.c new file +79 -0

79 lines not on this page · raw message

board/atmel/at91sam9261ek/partition.c new file +38 -0
new file mode 100644
index 0000000..a8a5fe6
@@ -0,0 +1,38 @@
+/*
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ */
+#include <common.h>
+#include <config.h>
+#include <asm/hardware.h>
+#include <dataflash.h>
+
+AT91S_DATAFLASH_INFO dataflash_info[CFG_MAX_DATAFLASH_BANKS];
+
+struct dataflash_addr cs[CFG_MAX_DATAFLASH_BANKS] = {
+	{CFG_DATAFLASH_LOGIC_ADDR_CS0, 0},	/* Logical adress, CS */
+	{CFG_DATAFLASH_LOGIC_ADDR_CS3, 3}
+};
+
+/*define the area offsets*/
+dataflash_protect_t area_list[NB_DATAFLASH_AREA] = {
+	{0x00000000, 0x000041FF, FLAG_PROTECT_SET,   0, "Bootstrap"},
+	{0x00004200, 0x000083FF, FLAG_PROTECT_CLEAR, 0, "Environment"},
+	{0x00008400, 0x00041FFF, FLAG_PROTECT_SET,   0, "U-Boot"},
+	{0x00042000, 0x00251FFF, FLAG_PROTECT_CLEAR, 0,	"Kernel"},
+	{0x00252000, 0xFFFFFFFF, FLAG_PROTECT_CLEAR, 0,	"FS"},
+};
board/atmel/at91sam9261ek/u-boot.lds new file +57 -0

57 lines not on this page · raw message

cpu/arm926ejs/at91sam9/usb.c +8 -0
index d678897..92dcafb 100644
@@ -33,7 +33,11 @@ int usb_cpu_init(void)
 {
 	/* Enable USB host clock. */
 	at91_sys_write(AT91_PMC_PCER, 1 << AT91_ID_UHP);
+#ifdef CONFIG_AT91SAM9261
+	at91_sys_write(AT91_PMC_SCER, AT91_PMC_UHP | AT91_PMC_HCK0);
+#else
 	at91_sys_write(AT91_PMC_SCER, AT91_PMC_UHP);
+#endif
 
 	return 0;
 }
@@ -42,7 +46,11 @@ int usb_cpu_stop(void)
 {
 	/* Disable USB host clock. */
 	at91_sys_write(AT91_PMC_PCDR, 1 << AT91_ID_UHP);
+#ifdef CONFIG_AT91SAM9261
+	at91_sys_write(AT91_PMC_SCDR, AT91_PMC_UHP | AT91_PMC_HCK0);
+#else
 	at91_sys_write(AT91_PMC_SCDR, AT91_PMC_UHP);
+#endif
 	return 0;
 }
 
drivers/net/dm9000x.c +2 -0
index 6131b5c..db6d3bd 100644
@@ -300,8 +300,10 @@ eth_init(bd_t * bd)
 	DM9000_iow(DM9000_ISR, 0x0f);	/* Clear interrupt status */
 
 	/* Set Node address */
+#ifndef CONFIG_AT91SAM9261EK
 	for (i = 0; i < 6; i++)
 		((u16 *) bd->bi_enetaddr)[i] = read_srom_word(i);
+#endif
 
 	if (is_zero_ether_addr(bd->bi_enetaddr) ||
 	    is_multicast_ether_addr(bd->bi_enetaddr)) {
include/asm-arm/arch-at91sam9/at91sam9261.h new file +105 -0

105 lines not on this page · raw message

include/asm-arm/arch-at91sam9/at91sam9261_matrix.h new file +62 -0

62 lines not on this page · raw message

include/asm-arm/arch-at91sam9/hardware.h +3 -0
index 80b334f..d56f72d 100644
@@ -26,6 +26,9 @@
 #define AT91_PMC_UHP	AT91SAM926x_PMC_UHP
 #elif defined(CONFIG_AT91SAM9261)
 #include <asm/arch/at91sam9261.h>
+#define AT91_BASE_SPI	AT91SAM9261_BASE_SPI0
+#define AT91_ID_UHP	AT91SAM9261_ID_UHP
+#define AT91_PMC_UHP	AT91SAM926x_PMC_UHP
 #elif defined(CONFIG_AT91SAM9263)
 #include <asm/arch/at91sam9263.h>
 #elif defined(CONFIG_AT91SAM9RL)
include/configs/at91sam9261ek.h new file +189 -0

189 lines not on this page · raw message

Signature · 1 line
1.5.3.3
#20 lore raw

PATCH 9/21 AT91SAM9261EK support

board/atmel/at91sam9261ek/Makefile line 3

Quoted 10 lines · In message <[email protected]> you wrote:
board/atmel/at91sam9261ek/Makefile new file +3 -0
new file mode 100644
index 0000000..5e4904c
@@ -0,0 +1,53 @@
+#
+# (C) Copyright 2003-2008
+# Wolfgang Denk, DENX Software Engineering, wd <at> denx.de.

Your (C) missing, mine is mangled again. Please fix.

board/atmel/at91sam9261ek/partition.c line 6

Quoted 12 lines
board/atmel/at91sam9261ek/partition.c new file +6 -0
new file mode 100644
index 0000000..a8a5fe6
@@ -0,0 +1,38 @@
+/*
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.

(C) missing.

board/atmel/at91sam9261ek/u-boot.lds line 3

Quoted 9 lines
board/atmel/at91sam9261ek/u-boot.lds new file +3 -0
new file mode 100644
index 0000000..05a6d83
@@ -0,0 +1,57 @@
+/*
+ * (C) Copyright 2002
+ * Gary Jennejohn, DENX Software Engineering, <gj <at> denx.de>

Please add your own (C), and don't meddle with Gary's.

include/asm-arm/arch-at91sam9/at91sam9261.h line 4

Quoted 10 lines
include/asm-arm/arch-at91sam9/at91sam9261.h new file +4 -0
new file mode 100644
index 0000000..c7c4778
@@ -0,0 +1,105 @@
+/*
+ * include/asm-arm/arch-at91/at91sam9261.h
+ *
+ * Copyright (C) SAN People

Who exactly is "SAN People" ?

include/asm-arm/arch-at91sam9/at91sam9261_matrix.h line 5

Quoted 11 lines
include/asm-arm/arch-at91sam9/at91sam9261_matrix.h new file +5 -0
new file mode 100644
index 0000000..6f07242
@@ -0,0 +1,62 @@
+/*
+ * include/asm-arm/arch-at91/at91sam9261_matrix.h
+ *
+ * Memory Controllers (MATRIX, EBI) - System peripherals registers.
+ * Based on AT91SAM9261 datasheet revision D.

(C) missing.

include/asm-arm/arch-at91sam9/at91sam9261_matrix.h line 18

Quoted 12 lines
include/asm-arm/arch-at91sam9/at91sam9261_matrix.h new file +12 -0
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#ifndef AT91SAM9261_MATRIX_H
+#define AT91SAM9261_MATRIX_H
+
+#define AT91_MATRIX_MCFG	(AT91_MATRIX + 0x00)	/* Master Configuration Register */
+#define		AT91_MATRIX_RCB0	(1 << 0)		/* Remap Command for AHB Master 0 (ARM926EJ-S Instruction Master) */
+#define		AT91_MATRIX_RCB1	(1 << 1)		/* Remap Command for AHB Master 1 (ARM926EJ-S Data Master) */

Line length!!!

Quoted 5 lines
include/configs/at91sam9261ek.h new file +0 -0
new file mode 100644
index 0000000..cdafed3

...

include/configs/at91sam9261ek.h line 161

Quoted 3 lines
include/configs/at91sam9261ek.h new file +3 -0
+#define CONFIG_BOOTARGS		"console=ttyS0,115200 " \
+				"root=/dev/mtdblock5 " \
+				"mtdparts=at91_nand:128k(bootstrap)ro,256k(uboot)ro,128k(env1)ro,128k(env2)ro,2M(linux),-(root) " \

Line length!!!

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
A well-written program is its own heaven; a poorly-written program is
its own hell.             -- Geoffrey James, "The Tao of Programming"
#21 lore raw

PATCH 9/21 AT91SAM9261EK support

Le mardi 06 mai 2008 ? 21:33 +0200, Wolfgang Denk a ?crit :

Quoted 11 lines

board/atmel/at91sam9261ek/u-boot.lds line 3

Quoted 9 lines
board/atmel/at91sam9261ek/u-boot.lds new file +3 -0
new file mode 100644
index 0000000..05a6d83
@@ -0,0 +1,57 @@
+/*
+ * (C) Copyright 2002
+ * Gary Jennejohn, DENX Software Engineering, <gj <at> denx.de>

Please add your own (C), and don't meddle with Gary's.

I did not modify this file, merely copied it verbatim from board/atmel/at91cap9adk, which in turn was copied from board/atmel/at91rm9200dk. So I see no reason to add my own copyright.

As for the mangle, see my other mail on the subject.

Quoted 4 lines
Quoted 4 lines
include/asm-arm/arch-at91sam9/at91sam9261.h new file +0 -1
new file mode 100644
index 0000000..c7c4778
--- /dev/null
Quoted 8 lines

include/asm-arm/arch-at91sam9/at91sam9261.h line 4

Quoted 6 lines

+++ b/include/asm-arm/arch-at91sam9/at91sam9261.h

include/asm-arm/arch-at91sam9/at91sam9261.h new file +4 -0
@@ -0,0 +1,105 @@
+/*
+ * include/asm-arm/arch-at91/at91sam9261.h
+ *
+ * Copyright (C) SAN People

Who exactly is "SAN People" ?

The at91sam9261.h and at91sam9261_matrix.h are verbatim copies of the header files of the Linux kernel.

For example:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=include/asm-arm/arch-at91/at91sam9261.h;h=c7c4778dac49bed468e44eab6a23a32dd468789a;hb=HEAD

Quoted 5 lines
Quoted 5 lines
include/asm-arm/arch-at91sam9/at91sam9261_matrix.h new file +0 -0
new file mode 100644
index 0000000..6f07242
Quoted 8 lines

include/asm-arm/arch-at91sam9/at91sam9261_matrix.h line 5

Quoted 6 lines
include/asm-arm/arch-at91sam9/at91sam9261_matrix.h new file +5 -0
@@ -0,0 +1,62 @@
+/*
+ * include/asm-arm/arch-at91/at91sam9261_matrix.h
+ *
+ * Memory Controllers (MATRIX, EBI) - System peripherals registers.
+ * Based on AT91SAM9261 datasheet revision D.

(C) missing.

ditto.

Quoted 15 lines

include/asm-arm/arch-at91sam9/at91sam9261_matrix.h line 18

Quoted 13 lines
include/asm-arm/arch-at91sam9/at91sam9261_matrix.h new file +12 -0
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#ifndef AT91SAM9261_MATRIX_H
+#define AT91SAM9261_MATRIX_H
+
+#define AT91_MATRIX_MCFG	(AT91_MATRIX + 0x00)	/* Master Configuration Register */
+#define		AT91_MATRIX_RCB0	(1 << 0)		/* Remap Command for AHB Master 0 (ARM926EJ-S Instruction Master) */
+#define		AT91_MATRIX_RCB1	(1 << 1)		/* Remap Command for AHB Master 1 (ARM926EJ-S Data Master) */

Line length!!!

No, I won't change this one. For maintenance reasons it is better to keep it identical to the kernel file.

Stelian.

Signature · 1 line
Stelian Pop <[email protected]>
#22 lore raw

PATCH 9/21 AT91SAM9261EK support

Quoted 9 lines · In message <1210105131.25356.61.camel@galileo> you wrote:
Quoted 5 lines
Quoted 3 lines

+ * (C) Copyright 2002
+ * Gary Jennejohn, DENX Software Engineering, <gj <at> denx.de>

Please add your own (C), and don't meddle with Gary's.

I did not modify this file, merely copied it verbatim from board/atmel/at91cap9adk, which in turn was copied from board/atmel/at91rm9200dk. So I see no reason to add my own copyright.

If it's just copuied without changes, it's time to factor it out.

Quoted 1 line

As for the mangle, see my other mail on the subject.

Understood, but needs to be fixed.

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

+ * Copyright (C) SAN People

Who exactly is "SAN People" ?

The at91sam9261.h and at91sam9261_matrix.h are verbatim copies of the header files of the Linux kernel.

This explains where the file is coming from, but does not answer my question.

Quoted 11 lines
Quoted 9 lines

include/asm-arm/arch-at91sam9/at91sam9261_matrix.h line 5

Quoted 7 lines

+++ b/include/asm-arm/arch-at91sam9/at91sam9261_matrix.h

include/asm-arm/arch-at91sam9/at91sam9261_matrix.h new file +5 -0
@@ -0,0 +1,62 @@
+/*
+ * include/asm-arm/arch-at91/at91sam9261_matrix.h
+ *
+ * Memory Controllers (MATRIX, EBI) - System peripherals registers.
+ * Based on AT91SAM9261 datasheet revision D.

(C) missing.

ditto.

Maybe. It's still missing.

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 human race has one really effective weapon, and that is laughter.
                                                         - Mark Twain
#23 lore raw

PATCH 9/21 AT91SAM9261EK support

Le mardi 06 mai 2008 ? 23:14 +0200, Wolfgang Denk a ?crit :

Quoted 5 lines
Quoted 4 lines · In message <1210105131.25356.61.camel@galileo> you wrote:
Quoted 4 lines
Quoted 3 lines

+ * (C) Copyright 2002
+ * Gary Jennejohn, DENX Software Engineering, <gj <at> denx.de>

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

Please add your own (C), and don't meddle with Gary's.

I did not modify this file, merely copied it verbatim from board/atmel/at91cap9adk, which in turn was copied from board/atmel/at91rm9200dk. So I see no reason to add my own copyright.

If it's just copuied without changes, it's time to factor it out.

Isn't every board supposed to have a u-boot.lds file ? How could I factor these out ?

Quoted 4 lines
Quoted 2 lines

As for the mangle, see my other mail on the subject.

Understood, but needs to be fixed.

I'll submit a patch for this.

Quoted 9 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line

+ * Copyright (C) SAN People

Who exactly is "SAN People" ?

The at91sam9261.h and at91sam9261_matrix.h are verbatim copies of the header files of the Linux kernel.

This explains where the file is coming from, but does not answer my question.

I think SAN is the former employer of Andrew Victor, the AT91 kernel maintainer.

Quoted 10 lines
Quoted 10 lines
Quoted 9 lines

include/asm-arm/arch-at91sam9/at91sam9261_matrix.h line 5

Quoted 7 lines

+++ b/include/asm-arm/arch-at91sam9/at91sam9261_matrix.h

include/asm-arm/arch-at91sam9/at91sam9261_matrix.h new file +5 -0
@@ -0,0 +1,62 @@
+/*
+ * include/asm-arm/arch-at91/at91sam9261_matrix.h
+ *
+ * Memory Controllers (MATRIX, EBI) - System peripherals registers.
+ * Based on AT91SAM9261 datasheet revision D.

(C) missing.

Quoted 3 lines
Quoted 1 line

ditto.

Maybe. It's still missing.

And what am I supposed to do ?

Signature · 1 line
Stelian Pop <[email protected]>
#24 lore raw

PATCH 9/21 AT91SAM9261EK support

Hello Stelian,

To be able to compile for at91sam9261-ek we need a logo called atmel.bmp. This bitmap is not available in the tree, so build fails. (There is, however, a denx.bmp)

The bitmap is also a binary file, so difficult to handle with patches. Have you any idea how to solve this?

Kind Regards,

Remy

2008/5/6 Stelian Pop <[email protected]>:

Quoted 74 lines

Le mardi 06 mai 2008 ? 23:14 +0200, Wolfgang Denk a ?crit :

Quoted 5 lines
Quoted 4 lines · In message <1210105131.25356.61.camel@galileo> you wrote:
Quoted 4 lines
Quoted 3 lines

+ * (C) Copyright 2002
+ * Gary Jennejohn, DENX Software Engineering, <gj <at> denx.de>

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

Please add your own (C), and don't meddle with Gary's.

I did not modify this file, merely copied it verbatim from board/atmel/at91cap9adk, which in turn was copied from board/atmel/at91rm9200dk. So I see no reason to add my own copyright.

If it's just copuied without changes, it's time to factor it out.

Isn't every board supposed to have a u-boot.lds file ? How could I factor these out ?

Quoted 4 lines
Quoted 2 lines

As for the mangle, see my other mail on the subject.

Understood, but needs to be fixed.

I'll submit a patch for this.

Quoted 9 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line

+ * Copyright (C) SAN People

Who exactly is "SAN People" ?

The at91sam9261.h and at91sam9261_matrix.h are verbatim copies of the header files of the Linux kernel.

This explains where the file is coming from, but does not answer my question.

I think SAN is the former employer of Andrew Victor, the AT91 kernel maintainer.

Quoted 10 lines
Quoted 10 lines
Quoted 9 lines

include/asm-arm/arch-at91sam9/at91sam9261_matrix.h line 5

Quoted 7 lines

+++ b/include/asm-arm/arch-at91sam9/at91sam9261_matrix.h

include/asm-arm/arch-at91sam9/at91sam9261_matrix.h new file +5 -0
@@ -0,0 +1,62 @@
+/*
+ * include/asm-arm/arch-at91/at91sam9261_matrix.h
+ *
+ * Memory Controllers (MATRIX, EBI) - System peripherals registers.
+ * Based on AT91SAM9261 datasheet revision D.

(C) missing.

Quoted 3 lines
Quoted 1 line

ditto.

Maybe. It's still missing.

And what am I supposed to do ?

--
Stelian Pop <[email protected]>

-------------------------------------------------------------------------

This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
U-Boot-Users mailing list
U-Boot-Users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users

#25 lore raw

PATCH 9/21 AT91SAM9261EK support

Le mercredi 07 mai 2008 ? 10:25 +0200, Remy Bohmer a ?crit :

Quoted 8 lines

Hello Stelian,

To be able to compile for at91sam9261-ek we need a logo called atmel.bmp. This bitmap is not available in the tree, so build fails. (There is, however, a denx.bmp)

The bitmap is also a binary file, so difficult to handle with patches. Have you any idea how to solve this?

The patch "[PATCH 19/21] Use custom logo for Atmel boards" is a git patch containing the binary bitmap. If you use git-am to apply the patch it should handle this fine.

Otherwise, if you use plain 'patch' it will ignore the binary file.

For the time being, either use git to apply the patch or revert the whole patch 19/21 (so the standard u-boot bmp will be used).

Signature · 1 line
Stelian Pop <[email protected]>
#26 lore raw

PATCH 9/21 AT91SAM9261EK support

In reply to Remy Bohmer

Hello Stelian,

To be able to compile for at91sam9261-ek we need a logo called atmel.bmp. This bitmap is not available in the tree, so build fails. (There is, however, a denx.bmp)

The bitmap is also a binary file, so difficult to handle with patches. Have you any idea how to solve this?

Kind Regards,
Remy

==> Is this not for the custodians to sort out as a special case?
Can't you just send a binary as an attachement and have this included in the mainstream?

An alternative would be to convert the bitmap to a non-binary file which can be used as data to a utility generating the binary during the build

Best Regards
Ulf Samuelsson

#27 lore raw

PATCH 9/21 AT91SAM9261EK support

Quoted 3 lines · In message <[email protected]> you wrote:

The bitmap is also a binary file, so difficult to handle with patches. Have you any idea how to solve this?

Use git. Git handles binary blobs just fine.

Quoted 1 line

==> Is this not for the custodians to sort out as a special case?

It is not a special case. A binary image is just another file type which can be processed using git tools.

Quoted 6 lines

Can't you just send a binary as an attachement and have this
included in the mainstream?

An alternative would be to convert the bitmap to a non-binary file which can be used as data to a utility generating the binary during the build

None of this is necessary.

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
Without freedom of choice there is no creativity.
	-- Kirk, "The return of the Archons", stardate 3157.4
#28 lore raw

PATCH 10/21 AT91SAM9263EK support

In reply to Stelian Pop
---
 MAINTAINERS                                        |    1 +
 MAKEALL                                            |    1 +
 Makefile                                           |    3 +
 board/atmel/at91sam9263ek/Makefile                 |   53 +++++
 board/atmel/at91sam9263ek/at91sam9263ek.c          |  240 ++++++++++++++++++++
 board/atmel/at91sam9263ek/config.mk                |    1 +
 board/atmel/at91sam9263ek/led.c                    |   78 +++++++
 board/atmel/at91sam9263ek/nand.c                   |   79 +++++++
 board/atmel/at91sam9263ek/partition.c              |   37 +++
 board/atmel/at91sam9263ek/u-boot.lds               |   57 +++++
 drivers/net/macb.c                                 |    6 +-
 include/asm-arm/arch-at91sam9/at91sam9263.h        |  127 +++++++++++
 include/asm-arm/arch-at91sam9/at91sam9263_matrix.h |  129 +++++++++++
 include/asm-arm/arch-at91sam9/hardware.h           |    4 +
 include/configs/at91sam9263ek.h                    |  195 ++++++++++++++++
 net/eth.c                                          |    3 +-
 16 files changed, 1011 insertions(+), 3 deletions(-)
 create mode 100644 board/atmel/at91sam9263ek/Makefile
 create mode 100644 board/atmel/at91sam9263ek/at91sam9263ek.c
 create mode 100644 board/atmel/at91sam9263ek/config.mk
 create mode 100644 board/atmel/at91sam9263ek/led.c
 create mode 100644 board/atmel/at91sam9263ek/nand.c
 create mode 100644 board/atmel/at91sam9263ek/partition.c
 create mode 100644 board/atmel/at91sam9263ek/u-boot.lds
 create mode 100644 include/asm-arm/arch-at91sam9/at91sam9263.h
 create mode 100644 include/asm-arm/arch-at91sam9/at91sam9263_matrix.h
 create mode 100644 include/configs/at91sam9263ek.h
MAINTAINERS +1 -0
index 26f31fd..84bf19f 100644
@@ -539,6 +539,7 @@ Stelian Pop <[email protected]>
 	at91cap9adk		ARM926EJS (AT91CAP9 SoC)
 	at91sam9260ek		ARM926EJS (AT91SAM9260 SoC)
 	at91sam9261ek		ARM926EJS (AT91SAM9261 SoC)
+	at91sam9263ek		ARM926EJS (AT91SAM9263 SoC)
 
 Stefan Roese <[email protected]>
 
MAKEALL +1 -0
index 251da90..29aa7fc 100755
@@ -459,6 +459,7 @@ LIST_ARM9="			\
 	at91rm9200dk		\
 	at91sam9260ek		\
 	at91sam9261ek		\
+	at91sam9263ek		\
 	cmc_pu2			\
 	ap920t			\
 	ap922_XA10		\
Makefile +3 -0
index 5e06ff5..65ef6c2 100644
@@ -2329,6 +2329,9 @@ at91rm9200dk_config	:	unconfig
 at91sam9261ek_config	:	unconfig
 	@$(MKCONFIG) $(@:_config=) arm arm926ejs at91sam9261ek atmel at91sam9
 
+at91sam9263ek_config	:	unconfig
+	@$(MKCONFIG) $(@:_config=) arm arm926ejs at91sam9263ek atmel at91sam9
+
 cmc_pu2_config	:	unconfig
 	@$(MKCONFIG) $(@:_config=) arm arm920t cmc_pu2 NULL at91rm9200
 
board/atmel/at91sam9263ek/Makefile new file +53 -0

53 lines not on this page · raw message

board/atmel/at91sam9263ek/at91sam9263ek.c new file +240 -0

240 lines not on this page · raw message

board/atmel/at91sam9263ek/config.mk new file +1 -0
new file mode 100644
index 0000000..ff2cfd1
@@ -0,0 +1 @@
+TEXT_BASE = 0x23f00000
board/atmel/at91sam9263ek/led.c new file +78 -0

78 lines not on this page · raw message

board/atmel/at91sam9263ek/nand.c new file +79 -0

79 lines not on this page · raw message

board/atmel/at91sam9263ek/partition.c new file +37 -0
new file mode 100644
index 0000000..3bffd71
@@ -0,0 +1,37 @@
+/*
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ */
+#include <common.h>
+#include <config.h>
+#include <asm/hardware.h>
+#include <dataflash.h>
+
+AT91S_DATAFLASH_INFO dataflash_info[CFG_MAX_DATAFLASH_BANKS];
+
+struct dataflash_addr cs[CFG_MAX_DATAFLASH_BANKS] = {
+	{CFG_DATAFLASH_LOGIC_ADDR_CS0, 0},	/* Logical adress, CS */
+};
+
+/*define the area offsets*/
+dataflash_protect_t area_list[NB_DATAFLASH_AREA] = {
+	{0x00000000, 0x000041FF, FLAG_PROTECT_SET,   0, "Bootstrap"},
+	{0x00004200, 0x000083FF, FLAG_PROTECT_CLEAR, 0, "Environment"},
+	{0x00008400, 0x00041FFF, FLAG_PROTECT_SET,   0, "U-Boot"},
+	{0x00042000, 0x00251FFF, FLAG_PROTECT_CLEAR, 0,	"Kernel"},
+	{0x00252000, 0xFFFFFFFF, FLAG_PROTECT_CLEAR, 0,	"FS"},
+};
board/atmel/at91sam9263ek/u-boot.lds new file +57 -0

57 lines not on this page · raw message

drivers/net/macb.c +4 -2
index 703784e..e5733f6 100644
@@ -417,13 +417,15 @@ static int macb_init(struct eth_device *netdev, bd_t *bd)
 
 	/* choose RMII or MII mode. This depends on the board */
 #ifdef CONFIG_RMII
-#if defined(CONFIG_AT91CAP9) || defined(CONFIG_AT91SAM9260)
+#if defined(CONFIG_AT91CAP9) || defined(CONFIG_AT91SAM9260) || \
+    defined(CONFIG_AT91SAM9263)
 	macb_writel(macb, USRIO, MACB_BIT(RMII) | MACB_BIT(CLKEN));
 #else
 	macb_writel(macb, USRIO, 0);
 #endif
 #else
-#if defined(CONFIG_AT91CAP9) || defined(CONFIG_AT91SAM9260)
+#if defined(CONFIG_AT91CAP9) || defined(CONFIG_AT91SAM9260) || \
+    defined(CONFIG_AT91SAM9263)
 	macb_writel(macb, USRIO, MACB_BIT(CLKEN));
 #else
 	macb_writel(macb, USRIO, MACB_BIT(MII));
include/asm-arm/arch-at91sam9/at91sam9263.h new file +127 -0

127 lines not on this page · raw message

include/asm-arm/arch-at91sam9/at91sam9263_matrix.h new file +129 -0

129 lines not on this page · raw message

include/asm-arm/arch-at91sam9/hardware.h +4 -0
index d56f72d..a5d8293 100644
@@ -31,6 +31,10 @@
 #define AT91_PMC_UHP	AT91SAM926x_PMC_UHP
 #elif defined(CONFIG_AT91SAM9263)
 #include <asm/arch/at91sam9263.h>
+#define AT91_BASE_EMAC	AT91SAM9263_BASE_EMAC
+#define AT91_BASE_SPI	AT91SAM9263_BASE_SPI0
+#define AT91_ID_UHP	AT91SAM9263_ID_UHP
+#define AT91_PMC_UHP	AT91SAM926x_PMC_UHP
 #elif defined(CONFIG_AT91SAM9RL)
 #include <asm/arch/at91sam9rl.h>
 #elif defined(CONFIG_AT91CAP9)
include/configs/at91sam9263ek.h new file +195 -0

195 lines not on this page · raw message

net/eth.c +2 -1
index c4f24c6..21d1496 100644
@@ -288,7 +288,8 @@ int eth_initialize(bd_t *bis)
 #if defined(CONFIG_FSLDMAFEC)
 	mcdmafec_initialize(bis);
 #endif
-#if defined(CONFIG_AT91CAP9) || defined(CONFIG_AT91SAM9260)
+#if defined(CONFIG_AT91CAP9) || defined(CONFIG_AT91SAM9260) || \
+    defined(CONFIG_AT91SAM9263)
 	at91sam9_eth_initialize(bis);
 #endif
 
Signature · 1 line
1.5.3.3
#29 lore raw

PATCH 10/21 AT91SAM9263EK support

board/atmel/at91sam9263ek/Makefile line 3

Quoted 10 lines · In message <[email protected]> you wrote:
board/atmel/at91sam9263ek/Makefile new file +3 -0
new file mode 100644
index 0000000..3ded315
@@ -0,0 +1,53 @@
+#
+# (C) Copyright 2003-2008
+# Wolfgang Denk, DENX Software Engineering, wd <at> denx.de.

Please add your own (C), and don't mess with mine.

board/atmel/at91sam9263ek/partition.c line 6

Quoted 12 lines
board/atmel/at91sam9263ek/partition.c new file +6 -0
new file mode 100644
index 0000000..3bffd71
@@ -0,0 +1,37 @@
+/*
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.

(C) missing.

board/atmel/at91sam9263ek/u-boot.lds line 3

Quoted 9 lines
board/atmel/at91sam9263ek/u-boot.lds new file +3 -0
new file mode 100644
index 0000000..05a6d83
@@ -0,0 +1,57 @@
+/*
+ * (C) Copyright 2002
+ * Gary Jennejohn, DENX Software Engineering, <gj <at> denx.de>

Please add your own (C), and don't mess with Gary's.

Quoted 5 lines
include/configs/at91sam9263ek.h new file +0 -0
new file mode 100644
index 0000000..e2ffbbe

...

include/configs/at91sam9263ek.h line 167

Quoted 3 lines
include/configs/at91sam9263ek.h new file +3 -0
+#define CONFIG_BOOTARGS		"console=ttyS0,115200 " \
+				"root=/dev/mtdblock5 " \
+				"mtdparts=at91_nand:128k(bootstrap)ro,256k(uboot)ro,128k(env1)ro,128k(env2)ro,2M(linux),-(root) " \

Line length!

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've already got a female to worry about. Her name is the Enterprise.
	-- Kirk, "The Corbomite Maneuver", stardate 1514.0
#30 lore raw

PATCH 11/21 AT91SAM9RLEK support

In reply to Stelian Pop
---
 MAINTAINERS                                       |    1 +
 MAKEALL                                           |    1 +
 Makefile                                          |    3 +
 board/atmel/at91sam9rlek/Makefile                 |   53 +++++++
 board/atmel/at91sam9rlek/at91sam9rlek.c           |  152 +++++++++++++++++++
 board/atmel/at91sam9rlek/config.mk                |    1 +
 board/atmel/at91sam9rlek/led.c                    |   77 ++++++++++
 board/atmel/at91sam9rlek/nand.c                   |   79 ++++++++++
 board/atmel/at91sam9rlek/partition.c              |   37 +++++
 board/atmel/at91sam9rlek/u-boot.lds               |   57 +++++++
 include/asm-arm/arch-at91sam9/at91sam9rl.h        |  115 ++++++++++++++
 include/asm-arm/arch-at91sam9/at91sam9rl_matrix.h |   96 ++++++++++++
 include/asm-arm/arch-at91sam9/hardware.h          |    2 +
 include/configs/at91sam9rlek.h                    |  164 +++++++++++++++++++++
 14 files changed, 838 insertions(+), 0 deletions(-)
 create mode 100644 board/atmel/at91sam9rlek/Makefile
 create mode 100644 board/atmel/at91sam9rlek/at91sam9rlek.c
 create mode 100644 board/atmel/at91sam9rlek/config.mk
 create mode 100644 board/atmel/at91sam9rlek/led.c
 create mode 100644 board/atmel/at91sam9rlek/nand.c
 create mode 100644 board/atmel/at91sam9rlek/partition.c
 create mode 100644 board/atmel/at91sam9rlek/u-boot.lds
 create mode 100644 include/asm-arm/arch-at91sam9/at91sam9rl.h
 create mode 100644 include/asm-arm/arch-at91sam9/at91sam9rl_matrix.h
 create mode 100644 include/configs/at91sam9rlek.h
MAINTAINERS +1 -0
index 84bf19f..2047af0 100644
@@ -540,6 +540,7 @@ Stelian Pop <[email protected]>
 	at91sam9260ek		ARM926EJS (AT91SAM9260 SoC)
 	at91sam9261ek		ARM926EJS (AT91SAM9261 SoC)
 	at91sam9263ek		ARM926EJS (AT91SAM9263 SoC)
+	at91sam9rlek		ARM926EJS (AT91SAM9RL SoC)
 
 Stefan Roese <[email protected]>
 
MAKEALL +1 -0
index 29aa7fc..62ff019 100755
@@ -460,6 +460,7 @@ LIST_ARM9="			\
 	at91sam9260ek		\
 	at91sam9261ek		\
 	at91sam9263ek		\
+	at91sam9rlek		\
 	cmc_pu2			\
 	ap920t			\
 	ap922_XA10		\
Makefile +3 -0
index 65ef6c2..50f61c1 100644
@@ -2332,6 +2332,9 @@ at91sam9261ek_config	:	unconfig
 at91sam9263ek_config	:	unconfig
 	@$(MKCONFIG) $(@:_config=) arm arm926ejs at91sam9263ek atmel at91sam9
 
+at91sam9rlek_config	:	unconfig
+	@$(MKCONFIG) $(@:_config=) arm arm926ejs at91sam9rlek atmel at91sam9
+
 cmc_pu2_config	:	unconfig
 	@$(MKCONFIG) $(@:_config=) arm arm920t cmc_pu2 NULL at91rm9200
 
board/atmel/at91sam9rlek/Makefile new file +53 -0

53 lines not on this page · raw message

board/atmel/at91sam9rlek/at91sam9rlek.c new file +152 -0

152 lines not on this page · raw message

board/atmel/at91sam9rlek/config.mk new file +1 -0
new file mode 100644
index 0000000..ff2cfd1
@@ -0,0 +1 @@
+TEXT_BASE = 0x23f00000
board/atmel/at91sam9rlek/led.c new file +77 -0

77 lines not on this page · raw message

board/atmel/at91sam9rlek/nand.c new file +79 -0

79 lines not on this page · raw message

board/atmel/at91sam9rlek/partition.c new file +37 -0
new file mode 100644
index 0000000..3bffd71
@@ -0,0 +1,37 @@
+/*
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ */
+#include <common.h>
+#include <config.h>
+#include <asm/hardware.h>
+#include <dataflash.h>
+
+AT91S_DATAFLASH_INFO dataflash_info[CFG_MAX_DATAFLASH_BANKS];
+
+struct dataflash_addr cs[CFG_MAX_DATAFLASH_BANKS] = {
+	{CFG_DATAFLASH_LOGIC_ADDR_CS0, 0},	/* Logical adress, CS */
+};
+
+/*define the area offsets*/
+dataflash_protect_t area_list[NB_DATAFLASH_AREA] = {
+	{0x00000000, 0x000041FF, FLAG_PROTECT_SET,   0, "Bootstrap"},
+	{0x00004200, 0x000083FF, FLAG_PROTECT_CLEAR, 0, "Environment"},
+	{0x00008400, 0x00041FFF, FLAG_PROTECT_SET,   0, "U-Boot"},
+	{0x00042000, 0x00251FFF, FLAG_PROTECT_CLEAR, 0,	"Kernel"},
+	{0x00252000, 0xFFFFFFFF, FLAG_PROTECT_CLEAR, 0,	"FS"},
+};
board/atmel/at91sam9rlek/u-boot.lds new file +57 -0

57 lines not on this page · raw message

include/asm-arm/arch-at91sam9/at91sam9rl.h new file +115 -0

115 lines not on this page · raw message

include/asm-arm/arch-at91sam9/at91sam9rl_matrix.h new file +96 -0

96 lines not on this page · raw message

include/asm-arm/arch-at91sam9/hardware.h +2 -0
index a5d8293..7e08602 100644
@@ -37,6 +37,8 @@
 #define AT91_PMC_UHP	AT91SAM926x_PMC_UHP
 #elif defined(CONFIG_AT91SAM9RL)
 #include <asm/arch/at91sam9rl.h>
+#define AT91_BASE_SPI	AT91SAM9RL_BASE_SPI
+#define AT91_ID_UHP	AT91SAM9RL_ID_UHP
 #elif defined(CONFIG_AT91CAP9)
 #include <asm/arch/at91cap9.h>
 #define AT91_BASE_EMAC	AT91CAP9_BASE_EMAC
include/configs/at91sam9rlek.h new file +164 -0

164 lines not on this page · raw message

Signature · 1 line
1.5.3.3
#31 lore raw

PATCH 11/21 AT91SAM9RLEK support

board/atmel/at91sam9rlek/Makefile line 3

Quoted 10 lines · In message <[email protected]> you wrote:
board/atmel/at91sam9rlek/Makefile new file +3 -0
new file mode 100644
index 0000000..f291d5e
@@ -0,0 +1,53 @@
+#
+# (C) Copyright 2003-2008
+# Wolfgang Denk, DENX Software Engineering, wd <at> denx.de.

You should add your own Copyright here. And please don't mutilate my entry - please leave this exactly as it was.

board/atmel/at91sam9rlek/partition.c line 6

Quoted 12 lines
board/atmel/at91sam9rlek/partition.c new file +6 -0
new file mode 100644
index 0000000..3bffd71
@@ -0,0 +1,37 @@
+/*
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.

Copyright entry missing.

Best regards,

Wolfgang Denk

Signature · 8 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The alternative to genuflecting before the  god  of  code-bumming  is
finding  a  better  algorithm.  It should be clear that none such was
available. If your code is too slow, you must make it faster.  If  no
better algorithm is available, you must trim cycles.
                                 - td at alice.UUCP (Tom Duff) 29 Aug 88
#32 lore raw

PATCH 11/21 AT91SAM9RLEK support

Le mardi 06 mai 2008 ? 21:26 +0200, Wolfgang Denk a ?crit :

Quoted 13 lines

board/atmel/at91sam9rlek/Makefile line 3

Quoted 10 lines · In message <[email protected]> you wrote:
board/atmel/at91sam9rlek/Makefile new file +3 -0
new file mode 100644
index 0000000..f291d5e
@@ -0,0 +1,53 @@
+#
+# (C) Copyright 2003-2008
+# Wolfgang Denk, DENX Software Engineering, wd <at> denx.de.

You should add your own Copyright here

Ok.

Quoted 2 lines

And please don't mutilate my
entry - please leave this exactly as it was.

I don't know what to say here. I suppose you're talking about the @ -> <at> replacement. This is a copy of board/atmel/at91cap9adk/Makefile, and I'm pretty sure that when I submitted the AT91CAP9 patches, the @ was there.

I think that somehow Peter Pearse converted it when applying the patches into his git tree.

Quoted 6 lines
Quoted 6 lines
board/atmel/at91sam9rlek/partition.c new file +0 -0
new file mode 100644
index 0000000..3bffd71
@@ -0,0 +1,37 @@
Quoted 8 lines

board/atmel/at91sam9rlek/partition.c line 6

Quoted 6 lines
board/atmel/at91sam9rlek/partition.c new file +6 -0
+/*
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.

Copyright entry missing.

Except that this is not mine. partition.c is a (pretty or complete, depending on the board) verbatim copy of board/atmel/at91cap9adk/partition.c, which was submitted by Ulf Samuelsson.

Signature · 1 line
Stelian Pop <[email protected]>
#33 lore raw

PATCH 12/21 Make nand_init() return the detected NAND size

In reply to Stelian Pop
---
 drivers/mtd/nand/nand.c |    3 ++-
 include/nand.h          |    2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)
drivers/mtd/nand/nand.c +2 -1
index 27b5792..c5746fe 100644
@@ -60,7 +60,7 @@ static void nand_init_chip(struct mtd_info *mtd, struct nand_chip *nand,
 
 }
 
-void nand_init(void)
+ulong nand_init(void)
 {
 	int i;
 	unsigned int size = 0;
@@ -78,6 +78,7 @@ void nand_init(void)
 	 */
 	board_nand_select_device(nand_info[nand_curr_device].priv, nand_curr_device);
 #endif
+	return size;
 }
 
 #endif
include/nand.h +1 -1
index 247d346..8f388c4 100644
@@ -32,7 +32,7 @@ typedef struct mtd_info nand_info_t;
 
 extern int nand_curr_device;
 extern nand_info_t nand_info[];
-extern void nand_init(void);
+extern ulong nand_init(void);
 
 static inline int nand_read(nand_info_t *info, off_t ofs, size_t *len, u_char *buf)
 {
Signature · 1 line
1.5.3.3
#34 lore raw

PATCH 13/21 Remeber the RAM and NAND detected sizes for later display

In reply to Stelian Pop
---
 include/asm-arm/u-boot.h |    4 ++++
 lib_arm/board.c          |   14 ++++++++------
 2 files changed, 12 insertions(+), 6 deletions(-)
include/asm-arm/u-boot.h +4 -0
index c120312..dbfe2cf 100644
@@ -48,10 +48,14 @@ typedef struct bd_info {
 	ulong start;
 	ulong size;
     } 			bi_dram[CONFIG_NR_DRAM_BANKS];
+    ulong		bi_dram_size;
 #ifdef CONFIG_HAS_ETH1
     /* second onboard ethernet port */
     unsigned char   bi_enet1addr[6];
 #endif
+#ifdef CONFIG_CMD_NAND
+    ulong		bi_nand_size;
+#endif
 } bd_t;
 
 #define bi_env_data bi_env->data
lib_arm/board.c +8 -6
index 67506b3..0752877 100644
@@ -56,7 +56,7 @@
 DECLARE_GLOBAL_DATA_PTR;
 
 #if defined(CONFIG_CMD_NAND)
-void nand_init (void);
+ulong nand_init (void);
 #endif
 
 #if defined(CONFIG_CMD_ONENAND)
@@ -187,21 +187,23 @@ static int display_dram_config (void)
 {
 	int i;
 
+	gd->bd->bi_dram_size = 0;
+
 #ifdef DEBUG
 	puts ("RAM Configuration:\n");
 
 	for(i=0; i<CONFIG_NR_DRAM_BANKS; i++) {
 		printf ("Bank #%d: %08lx ", i, gd->bd->bi_dram[i].start);
 		print_size (gd->bd->bi_dram[i].size, "\n");
+		gd->bd->bi_dram_size += gd->bd->bi_dram[i].size;
 	}
 #else
-	ulong size = 0;
 
 	for (i=0; i<CONFIG_NR_DRAM_BANKS; i++) {
-		size += gd->bd->bi_dram[i].size;
+		gd->bd->bi_dram_size += gd->bd->bi_dram[i].size;
 	}
 	puts("DRAM:  ");
-	print_size(size, "\n");
+	print_size(gd->bd->bi_dram_size, "\n");
 #endif
 
 	return (0);
@@ -279,7 +281,7 @@ void start_armboot (void)
 {
 	init_fnc_t **init_fnc_ptr;
 	char *s;
-#ifndef CFG_NO_FLASH
+#if !defined(CFG_NO_FLASH) || defined (CONFIG_VFD) || defined(CONFIG_LCD)
 	ulong size;
 #endif
 #if defined(CONFIG_VFD) || defined(CONFIG_LCD)
@@ -340,7 +342,7 @@ void start_armboot (void)
 
 #if defined(CONFIG_CMD_NAND)
 	puts ("NAND:  ");
-	nand_init();		/* go init the NAND */
+	gd->bd->bi_nand_size = nand_init();	/* go init the NAND */
 #endif
 
 #if defined(CONFIG_CMD_ONENAND)
Signature · 1 line
1.5.3.3
#35 lore raw

PATCH 13/21 Remeber the RAM and NAND detected sizes for later display

Quoted 12 lines · In message <[email protected]> you wrote:
---
 include/asm-arm/u-boot.h |    4 ++++
 lib_arm/board.c          |   14 ++++++++------
 2 files changed, 12 insertions(+), 6 deletions(-)
include/asm-arm/u-boot.h +0 -0
index c120312..dbfe2cf 100644

include/asm-arm/u-boot.h typedef struct bd_info { · line 51

Quoted 4 lines
include/asm-arm/u-boot.h +1 -0
@@ -48,10 +48,14 @@ typedef struct bd_info {
 	ulong start;
 	ulong size;
     } 			bi_dram[CONFIG_NR_DRAM_BANKS];
+    ulong		bi_dram_size;

Why would that be needed? Isn't adding the "size" entries above sufficient?

include/asm-arm/u-boot.h typedef struct bd_info { · line 56

Quoted 7 lines
include/asm-arm/u-boot.h +2 -2
 	for (i=0; i<CONFIG_NR_DRAM_BANKS; i++) {
-		size += gd->bd->bi_dram[i].size;
+		gd->bd->bi_dram_size += gd->bd->bi_dram[i].size;
 	}
 	puts("DRAM:  ");
-	print_size(size, "\n");
+	print_size(gd->bd->bi_dram_size, "\n");

We really don't need an extra variable here, me thinks.

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
You can't evaluate a man by logic alone.
	-- McCoy, "I, Mudd", stardate 4513.3
#36 lore raw

PATCH 13/21 Remeber the 0013-Remeber-the-RAM-and-NAND-detected-sizes-for-later-di.patch

Le mardi 06 mai 2008 ? 21:28 +0200, Wolfgang Denk a ?crit :

Quoted 8 lines
Quoted 7 lines · In message <[email protected]> you wrote:
---
 include/asm-arm/u-boot.h |    4 ++++
 lib_arm/board.c          |   14 ++++++++------
 2 files changed, 12 insertions(+), 6 deletions(-)
Quoted 12 lines

include/asm-arm/u-boot.h typedef struct bd_info { · line 51

Quoted 9 lines
include/asm-arm/u-boot.h +1 -0
index c120312..dbfe2cf 100644
@@ -48,10 +48,14 @@ typedef struct bd_info {
 	ulong start;
 	ulong size;
     } 			bi_dram[CONFIG_NR_DRAM_BANKS];
+    ulong		bi_dram_size;

Why would that be needed? Isn't adding the "size" entries above sufficient?

It is. But this addition is done once more in the LCD driver (see patch 14/21), so I thought it would be useful to remember the result.

But if you consider it's more costly to add 4 bytes in global data than to do the addition again, I can change it back.

Signature · 1 line
Stelian Pop <[email protected]>
#37 lore raw

PATCH 14/21 Add ATMEL LCD driver

In reply to Stelian Pop
---
 README                              |    4 +
 common/lcd.c                        |   66 +++++++++++++-
 drivers/video/Makefile              |    1 +
 drivers/video/atmel_lcdfb.c         |  160 +++++++++++++++++++++++++++++++
 include/asm-arm/arch-at91sam9/clk.h |    6 +
 include/atmel_lcdc.h                |  177 +++++++++++++++++++++++++++++++++++
 include/lcd.h                       |   30 ++++++-
 lib_arm/board.c                     |   37 ++++++--
 8 files changed, 469 insertions(+), 12 deletions(-)
 create mode 100644 drivers/video/atmel_lcdfb.c
 create mode 100644 include/atmel_lcdc.h
README +4 -0
index 5e2bca4..dca495d 100644
@@ -962,6 +962,10 @@ The following options need to be configured:
 		display); also select one of the supported displays
 		by defining one of these:
 
+		CONFIG_ATMEL_LCD:
+
+			HITACHI TX09D70VM1CCA, 3.5", 240x320.
+
 		CONFIG_NEC_NL6448AC33:
 
 			NEC NL6448AC33-18. Active, color, single scan.
common/lcd.c +65 -1

128 lines not on this page · raw message

drivers/video/Makefile +1 -0
index 0e40f2a..a07ee0e 100644
@@ -26,6 +26,7 @@ include $(TOPDIR)/config.mk
 LIB 	:= $(obj)libvideo.a
 
 COBJS-y += ati_radeon_fb.o
+COBJS-$(CONFIG_ATMEL_LCD) += atmel_lcdfb.o
 COBJS-y += cfb_console.o
 COBJS-y += ct69000.o
 COBJS-y += mb862xx.o
drivers/video/atmel_lcdfb.c new file +160 -0

160 lines not on this page · raw message

include/asm-arm/arch-at91sam9/clk.h +6 -0
index 86da9a6..7fd66c0 100644
@@ -36,4 +36,10 @@ static inline unsigned long get_usart_clk_rate(unsigned int dev_id)
 	return AT91_MASTER_CLOCK;
 }
 
+static inline unsigned long get_lcdc_clk_rate(unsigned int dev_id)
+{
+	return AT91_MASTER_CLOCK;
+}
+
+
 #endif /* __ASM_ARM_ARCH_CLK_H__ */
include/atmel_lcdc.h new file +177 -0

177 lines not on this page · raw message

include/lcd.h +29 -1
index 8a4273c..44ac8ef 100644
@@ -155,7 +155,35 @@ typedef struct vidinfo {
 
 	u_char	vl_bpix;	/* Bits per pixel, 0 = 1 */
 } vidinfo_t;
-#endif /* CONFIG_MPC823, CONFIG_PXA250 or CONFIG_MCC200 */
+
+#elif defined(CONFIG_ATMEL_LCD)
+
+typedef struct vidinfo {
+	u_long vl_col;		/* Number of columns (i.e. 640) */
+	u_long vl_row;		/* Number of rows (i.e. 480) */
+	u_long vl_clk;	/* pixel clock in ps    */
+
+	/* LCD configuration register */
+	u_long vl_sync;		/* Horizontal / vertical sync */
+	u_long vl_bpix;		/* Bits per pixel, 0 = 1, 1 = 2, 2 = 4, 3 = 8, 4 = 16 */
+	u_long vl_tft;		/* 0 = passive, 1 = TFT */
+
+	/* Horizontal control register. */
+	u_long vl_hsync_len;	/* Length of horizontal sync */
+	u_long vl_left_margin;	/* Time from sync to picture */
+	u_long vl_right_margin;	/* Time from picture to sync */
+
+	/* Vertical control register. */
+	u_long vl_vsync_len;	/* Length of vertical sync */
+	u_long vl_upper_margin;	/* Time from sync to picture */
+	u_long vl_lower_margin;	/* Time from picture to sync */
+
+	u_long	mmio;		/* Memory mapped registers */
+} vidinfo_t;
+
+extern vidinfo_t panel_info;
+
+#endif /* CONFIG_MPC823, CONFIG_PXA250 or CONFIG_MCC200 or CONFIG_ATMEL_LCD */
 
 /* Video functions */
 
lib_arm/board.c +27 -10
index 0752877..265591b 100644
@@ -121,6 +121,20 @@ void *sbrk (ptrdiff_t increment)
 	return ((void *) old);
 }
 
+char *strmhz (char *buf, long hz)
+{
+	long l, n;
+	long m;
+
+	n = hz / 1000000L;
+	l = sprintf (buf, "%ld", n);
+	m = (hz % 1000000L) / 1000L;
+	if (m != 0)
+		sprintf (buf + l, ".%03ld", m);
+	return (buf);
+}
+
+
 /************************************************************************
  * Coloured LED functionality
  ************************************************************************
@@ -325,16 +339,19 @@ void start_armboot (void)
 #endif /* CONFIG_VFD */
 
 #ifdef CONFIG_LCD
-#	ifndef PAGE_SIZE
-#	  define PAGE_SIZE 4096
-#	endif
-	/*
-	 * reserve memory for LCD display (always full pages)
-	 */
-	/* bss_end is defined in the board-specific linker script */
-	addr = (_bss_end + (PAGE_SIZE - 1)) & ~(PAGE_SIZE - 1);
-	size = lcd_setmem (addr);
-	gd->fb_base = addr;
+	/* board init may have inited fb_base */
+	if (!gd->fb_base) {
+#		ifndef PAGE_SIZE
+#		  define PAGE_SIZE 4096
+#		endif
+		/*
+		 * reserve memory for LCD display (always full pages)
+		 */
+		/* bss_end is defined in the board-specific linker script */
+		addr = (_bss_end + (PAGE_SIZE - 1)) & ~(PAGE_SIZE - 1);
+		size = lcd_setmem (addr);
+		gd->fb_base = addr;
+	}
 #endif /* CONFIG_LCD */
 
 	/* armboot_start is defined in the board-specific linker script */
Signature · 1 line
1.5.3.3
#38 lore raw

PATCH 15/21 AT91CAP9ADK: hook up the ATMEL LCD driver

In reply to Stelian Pop
---
 board/atmel/at91cap9adk/at91cap9adk.c |   64 +++++++++++++++++++++++++++++++++
 include/configs/at91cap9adk.h         |   13 +++++++
 2 files changed, 77 insertions(+), 0 deletions(-)
board/atmel/at91cap9adk/at91cap9adk.c +64 -0
index ab56f3a..ee4f26e 100644
@@ -30,6 +30,8 @@
 #include <asm/arch/at91_rstc.h>
 #include <asm/arch/gpio.h>
 #include <asm/arch/io.h>
+#include <lcd.h>
+#include <atmel_lcdc.h>
 #if defined(CONFIG_RESET_PHY_R) && defined(CONFIG_MACB)
 #include <net.h>
 #endif
@@ -233,6 +235,65 @@ static void at91cap9_uhp_hw_init(void)
 }
 #endif
 
+#ifdef CONFIG_LCD
+vidinfo_t panel_info = {
+	vl_col:		240,
+	vl_row:		320,
+	vl_clk:		4965000,
+	vl_sync:	ATMEL_LCDC_INVLINE_INVERTED |
+			ATMEL_LCDC_INVFRAME_INVERTED,
+	vl_bpix:	3,
+	vl_tft:		1,
+	vl_hsync_len:	5,
+	vl_left_margin:	1,
+	vl_right_margin:33,
+	vl_vsync_len:	1,
+	vl_upper_margin:1,
+	vl_lower_margin:0,
+	mmio:		AT91CAP9_LCDC_BASE,
+};
+
+void lcd_enable(void)
+{
+	at91_set_gpio_value(AT91_PIN_PC0, 0);  /* power up */
+}
+
+void lcd_disable(void)
+{
+	at91_set_gpio_value(AT91_PIN_PC0, 1);  /* power down */
+}
+
+static void at91cap9_lcd_hw_init(void)
+{
+	at91_set_A_periph(AT91_PIN_PC1, 0);	/* LCDHSYNC */
+	at91_set_A_periph(AT91_PIN_PC2, 0);	/* LCDDOTCK */
+	at91_set_A_periph(AT91_PIN_PC3, 0);	/* LCDDEN */
+	at91_set_B_periph(AT91_PIN_PB9, 0);	/* LCDCC */
+	at91_set_A_periph(AT91_PIN_PC6, 0);	/* LCDD2 */
+	at91_set_A_periph(AT91_PIN_PC7, 0);	/* LCDD3 */
+	at91_set_A_periph(AT91_PIN_PC8, 0);	/* LCDD4 */
+	at91_set_A_periph(AT91_PIN_PC9, 0);	/* LCDD5 */
+	at91_set_A_periph(AT91_PIN_PC10, 0);	/* LCDD6 */
+	at91_set_A_periph(AT91_PIN_PC11, 0);	/* LCDD7 */
+	at91_set_A_periph(AT91_PIN_PC14, 0);	/* LCDD10 */
+	at91_set_A_periph(AT91_PIN_PC15, 0);	/* LCDD11 */
+	at91_set_A_periph(AT91_PIN_PC16, 0);	/* LCDD12 */
+	at91_set_A_periph(AT91_PIN_PC17, 0);	/* LCDD13 */
+	at91_set_A_periph(AT91_PIN_PC18, 0);	/* LCDD14 */
+	at91_set_A_periph(AT91_PIN_PC19, 0);	/* LCDD15 */
+	at91_set_A_periph(AT91_PIN_PC22, 0);	/* LCDD18 */
+	at91_set_A_periph(AT91_PIN_PC23, 0);	/* LCDD19 */
+	at91_set_A_periph(AT91_PIN_PC24, 0);	/* LCDD20 */
+	at91_set_A_periph(AT91_PIN_PC25, 0);	/* LCDD21 */
+	at91_set_A_periph(AT91_PIN_PC26, 0);	/* LCDD22 */
+	at91_set_A_periph(AT91_PIN_PC27, 0);	/* LCDD23 */
+
+	at91_sys_write(AT91_PMC_PCER, 1 << AT91CAP9_ID_LCDC);
+
+	gd->fb_base = 0;
+}
+#endif
+
 int board_init(void)
 {
 	/* Enable Ctrlc */
@@ -257,6 +318,9 @@ int board_init(void)
 #ifdef CONFIG_USB_OHCI_NEW
 	at91cap9_uhp_hw_init();
 #endif
+#ifdef CONFIG_LCD
+	at91cap9_lcd_hw_init();
+#endif
 	return 0;
 }
 
include/configs/at91cap9adk.h +13 -0
index ec70618..82c2039 100644
@@ -28,6 +28,7 @@
 #define __CONFIG_H
 
 /* ARM asynchronous clock */
+#define AT91_CPU_NAME		"AT91CAP9"
 #define AT91_MAIN_CLOCK		200000000	/* from 12 MHz crystal */
 #define AT91_MASTER_CLOCK	100000000	/* peripheral = main / 2 */
 #define CFG_HZ			1000000		/* 1us resolution */
@@ -55,6 +56,18 @@
 #undef CONFIG_USART2
 #define CONFIG_USART3		1	/* USART 3 is DBGU */
 
+/* LCD */
+#define CONFIG_LCD			1
+#define LCD_BPP				LCD_COLOR8
+#define CONFIG_LCD_LOGO			1
+#undef LCD_TEST_PATTERN
+#define CONFIG_LCD_INFO			1
+#define CONFIG_LCD_INFO_BELOW_LOGO	1
+#define CFG_WHITE_ON_BLACK		1
+#define CONFIG_ATMEL_LCD		1
+#define CONFIG_ATMEL_LCD_BGR555		1
+#define CFG_CONSOLE_IS_IN_ENV		1
+
 #define CONFIG_BOOTDELAY	3
 
 /* #define CONFIG_ENV_OVERWRITE	1 */
Signature · 1 line
1.5.3.3
#39 lore raw

PATCH 16/21 AT91SAM9261EK: hook up the ATMEL LCD driver

In reply to Stelian Pop
---
 board/atmel/at91sam9261ek/at91sam9261ek.c |   64 +++++++++++++++++++++++++++++
 include/configs/at91sam9261ek.h           |   13 ++++++
 2 files changed, 77 insertions(+), 0 deletions(-)
board/atmel/at91sam9261ek/at91sam9261ek.c +64 -0
index 55a178e..d6ad15f 100644
@@ -30,6 +30,8 @@
 #include <asm/arch/at91_rstc.h>
 #include <asm/arch/gpio.h>
 #include <asm/arch/io.h>
+#include <lcd.h>
+#include <atmel_lcdc.h>
 #if defined(CONFIG_RESET_PHY_R) && defined(CONFIG_DRIVER_DM9000)
 #include <net.h>
 #endif
@@ -150,6 +152,65 @@ static void at91sam9261ek_dm9000_hw_init(void)
 }
 #endif
 
+#ifdef CONFIG_LCD
+vidinfo_t panel_info = {
+	vl_col:		240,
+	vl_row:		320,
+	vl_clk:		4965000,
+	vl_sync:	ATMEL_LCDC_INVLINE_INVERTED |
+			ATMEL_LCDC_INVFRAME_INVERTED,
+	vl_bpix:	3,
+	vl_tft:		1,
+	vl_hsync_len:	5,
+	vl_left_margin:	1,
+	vl_right_margin:33,
+	vl_vsync_len:	1,
+	vl_upper_margin:1,
+	vl_lower_margin:0,
+	mmio:		AT91SAM9261_LCDC_BASE,
+};
+
+void lcd_enable(void)
+{
+	at91_set_gpio_value(AT91_PIN_PA12, 0);  /* power up */
+}
+
+void lcd_disable(void)
+{
+	at91_set_gpio_value(AT91_PIN_PA12, 1);  /* power down */
+}
+
+static void at91sam9261ek_lcd_hw_init(void)
+{
+	at91_set_A_periph(AT91_PIN_PB1, 0);	/* LCDHSYNC */
+	at91_set_A_periph(AT91_PIN_PB2, 0);	/* LCDDOTCK */
+	at91_set_A_periph(AT91_PIN_PB3, 0);	/* LCDDEN */
+	at91_set_A_periph(AT91_PIN_PB4, 0);	/* LCDCC */
+	at91_set_A_periph(AT91_PIN_PB7, 0);	/* LCDD2 */
+	at91_set_A_periph(AT91_PIN_PB8, 0);	/* LCDD3 */
+	at91_set_A_periph(AT91_PIN_PB9, 0);	/* LCDD4 */
+	at91_set_A_periph(AT91_PIN_PB10, 0);	/* LCDD5 */
+	at91_set_A_periph(AT91_PIN_PB11, 0);	/* LCDD6 */
+	at91_set_A_periph(AT91_PIN_PB12, 0);	/* LCDD7 */
+	at91_set_A_periph(AT91_PIN_PB15, 0);	/* LCDD10 */
+	at91_set_A_periph(AT91_PIN_PB16, 0);	/* LCDD11 */
+	at91_set_A_periph(AT91_PIN_PB17, 0);	/* LCDD12 */
+	at91_set_A_periph(AT91_PIN_PB18, 0);	/* LCDD13 */
+	at91_set_A_periph(AT91_PIN_PB19, 0);	/* LCDD14 */
+	at91_set_A_periph(AT91_PIN_PB20, 0);	/* LCDD15 */
+	at91_set_B_periph(AT91_PIN_PB23, 0);	/* LCDD18 */
+	at91_set_B_periph(AT91_PIN_PB24, 0);	/* LCDD19 */
+	at91_set_B_periph(AT91_PIN_PB25, 0);	/* LCDD20 */
+	at91_set_B_periph(AT91_PIN_PB26, 0);	/* LCDD21 */
+	at91_set_B_periph(AT91_PIN_PB27, 0);	/* LCDD22 */
+	at91_set_B_periph(AT91_PIN_PB28, 0);	/* LCDD23 */
+
+	at91_sys_write(AT91_PMC_SCER, AT91_PMC_HCK1);
+
+	gd->fb_base = AT91SAM9261_SRAM_BASE;
+}
+#endif
+
 int board_init(void)
 {
 	/* Enable Ctrlc */
@@ -170,6 +231,9 @@ int board_init(void)
 #ifdef CONFIG_DRIVER_DM9000
 	at91sam9261ek_dm9000_hw_init();
 #endif
+#ifdef CONFIG_LCD
+	at91sam9261ek_lcd_hw_init();
+#endif
 	return 0;
 }
 
include/configs/at91sam9261ek.h +13 -0
index cdafed3..6a40853 100644
@@ -28,6 +28,7 @@
 #define __CONFIG_H
 
 /* ARM asynchronous clock */
+#define AT91_CPU_NAME		"AT91SAM9261"
 #define AT91_MAIN_CLOCK		198656000	/* from 18.432 MHz crystal */
 #define AT91_MASTER_CLOCK	99328000	/* peripheral = main / 2 */
 #define CFG_HZ			1000000		/* 1us resolution */
@@ -55,6 +56,18 @@
 #undef CONFIG_USART2
 #define CONFIG_USART3		1	/* USART 3 is DBGU */
 
+/* LCD */
+#define CONFIG_LCD			1
+#define LCD_BPP				LCD_COLOR8
+#define CONFIG_LCD_LOGO			1
+#undef LCD_TEST_PATTERN
+#define CONFIG_LCD_INFO			1
+#define CONFIG_LCD_INFO_BELOW_LOGO	1
+#define CFG_WHITE_ON_BLACK		1
+#define CONFIG_ATMEL_LCD		1
+#define CONFIG_ATMEL_LCD_BGR555		1
+#define CFG_CONSOLE_IS_IN_ENV		1
+
 #define CONFIG_BOOTDELAY	3
 
 /* #define CONFIG_ENV_OVERWRITE	1 */
Signature · 1 line
1.5.3.3
#40 lore raw

PATCH 17/21 AT91SAM9263EK: hook up the ATMEL LCD driver

In reply to Stelian Pop
---
 board/atmel/at91sam9263ek/at91sam9263ek.c |   65 +++++++++++++++++++++++++++++
 include/configs/at91sam9263ek.h           |   13 ++++++
 2 files changed, 78 insertions(+), 0 deletions(-)
board/atmel/at91sam9263ek/at91sam9263ek.c +65 -0
index ee6b69f..ba152d2 100644
@@ -23,6 +23,7 @@
  */
 
 #include <common.h>
+#include <asm/sizes.h>
 #include <asm/arch/at91sam9263.h>
 #include <asm/arch/at91sam9263_matrix.h>
 #include <asm/arch/at91sam926x_mc.h>
@@ -30,6 +31,8 @@
 #include <asm/arch/at91_rstc.h>
 #include <asm/arch/gpio.h>
 #include <asm/arch/io.h>
+#include <lcd.h>
+#include <atmel_lcdc.h>
 #if defined(CONFIG_RESET_PHY_R) && defined(CONFIG_MACB)
 #include <net.h>
 #endif
@@ -193,6 +196,65 @@ static void at91sam9263ek_uhp_hw_init(void)
 }
 #endif
 
+#ifdef CONFIG_LCD
+vidinfo_t panel_info = {
+	vl_col:		240,
+	vl_row:		320,
+	vl_clk:		4965000,
+	vl_sync:	ATMEL_LCDC_INVLINE_INVERTED |
+			ATMEL_LCDC_INVFRAME_INVERTED,
+	vl_bpix:	3,
+	vl_tft:		1,
+	vl_hsync_len:	5,
+	vl_left_margin:	1,
+	vl_right_margin:33,
+	vl_vsync_len:	1,
+	vl_upper_margin:1,
+	vl_lower_margin:0,
+	mmio:		AT91SAM9263_LCDC_BASE,
+};
+
+void lcd_enable(void)
+{
+	at91_set_gpio_value(AT91_PIN_PA30, 1);  /* power up */
+}
+
+void lcd_disable(void)
+{
+	at91_set_gpio_value(AT91_PIN_PA30, 0);  /* power down */
+}
+
+static void at91sam9263ek_lcd_hw_init(void)
+{
+	at91_set_A_periph(AT91_PIN_PC1, 0);	/* LCDHSYNC */
+	at91_set_A_periph(AT91_PIN_PC2, 0);	/* LCDDOTCK */
+	at91_set_A_periph(AT91_PIN_PC3, 0);	/* LCDDEN */
+	at91_set_B_periph(AT91_PIN_PB9, 0);	/* LCDCC */
+	at91_set_A_periph(AT91_PIN_PC6, 0);	/* LCDD2 */
+	at91_set_A_periph(AT91_PIN_PC7, 0);	/* LCDD3 */
+	at91_set_A_periph(AT91_PIN_PC8, 0);	/* LCDD4 */
+	at91_set_A_periph(AT91_PIN_PC9, 0);	/* LCDD5 */
+	at91_set_A_periph(AT91_PIN_PC10, 0);	/* LCDD6 */
+	at91_set_A_periph(AT91_PIN_PC11, 0);	/* LCDD7 */
+	at91_set_A_periph(AT91_PIN_PC14, 0);	/* LCDD10 */
+	at91_set_A_periph(AT91_PIN_PC15, 0);	/* LCDD11 */
+	at91_set_A_periph(AT91_PIN_PC16, 0);	/* LCDD12 */
+	at91_set_B_periph(AT91_PIN_PC12, 0);	/* LCDD13 */
+	at91_set_A_periph(AT91_PIN_PC18, 0);	/* LCDD14 */
+	at91_set_A_periph(AT91_PIN_PC19, 0);	/* LCDD15 */
+	at91_set_A_periph(AT91_PIN_PC22, 0);	/* LCDD18 */
+	at91_set_A_periph(AT91_PIN_PC23, 0);	/* LCDD19 */
+	at91_set_A_periph(AT91_PIN_PC24, 0);	/* LCDD20 */
+	at91_set_B_periph(AT91_PIN_PC17, 0);	/* LCDD21 */
+	at91_set_A_periph(AT91_PIN_PC26, 0);	/* LCDD22 */
+	at91_set_A_periph(AT91_PIN_PC27, 0);	/* LCDD23 */
+
+	at91_sys_write(AT91_PMC_PCER, 1 << AT91SAM9263_ID_LCDC);
+
+	gd->fb_base = AT91SAM9263_SRAM0_BASE;
+}
+#endif
+
 int board_init(void)
 {
 	/* Enable Ctrlc */
@@ -216,6 +278,9 @@ int board_init(void)
 #ifdef CONFIG_USB_OHCI_NEW
 	at91sam9263ek_uhp_hw_init();
 #endif
+#ifdef CONFIG_LCD
+	at91sam9263ek_lcd_hw_init();
+#endif
 	return 0;
 }
 
include/configs/at91sam9263ek.h +13 -0
index e2ffbbe..ae574d7 100644
@@ -28,6 +28,7 @@
 #define __CONFIG_H
 
 /* ARM asynchronous clock */
+#define AT91_CPU_NAME		"AT91SAM9263"
 #define AT91_MAIN_CLOCK		199919000	/* from 16.367 MHz crystal */
 #define AT91_MASTER_CLOCK	99959500	/* peripheral = main / 2 */
 #define CFG_HZ			1000000		/* 1us resolution */
@@ -55,6 +56,18 @@
 #undef CONFIG_USART2
 #define CONFIG_USART3		1	/* USART 3 is DBGU */
 
+/* LCD */
+#define CONFIG_LCD			1
+#define LCD_BPP				LCD_COLOR8
+#define CONFIG_LCD_LOGO			1
+#undef LCD_TEST_PATTERN
+#define CONFIG_LCD_INFO			1
+#define CONFIG_LCD_INFO_BELOW_LOGO	1
+#define CFG_WHITE_ON_BLACK		1
+#define CONFIG_ATMEL_LCD		1
+#define CONFIG_ATMEL_LCD_BGR555		1
+#define CFG_CONSOLE_IS_IN_ENV		1
+
 #define CONFIG_BOOTDELAY	3
 
 /* #define CONFIG_ENV_OVERWRITE	1 */
Signature · 1 line
1.5.3.3
#41 lore raw

PATCH 18/21 AT91SAM9RLEK: hook up the ATMEL LCD driver

In reply to Stelian Pop
---
 board/atmel/at91sam9rlek/at91sam9rlek.c |   63 +++++++++++++++++++++++++++++++
 include/configs/at91sam9rlek.h          |   13 ++++++
 2 files changed, 76 insertions(+), 0 deletions(-)
board/atmel/at91sam9rlek/at91sam9rlek.c +63 -0
index 488489c..1538bf1 100644
@@ -30,6 +30,8 @@
 #include <asm/arch/at91_rstc.h>
 #include <asm/arch/gpio.h>
 #include <asm/arch/io.h>
+#include <lcd.h>
+#include <atmel_lcdc.h>
 #if defined(CONFIG_RESET_PHY_R) && defined(CONFIG_MACB)
 #include <net.h>
 #endif
@@ -124,6 +126,64 @@ static void at91sam9rlek_spi_hw_init(void)
 }
 #endif
 
+#ifdef CONFIG_LCD
+vidinfo_t panel_info = {
+	vl_col:		240,
+	vl_row:		320,
+	vl_clk:		4965000,
+	vl_sync:	ATMEL_LCDC_INVLINE_INVERTED |
+			ATMEL_LCDC_INVFRAME_INVERTED,
+	vl_bpix:	3,
+	vl_tft:		1,
+	vl_hsync_len:	5,
+	vl_left_margin:	1,
+	vl_right_margin:33,
+	vl_vsync_len:	1,
+	vl_upper_margin:1,
+	vl_lower_margin:0,
+	mmio:		AT91SAM9RL_LCDC_BASE,
+};
+
+void lcd_enable(void)
+{
+	at91_set_gpio_value(AT91_PIN_PA30, 0);  /* power up */
+}
+
+void lcd_disable(void)
+{
+	at91_set_gpio_value(AT91_PIN_PA30, 1);  /* power down */
+}
+static void at91sam9rlek_lcd_hw_init(void)
+{
+	at91_set_B_periph(AT91_PIN_PC1, 0);	/* LCDPWR */
+	at91_set_A_periph(AT91_PIN_PC5, 0);	/* LCDHSYNC */
+	at91_set_A_periph(AT91_PIN_PC6, 0);	/* LCDDOTCK */
+	at91_set_A_periph(AT91_PIN_PC7, 0);	/* LCDDEN */
+	at91_set_A_periph(AT91_PIN_PC3, 0);	/* LCDCC */
+	at91_set_B_periph(AT91_PIN_PC9, 0);	/* LCDD3 */
+	at91_set_B_periph(AT91_PIN_PC10, 0);	/* LCDD4 */
+	at91_set_B_periph(AT91_PIN_PC11, 0);	/* LCDD5 */
+	at91_set_B_periph(AT91_PIN_PC12, 0);	/* LCDD6 */
+	at91_set_B_periph(AT91_PIN_PC13, 0);	/* LCDD7 */
+	at91_set_B_periph(AT91_PIN_PC15, 0);	/* LCDD11 */
+	at91_set_B_periph(AT91_PIN_PC16, 0);	/* LCDD12 */
+	at91_set_B_periph(AT91_PIN_PC17, 0);	/* LCDD13 */
+	at91_set_B_periph(AT91_PIN_PC18, 0);	/* LCDD14 */
+	at91_set_B_periph(AT91_PIN_PC19, 0);	/* LCDD15 */
+	at91_set_B_periph(AT91_PIN_PC20, 0);	/* LCDD18 */
+	at91_set_B_periph(AT91_PIN_PC21, 0);	/* LCDD19 */
+	at91_set_B_periph(AT91_PIN_PC22, 0);	/* LCDD20 */
+	at91_set_B_periph(AT91_PIN_PC23, 0);	/* LCDD21 */
+	at91_set_B_periph(AT91_PIN_PC24, 0);	/* LCDD22 */
+	at91_set_B_periph(AT91_PIN_PC25, 0);	/* LCDD23 */
+
+	at91_sys_write(AT91_PMC_PCER, 1 << AT91SAM9RL_ID_LCDC);
+
+	gd->fb_base = 0;
+}
+#endif
+
+
 int board_init(void)
 {
 	/* Enable Ctrlc */
@@ -141,6 +201,9 @@ int board_init(void)
 #ifdef CONFIG_HAS_DATAFLASH
 	at91sam9rlek_spi_hw_init();
 #endif
+#ifdef CONFIG_LCD
+	at91sam9rlek_lcd_hw_init();
+#endif
 	return 0;
 }
 
include/configs/at91sam9rlek.h +13 -0
index acf5d81..fac26a9 100644
@@ -28,6 +28,7 @@
 #define __CONFIG_H
 
 /* ARM asynchronous clock */
+#define AT91_CPU_NAME		"AT91SAM9RL"
 #define AT91_MAIN_CLOCK		200000000	/* from 12.000 MHz crystal */
 #define AT91_MASTER_CLOCK	100000000	/* peripheral = main / 2 */
 #define CFG_HZ			1000000		/* 1us resolution */
@@ -55,6 +56,18 @@
 #undef CONFIG_USART2
 #define CONFIG_USART3		1	/* USART 3 is DBGU */
 
+/* LCD */
+#define CONFIG_LCD			1
+#define LCD_BPP				LCD_COLOR8
+#define CONFIG_LCD_LOGO			1
+#undef LCD_TEST_PATTERN
+#define CONFIG_LCD_INFO			1
+#define CONFIG_LCD_INFO_BELOW_LOGO	1
+#define CFG_WHITE_ON_BLACK		1
+#define CONFIG_ATMEL_LCD		1
+#define CONFIG_ATMEL_LCD_RGB565		1
+#define CFG_CONSOLE_IS_IN_ENV		1
+
 #define CONFIG_BOOTDELAY	3
 
 /* #define CONFIG_ENV_OVERWRITE	1 */
Signature · 1 line
1.5.3.3
#42 lore raw

PATCH 19/21 Use custom logo for Atmel boards

In reply to Stelian Pop
---
 tools/Makefile        |    4 ++++
 tools/logos/atmel.bmp |  Bin 0 -> 26334 bytes
 2 files changed, 4 insertions(+), 0 deletions(-)
 create mode 100644 tools/logos/atmel.bmp
tools/Makefile +4 -0
index b897923..dc210e8 100644
@@ -44,6 +44,10 @@ LOGO_H	= $(OBJTREE)/include/bmp_logo.h
 ifeq ($(LOGO_BMP),)
 LOGO_BMP= logos/denx.bmp
 endif
+ifeq ($(VENDOR),atmel)
+LOGO_BMP= logos/atmel.bmp
+endif
+
 
 #-------------------------------------------------------------------------
 
tools/logos/atmel.bmp new file binary +0 -0
new file mode 100644
index 0000000000000000000000000000000000000000..3c445c9bc365aff31bf5f6c464ab2b1d7a99e99e
GIT binary patch

z&wsl7l(8TE-nW;}xc-dsfBTzHmmmJluPmQ_ at 0-g%{rMj(KVa;C|MOp#&wle4m%snx z-(CLaUw^{f&o6)d``=mq<L~}rR5<~$?}sw~LEfA|~AXW#qQ@>k#gwdJ$llaRH z|KTr}AOF#JmmmK2FE7WdEB?TJKx*qs+}W)ba(kVI=ee{2-?%h6%IL_<yWU59FGIj z)#);_8&iA)#N|60YiyEr74P8->e0DfudYOzat#uNnUXu}uohkpdtQfS*)K3q0lIrf z!-BUkMe;UblrV5~Ga8lX=E|8laa7G<WXgrL(rMKtfG$u$5zZh|BeSf9apDv=+KTQ z#O)|c(cQ&bVnX^k#1GOZQMei}>VsUNAUyJWnA^;q^-m16l2;Q*zG!thzbk4aDtNV zDe^NdQ{>Rqe)29v^$tyzX3-V|Wr|pER}6ot8t{dX=k$eAgn_g+#h3yp(+8-v$CZb} zet)Bmcoui>uZDliO1wl1dcY=8tjv|1z=~n31U7e=H}r=*Y<JSgewYBMw9$ZY!PI1e zWLYFVDQ7ju{^fU_FPCSg>wLpp=1<dI7g1~37eyi#H*@FcZY|U1Iw4?W91r0Z2J zmq8n#QAz=$o70;No;KI5&fA8mE1qLY!T6BH-UNxbTBin+tdiJ?F^yYR01^1;btVx! zp+6*dh7{U;hRnP=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 Support AT91CAP9 revC CPUs

In reply to Stelian Pop
---
 board/atmel/at91cap9adk/at91cap9adk.c    |   28 ++++++++++++++++++++++++++++
 include/asm-arm/arch-at91sam9/at91_pmc.h |    5 +++++
 include/asm-arm/arch-at91sam9/at91cap9.h |   14 +++++++++++++-
 3 files changed, 46 insertions(+), 1 deletions(-)
board/atmel/at91cap9adk/at91cap9adk.c +28 -0
index ee4f26e..b92dd82 100644
@@ -72,6 +72,33 @@ static void at91cap9_serial_hw_init(void)
 #endif
 }
 
+static void at91cap9_slowclock_hw_init(void)
+{
+	/*
+	 * On AT91CAP9 revC CPUs, the slow clock can be based on an
+	 * internal impreciseRC oscillator or an external 32kHz oscillator.
+	 * Switch to the latter.
+	 */
+#define ARCH_ID_AT91CAP9_REVB	0x399
+#define ARCH_ID_AT91CAP9_REVC	0x601
+	if (at91_sys_read(AT91_PMC_VER) == ARCH_ID_AT91CAP9_REVC) {
+		unsigned i, tmp = at91_sys_read(AT91_SCKCR);
+		if ((tmp & AT91CAP9_SCKCR_OSCSEL) == AT91CAP9_SCKCR_OSCSEL_RC) {
+			extern void timer_init(void);
+			timer_init();
+			tmp |= AT91CAP9_SCKCR_OSC32EN;
+			at91_sys_write(AT91_SCKCR, tmp);
+			for (i = 0; i < 1200; i++)
+				udelay(1000);
+			tmp |= AT91CAP9_SCKCR_OSCSEL_32;
+			at91_sys_write(AT91_SCKCR, tmp);
+			udelay(200);
+			tmp &= ~AT91CAP9_SCKCR_RCEN;
+			at91_sys_write(AT91_SCKCR, tmp);
+		}
+	}
+}
+
 static void at91cap9_nor_hw_init(void)
 {
 	unsigned long csa;
@@ -305,6 +332,7 @@ int board_init(void)
 	gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
 
 	at91cap9_serial_hw_init();
+	at91cap9_slowclock_hw_init();
 	at91cap9_nor_hw_init();
 #ifdef CONFIG_CMD_NAND
 	at91cap9_nand_hw_init();
include/asm-arm/arch-at91sam9/at91_pmc.h +5 -0
index 52cd8e5..9981c42 100644
@@ -96,4 +96,9 @@
 #define		AT91_PMC_PCK3RDY	(1 << 11)		/* Programmable Clock 3 */
 #define	AT91_PMC_IMR		(AT91_PMC + 0x6c)	/* Interrupt Mask Register */
 
+#define AT91_PMC_PROT		(AT91_PMC + 0xe4)	/* Protect Register [AT91CAP9 revC only] */
+#define		AT91_PMC_PROTKEY	0x504d4301		/* Activation Code */
+
+#define AT91_PMC_VER	(AT91_PMC + 0xfc)	/* PMC Module Version [AT91CAP9 only] */
+
 #endif
include/asm-arm/arch-at91sam9/at91cap9.h +13 -1
index e16909c..6bd78fa 100644
@@ -101,13 +101,25 @@
 #define AT91_RTT	(0xfffffd20 - AT91_BASE_SYS)
 #define AT91_PIT	(0xfffffd30 - AT91_BASE_SYS)
 #define AT91_WDT	(0xfffffd40 - AT91_BASE_SYS)
-#define AT91_GPBR	(0xfffffd50 - AT91_BASE_SYS)
+#define AT91_SCKCR	(0xfffffd50 - AT91_BASE_SYS)
+#define AT91_GPBR_REVB	(0xfffffd50 - AT91_BASE_SYS)
+#define AT91_GPBR_REVC	(0xfffffd60 - AT91_BASE_SYS)
 
 #define AT91_USART0	AT91CAP9_BASE_US0
 #define AT91_USART1	AT91CAP9_BASE_US1
 #define AT91_USART2	AT91CAP9_BASE_US2
 
 /*
+ * SCKCR flags
+ */
+#define AT91CAP9_SCKCR_RCEN	(1 << 0)	/* RC Oscillator Enable */
+#define AT91CAP9_SCKCR_OSC32EN	(1 << 1)	/* 32kHz Oscillator Enable */
+#define AT91CAP9_SCKCR_OSC32BYP	(1 << 2)	/* 32kHz Oscillator Bypass */
+#define AT91CAP9_SCKCR_OSCSEL	(1 << 3)	/* Slow Clock Selector */
+#define		AT91CAP9_SCKCR_OSCSEL_RC	(0 << 3)
+#define		AT91CAP9_SCKCR_OSCSEL_32	(1 << 3)
+
+/*
  * Internal Memory.
  */
 #define AT91CAP9_SRAM_BASE	0x00100000	/* Internal SRAM base address */
Signature · 1 line
1.5.3.3
#45 lore raw

PATCH 20/21 Support AT91CAP9 revC CPUs

In reply to Stelian Pop
Quoted 18 lines · In message <[email protected]> you wrote:
---
 board/atmel/at91cap9adk/at91cap9adk.c    |   28 ++++++++++++++++++++++++++++
 include/asm-arm/arch-at91sam9/at91_pmc.h |    5 +++++
 include/asm-arm/arch-at91sam9/at91cap9.h |   14 +++++++++++++-
 3 files changed, 46 insertions(+), 1 deletions(-)
board/atmel/at91cap9adk/at91cap9adk.c +2 -0
index ee4f26e..b92dd82 100644
@@ -72,6 +72,33 @@ static void at91cap9_serial_hw_init(void)
 #endif
 }
 
+static void at91cap9_slowclock_hw_init(void)
+{

board/atmel/at91cap9adk/at91cap9adk.c static void at91cap9_serial_hw_init(void) · line 86

Quoted 10 lines
board/atmel/at91cap9adk/at91cap9adk.c +10 -0
+	/*
+	 * On AT91CAP9 revC CPUs, the slow clock can be based on an
+	 * internal impreciseRC oscillator or an external 32kHz oscillator.
+	 * Switch to the latter.
+	 */
+#define ARCH_ID_AT91CAP9_REVB	0x399
+#define ARCH_ID_AT91CAP9_REVC	0x601
+	if (at91_sys_read(AT91_PMC_VER) == ARCH_ID_AT91CAP9_REVC) {
+		unsigned i, tmp = at91_sys_read(AT91_SCKCR);
+		if ((tmp & AT91CAP9_SCKCR_OSCSEL) == AT91CAP9_SCKCR_OSCSEL_RC) {

Please don't add #defines in the middle of a source file. Either right at the beginning, or in a header file.

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Politics:  A  strife  of  interests  masquerading  as  a  contest  of
principles. The conduct of public affairs for private advantage.
- Ambrose Bierce
#46 lore raw

PATCH 20/21 Support AT91CAP9 revC CPUs

In reply to Stelian Pop

include/asm-arm/arch-at91sam9/at91_pmc.h line 100

Quoted 11 lines · In message <[email protected]> you wrote:
include/asm-arm/arch-at91sam9/at91_pmc.h +2 -0
index 52cd8e5..9981c42 100644
@@ -96,4 +96,9 @@
 #define		AT91_PMC_PCK3RDY	(1 << 11)		/* Programmable Clock 3 */
 #define	AT91_PMC_IMR		(AT91_PMC + 0x6c)	/* Interrupt Mask Register */
 
+#define AT91_PMC_PROT		(AT91_PMC + 0xe4)	/* Protect Register [AT91CAP9 revC only] */
+#define		AT91_PMC_PROTKEY	0x504d4301		/* Activation Code */

Line lenght ?

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
Never worry about theory as long as  the  machinery  does  what  it's
supposed to do.                                      - R. A. Heinlein