[U-Boot] [PATCH 1/1] omap3: bugfix in timer on rollover

2016-06-06 Thread Daniel Gorsulowski
Signed-off-by: Daniel Gorsulowski <daniel.gorsulow...@esd.eu>
---
 arch/arm/cpu/armv7/omap-common/timer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/cpu/armv7/omap-common/timer.c 
b/arch/arm/cpu/armv7/omap-common/timer.c
index 032bd2c..49e3a97 100644
--- a/arch/arm/cpu/armv7/omap-common/timer.c
+++ b/arch/arm/cpu/armv7/omap-common/timer.c
@@ -77,7 +77,7 @@ ulong get_timer_masked(void)
/* move stamp fordward with absoulte diff ticks */
gd->arch.tbl += (now - gd->arch.lastinc);
} else {/* we have rollover of incrementer */
-   gd->arch.tbl += ((TIMER_LOAD_VAL / (TIMER_CLOCK /
+   gd->arch.tbl += ((TIMER_OVERFLOW_VAL / (TIMER_CLOCK /
CONFIG_SYS_HZ)) - gd->arch.lastinc) + now;
}
gd->arch.lastinc = now;
-- 
2.7.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] arm: ti: SF commands raise watchdog reset

2016-06-02 Thread Daniel Gorsulowski

Hello,

I have an issue with sf commands. If a command takes longer than the 
defined HW Watchdog timeout, the board resets.


My Platform is:
Board: Custom
CPU: Sitara AM3357ZCZ
Flash: Micron N25Q256A13E1240F Serial NOR Flash
U-Boot: repoduced on 2016.01 and 2016.03

Commands to reproduce the problem:
=> sf probe
SF: Detected N25Q256 with page size 256 Bytes, erase size 4 KiB, total 
32 MiB

=> sf erase 0 200
>>> board resets after 1 minute <<<

If I do
#undef CONFIG_HW_WATCHDOG
in my board config, the board runs stable.


The Watchdog ist set to 60 seconds. See drivers/watchdog/omap_wdt.c:
...
#define WDT_HW_TIMEOUT 60
...
void hw_watchdog_init(void)
{
...
omap_wdt_set_timeout(WDT_HW_TIMEOUT);
...
}


I have no idea how to fix this, so I ask you.
I guess, nobody has similar hardware to reproduce this. But maybe 
someone has an idea and can tell me what I could try out.


Maybe the issue is related to 
http://lists.denx.de/pipermail/u-boot/2015-November/232844.html


Kind regards
Daniel
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH V3 1/1] arm: at91: reworked meesc board support

2015-11-01 Thread Daniel Gorsulowski
Signed-off-by: Daniel Gorsulowski <daniel.gorsulow...@esd.eu>
---
Changes in V2:
- Fetched again and created patch against current master

Changes in V3:
- None, just resent using 'git send-email'

 board/esd/meesc/meesc.c | 20 
 include/configs/meesc.h | 42 --
 2 files changed, 36 insertions(+), 26 deletions(-)

diff --git a/board/esd/meesc/meesc.c b/board/esd/meesc/meesc.c
index c5994e0..b7f9f90 100644
--- a/board/esd/meesc/meesc.c
+++ b/board/esd/meesc/meesc.c
@@ -3,7 +3,7 @@
  * Stelian Pop <stel...@popies.net>
  * Lead Tech Design 
  *
- * (C) Copyright 2009-2011
+ * (C) Copyright 2009-2015
  * Daniel Gorsulowski <daniel.gorsulow...@esd.eu>
  * esd electronic system design gmbh 
  *
@@ -28,6 +28,7 @@ DECLARE_GLOBAL_DATA_PTR;
  * Miscelaneous platform dependent initialisations
  */
 
+#ifdef CONFIG_REVISION_TAG
 static int hw_rev = -1;/* hardware revision */
 
 int get_hw_rev(void)
@@ -45,6 +46,7 @@ int get_hw_rev(void)
 
return hw_rev;
 }
+#endif /* CONFIG_REVISION_TAG */
 
 #ifdef CONFIG_CMD_NAND
 static void meesc_nand_hw_init(void)
@@ -125,12 +127,18 @@ static void meesc_ethercat_hw_init(void)
 
 int dram_init(void)
 {
-   gd->ram_size = get_ram_size(
-   (void *)CONFIG_SYS_SDRAM_BASE,
-   CONFIG_SYS_SDRAM_SIZE);
+   /* dram_init must store complete ramsize in gd->ram_size */
+   gd->ram_size = get_ram_size((void *)PHYS_SDRAM,
+   PHYS_SDRAM_SIZE);
return 0;
 }
 
+void dram_init_banksize(void)
+{
+   gd->bd->bi_dram[0].start = PHYS_SDRAM;
+   gd->bd->bi_dram[0].size = PHYS_SDRAM_SIZE;
+}
+
 int board_eth_init(bd_t *bis)
 {
int rc = 0;
@@ -140,6 +148,7 @@ int board_eth_init(bd_t *bis)
return rc;
 }
 
+#ifdef CONFIG_DISPLAY_BOARDINFO
 int checkboard(void)
 {
char str[32];
@@ -173,10 +182,13 @@ int checkboard(void)
puts(", serial# ");
puts(str);
}
+#ifdef CONFIG_REVISION_TAG
printf("\nHardware-revision: 1.%d\n", get_hw_rev());
+#endif
printf("Mach-type: %lu\n", gd->bd->bi_arch_number);
return 0;
 }
+#endif /* CONFIG_DISPLAY_BOARDINFO */
 
 #ifdef CONFIG_SERIAL_TAG
 void get_board_serial(struct tag_serialnr *serialnr)
diff --git a/include/configs/meesc.h b/include/configs/meesc.h
index 9c53fb4..10a6ce9 100644
--- a/include/configs/meesc.h
+++ b/include/configs/meesc.h
@@ -3,7 +3,7 @@
  * Stelian Pop <stel...@popies.net>
  * Lead Tech Design 
  *
- * (C) Copyright 2009-2011
+ * (C) Copyright 2009-2015
  * Daniel Gorsulowski <daniel.gorsulow...@esd.eu>
  * esd electronic system design gmbh 
  *
@@ -27,7 +27,7 @@
  * Since the linker has to swallow that define, we must use a pure
  * hex number here!
  */
-#define CONFIG_SYS_TEXT_BASE   0x20002000
+#define CONFIG_SYS_TEXT_BASE   0x21F0
 
 /*
  * since a number of boards are not being listed in linux
@@ -56,14 +56,13 @@
 #define CONFIG_DISPLAY_CPUINFO /* display cpu info and speed */
 #define CONFIG_PREBOOT /* enable preboot variable */
 
+#define CONFIG_CMD_BOOTZ
+#define CONFIG_OF_LIBFDT
 
 /*
  * Hardware drivers
  */
 
-/* required until arch/arm/include/asm/arch-at91/at91sam9263.h is reworked */
-#define ATMEL_PMC_UHP  AT91SAM926x_PMC_UHP
-
 /* general purpose I/O */
 #define CONFIG_AT91_GPIO
 
@@ -87,10 +86,17 @@
 /*
  * Command line configuration.
  */
+#undef CONFIG_CMD_BDI
+#undef CONFIG_CMD_FPGA
+#undef CONFIG_CMD_LOADS
+#undef CONFIG_CMD_IMLS
+
 #define CONFIG_CMD_PING
 #define CONFIG_CMD_DHCP
+
+#ifdef CONFIG_SYS_USE_NANDFLASH
 #define CONFIG_CMD_NAND
-#define CONFIG_CMD_USB
+#endif
 
 /* LED */
 #define CONFIG_AT91_LED
@@ -99,9 +105,12 @@
  * SDRAM: 1 bank, min 32, max 128 MB
  * Initialized before u-boot gets started.
  */
+#define PHYS_SDRAM ATMEL_BASE_CS1 /* 
0x2000 */
+#define PHYS_SDRAM_SIZE0x0200 /* 32 
MByte */
+
 #define CONFIG_NR_DRAM_BANKS   1
-#define CONFIG_SYS_SDRAM_BASE  0x2000 /* ATMEL_BASE_CS1 */
-#define CONFIG_SYS_SDRAM_SIZE  0x0200
+#define CONFIG_SYS_SDRAM_BASE  PHYS_SDRAM
+#define CONFIG_SYS_SDRAM_SIZE  PHYS_SDRAM_SIZE
 
 #define CONFIG_SYS_MEMTEST_START   (CONFIG_SYS_SDRAM_BASE + 0x0010)
 #define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_SDRAM_BASE + 0x01E0)
@@ -133,7 +142,7 @@
 #ifdef CONFIG_CMD_NAND
 # define CONFIG_NAND_ATMEL
 # define CONFIG_SYS_MAX_NAND_DEVICE1
-# define CONFIG_SYS_NAND_BASE  0x4000 /* ATMEL_BASE_CS3 */
+# define CONFIG_SYS_NAND_BASE  ATMEL_BASE_CS3 /* 0x4000 */
 # define CONFIG_SYS_NAND_DBW_8
 # define CONFIG_SYS_NAND_MASK_ALE  (1 << 21)
 # define CONFIG_SYS_NAND_MASK_CLE  

[U-Boot] [PATCH 1/1] arm: at91: reworked meesc board support

2015-10-29 Thread Daniel Gorsulowski

Signed-off-by: Daniel Gorsulowski <daniel.gorsulow...@esd.eu>
---
 board/esd/meesc/meesc.c | 20 
 include/configs/meesc.h | 45 +++--
 2 files changed, 39 insertions(+), 26 deletions(-)

diff --git a/board/esd/meesc/meesc.c b/board/esd/meesc/meesc.c
index c5994e0..b7f9f90 100644
--- a/board/esd/meesc/meesc.c
+++ b/board/esd/meesc/meesc.c
@@ -3,7 +3,7 @@
  * Stelian Pop <stel...@popies.net>
  * Lead Tech Design 
  *
- * (C) Copyright 2009-2011
+ * (C) Copyright 2009-2015
  * Daniel Gorsulowski <daniel.gorsulow...@esd.eu>
  * esd electronic system design gmbh 
  *
@@ -28,6 +28,7 @@ DECLARE_GLOBAL_DATA_PTR;
  * Miscelaneous platform dependent initialisations
  */

+#ifdef CONFIG_REVISION_TAG
 static int hw_rev = -1;/* hardware revision */

 int get_hw_rev(void)
@@ -45,6 +46,7 @@ int get_hw_rev(void)

return hw_rev;
 }
+#endif /* CONFIG_REVISION_TAG */

 #ifdef CONFIG_CMD_NAND
 static void meesc_nand_hw_init(void)
@@ -125,12 +127,18 @@ static void meesc_ethercat_hw_init(void)

 int dram_init(void)
 {
-   gd->ram_size = get_ram_size(
-   (void *)CONFIG_SYS_SDRAM_BASE,
-   CONFIG_SYS_SDRAM_SIZE);
+   /* dram_init must store complete ramsize in gd->ram_size */
+   gd->ram_size = get_ram_size((void *)PHYS_SDRAM,
+   PHYS_SDRAM_SIZE);
return 0;
 }

+void dram_init_banksize(void)
+{
+   gd->bd->bi_dram[0].start = PHYS_SDRAM;
+   gd->bd->bi_dram[0].size = PHYS_SDRAM_SIZE;
+}
+
 int board_eth_init(bd_t *bis)
 {
int rc = 0;
@@ -140,6 +148,7 @@ int board_eth_init(bd_t *bis)
return rc;
 }

+#ifdef CONFIG_DISPLAY_BOARDINFO
 int checkboard(void)
 {
char str[32];
@@ -173,10 +182,13 @@ int checkboard(void)
puts(", serial# ");
puts(str);
}
+#ifdef CONFIG_REVISION_TAG
printf("\nHardware-revision: 1.%d\n", get_hw_rev());
+#endif
printf("Mach-type: %lu\n", gd->bd->bi_arch_number);
return 0;
 }
+#endif /* CONFIG_DISPLAY_BOARDINFO */

 #ifdef CONFIG_SERIAL_TAG
 void get_board_serial(struct tag_serialnr *serialnr)
diff --git a/include/configs/meesc.h b/include/configs/meesc.h
index 9c53fb4..d976c8e 100644
--- a/include/configs/meesc.h
+++ b/include/configs/meesc.h
@@ -3,7 +3,7 @@
  * Stelian Pop <stel...@popies.net>
  * Lead Tech Design 
  *
- * (C) Copyright 2009-2011
+ * (C) Copyright 2009-2015
  * Daniel Gorsulowski <daniel.gorsulow...@esd.eu>
  * esd electronic system design gmbh 
  *
@@ -27,7 +27,7 @@
  * Since the linker has to swallow that define, we must use a pure
  * hex number here!
  */
-#define CONFIG_SYS_TEXT_BASE   0x20002000
+#define CONFIG_SYS_TEXT_BASE   0x21F0

 /*
  * since a number of boards are not being listed in linux
@@ -56,14 +56,15 @@
 #define CONFIG_DISPLAY_CPUINFO /* display cpu info and speed */
 #define CONFIG_PREBOOT /* enable preboot variable */

+#define CONFIG_CMD_BOOTZ
+#define CONFIG_OF_LIBFDT
+
+#define CONFIG_SYS_GENERIC_BOARD

 /*
  * Hardware drivers
  */

-/* required until arch/arm/include/asm/arch-at91/at91sam9263.h is 
reworked */

-#define ATMEL_PMC_UHP  AT91SAM926x_PMC_UHP
-
 /* general purpose I/O */
 #define CONFIG_AT91_GPIO

@@ -87,10 +88,18 @@
 /*
  * Command line configuration.
  */
+#include 
+#undef CONFIG_CMD_BDI
+#undef CONFIG_CMD_FPGA
+#undef CONFIG_CMD_LOADS
+#undef CONFIG_CMD_IMLS
+
 #define CONFIG_CMD_PING
 #define CONFIG_CMD_DHCP
+
+#ifdef CONFIG_SYS_USE_NANDFLASH
 #define CONFIG_CMD_NAND
-#define CONFIG_CMD_USB
+#endif

 /* LED */
 #define CONFIG_AT91_LED
@@ -99,9 +108,12 @@
  * SDRAM: 1 bank, min 32, max 128 MB
  * Initialized before u-boot gets started.
  */
+#define PHYS_SDRAM ATMEL_BASE_CS1 /* 
0x2000 */
+#define PHYS_SDRAM_SIZE0x0200 /* 32 
MByte */
+
 #define CONFIG_NR_DRAM_BANKS   1
-#define CONFIG_SYS_SDRAM_BASE  0x2000 /* ATMEL_BASE_CS1 */
-#define CONFIG_SYS_SDRAM_SIZE  0x0200
+#define CONFIG_SYS_SDRAM_BASE  PHYS_SDRAM
+#define CONFIG_SYS_SDRAM_SIZE  PHYS_SDRAM_SIZE

 #define CONFIG_SYS_MEMTEST_START   (CONFIG_SYS_SDRAM_BASE + 0x0010)
 #define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_SDRAM_BASE + 0x01E0)
@@ -133,7 +145,7 @@
 #ifdef CONFIG_CMD_NAND
 # define CONFIG_NAND_ATMEL
 # define CONFIG_SYS_MAX_NAND_DEVICE1
-# define CONFIG_SYS_NAND_BASE  0x4000 /* ATMEL_BASE_CS3 */
+# define CONFIG_SYS_NAND_BASE  ATMEL_BASE_CS3 /* 0x4000 */
 # define CONFIG_SYS_NAND_DBW_8
 # define CONFIG_SYS_NAND_MASK_ALE  (1 << 21)
 # define CONFIG_SYS_NAND_MASK_CLE  (1 << 22)
@@ -148,19 +160,6 @@
 #define CONFIG_NET_RETRY_COUNT 20
 #undef CONFI

[U-Boot] [PATCH V2 1/1] arm: at91: reworked meesc board support

2015-10-29 Thread Daniel Gorsulowski

Signed-off-by: Daniel Gorsulowski <daniel.gorsulow...@esd.eu>
---
Changes in V2:
- Fetched again and created patch against current master

 board/esd/meesc/meesc.c | 20 
 include/configs/meesc.h | 42 --
 2 files changed, 36 insertions(+), 26 deletions(-)

diff --git a/board/esd/meesc/meesc.c b/board/esd/meesc/meesc.c
index c5994e0..b7f9f90 100644
--- a/board/esd/meesc/meesc.c
+++ b/board/esd/meesc/meesc.c
@@ -3,7 +3,7 @@
  * Stelian Pop <stel...@popies.net>
  * Lead Tech Design 
  *
- * (C) Copyright 2009-2011
+ * (C) Copyright 2009-2015
  * Daniel Gorsulowski <daniel.gorsulow...@esd.eu>
  * esd electronic system design gmbh 
  *
@@ -28,6 +28,7 @@ DECLARE_GLOBAL_DATA_PTR;
  * Miscelaneous platform dependent initialisations
  */

+#ifdef CONFIG_REVISION_TAG
 static int hw_rev = -1;/* hardware revision */

 int get_hw_rev(void)
@@ -45,6 +46,7 @@ int get_hw_rev(void)

return hw_rev;
 }
+#endif /* CONFIG_REVISION_TAG */

 #ifdef CONFIG_CMD_NAND
 static void meesc_nand_hw_init(void)
@@ -125,12 +127,18 @@ static void meesc_ethercat_hw_init(void)

 int dram_init(void)
 {
-   gd->ram_size = get_ram_size(
-   (void *)CONFIG_SYS_SDRAM_BASE,
-   CONFIG_SYS_SDRAM_SIZE);
+   /* dram_init must store complete ramsize in gd->ram_size */
+   gd->ram_size = get_ram_size((void *)PHYS_SDRAM,
+   PHYS_SDRAM_SIZE);
return 0;
 }

+void dram_init_banksize(void)
+{
+   gd->bd->bi_dram[0].start = PHYS_SDRAM;
+   gd->bd->bi_dram[0].size = PHYS_SDRAM_SIZE;
+}
+
 int board_eth_init(bd_t *bis)
 {
int rc = 0;
@@ -140,6 +148,7 @@ int board_eth_init(bd_t *bis)
return rc;
 }

+#ifdef CONFIG_DISPLAY_BOARDINFO
 int checkboard(void)
 {
char str[32];
@@ -173,10 +182,13 @@ int checkboard(void)
puts(", serial# ");
puts(str);
}
+#ifdef CONFIG_REVISION_TAG
printf("\nHardware-revision: 1.%d\n", get_hw_rev());
+#endif
printf("Mach-type: %lu\n", gd->bd->bi_arch_number);
return 0;
 }
+#endif /* CONFIG_DISPLAY_BOARDINFO */

 #ifdef CONFIG_SERIAL_TAG
 void get_board_serial(struct tag_serialnr *serialnr)
diff --git a/include/configs/meesc.h b/include/configs/meesc.h
index 9c53fb4..10a6ce9 100644
--- a/include/configs/meesc.h
+++ b/include/configs/meesc.h
@@ -3,7 +3,7 @@
  * Stelian Pop <stel...@popies.net>
  * Lead Tech Design 
  *
- * (C) Copyright 2009-2011
+ * (C) Copyright 2009-2015
  * Daniel Gorsulowski <daniel.gorsulow...@esd.eu>
  * esd electronic system design gmbh 
  *
@@ -27,7 +27,7 @@
  * Since the linker has to swallow that define, we must use a pure
  * hex number here!
  */
-#define CONFIG_SYS_TEXT_BASE   0x20002000
+#define CONFIG_SYS_TEXT_BASE   0x21F0

 /*
  * since a number of boards are not being listed in linux
@@ -56,14 +56,13 @@
 #define CONFIG_DISPLAY_CPUINFO /* display cpu info and speed */
 #define CONFIG_PREBOOT /* enable preboot variable */

+#define CONFIG_CMD_BOOTZ
+#define CONFIG_OF_LIBFDT

 /*
  * Hardware drivers
  */

-/* required until arch/arm/include/asm/arch-at91/at91sam9263.h is 
reworked */

-#define ATMEL_PMC_UHP  AT91SAM926x_PMC_UHP
-
 /* general purpose I/O */
 #define CONFIG_AT91_GPIO

@@ -87,10 +86,17 @@
 /*
  * Command line configuration.
  */
+#undef CONFIG_CMD_BDI
+#undef CONFIG_CMD_FPGA
+#undef CONFIG_CMD_LOADS
+#undef CONFIG_CMD_IMLS
+
 #define CONFIG_CMD_PING
 #define CONFIG_CMD_DHCP
+
+#ifdef CONFIG_SYS_USE_NANDFLASH
 #define CONFIG_CMD_NAND
-#define CONFIG_CMD_USB
+#endif

 /* LED */
 #define CONFIG_AT91_LED
@@ -99,9 +105,12 @@
  * SDRAM: 1 bank, min 32, max 128 MB
  * Initialized before u-boot gets started.
  */
+#define PHYS_SDRAM ATMEL_BASE_CS1 /* 
0x2000 */
+#define PHYS_SDRAM_SIZE0x0200 /* 32 
MByte */
+
 #define CONFIG_NR_DRAM_BANKS   1
-#define CONFIG_SYS_SDRAM_BASE  0x2000 /* ATMEL_BASE_CS1 */
-#define CONFIG_SYS_SDRAM_SIZE  0x0200
+#define CONFIG_SYS_SDRAM_BASE  PHYS_SDRAM
+#define CONFIG_SYS_SDRAM_SIZE  PHYS_SDRAM_SIZE

 #define CONFIG_SYS_MEMTEST_START   (CONFIG_SYS_SDRAM_BASE + 0x0010)
 #define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_SDRAM_BASE + 0x01E0)
@@ -133,7 +142,7 @@
 #ifdef CONFIG_CMD_NAND
 # define CONFIG_NAND_ATMEL
 # define CONFIG_SYS_MAX_NAND_DEVICE1
-# define CONFIG_SYS_NAND_BASE  0x4000 /* ATMEL_BASE_CS3 */
+# define CONFIG_SYS_NAND_BASE  ATMEL_BASE_CS3 /* 0x4000 */
 # define CONFIG_SYS_NAND_DBW_8
 # define CONFIG_SYS_NAND_MASK_ALE  (1 << 21)
 # define CONFIG_SYS_NAND_MASK_CLE  (1 << 22)
@@ -148,19 +157,6 @@
 #define CONFIG_NET_RETRY

Re: [U-Boot] [PATCH 17/45] arm: Remove meesc and meesc_dataflash boards

2015-08-30 Thread Daniel Gorsulowski

On 31.08.2015 at 03:19 Simon Glass wrote:

These boards have not been converted to generic board by the deadline.
Remove them.

Signed-off-by: Simon Glass s...@chromium.org
---

  arch/arm/mach-at91/Kconfig|   5 -
  board/esd/meesc/Kconfig   |  12 --
  board/esd/meesc/MAINTAINERS   |   7 -
  board/esd/meesc/Makefile  |  13 --
  board/esd/meesc/meesc.c   | 271 --
  board/esd/meesc/partition.c   |  23 
  configs/meesc_dataflash_defconfig |   9 --
  configs/meesc_defconfig   |   9 --
  include/configs/meesc.h   | 199 
  9 files changed, 548 deletions(-)
  delete mode 100644 board/esd/meesc/Kconfig
  delete mode 100644 board/esd/meesc/MAINTAINERS
  delete mode 100644 board/esd/meesc/Makefile
  delete mode 100644 board/esd/meesc/meesc.c
  delete mode 100644 board/esd/meesc/partition.c
  delete mode 100644 configs/meesc_dataflash_defconfig
  delete mode 100644 configs/meesc_defconfig
  delete mode 100644 include/configs/meesc.h


...

Hello,

I know, deadline is all over. But I was otherwise engaged within last 
few years. Only this mail let me get awoke.


Maybe you'll accept coming patch anyway...

Kind regards,
Daniel

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/1] arm: at91: convert meesc board to generic board

2015-08-30 Thread Daniel Gorsulowski

Signed-off-by: Daniel Gorsulowski daniel.gorsulow...@esd.eu
---
 include/configs/meesc.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/configs/meesc.h b/include/configs/meesc.h
index e5bb873..ab6c910 100644
--- a/include/configs/meesc.h
+++ b/include/configs/meesc.h
@@ -56,6 +56,8 @@
 #define CONFIG_DISPLAY_CPUINFO /* display cpu info and 
speed */
 #define CONFIG_PREBOOT /* enable preboot 
variable */


+#define CONFIG_SYS_GENERIC_BOARD
+
 /*
  * Hardware drivers
  */
--
2.5.0
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] at91: modified NAND flash timing on meesc board

2012-02-19 Thread Daniel Gorsulowski
Hi Albert,

Albert ARIBAUD wrote:
 Hi Daniel,
 
 Le 25/01/2012 14:19, Daniel Gorsulowski a écrit :
 Signed-off-by: Daniel Gorsulowskidaniel.gorsulow...@esd.eu
 ---
   board/esd/meesc/meesc.c |8 
   1 files changed, 4 insertions(+), 4 deletions(-)

 diff --git a/board/esd/meesc/meesc.c b/board/esd/meesc/meesc.c
 index 4882ffc..9dd4375 100644
 --- a/board/esd/meesc/meesc.c
 +++ b/board/esd/meesc/meesc.c
 @@ -73,20 +73,20 @@ static void meesc_nand_hw_init(void)
   writel(csa,matrix-csa[0]);

   /* Configure SMC CS3 for NAND/SmartMedia */
 -writel(AT91_SMC_SETUP_NWE(1) | AT91_SMC_SETUP_NCS_WR(0) |
 -AT91_SMC_SETUP_NRD(1) | AT91_SMC_SETUP_NCS_RD(0),
 +writel(AT91_SMC_SETUP_NWE(1) | AT91_SMC_SETUP_NCS_WR(1) |
 +AT91_SMC_SETUP_NRD(2) | AT91_SMC_SETUP_NCS_RD(2),
   smc-cs[3].setup);

   writel(AT91_SMC_PULSE_NWE(3) | AT91_SMC_PULSE_NCS_WR(3) |
   AT91_SMC_PULSE_NRD(3) | AT91_SMC_PULSE_NCS_RD(3),
   smc-cs[3].pulse);

 -writel(AT91_SMC_CYCLE_NWE(5) | AT91_SMC_CYCLE_NRD(5),
 +writel(AT91_SMC_CYCLE_NWE(6) | AT91_SMC_CYCLE_NRD(6),
   smc-cs[3].cycle);
   writel(AT91_SMC_MODE_RM_NRD | AT91_SMC_MODE_WM_NWE |
   AT91_SMC_MODE_EXNW_DISABLE |
   AT91_SMC_MODE_DBW_8 |
 -AT91_SMC_MODE_TDF_CYCLE(3),
 +AT91_SMC_MODE_TDF_CYCLE(12),
   smc-cs[3].mode);

   /* Configure RDY/BSY */
 
 Is this (and its counterpart for otc570) a performance improvement or a
 bug fix?.

There were problems with a new batch of NAND flashes in our production
process. We figured out, that the NAND timing is too fast.
So I would call this a bug fix.
 
 Amicalement,
 --
 Albert.

Kind regards,
Daniel Gorsulowski
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/2] at91: modified NAND flash timing on meesc board

2012-01-25 Thread Daniel Gorsulowski
Signed-off-by: Daniel Gorsulowski daniel.gorsulow...@esd.eu
---
 board/esd/meesc/meesc.c |8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/board/esd/meesc/meesc.c b/board/esd/meesc/meesc.c
index 4882ffc..9dd4375 100644
--- a/board/esd/meesc/meesc.c
+++ b/board/esd/meesc/meesc.c
@@ -73,20 +73,20 @@ static void meesc_nand_hw_init(void)
writel(csa, matrix-csa[0]);
 
/* Configure SMC CS3 for NAND/SmartMedia */
-   writel(AT91_SMC_SETUP_NWE(1) | AT91_SMC_SETUP_NCS_WR(0) |
-   AT91_SMC_SETUP_NRD(1) | AT91_SMC_SETUP_NCS_RD(0),
+   writel(AT91_SMC_SETUP_NWE(1) | AT91_SMC_SETUP_NCS_WR(1) |
+   AT91_SMC_SETUP_NRD(2) | AT91_SMC_SETUP_NCS_RD(2),
smc-cs[3].setup);
 
writel(AT91_SMC_PULSE_NWE(3) | AT91_SMC_PULSE_NCS_WR(3) |
AT91_SMC_PULSE_NRD(3) | AT91_SMC_PULSE_NCS_RD(3),
smc-cs[3].pulse);
 
-   writel(AT91_SMC_CYCLE_NWE(5) | AT91_SMC_CYCLE_NRD(5),
+   writel(AT91_SMC_CYCLE_NWE(6) | AT91_SMC_CYCLE_NRD(6),
smc-cs[3].cycle);
writel(AT91_SMC_MODE_RM_NRD | AT91_SMC_MODE_WM_NWE |
AT91_SMC_MODE_EXNW_DISABLE |
AT91_SMC_MODE_DBW_8 |
-   AT91_SMC_MODE_TDF_CYCLE(3),
+   AT91_SMC_MODE_TDF_CYCLE(12),
smc-cs[3].mode);
 
/* Configure RDY/BSY */
-- 
1.5.3

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 2/2] at91: modified NAND flash timing on otc570 board

2012-01-25 Thread Daniel Gorsulowski
Signed-off-by: Daniel Gorsulowski daniel.gorsulow...@esd.eu
---
 board/esd/otc570/otc570.c |8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/board/esd/otc570/otc570.c b/board/esd/otc570/otc570.c
index 5dded41..0c12b66 100644
--- a/board/esd/otc570/otc570.c
+++ b/board/esd/otc570/otc570.c
@@ -81,20 +81,20 @@ static void otc570_nand_hw_init(void)
writel(csa, matrix-csa[0]);
 
/* Configure SMC CS3 for NAND/SmartMedia */
-   writel(AT91_SMC_SETUP_NWE(1) | AT91_SMC_SETUP_NCS_WR(0) |
-   AT91_SMC_SETUP_NRD(1) | AT91_SMC_SETUP_NCS_RD(0),
+   writel(AT91_SMC_SETUP_NWE(1) | AT91_SMC_SETUP_NCS_WR(1) |
+   AT91_SMC_SETUP_NRD(2) | AT91_SMC_SETUP_NCS_RD(2),
smc-cs[3].setup);
 
writel(AT91_SMC_PULSE_NWE(3) | AT91_SMC_PULSE_NCS_WR(3) |
AT91_SMC_PULSE_NRD(3) | AT91_SMC_PULSE_NCS_RD(3),
smc-cs[3].pulse);
 
-   writel(AT91_SMC_CYCLE_NWE(5) | AT91_SMC_CYCLE_NRD(5),
+   writel(AT91_SMC_CYCLE_NWE(6) | AT91_SMC_CYCLE_NRD(6),
smc-cs[3].cycle);
writel(AT91_SMC_MODE_RM_NRD | AT91_SMC_MODE_WM_NWE |
AT91_SMC_MODE_EXNW_DISABLE |
AT91_SMC_MODE_DBW_8 |
-   AT91_SMC_MODE_TDF_CYCLE(3),
+   AT91_SMC_MODE_TDF_CYCLE(12),
smc-cs[3].mode);
 
/* Configure RDY/BSY */
-- 
1.5.3

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/2] at91: defined mach-types for meesc board in board config file

2011-10-31 Thread Daniel Gorsulowski
quotation from Albert ARIBAUD:
Recently the ARM mach-types.h file has been brought in sync with its
Linux original, leasing to a number of boards not being listed any more,
as the new list only contains boards which have actual Linux support or
were declared less than one year ago.

The symptom is a build failure with a message of the form error:
'MACH_TYPE_XX' undeclared (first use in this function).

U-Boot maintainers of such boards (in Cc: of this mail) should provide a
patch to re-introduce the MACH_TYPE_XX definition in their boards'
config header file in include/configs/.

Signed-off-by: Daniel Gorsulowski daniel.gorsulow...@esd.eu
---
 include/configs/meesc.h |8 
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/include/configs/meesc.h b/include/configs/meesc.h
index a2b55d5..ea40290 100644
--- a/include/configs/meesc.h
+++ b/include/configs/meesc.h
@@ -45,6 +45,14 @@
  */
 #define CONFIG_SYS_TEXT_BASE   0x20002000
 
+/*
+ * since a number of boards are not being listed in linux
+ * arch/arm/tools/mach-types any more, the mach-types have to be
+ * defined here
+ */
+#define MACH_TYPE_MEESC2165
+#define MACH_TYPE_ETHERCAN22407
+
 /* ARM asynchronous clock */
 #define CONFIG_SYS_AT91_SLOW_CLOCK 32768   /* 32.768 kHz crystal */
 #define CONFIG_SYS_AT91_MAIN_CLOCK 1600/* 16.0 MHz crystal */
-- 
1.5.3

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 2/2] at91: defined mach-types for otc570 board in board config file

2011-10-31 Thread Daniel Gorsulowski
quotation from Albert ARIBAUD:
Recently the ARM mach-types.h file has been brought in sync with its
Linux original, leasing to a number of boards not being listed any more,
as the new list only contains boards which have actual Linux support or
were declared less than one year ago.

The symptom is a build failure with a message of the form error:
'MACH_TYPE_XX' undeclared (first use in this function).

U-Boot maintainers of such boards (in Cc: of this mail) should provide a
patch to re-introduce the MACH_TYPE_XX definition in their boards'
config header file in include/configs/.

Signed-off-by: Daniel Gorsulowski daniel.gorsulow...@esd.eu
---
 include/configs/otc570.h |7 +++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/include/configs/otc570.h b/include/configs/otc570.h
index e2c2eda..c068aa0 100644
--- a/include/configs/otc570.h
+++ b/include/configs/otc570.h
@@ -45,6 +45,13 @@
  */
 #define CONFIG_SYS_TEXT_BASE   0x20002000
 
+/*
+ * since a number of boards are not being listed in linux
+ * arch/arm/tools/mach-types any more, the mach-types have to be
+ * defined here
+ */
+#define MACH_TYPE_OTC570   2166
+
 /* ARM asynchronous clock */
 #define CONFIG_SYS_AT91_SLOW_CLOCK 32768   /* 32.768 kHz crystal */
 #define CONFIG_SYS_AT91_MAIN_CLOCK 1600/* 16.0 MHz crystal */
-- 
1.5.3

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Nand: Uboot-Environment at bad block

2011-08-04 Thread Daniel Gorsulowski
Arno Steffen wrote:
 In one of my devices, uboot-environment is located at a bad block.
 save
 Saving Environment to NAND...
 Erasing Nand...
 Skipping bad block at  0x000c
 
 Writing to Nand... FAILED!
 
 In my memory mapping I have already reseverd 2blocks.
 How can I setup uboot in a way, that it will look at c or (in case
 of bad block) at the next block e?
 
...
 
 Maybe someone can give me an advice?
 Thanks
 - Arno
 
...

Hello!

Is there a solution to this problem?
I was going to ask exactly the same question, but then I found this topic.

My board config (ARM platform) is
  #define CONFIG_ENV_IS_IN_NAND 1
  #define CONFIG_ENV_OFFSET 0xC
  #define CONFIG_ENV_SIZE   0x2

Now there is a board with a bad block exactly at 0xC
  = nand bad

  Device 0 bad blocks:
000c
02f4
...

If I try to write the environment, i get
  Saving Environment to NAND...
  Erasing Nand...
  Skipping bad block at  0x000c

  Writing to Nand... FAILED!

Any hints?

Kind regards
Daniel

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH-V2 2/2] at91: reworked support for otc570 board

2011-04-20 Thread Daniel Gorsulowski
Hello Reinhard,

Reinhard Meyer wrote:
 Am 18.04.2011 16:15, schrieb Daniel Gorsulowski:
 The otc570 board support was broken. Within this opportunity, I completely
 reworked the board files.

 Signed-off-by: Daniel Gorsulowski daniel.gorsulow...@esd.eu
 ---

 This patch is based on u-boot-atmel/rework101229 branch (minus the last 5
 patches) plus the 'at91: fixed at91sam9263 system file' patch in
 u-boot-atmel/next branch.

 V2: -fixed commit description

  board/esd/otc570/config.mk |1 -
  board/esd/otc570/otc570.c  |  106 ++
  boards.cfg |3 +-
  include/configs/otc570.h   |  265 
 +---
  4 files changed, 211 insertions(+), 164 deletions(-)
  delete mode 100644 board/esd/otc570/config.mk
 
 This patch had several places with spacetab or start of linespace.
 
 I removed them manually. Please, next time run your patches through
 linux/scripts/checkpatch.pl. Thanks.

Sorry, but I checked my patches by checkpatch.pl. Maybe you can explain
me, what I did wrong?

danielg@debby:~/git/u-boot-atmel$
../linux/linux-2.6/scripts/checkpatch.pl
0002-at91-reworked-support-for-otc570-board.patch
WARNING: Use #include linux/io.h instead of asm/io.h
#48: FILE: board/esd/otc570/otc570.c:30:
+#include asm/io.h

ERROR: Macros with complex values should be enclosed in parenthesis
#578: FILE: include/configs/otc570.h:209:
+# define CONFIG_SYS_NAND_ENABLE_PINAT91_PIO_PORTD, 15

ERROR: Macros with complex values should be enclosed in parenthesis
#579: FILE: include/configs/otc570.h:210:
+# define CONFIG_SYS_NAND_READY_PIN AT91_PIO_PORTA, 22

total: 2 errors, 1 warnings, 610 lines checked

0002-at91-reworked-support-for-otc570-board.patch has style problems,
please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

 
 Applied to u-boot-atmel/next.

Thank you!

 
 Best Regards,
 
 Reinhard
 ___
 U-Boot mailing list
 U-Boot@lists.denx.de
 http://lists.denx.de/mailman/listinfo/u-boot
 
 
 

-- 
Mit freundlichen Grüßen
Daniel Gorsulowski

-
B.Eng. Daniel Gorsulowski
System-Design

esd electronic system design gmbh
Vahrenwalder Str. 207 - 30165 Hannover - GERMANY
Telefon: 0511-37298-192 - Fax: 0511-37298-68
Bitte besuchen Sie uns im Internet unter http://www.esd.eu
Quality Products - Made in Germany
-
Geschäftsführer: Klaus Detering
Amtsgericht Hannover HRB 51373 - VAT-ID DE 115672832
-
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH-V2 1/2] at91: reworked support for meesc board

2011-04-18 Thread Daniel Gorsulowski
The meesc board support was broken. Within this opportunity, I completely
reworked the board files.

Signed-off-by: Daniel Gorsulowski daniel.gorsulow...@esd.eu
---

This patch is based on u-boot-atmel/rework101229 branch (minus the last 5
patches) plus the 'at91: fixed at91sam9263 system file' patch in
u-boot-atmel/next branch.

V2: -fixed commit description

 board/esd/meesc/config.mk |1 -
 board/esd/meesc/meesc.c   |   49 ++-
 boards.cfg|3 +-
 include/configs/meesc.h   |  208 ++---
 4 files changed, 149 insertions(+), 112 deletions(-)
 delete mode 100644 board/esd/meesc/config.mk

diff --git a/board/esd/meesc/config.mk b/board/esd/meesc/config.mk
deleted file mode 100644
index 2077692..000
--- a/board/esd/meesc/config.mk
+++ /dev/null
@@ -1 +0,0 @@
-CONFIG_SYS_TEXT_BASE = 0x21f0
diff --git a/board/esd/meesc/meesc.c b/board/esd/meesc/meesc.c
index 41fa3e1..e016b68 100644
--- a/board/esd/meesc/meesc.c
+++ b/board/esd/meesc/meesc.c
@@ -3,7 +3,7 @@
  * Stelian Pop stelian@leadtechdesign.com
  * Lead Tech Design www.leadtechdesign.com
  *
- * (C) Copyright 2009-2010
+ * (C) Copyright 2009-2011
  * Daniel Gorsulowski daniel.gorsulow...@esd.eu
  * esd electronic system design gmbh www.esd.eu
  *
@@ -27,7 +27,7 @@
  */
 
 #include common.h
-#include asm/arch/at91sam9263.h
+#include asm/io.h
 #include asm/arch/at91sam9_smc.h
 #include asm/arch/at91_common.h
 #include asm/arch/at91_pmc.h
@@ -35,8 +35,6 @@
 #include asm/arch/at91_matrix.h
 #include asm/arch/at91_pio.h
 #include asm/arch/clk.h
-#include asm/arch/hardware.h
-#include asm/arch/io.h
 #include netdev.h
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -67,8 +65,8 @@ int get_hw_rev(void)
 static void meesc_nand_hw_init(void)
 {
unsigned long csa;
-   at91_smc_t  *smc= (at91_smc_t *) AT91_SMC0_BASE;
-   at91_matrix_t   *matrix = (at91_matrix_t *) AT91_MATRIX_BASE;
+   at91_smc_t  *smc= (at91_smc_t *) ATMEL_BASE_SMC0;
+   at91_matrix_t   *matrix = (at91_matrix_t *) ATMEL_BASE_MATRIX;
 
/* Enable CS3 */
csa = readl(matrix-csa[0]) | AT91_MATRIX_CSA_EBI_CS3A;
@@ -88,7 +86,7 @@ static void meesc_nand_hw_init(void)
writel(AT91_SMC_MODE_RM_NRD | AT91_SMC_MODE_WM_NWE |
AT91_SMC_MODE_EXNW_DISABLE |
AT91_SMC_MODE_DBW_8 |
-   AT91_SMC_MODE_TDF_CYCLE(2),
+   AT91_SMC_MODE_TDF_CYCLE(3),
smc-cs[3].mode);
 
/* Configure RDY/BSY */
@@ -102,9 +100,9 @@ static void meesc_nand_hw_init(void)
 #ifdef CONFIG_MACB
 static void meesc_macb_hw_init(void)
 {
-   at91_pmc_t  *pmc= (at91_pmc_t *) AT91_PMC_BASE;
+   at91_pmc_t  *pmc= (at91_pmc_t *) ATMEL_BASE_PMC;
/* Enable clock */
-   writel(1  AT91SAM9263_ID_EMAC, pmc-pcer);
+   writel(1  ATMEL_ID_EMAC, pmc-pcer);
at91_macb_hw_init();
 }
 #endif
@@ -117,7 +115,7 @@ static void meesc_macb_hw_init(void)
  */
 static void meesc_ethercat_hw_init(void)
 {
-   at91_smc_t  *smc1   = (at91_smc_t *) AT91_SMC1_BASE;
+   at91_smc_t  *smc1   = (at91_smc_t *) ATMEL_BASE_SMC1;
 
/* Configure SMC EBI1_CS0 for EtherCAT */
writel(AT91_SMC_SETUP_NWE(0) | AT91_SMC_SETUP_NCS_WR(0) |
@@ -142,8 +140,9 @@ static void meesc_ethercat_hw_init(void)
 
 int dram_init(void)
 {
-   gd-bd-bi_dram[0].start = PHYS_SDRAM;
-   gd-bd-bi_dram[0].size = get_ram_size((long *) PHYS_SDRAM, (1  27));
+   gd-ram_size = get_ram_size(
+   (void *)CONFIG_SYS_SDRAM_BASE,
+   CONFIG_SYS_SDRAM_SIZE);
return 0;
 }
 
@@ -151,7 +150,7 @@ int board_eth_init(bd_t *bis)
 {
int rc = 0;
 #ifdef CONFIG_MACB
-   rc = macb_eth_initialize(0, (void *)AT91_EMAC_BASE, 0x00);
+   rc = macb_eth_initialize(0, (void *)ATMEL_BASE_EMAC, 0x00);
 #endif
return rc;
 }
@@ -225,7 +224,7 @@ int misc_init_r(void)
 {
char*str;
charbuf[32];
-   at91_pmc_t  *pmc = (at91_pmc_t *) AT91_PMC_BASE;
+   at91_pmc_t  *pmc = (at91_pmc_t *) ATMEL_BASE_PMC;
 
/*
 * Normally the processor clock has a divisor of 2.
@@ -246,24 +245,28 @@ int misc_init_r(void)
 }
 #endif /* CONFIG_MISC_INIT_R */
 
-int board_init(void)
+int board_early_init_f(void)
 {
-   at91_pmc_t  *pmc= (at91_pmc_t *) AT91_PMC_BASE;
+   at91_pmc_t  *pmc= (at91_pmc_t *) ATMEL_BASE_PMC;
 
-   /* Peripheral Clock Enable Register */
-   writel(1  AT91SAM9263_ID_PIOA |
-   1  AT91SAM9263_ID_PIOB |
-   1  AT91SAM9263_ID_PIOCDE |
-   1  AT91SAM9263_ID_UHP,
+   /* enable all clocks */
+   writel((1  ATMEL_ID_PIOA) | (1  ATMEL_ID_PIOB) |
+   (1  ATMEL_ID_PIOCDE) | (1  ATMEL_ID_UHP),
pmc-pcer);
 
+   at91_seriald_hw_init();
+
+   return 0;
+}
+
+int board_init(void)
+{
/* initialize ET1100 Controller

[U-Boot] [PATCH-V2 2/2] at91: reworked support for otc570 board

2011-04-18 Thread Daniel Gorsulowski
The otc570 board support was broken. Within this opportunity, I completely
reworked the board files.

Signed-off-by: Daniel Gorsulowski daniel.gorsulow...@esd.eu
---

This patch is based on u-boot-atmel/rework101229 branch (minus the last 5
patches) plus the 'at91: fixed at91sam9263 system file' patch in
u-boot-atmel/next branch.

V2: -fixed commit description

 board/esd/otc570/config.mk |1 -
 board/esd/otc570/otc570.c  |  106 ++
 boards.cfg |3 +-
 include/configs/otc570.h   |  265 +---
 4 files changed, 211 insertions(+), 164 deletions(-)
 delete mode 100644 board/esd/otc570/config.mk

diff --git a/board/esd/otc570/config.mk b/board/esd/otc570/config.mk
deleted file mode 100644
index e554a45..000
--- a/board/esd/otc570/config.mk
+++ /dev/null
@@ -1 +0,0 @@
-CONFIG_SYS_TEXT_BASE = 0x23f0
diff --git a/board/esd/otc570/otc570.c b/board/esd/otc570/otc570.c
index 410d8b4..f025fc9 100644
--- a/board/esd/otc570/otc570.c
+++ b/board/esd/otc570/otc570.c
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2010
+ * (C) Copyright 2010-2011
  * Daniel Gorsulowski daniel.gorsulow...@esd.eu
  * esd electronic system design gmbh www.esd.eu
  *
@@ -27,7 +27,7 @@
  */
 
 #include common.h
-#include asm/arch/at91sam9263.h
+#include asm/io.h
 #include asm/arch/at91sam9_smc.h
 #include asm/arch/at91_common.h
 #include asm/arch/at91_pmc.h
@@ -35,14 +35,14 @@
 #include asm/arch/at91_matrix.h
 #include asm/arch/at91_pio.h
 #include asm/arch/clk.h
-#include asm/arch/hardware.h
-#include asm/arch/io.h
-#include atmel_lcdc.h
-#include lcd.h
 #include netdev.h
-#ifdef CONFIG_LCD_INFO
-#include nand.h
-#include version.h
+#ifdef CONFIG_LCD
+# include atmel_lcdc.h
+# include lcd.h
+# ifdef CONFIG_LCD_INFO
+#  include nand.h
+#  include version.h
+# endif
 #endif
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -73,8 +73,8 @@ int get_hw_rev(void)
 static void otc570_nand_hw_init(void)
 {
unsigned long csa;
-   at91_smc_t  *smc= (at91_smc_t *) AT91_SMC0_BASE;
-   at91_matrix_t   *matrix = (at91_matrix_t *) AT91_MATRIX_BASE;
+   at91_smc_t  *smc= (at91_smc_t *) ATMEL_BASE_SMC0;
+   at91_matrix_t   *matrix = (at91_matrix_t *) ATMEL_BASE_MATRIX;
 
/* Enable CS3 */
csa = readl(matrix-csa[0]) | AT91_MATRIX_CSA_EBI_CS3A;
@@ -93,8 +93,8 @@ static void otc570_nand_hw_init(void)
smc-cs[3].cycle);
writel(AT91_SMC_MODE_RM_NRD | AT91_SMC_MODE_WM_NWE |
AT91_SMC_MODE_EXNW_DISABLE |
-  AT91_SMC_MODE_DBW_8 |
-  AT91_SMC_MODE_TDF_CYCLE(2),
+   AT91_SMC_MODE_DBW_8 |
+   AT91_SMC_MODE_TDF_CYCLE(3),
smc-cs[3].mode);
 
/* Configure RDY/BSY */
@@ -108,9 +108,9 @@ static void otc570_nand_hw_init(void)
 #ifdef CONFIG_MACB
 static void otc570_macb_hw_init(void)
 {
-   at91_pmc_t  *pmc= (at91_pmc_t *) AT91_PMC_BASE;
+   at91_pmc_t  *pmc= (at91_pmc_t *) ATMEL_BASE_PMC;
/* Enable clock */
-   writel(1  AT91SAM9263_ID_EMAC, pmc-pcer);
+   writel(1  ATMEL_ID_EMAC, pmc-pcer);
at91_macb_hw_init();
 }
 #endif
@@ -123,7 +123,7 @@ static void otc570_macb_hw_init(void)
  */
 static void otc570_ethercat_hw_init(void)
 {
-   at91_smc_t  *smc1   = (at91_smc_t *) AT91_SMC1_BASE;
+   at91_smc_t  *smc1   = (at91_smc_t *) ATMEL_BASE_SMC1;
 
/* Configure SMC EBI1_CS0 for EtherCAT */
writel(AT91_SMC_SETUP_NWE(0) | AT91_SMC_SETUP_NCS_WR(0) |
@@ -155,7 +155,7 @@ vidinfo_t panel_info = {
.vl_sync =  ATMEL_LCDC_INVLINE_INVERTED |
ATMEL_LCDC_INVFRAME_INVERTED,
 
-   .vl_bpix =  3,  /* Bits per pixel, 0 = 1bit, 3 = 8bit */
+   .vl_bpix =  LCD_BPP,/* Bits per pixel, 0 = 1bit, 3 = 8bit */
.vl_tft =   1,  /* 0 = passive, 1 = TFT */
.vl_vsync_len = 1,  /* Length of vertical sync in NOL */
.vl_upper_margin =  35, /* Idle lines at the frame start */
@@ -164,22 +164,22 @@ vidinfo_t panel_info = {
.vl_left_margin =   112,/* Idle cycles at the line beginning */
.vl_right_margin =  1,  /* Idle cycles at the end of the line */
 
-   .mmio = AT91SAM9263_LCDC_BASE,
+   .mmio = ATMEL_BASE_LCDC,
 };
 
 void lcd_enable(void)
 {
-   at91_set_pio_value(AT91_PIO_PORTA, 30, 0);  /* power up */
+   at91_set_pio_value(AT91_PIO_PORTA, 30, 0); /* power up */
 }
 
 void lcd_disable(void)
 {
-   at91_set_pio_value(AT91_PIO_PORTA, 30, 1);  /* power down */
+   at91_set_pio_value(AT91_PIO_PORTA, 30, 1); /* power down */
 }
 
 static void otc570_lcd_hw_init(void)
 {
-   at91_pmc_t  *pmc= (at91_pmc_t *) AT91_PMC_BASE;
+   at91_pmc_t  *pmc= (at91_pmc_t *) ATMEL_BASE_PMC;
 
at91_set_a_periph(AT91_PIO_PORTC, 0, 0);/* LCDVSYNC

[U-Boot] [PATCH 1/1] at91: reworked support for otc570 board

2011-04-15 Thread Daniel Gorsulowski
After relocation rework, the meesc and otc570 board support
was broken. This patch will fix the otc570 board.

Signed-off-by: Daniel Gorsulowski daniel.gorsulow...@esd.eu
---

This patch is based on u-boot-atmel/rework101229 branch (minus the last 5
patches) plus the 'at91: fixed at91sam9263 system file' patch in
u-boot-atmel/next branch.

 board/esd/otc570/config.mk |1 -
 board/esd/otc570/otc570.c  |  106 ++
 boards.cfg |3 +-
 include/configs/otc570.h   |  265 +---
 4 files changed, 211 insertions(+), 164 deletions(-)
 delete mode 100644 board/esd/otc570/config.mk

diff --git a/board/esd/otc570/config.mk b/board/esd/otc570/config.mk
deleted file mode 100644
index e554a45..000
--- a/board/esd/otc570/config.mk
+++ /dev/null
@@ -1 +0,0 @@
-CONFIG_SYS_TEXT_BASE = 0x23f0
diff --git a/board/esd/otc570/otc570.c b/board/esd/otc570/otc570.c
index 410d8b4..f025fc9 100644
--- a/board/esd/otc570/otc570.c
+++ b/board/esd/otc570/otc570.c
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2010
+ * (C) Copyright 2010-2011
  * Daniel Gorsulowski daniel.gorsulow...@esd.eu
  * esd electronic system design gmbh www.esd.eu
  *
@@ -27,7 +27,7 @@
  */
 
 #include common.h
-#include asm/arch/at91sam9263.h
+#include asm/io.h
 #include asm/arch/at91sam9_smc.h
 #include asm/arch/at91_common.h
 #include asm/arch/at91_pmc.h
@@ -35,14 +35,14 @@
 #include asm/arch/at91_matrix.h
 #include asm/arch/at91_pio.h
 #include asm/arch/clk.h
-#include asm/arch/hardware.h
-#include asm/arch/io.h
-#include atmel_lcdc.h
-#include lcd.h
 #include netdev.h
-#ifdef CONFIG_LCD_INFO
-#include nand.h
-#include version.h
+#ifdef CONFIG_LCD
+# include atmel_lcdc.h
+# include lcd.h
+# ifdef CONFIG_LCD_INFO
+#  include nand.h
+#  include version.h
+# endif
 #endif
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -73,8 +73,8 @@ int get_hw_rev(void)
 static void otc570_nand_hw_init(void)
 {
unsigned long csa;
-   at91_smc_t  *smc= (at91_smc_t *) AT91_SMC0_BASE;
-   at91_matrix_t   *matrix = (at91_matrix_t *) AT91_MATRIX_BASE;
+   at91_smc_t  *smc= (at91_smc_t *) ATMEL_BASE_SMC0;
+   at91_matrix_t   *matrix = (at91_matrix_t *) ATMEL_BASE_MATRIX;
 
/* Enable CS3 */
csa = readl(matrix-csa[0]) | AT91_MATRIX_CSA_EBI_CS3A;
@@ -93,8 +93,8 @@ static void otc570_nand_hw_init(void)
smc-cs[3].cycle);
writel(AT91_SMC_MODE_RM_NRD | AT91_SMC_MODE_WM_NWE |
AT91_SMC_MODE_EXNW_DISABLE |
-  AT91_SMC_MODE_DBW_8 |
-  AT91_SMC_MODE_TDF_CYCLE(2),
+   AT91_SMC_MODE_DBW_8 |
+   AT91_SMC_MODE_TDF_CYCLE(3),
smc-cs[3].mode);
 
/* Configure RDY/BSY */
@@ -108,9 +108,9 @@ static void otc570_nand_hw_init(void)
 #ifdef CONFIG_MACB
 static void otc570_macb_hw_init(void)
 {
-   at91_pmc_t  *pmc= (at91_pmc_t *) AT91_PMC_BASE;
+   at91_pmc_t  *pmc= (at91_pmc_t *) ATMEL_BASE_PMC;
/* Enable clock */
-   writel(1  AT91SAM9263_ID_EMAC, pmc-pcer);
+   writel(1  ATMEL_ID_EMAC, pmc-pcer);
at91_macb_hw_init();
 }
 #endif
@@ -123,7 +123,7 @@ static void otc570_macb_hw_init(void)
  */
 static void otc570_ethercat_hw_init(void)
 {
-   at91_smc_t  *smc1   = (at91_smc_t *) AT91_SMC1_BASE;
+   at91_smc_t  *smc1   = (at91_smc_t *) ATMEL_BASE_SMC1;
 
/* Configure SMC EBI1_CS0 for EtherCAT */
writel(AT91_SMC_SETUP_NWE(0) | AT91_SMC_SETUP_NCS_WR(0) |
@@ -155,7 +155,7 @@ vidinfo_t panel_info = {
.vl_sync =  ATMEL_LCDC_INVLINE_INVERTED |
ATMEL_LCDC_INVFRAME_INVERTED,
 
-   .vl_bpix =  3,  /* Bits per pixel, 0 = 1bit, 3 = 8bit */
+   .vl_bpix =  LCD_BPP,/* Bits per pixel, 0 = 1bit, 3 = 8bit */
.vl_tft =   1,  /* 0 = passive, 1 = TFT */
.vl_vsync_len = 1,  /* Length of vertical sync in NOL */
.vl_upper_margin =  35, /* Idle lines at the frame start */
@@ -164,22 +164,22 @@ vidinfo_t panel_info = {
.vl_left_margin =   112,/* Idle cycles at the line beginning */
.vl_right_margin =  1,  /* Idle cycles at the end of the line */
 
-   .mmio = AT91SAM9263_LCDC_BASE,
+   .mmio = ATMEL_BASE_LCDC,
 };
 
 void lcd_enable(void)
 {
-   at91_set_pio_value(AT91_PIO_PORTA, 30, 0);  /* power up */
+   at91_set_pio_value(AT91_PIO_PORTA, 30, 0); /* power up */
 }
 
 void lcd_disable(void)
 {
-   at91_set_pio_value(AT91_PIO_PORTA, 30, 1);  /* power down */
+   at91_set_pio_value(AT91_PIO_PORTA, 30, 1); /* power down */
 }
 
 static void otc570_lcd_hw_init(void)
 {
-   at91_pmc_t  *pmc= (at91_pmc_t *) AT91_PMC_BASE;
+   at91_pmc_t  *pmc= (at91_pmc_t *) ATMEL_BASE_PMC;
 
at91_set_a_periph(AT91_PIO_PORTC, 0, 0);/* LCDVSYNC */
at91_set_a_periph

[U-Boot] [PATCH 1/1] at91: reworked support for meesc board

2011-04-13 Thread Daniel Gorsulowski
After relocation rework, the meesc and otc570 board support
was broken. This patch will fix the meesc board.

Signed-off-by: Daniel Gorsulowski daniel.gorsulow...@esd.eu
---

This patch is based on u-boot-atmel/rework101229 branch (minus the last 5
patches) plus the 'at91: fixed at91sam9263 system file' patch in
u-boot-atmel/next branch.
The patch for the otc570 board will follow.

 board/esd/meesc/config.mk |1 -
 board/esd/meesc/meesc.c   |   49 ++-
 boards.cfg|3 +-
 include/configs/meesc.h   |  208 ++---
 4 files changed, 149 insertions(+), 112 deletions(-)
 delete mode 100644 board/esd/meesc/config.mk

diff --git a/board/esd/meesc/config.mk b/board/esd/meesc/config.mk
deleted file mode 100644
index 2077692..000
--- a/board/esd/meesc/config.mk
+++ /dev/null
@@ -1 +0,0 @@
-CONFIG_SYS_TEXT_BASE = 0x21f0
diff --git a/board/esd/meesc/meesc.c b/board/esd/meesc/meesc.c
index 41fa3e1..14a6682 100644
--- a/board/esd/meesc/meesc.c
+++ b/board/esd/meesc/meesc.c
@@ -3,7 +3,7 @@
  * Stelian Pop stelian@leadtechdesign.com
  * Lead Tech Design www.leadtechdesign.com
  *
- * (C) Copyright 2009-2010
+ * (C) Copyright 2009-2011
  * Daniel Gorsulowski daniel.gorsulow...@esd.eu
  * esd electronic system design gmbh www.esd.eu
  *
@@ -27,7 +27,7 @@
  */
 
 #include common.h
-#include asm/arch/at91sam9263.h
+#include asm/io.h
 #include asm/arch/at91sam9_smc.h
 #include asm/arch/at91_common.h
 #include asm/arch/at91_pmc.h
@@ -35,8 +35,6 @@
 #include asm/arch/at91_matrix.h
 #include asm/arch/at91_pio.h
 #include asm/arch/clk.h
-#include asm/arch/hardware.h
-#include asm/arch/io.h
 #include netdev.h
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -67,8 +65,8 @@ int get_hw_rev(void)
 static void meesc_nand_hw_init(void)
 {
unsigned long csa;
-   at91_smc_t  *smc= (at91_smc_t *) AT91_SMC0_BASE;
-   at91_matrix_t   *matrix = (at91_matrix_t *) AT91_MATRIX_BASE;
+   at91_smc_t  *smc= (at91_smc_t *) ATMEL_BASE_SMC0;
+   at91_matrix_t   *matrix = (at91_matrix_t *) ATMEL_BASE_MATRIX;
 
/* Enable CS3 */
csa = readl(matrix-csa[0]) | AT91_MATRIX_CSA_EBI_CS3A;
@@ -88,7 +86,7 @@ static void meesc_nand_hw_init(void)
writel(AT91_SMC_MODE_RM_NRD | AT91_SMC_MODE_WM_NWE |
AT91_SMC_MODE_EXNW_DISABLE |
AT91_SMC_MODE_DBW_8 |
-   AT91_SMC_MODE_TDF_CYCLE(2),
+   AT91_SMC_MODE_TDF_CYCLE(3),
smc-cs[3].mode);
 
/* Configure RDY/BSY */
@@ -102,9 +100,9 @@ static void meesc_nand_hw_init(void)
 #ifdef CONFIG_MACB
 static void meesc_macb_hw_init(void)
 {
-   at91_pmc_t  *pmc= (at91_pmc_t *) AT91_PMC_BASE;
+   at91_pmc_t  *pmc= (at91_pmc_t *) ATMEL_BASE_PMC;
/* Enable clock */
-   writel(1  AT91SAM9263_ID_EMAC, pmc-pcer);
+   writel(1  ATMEL_ID_EMAC, pmc-pcer);
at91_macb_hw_init();
 }
 #endif
@@ -117,7 +115,7 @@ static void meesc_macb_hw_init(void)
  */
 static void meesc_ethercat_hw_init(void)
 {
-   at91_smc_t  *smc1   = (at91_smc_t *) AT91_SMC1_BASE;
+   at91_smc_t  *smc1   = (at91_smc_t *) ATMEL_BASE_SMC1;
 
/* Configure SMC EBI1_CS0 for EtherCAT */
writel(AT91_SMC_SETUP_NWE(0) | AT91_SMC_SETUP_NCS_WR(0) |
@@ -142,8 +140,9 @@ static void meesc_ethercat_hw_init(void)
 
 int dram_init(void)
 {
-   gd-bd-bi_dram[0].start = PHYS_SDRAM;
-   gd-bd-bi_dram[0].size = get_ram_size((long *) PHYS_SDRAM, (1  27));
+   gd-ram_size = get_ram_size(
+   (void *)CONFIG_SYS_SDRAM_BASE,
+   CONFIG_SYS_SDRAM_SIZE);
return 0;
 }
 
@@ -151,7 +150,7 @@ int board_eth_init(bd_t *bis)
 {
int rc = 0;
 #ifdef CONFIG_MACB
-   rc = macb_eth_initialize(0, (void *)AT91_EMAC_BASE, 0x00);
+   rc = macb_eth_initialize(0, (void *)ATMEL_BASE_EMAC, 0x00);
 #endif
return rc;
 }
@@ -225,7 +224,7 @@ int misc_init_r(void)
 {
char*str;
charbuf[32];
-   at91_pmc_t  *pmc = (at91_pmc_t *) AT91_PMC_BASE;
+   at91_pmc_t  *pmc = (at91_pmc_t *) ATMEL_BASE_PMC;
 
/*
 * Normally the processor clock has a divisor of 2.
@@ -246,24 +245,28 @@ int misc_init_r(void)
 }
 #endif /* CONFIG_MISC_INIT_R */
 
-int board_init(void)
+int board_early_init_f(void)
 {
-   at91_pmc_t  *pmc= (at91_pmc_t *) AT91_PMC_BASE;
+   at91_pmc_t  *pmc= (at91_pmc_t *) ATMEL_BASE_PMC;
 
-   /* Peripheral Clock Enable Register */
-   writel(1  AT91SAM9263_ID_PIOA |
-   1  AT91SAM9263_ID_PIOB |
-   1  AT91SAM9263_ID_PIOCDE |
-   1  AT91SAM9263_ID_UHP,
+   /* enable all clocks */
+   writel((1  ATMEL_ID_PIOA) | (1  ATMEL_ID_PIOB) |
+   (1  ATMEL_ID_PIOCDE) | (1  ATMEL_ID_UHP),
pmc-pcer);
 
+   at91_seriald_hw_init();
+
+   return 0;
+}
+
+int board_init(void)
+{
/* initialize ET1100 Controller

Re: [U-Boot] U-Boot support for board(s) meesc, otc570

2011-01-24 Thread Daniel Gorsulowski
Hello Reinhard,

...

 Check that your AT91Bootstrap loads u-boot to a sane address not at the
 very end
 of DRAM, and that CONFIG_SYS_TEXT_BASE is exactly the address where
 AT91Bootstrap
 loads u-boot. (I changed AT91Bootstrap to load u-boot to the very begin
 of DRAM
 for our boards.)

 
 I neither change the AT91Bootstrap nor the CONFIG_SYS_TEXT_BASE address,
 so the problem must be located elsewhere.
 
 Today I found out by GPIO debugging, that U-Boot seems to boot but prints
 its startup messages to wrong USART with proper baudrate. I'll try to
 find out, why there is no output on DBGU.
 

I have to correct myself.
My board_init() and checkboard() fanctions are executed. But the board
crashes, before misc_init_r() functions executes.
(I guess, it crashes somwhere in board_init_f())
I'll try to find out more infos. But without an appropriate opportunity
to debug, it will be verry difficult.


Best regards
Daniel
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 2/2] at91: fixed 'esd gmbh' meesc and otc570 boards

2011-01-21 Thread Daniel Gorsulowski
Signed-off-by: Daniel Gorsulowski daniel.gorsulow...@esd.eu
---

There is still a bug in USART config. This patch is for reviewing only!

 board/esd/meesc/config.mk  |1 -
 board/esd/meesc/meesc.c|   39 +-
 board/esd/otc570/config.mk |1 -
 board/esd/otc570/otc570.c  |   51 +++--
 boards.cfg |6 +-
 include/configs/meesc.h|  150 ++---
 include/configs/otc570.h   |  179 +---
 7 files changed, 241 insertions(+), 186 deletions(-)
 delete mode 100644 board/esd/meesc/config.mk
 delete mode 100644 board/esd/otc570/config.mk

diff --git a/board/esd/meesc/config.mk b/board/esd/meesc/config.mk
deleted file mode 100644
index 2077692..000
--- a/board/esd/meesc/config.mk
+++ /dev/null
@@ -1 +0,0 @@
-CONFIG_SYS_TEXT_BASE = 0x21f0
diff --git a/board/esd/meesc/meesc.c b/board/esd/meesc/meesc.c
index 41fa3e1..46cd33c 100644
--- a/board/esd/meesc/meesc.c
+++ b/board/esd/meesc/meesc.c
@@ -3,7 +3,7 @@
  * Stelian Pop stelian@leadtechdesign.com
  * Lead Tech Design www.leadtechdesign.com
  *
- * (C) Copyright 2009-2010
+ * (C) Copyright 2009-2011
  * Daniel Gorsulowski daniel.gorsulow...@esd.eu
  * esd electronic system design gmbh www.esd.eu
  *
@@ -27,6 +27,7 @@
  */
 
 #include common.h
+#include asm/io.h
 #include asm/arch/at91sam9263.h
 #include asm/arch/at91sam9_smc.h
 #include asm/arch/at91_common.h
@@ -36,7 +37,6 @@
 #include asm/arch/at91_pio.h
 #include asm/arch/clk.h
 #include asm/arch/hardware.h
-#include asm/arch/io.h
 #include netdev.h
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -67,8 +67,8 @@ int get_hw_rev(void)
 static void meesc_nand_hw_init(void)
 {
unsigned long csa;
-   at91_smc_t  *smc= (at91_smc_t *) AT91_SMC0_BASE;
-   at91_matrix_t   *matrix = (at91_matrix_t *) AT91_MATRIX_BASE;
+   at91_smc_t  *smc= (at91_smc_t *) ATMEL_BASE_SMC0;
+   at91_matrix_t   *matrix = (at91_matrix_t *) ATMEL_BASE_MATRIX;
 
/* Enable CS3 */
csa = readl(matrix-csa[0]) | AT91_MATRIX_CSA_EBI_CS3A;
@@ -88,7 +88,7 @@ static void meesc_nand_hw_init(void)
writel(AT91_SMC_MODE_RM_NRD | AT91_SMC_MODE_WM_NWE |
AT91_SMC_MODE_EXNW_DISABLE |
AT91_SMC_MODE_DBW_8 |
-   AT91_SMC_MODE_TDF_CYCLE(2),
+   AT91_SMC_MODE_TDF_CYCLE(3),
smc-cs[3].mode);
 
/* Configure RDY/BSY */
@@ -102,9 +102,9 @@ static void meesc_nand_hw_init(void)
 #ifdef CONFIG_MACB
 static void meesc_macb_hw_init(void)
 {
-   at91_pmc_t  *pmc= (at91_pmc_t *) AT91_PMC_BASE;
+   at91_pmc_t  *pmc= (at91_pmc_t *) ATMEL_BASE_PMC;
/* Enable clock */
-   writel(1  AT91SAM9263_ID_EMAC, pmc-pcer);
+   writel(1  ATMEL_ID_EMAC, pmc-pcer);
at91_macb_hw_init();
 }
 #endif
@@ -117,7 +117,7 @@ static void meesc_macb_hw_init(void)
  */
 static void meesc_ethercat_hw_init(void)
 {
-   at91_smc_t  *smc1   = (at91_smc_t *) AT91_SMC1_BASE;
+   at91_smc_t  *smc1   = (at91_smc_t *) ATMEL_BASE_SMC1;
 
/* Configure SMC EBI1_CS0 for EtherCAT */
writel(AT91_SMC_SETUP_NWE(0) | AT91_SMC_SETUP_NCS_WR(0) |
@@ -142,8 +142,9 @@ static void meesc_ethercat_hw_init(void)
 
 int dram_init(void)
 {
-   gd-bd-bi_dram[0].start = PHYS_SDRAM;
-   gd-bd-bi_dram[0].size = get_ram_size((long *) PHYS_SDRAM, (1  27));
+   gd-bd-bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
+   gd-bd-bi_dram[0].size = get_ram_size((long *) CONFIG_SYS_SDRAM_BASE,
+   (1  27));
return 0;
 }
 
@@ -151,7 +152,7 @@ int board_eth_init(bd_t *bis)
 {
int rc = 0;
 #ifdef CONFIG_MACB
-   rc = macb_eth_initialize(0, (void *)AT91_EMAC_BASE, 0x00);
+   rc = macb_eth_initialize(0, (void *)ATMEL_BASE_EMAC, 0x00);
 #endif
return rc;
 }
@@ -225,7 +226,7 @@ int misc_init_r(void)
 {
char*str;
charbuf[32];
-   at91_pmc_t  *pmc = (at91_pmc_t *) AT91_PMC_BASE;
+   at91_pmc_t  *pmc = (at91_pmc_t *) ATMEL_BASE_PMC;
 
/*
 * Normally the processor clock has a divisor of 2.
@@ -248,22 +249,22 @@ int misc_init_r(void)
 
 int board_init(void)
 {
-   at91_pmc_t  *pmc= (at91_pmc_t *) AT91_PMC_BASE;
+   at91_pmc_t  *pmc= (at91_pmc_t *) ATMEL_BASE_PMC;
 
/* Peripheral Clock Enable Register */
-   writel(1  AT91SAM9263_ID_PIOA |
-   1  AT91SAM9263_ID_PIOB |
-   1  AT91SAM9263_ID_PIOCDE |
-   1  AT91SAM9263_ID_UHP,
+   writel(1  ATMEL_ID_PIOA |
+   1  ATMEL_ID_PIOB |
+   1  ATMEL_ID_PIOCDE |
+   1  ATMEL_ID_UHP,
pmc-pcer);
 
/* initialize ET1100 Controller */
meesc_ethercat_hw_init();
 
/* adress of boot parameters */
-   gd-bd-bi_boot_params = PHYS_SDRAM + 0x100;
+   gd-bd-bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100

Re: [U-Boot] U-Boot support for board(s) meesc, otc570

2011-01-21 Thread Daniel Gorsulowski
Dear Reinhard,

Reinhard Meyer wrote:
 Dear Daniel Gorsulowski,
 Hello Reinhard,

 Reinhard Meyer wrote:
 Dear Daniel Gorsulowski,
 
 ...
 
 The at91sam9260(9xe)ek board builds fine and works.

 I can confirm that.

 Use that as a template or reference what to do.
 You should *only* need to adapt board/*/files and your configs/board.h
 files. And of course updated entries in boards.cfg.

 Not quiet. I had to fix arch/arm/cpu/arm926ejs/at91/at91sam9263_devices.c
 additionally.
 Yes, of course... I had only reworked the 9260 variant yet. You should
 need
 to change it similarly to at91sam9260_devices.c...

 With my adoptions, my boards builds fine. But they do not boot.
 Can you really confirm that the at91sam9260ek board boots? I have no
 chance to debug my problems, so I have no idea, why my boards does not
 boot.
 Yes it does.
 
 What exactly does does not boot mean? No message at all?

Yes, sorry for indefinite description...
There is no message at all, except for bootrom 'RomBOOT' promt.

 
 Check that your AT91Bootstrap loads u-boot to a sane address not at the
 very end
 of DRAM, and that CONFIG_SYS_TEXT_BASE is exactly the address where
 AT91Bootstrap
 loads u-boot. (I changed AT91Bootstrap to load u-boot to the very begin
 of DRAM
 for our boards.)
 

I neither change the AT91Bootstrap nor the CONFIG_SYS_TEXT_BASE address,
so the problem must be located elsewhere.

Today I found out by GPIO debugging, that U-Boot seems to boot but prints
its startup messages to wrong USART with proper baudrate. I'll try to
find out, why there is no output on DBGU.


 Nevertheless, should I send my patches for reviewing?

 
 Of course. We might see something that helps you.

Ok, I'll do so.

 
 Best Regards,
 Reinhard
 
 
 
Best regards,
Daniel Gorsulowski
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/2] at91: fixed at91sam9263 system file

2011-01-21 Thread Daniel Gorsulowski
Signed-off-by: Daniel Gorsulowski daniel.gorsulow...@esd.eu
---
 arch/arm/cpu/arm926ejs/at91/at91sam9263_devices.c |   55 +++--
 1 files changed, 18 insertions(+), 37 deletions(-)

diff --git a/arch/arm/cpu/arm926ejs/at91/at91sam9263_devices.c 
b/arch/arm/cpu/arm926ejs/at91/at91sam9263_devices.c
index deda3e5..15e880a 100644
--- a/arch/arm/cpu/arm926ejs/at91/at91sam9263_devices.c
+++ b/arch/arm/cpu/arm926ejs/at91/at91sam9263_devices.c
@@ -3,7 +3,7 @@
  * Stelian Pop stelian@leadtechdesign.com
  * Lead Tech Design www.leadtechdesign.com
  *
- * (C) Copyright 2009
+ * (C) Copyright 2009-2011
  * Daniel Gorsulowski daniel.gorsulow...@esd.eu
  * esd electronic system design gmbh www.esd.eu
  *
@@ -27,78 +27,59 @@
  */
 
 #include common.h
+#include asm/io.h
 #include asm/arch/hardware.h
-#include asm/arch/io.h
 #include asm/arch/at91_common.h
 #include asm/arch/at91_pmc.h
 #include asm/arch/at91_pio.h
 
 void at91_serial0_hw_init(void)
 {
-   at91_pmc_t  *pmc= (at91_pmc_t *) AT91_PMC_BASE;
+   at91_pmc_t  *pmc= (at91_pmc_t *) ATMEL_BASE_PMC;
 
at91_set_a_periph(AT91_PIO_PORTA, 26, 1);   /* TXD0 */
at91_set_a_periph(AT91_PIO_PORTA, 27, 0);   /* RXD0 */
-   writel(1  AT91SAM9263_ID_US0, pmc-pcer);
+   writel(1  ATMEL_ID_USART0, pmc-pcer);
 }
 
 void at91_serial1_hw_init(void)
 {
-   at91_pmc_t  *pmc= (at91_pmc_t *) AT91_PMC_BASE;
+   at91_pmc_t  *pmc= (at91_pmc_t *) ATMEL_BASE_PMC;
 
at91_set_a_periph(AT91_PIO_PORTD, 0, 1);/* TXD1 */
at91_set_a_periph(AT91_PIO_PORTD, 1, 0);/* RXD1 */
-   writel(1  AT91SAM9263_ID_US1, pmc-pcer);
+   writel(1  ATMEL_ID_USART1, pmc-pcer);
 }
 
 void at91_serial2_hw_init(void)
 {
-   at91_pmc_t  *pmc= (at91_pmc_t *) AT91_PMC_BASE;
+   at91_pmc_t  *pmc= (at91_pmc_t *) ATMEL_BASE_PMC;
 
at91_set_a_periph(AT91_PIO_PORTD, 2, 1);/* TXD2 */
at91_set_a_periph(AT91_PIO_PORTD, 3, 0);/* RXD2 */
-   writel(1  AT91SAM9263_ID_US2, pmc-pcer);
+   writel(1  ATMEL_ID_USART2, pmc-pcer);
 }
 
-void at91_serial3_hw_init(void)
+void at91_seriald_hw_init(void)
 {
-   at91_pmc_t  *pmc= (at91_pmc_t *) AT91_PMC_BASE;
+   at91_pmc_t  *pmc= (at91_pmc_t *) ATMEL_BASE_PMC;
 
at91_set_a_periph(AT91_PIO_PORTC, 30, 0);   /* DRXD */
at91_set_a_periph(AT91_PIO_PORTC, 31, 1);   /* DTXD */
-   writel(1  AT91_ID_SYS, pmc-pcer);
+   writel(1  ATMEL_ID_SYS, pmc-pcer);
 }
 
-void at91_serial_hw_init(void)
-{
-#ifdef CONFIG_USART0
-   at91_serial0_hw_init();
-#endif
-
-#ifdef CONFIG_USART1
-   at91_serial1_hw_init();
-#endif
-
-#ifdef CONFIG_USART2
-   at91_serial2_hw_init();
-#endif
-
-#ifdef CONFIG_USART3   /* DBGU */
-   at91_serial3_hw_init();
-#endif
-}
-
-#ifdef CONFIG_HAS_DATAFLASH
+#if defined(CONFIG_HAS_DATAFLASH) || defined(CONFIG_ATMEL_SPI)
 void at91_spi0_hw_init(unsigned long cs_mask)
 {
-   at91_pmc_t  *pmc= (at91_pmc_t *) AT91_PMC_BASE;
+   at91_pmc_t  *pmc= (at91_pmc_t *) ATMEL_BASE_PMC;
 
at91_set_b_periph(AT91_PIO_PORTA, 0, 0);/* SPI0_MISO */
at91_set_b_periph(AT91_PIO_PORTA, 1, 0);/* SPI0_MOSI */
at91_set_b_periph(AT91_PIO_PORTA, 2, 0);/* SPI0_SPCK */
 
/* Enable clock */
-   writel(1  AT91SAM9263_ID_SPI0, pmc-pcer);
+   writel(1  ATMEL_ID_SPI0, pmc-pcer);
 
if (cs_mask  (1  0)) {
at91_set_b_periph(AT91_PIO_PORTA, 5, 1);
@@ -128,14 +109,14 @@ void at91_spi0_hw_init(unsigned long cs_mask)
 
 void at91_spi1_hw_init(unsigned long cs_mask)
 {
-   at91_pmc_t  *pmc= (at91_pmc_t *) AT91_PMC_BASE;
+   at91_pmc_t  *pmc= (at91_pmc_t *) ATMEL_BASE_PMC;
 
at91_set_a_periph(AT91_PIO_PORTB, 12, 0);   /* SPI1_MISO */
at91_set_a_periph(AT91_PIO_PORTB, 13, 0);   /* SPI1_MOSI */
at91_set_a_periph(AT91_PIO_PORTB, 14, 0);   /* SPI1_SPCK */
 
/* Enable clock */
-   writel(1  AT91SAM9263_ID_SPI1, pmc-pcer);
+   writel(1  ATMEL_ID_SPI1, pmc-pcer);
 
if (cs_mask  (1  0)) {
at91_set_a_periph(AT91_PIO_PORTB, 15, 1);
@@ -203,12 +184,12 @@ void at91_uhp_hw_init(void)
 #ifdef CONFIG_AT91_CAN
 void at91_can_hw_init(void)
 {
-   at91_pmc_t  *pmc= (at91_pmc_t *) AT91_PMC_BASE;
+   at91_pmc_t  *pmc= (at91_pmc_t *) ATMEL_BASE_PMC;
 
at91_set_a_periph(AT91_PIO_PORTA, 13, 0);   /* CAN_TX */
at91_set_a_periph(AT91_PIO_PORTA, 14, 1);   /* CAN_RX */
 
/* Enable clock */
-   writel(1  AT91SAM9263_ID_CAN, pmc-pcer);
+   writel(1  ATMEL_ID_CAN, pmc-pcer);
 }
 #endif
-- 
1.5.3

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] U-Boot support for board(s) meesc, otc570

2011-01-21 Thread Daniel Gorsulowski
Hello Reinhard,

Reinhard Meyer wrote:
 Dear Daniel Gorsulowski,
 Today I found out by GPIO debugging, that U-Boot seems to boot but prints
 its startup messages to wrong USART with proper baudrate. I'll try to
 find out, why there is no output on DBGU.
 
 Note that the USART to use is defined differently than before:
 
 /* serial console */
 #define CONFIG_ATMEL_USART
 #define CONFIG_USART_BASE ATMEL_BASE_DBGU
 #define   CONFIG_USART_ID ATMEL_ID_SYS
 #define CONFIG_BAUDRATE   115200
 #define CONFIG_SYS_BAUDRATE_TABLE {115200 , 19200, 38400, 57600, 9600 }

I did so, see http://lists.denx.de/pipermail/u-boot/2011-January/085863.html

But I'm a little bit confused. In the past, USART_ID was defined by '3',
if DBGU was used. Now, USART_ID is replaced by CONFIG_USART_ID, which is
defined by ATMEL_ID_SYS, which is defined by '1'.
However, this discrepancy does not matter, because CONFIG_USART_ID is
only used once in drivers/serial/atmel_usart.c, line 57:
usart_hz = get_usart_clk_rate(USART_ID);
And get_usart_clk_rate(); ignores its parameter. See
arch/arm/include/asm/arch-at91/clk.h
static inline unsigned long get_usart_clk_rate(unsigned int dev_id)
{
return get_mck_clk_rate();
}
(all other functions in clk.h act similar. I think, a rework would be
advisable?)

Back to the problem...
In my opinion, my USART configuration is correct. I still have no idea,
why there is no output on DBGU.

 
 Best Regards,
 Reinhard

Regards,
Daniel
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] U-Boot support for board(s) meesc, otc570

2011-01-21 Thread Daniel Gorsulowski
Hello Reinhard,

...

 Back to the problem...
 In my opinion, my USART configuration is correct. I still have no idea,
 why there is no output on DBGU.

 I am at a loss there, too.

 Which USART is the output coming from instead? Is it really console output
 or maybe some other, independent pulses?

I don't know, to which USART the output goes. I guess you assume, my
GPIO debugging was to meassure the pulses on the USART pins. But no, my
GPIO debugging was as follows:
-set gpio pin with led attached
-send characters by puts() (wherever it goes) ;-)
-reset gpio pin
-measure time between high- and low- rising edge on gpio pin
-calculate baudrate

(on DBGU pin, there is no pulse at all past starting U-Boot)


 Can you verify that the value for ATMEL_BASE_DBGU in at91sam9263.h is
 correct?

Yes, according to datasheet, Debug Unit Control Register (DBGU_CR) is
located at 0xEE00.
And in at91sam9263.h is defined:
#define ATMEL_BASE_DBGU 0xee00


 Are you using the actual driver source? It should have lines like
 atmel_usart3_t *usart = (atmel_usart3_t*)CONFIG_USART_BASE;
 at the begin of each function.

Yes, I'm using the driver with your changes from 2010-11-03 16:32:56


 Best Regards,
 Reinhard



Best Regards,
Daniel
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/2] at91: fixed 'esd gmbh' meesc and otc570 boards

2011-01-21 Thread Daniel Gorsulowski
Reinhard Meyer wrote:
 Dear Daniel Gorsulowski,
 Signed-off-by: Daniel Gorsulowskidaniel.gorsulow...@esd.eu
 ...
 -gd-bd-bi_dram[0].start = PHYS_SDRAM;
 -gd-bd-bi_dram[0].size = get_ram_size((long *) PHYS_SDRAM, (1  27));
 +gd-bd-bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
 +gd-bd-bi_dram[0].size = get_ram_size((long *) CONFIG_SYS_SDRAM_BASE,
 +(1  27));
 Maybe there is a suitable SIZE_128MIB (didn't check) - would look more 
 readable ;)

AFAIK, Wolfgang wants to get rid of the sizes.h file. So I'll replace
that with something like (128*1024*1024)

 diff --git a/board/esd/otc570/otc570.c b/board/esd/otc570/otc570.c
 index 410d8b4..c66f99e 100644
 --- a/board/esd/otc570/otc570.c
 +++ b/board/esd/otc570/otc570.c
 @@ -1,5 +1,5 @@
   /*
 - * (C) Copyright 2010
 + * (C) Copyright 2010-2011
* Daniel Gorsulowskidaniel.gorsulow...@esd.eu
* esd electronic system design gmbhwww.esd.eu
*
 @@ -27,6 +27,7 @@
*/

   #includecommon.h
 +#includeasm/io.h
   #includeasm/arch/at91sam9263.h
 including hardware.h does include above, don't include it directly.

Ok, I'll remove this include

...
 diff --git a/boards.cfg b/boards.cfg
 index 9b15026..77f3fc4 100644
 --- a/boards.cfg
 +++ b/boards.cfg
 @@ -83,8 +83,10 @@ at91sam9xeek_dataflash_cs0   arm arm926ejs   
 at91sam9260ek   atmel
   at91sam9xeek_dataflash_cs1   arm arm926ejs   at91sam9260ek   
 atmel  at91at91sam9260ek:AT91SAM9XE,SYS_USE_DATAFLASH_CS1
   top9000eval_xe   arm arm926ejs   top9000 
 emkat91top9000:EVAL9000
   top9000su_xe arm arm926ejs   top9000 
 emkat91top9000:SU9000
 -meescarm arm926ejs   -   
 esdat91
 -otc570   arm arm926ejs   -   
 esdat91
 +meescarm arm926ejs   meesc   
 esdat91meesc:AT91SAM9263,SYS_USE_NANDFLASH
 +meesc_dataflash  arm arm926ejs   meesc   
 esdat91meesc:AT91SAM9263,SYS_USE_DATAFLASH
 +otc570   arm arm926ejs   otc570  
 esdat91otc570:AT91SAM9263,SYS_USE_NANDFLASH
 +otc570_dataflash arm arm926ejs   otc570  
 esdat91otc570:AT91SAM9263,SYS_USE_DATAFLASH
 Apparently its always a sam9263, so please don't define it here. The defines 
 in boards.cfg should only be used
 for differences between variants.

I'll move that to board config files

 diff --git a/include/configs/meesc.h b/include/configs/meesc.h
 index a27b36b..dbb97ed 100644
 --- a/include/configs/meesc.h
 +++ b/include/configs/meesc.h
 @@ -3,7 +3,7 @@
* Stelian Popstelian@leadtechdesign.com
* Lead Tech Designwww.leadtechdesign.com
*
 - * (C) Copyright 2009-2010
 + * (C) Copyright 2009-2011
* Daniel Gorsulowskidaniel.gorsulow...@esd.eu
* esd electronic system design gmbhwww.esd.eu
*
 @@ -31,49 +31,67 @@
   #ifndef __CONFIG_H
   #define __CONFIG_H

 -/* Common stuff */
 -#define CONFIG_MEESC1   /* Board is esd MEESC */
 -#define CONFIG_ARM926EJS1   /* This is an ARM926EJS Core */
 -#define CONFIG_AT91SAM9263  1   /* It's an AT91SAM9263 SoC */
 -#define CONFIG_SYS_AT91_MAIN_CLOCK  1600/* 16.0 MHz crystal */
 +/*
 + * SoC must be defined first, before hardware.h is included.
 + * In this case SoC is defined in boards.cfg.
 Please define SoC here.

See beyond...

...
 
 I'll run it through checkpatch.pl later.
 
 Best Regards,
 Reinhard

Best regards,
Daniel
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] U-Boot support for board(s) meesc, otc570

2011-01-19 Thread Daniel Gorsulowski
Hello Reinhard,

Reinhard Meyer wrote:
 Dear Daniel Gorsulowski,
 Hello Albert,

 Albert ARIBAUD wrote:
 Le 18/01/2011 10:27, Daniel Gorsulowski a écrit :
 Hello again!

 Hi Daniel,

 One month ago, I asked you for help (see message below), but got no
 answer.

 Sorry about that. Last quarter of 2010 was rather busy for me.

 Do you see any chance, to fix the at91 tree?

 There is no way to fix my boards, as long as all at91 builds have
 fundamental problems.

 I found a patch series from Alexander Stein, but it seems, this series
 does not go mainline:
 http://lists.denx.de/pipermail/u-boot/2010-November/080885.html
 Should I ask Alexander for resend his pathes?

 Regards
 Daniel

 Reinhard (Cc:) has lots of fixes in his u-boot-atmel tree; you should try
 its master branch. I'm leaving below your (unanswered, apologies again)
 questions for Reinhard to answer.

 Regards,
 Albert.

 Thanks for your response!
 I tried Reinhards master branch, but build throws same errors as shown
 below. It seems, among other things the atmel usart driver needs an
 update to new SoC access. Alexander Steins patch series seems to add this
 support.

 I'll wait for a fix until I send patches for my boards.
 
 1. Please send always the mailing list, too!
 
 2. Use the rework101229 branch (minus the last 5 patches).
 
 There is lot of cleanup done in the header files and the ATMEL drivers.
 The at91sam9260(9xe)ek board builds fine and works.

I can confirm that.

 Use that as a template or reference what to do.
 You should *only* need to adapt board/*/files and your configs/board.h
 files. And of course updated entries in boards.cfg.

Not quiet. I had to fix arch/arm/cpu/arm926ejs/at91/at91sam9263_devices.c
additionally.

With my adoptions, my boards builds fine. But they do not boot.
Can you really confirm that the at91sam9260ek board boots? I have no
chance to debug my problems, so I have no idea, why my boards does not boot.

Nevertheless, should I send my patches for reviewing?

 
 Once the rework is done for *almost* *ALL* AT91 SoCs it will be put for
 review into mainline, probably for the 06.2011 U-Boot.
 
 Best Regards,
 Reinhard
 


-- 
Best Regards,
Daniel Gorsulowski

-
B.Eng. Daniel Gorsulowski
System-Design

esd electronic system design gmbh
Vahrenwalder Str. 207 - 30165 Hannover - GERMANY
Telefon: 0511-37298-192 - Fax: 0511-37298-68
Bitte besuchen Sie uns im Internet unter http://www.esd.eu
Quality Products - Made in Germany
-
Geschäftsführer: Klaus Detering
Amtsgericht Hannover HRB 51373 - VAT-ID DE 115672832
-
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v3 1/3] at91: Defined main clock frequency on esd at91 boards

2010-08-09 Thread Daniel Gorsulowski
Autodetection is undesired now

Signed-off-by: Daniel Gorsulowski daniel.gorsulow...@esd.eu
---

v2: fixed copyright changing error according to Wolfgangs hint
v3: nothing changed, just resend to cohere patch series

 include/configs/meesc.h  |3 ++-
 include/configs/otc570.h |1 +
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/include/configs/meesc.h b/include/configs/meesc.h
index e085f4a..dad0bef 100644
--- a/include/configs/meesc.h
+++ b/include/configs/meesc.h
@@ -3,7 +3,7 @@
  * Stelian Pop stelian@leadtechdesign.com
  * Lead Tech Design www.leadtechdesign.com
  *
- * (C) Copyright 2009
+ * (C) Copyright 2009-2010
  * Daniel Gorsulowski daniel.gorsulow...@esd.eu
  * esd electronic system design gmbh www.esd.eu
  *
@@ -38,6 +38,7 @@
 #define CONFIG_MEESC   1   /* Board is esd MEESC */
 #define CONFIG_ARM926EJS   1   /* This is an ARM926EJS Core */
 #define CONFIG_AT91SAM9263 1   /* It's an AT91SAM9263 SoC */
+#define CONFIG_SYS_AT91_MAIN_CLOCK 1600/* 16.0 MHz crystal */
 #define CONFIG_DISPLAY_BOARDINFO   1
 #define CONFIG_DISPLAY_CPUINFO 1   /* display cpu info and speed */
 #define CONFIG_PREBOOT /* enable preboot variable */
diff --git a/include/configs/otc570.h b/include/configs/otc570.h
index fb0f576..4a1cede 100644
--- a/include/configs/otc570.h
+++ b/include/configs/otc570.h
@@ -35,6 +35,7 @@
 #define CONFIG_OTC570  1   /* Board is esd OTC570 */
 #define CONFIG_ARM926EJS   1   /* This is an ARM926EJS Core */
 #define CONFIG_AT91SAM9263 1   /* It's an AT91SAM9263 SoC */
+#define CONFIG_SYS_AT91_MAIN_CLOCK 1600/* 16.0 MHz crystal */
 #define CONFIG_SYS_HZ  1000/* decrementer freq */
 #define CONFIG_DISPLAY_BOARDINFO   1
 #define CONFIG_DISPLAY_CPUINFO 1   /* display cpu info and speed */
-- 
1.5.3

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v5 2/3] at91: Update meesc board to new SoC access

2010-08-09 Thread Daniel Gorsulowski
* convert meesc board to use c stucture SoC access
* change gpio access to at91_gpio syntax
* moved CONFIG_SYS_HZ below board and cpu defines (purely cosmetic)

Signed-off-by: Daniel Gorsulowski daniel.gorsulow...@esd.eu
---

v2: fixed copyright changing error according to Wolfgangs hint
v3: removed some whitespace, indentation and coding style errors
v4: fixed build error (removed jamming parenthesis in pio defines)
v5: nothing changed, just resend to cohere patch series

 board/esd/meesc/meesc.c |  112 --
 include/configs/meesc.h |   10 ++---
 2 files changed, 62 insertions(+), 60 deletions(-)

diff --git a/board/esd/meesc/meesc.c b/board/esd/meesc/meesc.c
index a1b66cb..eb87cfc 100644
--- a/board/esd/meesc/meesc.c
+++ b/board/esd/meesc/meesc.c
@@ -3,7 +3,7 @@
  * Stelian Pop stelian@leadtechdesign.com
  * Lead Tech Design www.leadtechdesign.com
  *
- * (C) Copyright 2009
+ * (C) Copyright 2009-2010
  * Daniel Gorsulowski daniel.gorsulow...@esd.eu
  * esd electronic system design gmbh www.esd.eu
  *
@@ -28,13 +28,13 @@
 
 #include common.h
 #include asm/arch/at91sam9263.h
-#include asm/arch/at91sam9_matrix.h
 #include asm/arch/at91sam9_smc.h
 #include asm/arch/at91_common.h
 #include asm/arch/at91_pmc.h
 #include asm/arch/at91_rstc.h
+#include asm/arch/at91_matrix.h
+#include asm/arch/at91_pio.h
 #include asm/arch/clk.h
-#include asm/arch/gpio.h
 #include asm/arch/hardware.h
 #include asm/arch/io.h
 #include netdev.h
@@ -52,10 +52,10 @@ int get_hw_rev(void)
if (hw_rev = 0)
return hw_rev;
 
-   hw_rev = at91_get_gpio_value(AT91_PIN_PB19);
-   hw_rev |= at91_get_gpio_value(AT91_PIN_PB20)  1;
-   hw_rev |= at91_get_gpio_value(AT91_PIN_PB21)  2;
-   hw_rev |= at91_get_gpio_value(AT91_PIN_PB22)  3;
+   hw_rev = at91_get_pio_value(AT91_PIO_PORTB, 19);
+   hw_rev |= at91_get_pio_value(AT91_PIO_PORTB, 20)  1;
+   hw_rev |= at91_get_pio_value(AT91_PIO_PORTB, 21)  2;
+   hw_rev |= at91_get_pio_value(AT91_PIO_PORTB, 22)  3;
 
if (hw_rev == 15)
hw_rev = 0;
@@ -67,44 +67,44 @@ int get_hw_rev(void)
 static void meesc_nand_hw_init(void)
 {
unsigned long csa;
+   at91_smc_t  *smc= (at91_smc_t *) AT91_SMC0_BASE;
+   at91_matrix_t   *matrix = (at91_matrix_t *) AT91_MATRIX_BASE;
 
/* Enable CS3 */
-   csa = at91_sys_read(AT91_MATRIX_EBI0CSA);
-   at91_sys_write(AT91_MATRIX_EBI0CSA,
-   csa | AT91_MATRIX_EBI0_CS3A_SMC_SMARTMEDIA);
+   csa = readl(matrix-csa[0]) | AT91_MATRIX_CSA_EBI_CS3A;
+   writel(csa, matrix-csa[0]);
 
/* Configure SMC CS3 for NAND/SmartMedia */
-   at91_sys_write(AT91_SMC_SETUP(3),
-   AT91_SMC_NWESETUP_(1) | AT91_SMC_NCS_WRSETUP_(0) |
-   AT91_SMC_NRDSETUP_(1) | AT91_SMC_NCS_RDSETUP_(0));
-   at91_sys_write(AT91_SMC_PULSE(3),
-   AT91_SMC_NWEPULSE_(3) | AT91_SMC_NCS_WRPULSE_(3) |
-   AT91_SMC_NRDPULSE_(3) | AT91_SMC_NCS_RDPULSE_(3));
-   at91_sys_write(AT91_SMC_CYCLE(3),
-   AT91_SMC_NWECYCLE_(5) | AT91_SMC_NRDCYCLE_(5));
-   at91_sys_write(AT91_SMC_MODE(3),
-   AT91_SMC_READMODE | AT91_SMC_WRITEMODE |
-   AT91_SMC_EXNWMODE_DISABLE |
-#ifdef CONFIG_SYS_NAND_DBW_16
-   AT91_SMC_DBW_16 |
-#else /* CONFIG_SYS_NAND_DBW_8 */
-   AT91_SMC_DBW_8 |
-#endif
-   AT91_SMC_TDF_(2));
+   writel(AT91_SMC_SETUP_NWE(1) | AT91_SMC_SETUP_NCS_WR(0) |
+   AT91_SMC_SETUP_NRD(1) | AT91_SMC_SETUP_NCS_RD(0),
+   smc-cs[3].setup);
+
+   writel(AT91_SMC_PULSE_NWE(3) | AT91_SMC_PULSE_NCS_WR(3) |
+   AT91_SMC_PULSE_NRD(3) | AT91_SMC_PULSE_NCS_RD(3),
+   smc-cs[3].pulse);
+
+   writel(AT91_SMC_CYCLE_NWE(5) | AT91_SMC_CYCLE_NRD(5),
+   smc-cs[3].cycle);
+   writel(AT91_SMC_MODE_RM_NRD | AT91_SMC_MODE_WM_NWE |
+   AT91_SMC_MODE_EXNW_DISABLE |
+   AT91_SMC_MODE_DBW_8 |
+   AT91_SMC_MODE_TDF_CYCLE(2),
+   smc-cs[3].mode);
 
/* Configure RDY/BSY */
-   at91_set_gpio_input(CONFIG_SYS_NAND_READY_PIN, 1);
+   at91_set_pio_input(CONFIG_SYS_NAND_READY_PIN, 1);
 
/* Enable NandFlash */
-   at91_set_gpio_output(CONFIG_SYS_NAND_ENABLE_PIN, 1);
+   at91_set_pio_output(CONFIG_SYS_NAND_ENABLE_PIN, 1);
 }
 #endif /* CONFIG_CMD_NAND */
 
 #ifdef CONFIG_MACB
 static void meesc_macb_hw_init(void)
 {
+   at91_pmc_t  *pmc= (at91_pmc_t *) AT91_PMC_BASE;
/* Enable clock */
-   at91_sys_write(AT91_PMC_PCER, 1  AT91SAM9263_ID_EMAC);
+   writel(1  AT91SAM9263_ID_EMAC, pmc-pcer);
at91_macb_hw_init();
 }
 #endif
@@ -117,26 +117,27 @@ static void meesc_macb_hw_init(void)
  */
 static void meesc_ethercat_hw_init(void)
 {
+   at91_smc_t  *smc1   = (at91_smc_t *) AT91_SMC1_BASE;
+
/* Configure SMC EBI1_CS0

[U-Boot] [PATCH v3 3/3] at91: Enabeling USB host on meesc board

2010-08-09 Thread Daniel Gorsulowski
There was an redesign, so USB is available now.

Signed-off-by: Daniel Gorsulowski daniel.gorsulow...@esd.eu
---

v2: Nothing changed but commit message
v3: nothing changed, just resend to cohere patch series

 board/esd/meesc/meesc.c |6 +-
 include/configs/meesc.h |   13 -
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/board/esd/meesc/meesc.c b/board/esd/meesc/meesc.c
index eb87cfc..a169654 100644
--- a/board/esd/meesc/meesc.c
+++ b/board/esd/meesc/meesc.c
@@ -253,7 +253,8 @@ int board_init(void)
/* Peripheral Clock Enable Register */
writel(1  AT91SAM9263_ID_PIOA |
1  AT91SAM9263_ID_PIOB |
-   1  AT91SAM9263_ID_PIOCDE,
+   1  AT91SAM9263_ID_PIOCDE |
+   1  AT91SAM9263_ID_UHP,
pmc-pcer);
 
/* initialize ET1100 Controller */
@@ -275,5 +276,8 @@ int board_init(void)
 #ifdef CONFIG_AT91_CAN
at91_can_hw_init();
 #endif
+#ifdef CONFIG_USB_OHCI_NEW
+   at91_uhp_hw_init();
+#endif
return 0;
 }
diff --git a/include/configs/meesc.h b/include/configs/meesc.h
index eaea1cd..dbb2531 100644
--- a/include/configs/meesc.h
+++ b/include/configs/meesc.h
@@ -84,11 +84,11 @@
 #undef CONFIG_CMD_FPGA
 #undef CONFIG_CMD_LOADS
 #undef CONFIG_CMD_IMLS
-#undef CONFIG_CMD_USB
 
 #define CONFIG_CMD_PING1
 #define CONFIG_CMD_DHCP1
 #define CONFIG_CMD_NAND1
+#define CONFIG_CMD_USB 1
 
 /* LED */
 #define CONFIG_AT91_LED1
@@ -132,6 +132,17 @@
 #define CONFIG_NET_RETRY_COUNT 20
 #undef CONFIG_RESET_PHY_R
 
+/* USB */
+#define CONFIG_USB_ATMEL
+#define CONFIG_USB_OHCI_NEW1
+#define CONFIG_DOS_PARTITION   1
+#define CONFIG_SYS_USB_OHCI_CPU_INIT   1
+#define CONFIG_SYS_USB_OHCI_REGS_BASE  0x00a0
+#define CONFIG_SYS_USB_OHCI_SLOT_NAME  at91sam9263
+#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 2
+#define CONFIG_USB_STORAGE 1
+#define CONFIG_CMD_FAT 1
+
 #define CONFIG_SYS_LOAD_ADDR   0x2200 /* load address */
 
 #define CONFIG_SYS_MEMTEST_START   PHYS_SDRAM
-- 
1.5.3

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH-V3] at91: Update meesc board to new SoC access

2010-07-19 Thread Daniel Gorsulowski
* convert meesc board to use c stucture SoC access
* change gpio access to at91_gpio syntax
* moved CONFIG_SYS_HZ below board and cpu defines (purely cosmetic)

Signed-off-by: Daniel Gorsulowski daniel.gorsulow...@esd.eu
---

v2: fixed copyright changing error according to Wolfgangs hint
v3: removed some whitespace, indentation and coding style errors

 board/esd/meesc/meesc.c |  112 --
 include/configs/meesc.h |9 ++--
 2 files changed, 62 insertions(+), 59 deletions(-)

diff --git a/board/esd/meesc/meesc.c b/board/esd/meesc/meesc.c
index a1b66cb..eb87cfc 100644
--- a/board/esd/meesc/meesc.c
+++ b/board/esd/meesc/meesc.c
@@ -3,7 +3,7 @@
  * Stelian Pop stelian@leadtechdesign.com
  * Lead Tech Design www.leadtechdesign.com
  *
- * (C) Copyright 2009
+ * (C) Copyright 2009-2010
  * Daniel Gorsulowski daniel.gorsulow...@esd.eu
  * esd electronic system design gmbh www.esd.eu
  *
@@ -28,13 +28,13 @@
 
 #include common.h
 #include asm/arch/at91sam9263.h
-#include asm/arch/at91sam9_matrix.h
 #include asm/arch/at91sam9_smc.h
 #include asm/arch/at91_common.h
 #include asm/arch/at91_pmc.h
 #include asm/arch/at91_rstc.h
+#include asm/arch/at91_matrix.h
+#include asm/arch/at91_pio.h
 #include asm/arch/clk.h
-#include asm/arch/gpio.h
 #include asm/arch/hardware.h
 #include asm/arch/io.h
 #include netdev.h
@@ -52,10 +52,10 @@ int get_hw_rev(void)
if (hw_rev = 0)
return hw_rev;
 
-   hw_rev = at91_get_gpio_value(AT91_PIN_PB19);
-   hw_rev |= at91_get_gpio_value(AT91_PIN_PB20)  1;
-   hw_rev |= at91_get_gpio_value(AT91_PIN_PB21)  2;
-   hw_rev |= at91_get_gpio_value(AT91_PIN_PB22)  3;
+   hw_rev = at91_get_pio_value(AT91_PIO_PORTB, 19);
+   hw_rev |= at91_get_pio_value(AT91_PIO_PORTB, 20)  1;
+   hw_rev |= at91_get_pio_value(AT91_PIO_PORTB, 21)  2;
+   hw_rev |= at91_get_pio_value(AT91_PIO_PORTB, 22)  3;
 
if (hw_rev == 15)
hw_rev = 0;
@@ -67,44 +67,44 @@ int get_hw_rev(void)
 static void meesc_nand_hw_init(void)
 {
unsigned long csa;
+   at91_smc_t  *smc= (at91_smc_t *) AT91_SMC0_BASE;
+   at91_matrix_t   *matrix = (at91_matrix_t *) AT91_MATRIX_BASE;
 
/* Enable CS3 */
-   csa = at91_sys_read(AT91_MATRIX_EBI0CSA);
-   at91_sys_write(AT91_MATRIX_EBI0CSA,
-   csa | AT91_MATRIX_EBI0_CS3A_SMC_SMARTMEDIA);
+   csa = readl(matrix-csa[0]) | AT91_MATRIX_CSA_EBI_CS3A;
+   writel(csa, matrix-csa[0]);
 
/* Configure SMC CS3 for NAND/SmartMedia */
-   at91_sys_write(AT91_SMC_SETUP(3),
-   AT91_SMC_NWESETUP_(1) | AT91_SMC_NCS_WRSETUP_(0) |
-   AT91_SMC_NRDSETUP_(1) | AT91_SMC_NCS_RDSETUP_(0));
-   at91_sys_write(AT91_SMC_PULSE(3),
-   AT91_SMC_NWEPULSE_(3) | AT91_SMC_NCS_WRPULSE_(3) |
-   AT91_SMC_NRDPULSE_(3) | AT91_SMC_NCS_RDPULSE_(3));
-   at91_sys_write(AT91_SMC_CYCLE(3),
-   AT91_SMC_NWECYCLE_(5) | AT91_SMC_NRDCYCLE_(5));
-   at91_sys_write(AT91_SMC_MODE(3),
-   AT91_SMC_READMODE | AT91_SMC_WRITEMODE |
-   AT91_SMC_EXNWMODE_DISABLE |
-#ifdef CONFIG_SYS_NAND_DBW_16
-   AT91_SMC_DBW_16 |
-#else /* CONFIG_SYS_NAND_DBW_8 */
-   AT91_SMC_DBW_8 |
-#endif
-   AT91_SMC_TDF_(2));
+   writel(AT91_SMC_SETUP_NWE(1) | AT91_SMC_SETUP_NCS_WR(0) |
+   AT91_SMC_SETUP_NRD(1) | AT91_SMC_SETUP_NCS_RD(0),
+   smc-cs[3].setup);
+
+   writel(AT91_SMC_PULSE_NWE(3) | AT91_SMC_PULSE_NCS_WR(3) |
+   AT91_SMC_PULSE_NRD(3) | AT91_SMC_PULSE_NCS_RD(3),
+   smc-cs[3].pulse);
+
+   writel(AT91_SMC_CYCLE_NWE(5) | AT91_SMC_CYCLE_NRD(5),
+   smc-cs[3].cycle);
+   writel(AT91_SMC_MODE_RM_NRD | AT91_SMC_MODE_WM_NWE |
+   AT91_SMC_MODE_EXNW_DISABLE |
+   AT91_SMC_MODE_DBW_8 |
+   AT91_SMC_MODE_TDF_CYCLE(2),
+   smc-cs[3].mode);
 
/* Configure RDY/BSY */
-   at91_set_gpio_input(CONFIG_SYS_NAND_READY_PIN, 1);
+   at91_set_pio_input(CONFIG_SYS_NAND_READY_PIN, 1);
 
/* Enable NandFlash */
-   at91_set_gpio_output(CONFIG_SYS_NAND_ENABLE_PIN, 1);
+   at91_set_pio_output(CONFIG_SYS_NAND_ENABLE_PIN, 1);
 }
 #endif /* CONFIG_CMD_NAND */
 
 #ifdef CONFIG_MACB
 static void meesc_macb_hw_init(void)
 {
+   at91_pmc_t  *pmc= (at91_pmc_t *) AT91_PMC_BASE;
/* Enable clock */
-   at91_sys_write(AT91_PMC_PCER, 1  AT91SAM9263_ID_EMAC);
+   writel(1  AT91SAM9263_ID_EMAC, pmc-pcer);
at91_macb_hw_init();
 }
 #endif
@@ -117,26 +117,27 @@ static void meesc_macb_hw_init(void)
  */
 static void meesc_ethercat_hw_init(void)
 {
+   at91_smc_t  *smc1   = (at91_smc_t *) AT91_SMC1_BASE;
+
/* Configure SMC EBI1_CS0 for EtherCAT */
-   at91_sys_write(AT91_SMC1_SETUP(0),
-   AT91_SMC_NWESETUP_(0) | AT91_SMC_NCS_WRSETUP_(0

[U-Boot] [PATCH-V2 3/3] at91: Enabeling USB host on meesc board

2010-07-16 Thread Daniel Gorsulowski
There was an redesign, so USB is available now.

Signed-off-by: Daniel Gorsulowski daniel.gorsulow...@esd.eu
---

v2: Nothing changed but commit message

Note:   This patch depends on
'at91: Update meesc board to new SoC access' patch!

 board/esd/meesc/meesc.c |6 +-
 include/configs/meesc.h |   13 -
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/board/esd/meesc/meesc.c b/board/esd/meesc/meesc.c
index b827214..f7c9b62 100644
--- a/board/esd/meesc/meesc.c
+++ b/board/esd/meesc/meesc.c
@@ -253,7 +253,8 @@ int board_init(void)
/* Peripheral Clock Enable Register */
writel( 1  AT91SAM9263_ID_PIOA |
1  AT91SAM9263_ID_PIOB |
-   1  AT91SAM9263_ID_PIOCDE,
+   1  AT91SAM9263_ID_PIOCDE |
+   1  AT91SAM9263_ID_UHP,
pmc-pcer);
 
/* initialize ET1100 Controller */
@@ -275,5 +276,8 @@ int board_init(void)
 #ifdef CONFIG_AT91_CAN
at91_can_hw_init();
 #endif
+#ifdef CONFIG_USB_OHCI_NEW
+   at91_uhp_hw_init();
+#endif
return 0;
 }
diff --git a/include/configs/meesc.h b/include/configs/meesc.h
index 0fb4034..9b9041a 100644
--- a/include/configs/meesc.h
+++ b/include/configs/meesc.h
@@ -85,11 +85,11 @@
 #undef CONFIG_CMD_FPGA
 #undef CONFIG_CMD_LOADS
 #undef CONFIG_CMD_IMLS
-#undef CONFIG_CMD_USB
 
 #define CONFIG_CMD_PING1
 #define CONFIG_CMD_DHCP1
 #define CONFIG_CMD_NAND1
+#define CONFIG_CMD_USB 1
 
 /* LED */
 #define CONFIG_AT91_LED1
@@ -133,6 +133,17 @@
 #define CONFIG_NET_RETRY_COUNT 20
 #undef CONFIG_RESET_PHY_R
 
+/* USB */
+#define CONFIG_USB_ATMEL
+#define CONFIG_USB_OHCI_NEW1
+#define CONFIG_DOS_PARTITION   1
+#define CONFIG_SYS_USB_OHCI_CPU_INIT   1
+#define CONFIG_SYS_USB_OHCI_REGS_BASE  0x00a0
+#define CONFIG_SYS_USB_OHCI_SLOT_NAME  at91sam9263
+#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 2
+#define CONFIG_USB_STORAGE 1
+#define CONFIG_CMD_FAT 1
+
 #define CONFIG_SYS_LOAD_ADDR   0x2200 /* load address */
 
 #define CONFIG_SYS_MEMTEST_START   PHYS_SDRAM
-- 
1.5.3

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH-V2 1/3] at91: Defined main clock frequency on esd at91 boards

2010-07-16 Thread Daniel Gorsulowski
Autodetection is undesired now

Signed-off-by: Daniel Gorsulowski daniel.gorsulow...@esd.eu
---

v2: fixed copyright changing error according to Wolfgangs hint

 include/configs/meesc.h  |3 ++-
 include/configs/otc570.h |1 +
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/include/configs/meesc.h b/include/configs/meesc.h
index e085f4a..dad0bef 100644
--- a/include/configs/meesc.h
+++ b/include/configs/meesc.h
@@ -3,7 +3,7 @@
  * Stelian Pop stelian@leadtechdesign.com
  * Lead Tech Design www.leadtechdesign.com
  *
- * (C) Copyright 2009
+ * (C) Copyright 2009-2010
  * Daniel Gorsulowski daniel.gorsulow...@esd.eu
  * esd electronic system design gmbh www.esd.eu
  *
@@ -38,6 +38,7 @@
 #define CONFIG_MEESC   1   /* Board is esd MEESC */
 #define CONFIG_ARM926EJS   1   /* This is an ARM926EJS Core */
 #define CONFIG_AT91SAM9263 1   /* It's an AT91SAM9263 SoC */
+#define CONFIG_SYS_AT91_MAIN_CLOCK 1600/* 16.0 MHz crystal */
 #define CONFIG_DISPLAY_BOARDINFO   1
 #define CONFIG_DISPLAY_CPUINFO 1   /* display cpu info and speed */
 #define CONFIG_PREBOOT /* enable preboot variable */
diff --git a/include/configs/otc570.h b/include/configs/otc570.h
index fb0f576..4a1cede 100644
--- a/include/configs/otc570.h
+++ b/include/configs/otc570.h
@@ -35,6 +35,7 @@
 #define CONFIG_OTC570  1   /* Board is esd OTC570 */
 #define CONFIG_ARM926EJS   1   /* This is an ARM926EJS Core */
 #define CONFIG_AT91SAM9263 1   /* It's an AT91SAM9263 SoC */
+#define CONFIG_SYS_AT91_MAIN_CLOCK 1600/* 16.0 MHz crystal */
 #define CONFIG_SYS_HZ  1000/* decrementer freq */
 #define CONFIG_DISPLAY_BOARDINFO   1
 #define CONFIG_DISPLAY_CPUINFO 1   /* display cpu info and speed */
-- 
1.5.3

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH-V2 2/3] at91: Update meesc board to new SoC access

2010-07-16 Thread Daniel Gorsulowski
* convert meesc board to use c stucture SoC access
* change gpio access to at91_gpio syntax
* moved CONFIG_SYS_HZ below board and cpu defines (purely cosmetic)

Signed-off-by: Daniel Gorsulowski daniel.gorsulow...@esd.eu
---

v2: fixed copyright changing error according to Wolfgangs hint

 board/esd/meesc/meesc.c |  112 --
 include/configs/meesc.h |9 ++--
 2 files changed, 62 insertions(+), 59 deletions(-)

diff --git a/board/esd/meesc/meesc.c b/board/esd/meesc/meesc.c
index a1b66cb..b827214 100644
--- a/board/esd/meesc/meesc.c
+++ b/board/esd/meesc/meesc.c
@@ -3,7 +3,7 @@
  * Stelian Pop stelian@leadtechdesign.com
  * Lead Tech Design www.leadtechdesign.com
  *
- * (C) Copyright 2009
+ * (C) Copyright 2009-2010
  * Daniel Gorsulowski daniel.gorsulow...@esd.eu
  * esd electronic system design gmbh www.esd.eu
  *
@@ -28,13 +28,13 @@
 
 #include common.h
 #include asm/arch/at91sam9263.h
-#include asm/arch/at91sam9_matrix.h
 #include asm/arch/at91sam9_smc.h
 #include asm/arch/at91_common.h
 #include asm/arch/at91_pmc.h
 #include asm/arch/at91_rstc.h
+#include asm/arch/at91_matrix.h
+#include asm/arch/at91_pio.h
 #include asm/arch/clk.h
-#include asm/arch/gpio.h
 #include asm/arch/hardware.h
 #include asm/arch/io.h
 #include netdev.h
@@ -52,10 +52,10 @@ int get_hw_rev(void)
if (hw_rev = 0)
return hw_rev;
 
-   hw_rev = at91_get_gpio_value(AT91_PIN_PB19);
-   hw_rev |= at91_get_gpio_value(AT91_PIN_PB20)  1;
-   hw_rev |= at91_get_gpio_value(AT91_PIN_PB21)  2;
-   hw_rev |= at91_get_gpio_value(AT91_PIN_PB22)  3;
+   hw_rev = at91_get_pio_value(AT91_PIO_PORTB, 19);
+   hw_rev |= at91_get_pio_value(AT91_PIO_PORTB, 20)  1;
+   hw_rev |= at91_get_pio_value(AT91_PIO_PORTB, 21)  2;
+   hw_rev |= at91_get_pio_value(AT91_PIO_PORTB, 22)  3;
 
if (hw_rev == 15)
hw_rev = 0;
@@ -67,44 +67,44 @@ int get_hw_rev(void)
 static void meesc_nand_hw_init(void)
 {
unsigned long csa;
+   at91_smc_t  *smc= (at91_smc_t *) AT91_SMC0_BASE;
+   at91_matrix_t   *matrix = (at91_matrix_t *) AT91_MATRIX_BASE;
 
/* Enable CS3 */
-   csa = at91_sys_read(AT91_MATRIX_EBI0CSA);
-   at91_sys_write(AT91_MATRIX_EBI0CSA,
-   csa | AT91_MATRIX_EBI0_CS3A_SMC_SMARTMEDIA);
+   csa = readl(matrix-csa[0]) | AT91_MATRIX_CSA_EBI_CS3A;
+   writel(csa, matrix-csa[0]);
 
/* Configure SMC CS3 for NAND/SmartMedia */
-   at91_sys_write(AT91_SMC_SETUP(3),
-   AT91_SMC_NWESETUP_(1) | AT91_SMC_NCS_WRSETUP_(0) |
-   AT91_SMC_NRDSETUP_(1) | AT91_SMC_NCS_RDSETUP_(0));
-   at91_sys_write(AT91_SMC_PULSE(3),
-   AT91_SMC_NWEPULSE_(3) | AT91_SMC_NCS_WRPULSE_(3) |
-   AT91_SMC_NRDPULSE_(3) | AT91_SMC_NCS_RDPULSE_(3));
-   at91_sys_write(AT91_SMC_CYCLE(3),
-   AT91_SMC_NWECYCLE_(5) | AT91_SMC_NRDCYCLE_(5));
-   at91_sys_write(AT91_SMC_MODE(3),
-   AT91_SMC_READMODE | AT91_SMC_WRITEMODE |
-   AT91_SMC_EXNWMODE_DISABLE |
-#ifdef CONFIG_SYS_NAND_DBW_16
-   AT91_SMC_DBW_16 |
-#else /* CONFIG_SYS_NAND_DBW_8 */
-   AT91_SMC_DBW_8 |
-#endif
-   AT91_SMC_TDF_(2));
+   writel(AT91_SMC_SETUP_NWE(1) | AT91_SMC_SETUP_NCS_WR(0) |
+   AT91_SMC_SETUP_NRD(1) | AT91_SMC_SETUP_NCS_RD(0),
+   smc-cs[3].setup);
+
+   writel(AT91_SMC_PULSE_NWE(3) | AT91_SMC_PULSE_NCS_WR(3) |
+   AT91_SMC_PULSE_NRD(3) | AT91_SMC_PULSE_NCS_RD(3),
+   smc-cs[3].pulse);
+
+   writel(AT91_SMC_CYCLE_NWE(5) | AT91_SMC_CYCLE_NRD(5),
+   smc-cs[3].cycle);
+   writel(AT91_SMC_MODE_RM_NRD | AT91_SMC_MODE_WM_NWE |
+   AT91_SMC_MODE_EXNW_DISABLE |
+  AT91_SMC_MODE_DBW_8 |
+  AT91_SMC_MODE_TDF_CYCLE(2),
+   smc-cs[3].mode);
 
/* Configure RDY/BSY */
-   at91_set_gpio_input(CONFIG_SYS_NAND_READY_PIN, 1);
+   at91_set_pio_input(CONFIG_SYS_NAND_READY_PIN, 1);
 
/* Enable NandFlash */
-   at91_set_gpio_output(CONFIG_SYS_NAND_ENABLE_PIN, 1);
+   at91_set_pio_output(CONFIG_SYS_NAND_ENABLE_PIN, 1);
 }
 #endif /* CONFIG_CMD_NAND */
 
 #ifdef CONFIG_MACB
 static void meesc_macb_hw_init(void)
 {
+   at91_pmc_t  *pmc= (at91_pmc_t *) AT91_PMC_BASE;
/* Enable clock */
-   at91_sys_write(AT91_PMC_PCER, 1  AT91SAM9263_ID_EMAC);
+   writel(1  AT91SAM9263_ID_EMAC, pmc-pcer);
at91_macb_hw_init();
 }
 #endif
@@ -117,26 +117,27 @@ static void meesc_macb_hw_init(void)
  */
 static void meesc_ethercat_hw_init(void)
 {
+   at91_smc_t  *smc1   = (at91_smc_t *) AT91_SMC1_BASE;
+
/* Configure SMC EBI1_CS0 for EtherCAT */
-   at91_sys_write(AT91_SMC1_SETUP(0),
-   AT91_SMC_NWESETUP_(0) | AT91_SMC_NCS_WRSETUP_(0) |
-   AT91_SMC_NRDSETUP_(0) | AT91_SMC_NCS_RDSETUP_(0

[U-Boot] [PATCH 1/3] at91: Defined main clock frequency on esd at91 boards

2010-07-08 Thread Daniel Gorsulowski
Autodetection is undesired now

Signed-off-by: Daniel Gorsulowski daniel.gorsulow...@esd.eu
---
 include/configs/meesc.h  |9 +
 include/configs/otc570.h |1 +
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/include/configs/meesc.h b/include/configs/meesc.h
index e085f4a..d3cc582 100644
--- a/include/configs/meesc.h
+++ b/include/configs/meesc.h
@@ -1,12 +1,12 @@
 /*
+ * (C) Copyright 2010
+ * Daniel Gorsulowski daniel.gorsulow...@esd.eu
+ * esd electronic system design gmbh www.esd.eu
+ *
  * (C) Copyright 2007-2008
  * Stelian Pop stelian@leadtechdesign.com
  * Lead Tech Design www.leadtechdesign.com
  *
- * (C) Copyright 2009
- * Daniel Gorsulowski daniel.gorsulow...@esd.eu
- * esd electronic system design gmbh www.esd.eu
- *
  * Configuation settings for the esd MEESC board.
  *
  * See file CREDITS for list of people who contributed to this
@@ -38,6 +38,7 @@
 #define CONFIG_MEESC   1   /* Board is esd MEESC */
 #define CONFIG_ARM926EJS   1   /* This is an ARM926EJS Core */
 #define CONFIG_AT91SAM9263 1   /* It's an AT91SAM9263 SoC */
+#define CONFIG_SYS_AT91_MAIN_CLOCK 1600/* 16.0 MHz crystal */
 #define CONFIG_DISPLAY_BOARDINFO   1
 #define CONFIG_DISPLAY_CPUINFO 1   /* display cpu info and speed */
 #define CONFIG_PREBOOT /* enable preboot variable */
diff --git a/include/configs/otc570.h b/include/configs/otc570.h
index fb0f576..4a1cede 100644
--- a/include/configs/otc570.h
+++ b/include/configs/otc570.h
@@ -35,6 +35,7 @@
 #define CONFIG_OTC570  1   /* Board is esd OTC570 */
 #define CONFIG_ARM926EJS   1   /* This is an ARM926EJS Core */
 #define CONFIG_AT91SAM9263 1   /* It's an AT91SAM9263 SoC */
+#define CONFIG_SYS_AT91_MAIN_CLOCK 1600/* 16.0 MHz crystal */
 #define CONFIG_SYS_HZ  1000/* decrementer freq */
 #define CONFIG_DISPLAY_BOARDINFO   1
 #define CONFIG_DISPLAY_CPUINFO 1   /* display cpu info and speed */
-- 
1.5.3

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 3/3] at91: Enabeling USB host on meesc board

2010-07-08 Thread Daniel Gorsulowski
There was an redesign, so USB is available now.
Note:   This patch depends on
'at91: Update meesc board to new SoC access' patch!

Signed-off-by: Daniel Gorsulowski daniel.gorsulow...@esd.eu
---
 board/esd/meesc/meesc.c |6 +-
 include/configs/meesc.h |   13 -
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/board/esd/meesc/meesc.c b/board/esd/meesc/meesc.c
index 1477fab..3c79c07 100644
--- a/board/esd/meesc/meesc.c
+++ b/board/esd/meesc/meesc.c
@@ -253,7 +253,8 @@ int board_init(void)
/* Peripheral Clock Enable Register */
writel( 1  AT91SAM9263_ID_PIOA |
1  AT91SAM9263_ID_PIOB |
-   1  AT91SAM9263_ID_PIOCDE,
+   1  AT91SAM9263_ID_PIOCDE |
+   1  AT91SAM9263_ID_UHP,
pmc-pcer);
 
/* initialize ET1100 Controller */
@@ -275,5 +276,8 @@ int board_init(void)
 #ifdef CONFIG_AT91_CAN
at91_can_hw_init();
 #endif
+#ifdef CONFIG_USB_OHCI_NEW
+   at91_uhp_hw_init();
+#endif
return 0;
 }
diff --git a/include/configs/meesc.h b/include/configs/meesc.h
index 89f99fa..c617cd4 100644
--- a/include/configs/meesc.h
+++ b/include/configs/meesc.h
@@ -85,11 +85,11 @@
 #undef CONFIG_CMD_FPGA
 #undef CONFIG_CMD_LOADS
 #undef CONFIG_CMD_IMLS
-#undef CONFIG_CMD_USB
 
 #define CONFIG_CMD_PING1
 #define CONFIG_CMD_DHCP1
 #define CONFIG_CMD_NAND1
+#define CONFIG_CMD_USB 1
 
 /* LED */
 #define CONFIG_AT91_LED1
@@ -133,6 +133,17 @@
 #define CONFIG_NET_RETRY_COUNT 20
 #undef CONFIG_RESET_PHY_R
 
+/* USB */
+#define CONFIG_USB_ATMEL
+#define CONFIG_USB_OHCI_NEW1
+#define CONFIG_DOS_PARTITION   1
+#define CONFIG_SYS_USB_OHCI_CPU_INIT   1
+#define CONFIG_SYS_USB_OHCI_REGS_BASE  0x00a0
+#define CONFIG_SYS_USB_OHCI_SLOT_NAME  at91sam9263
+#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 2
+#define CONFIG_USB_STORAGE 1
+#define CONFIG_CMD_FAT 1
+
 #define CONFIG_SYS_LOAD_ADDR   0x2200 /* load address */
 
 #define CONFIG_SYS_MEMTEST_START   PHYS_SDRAM
-- 
1.5.3

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 2/3] at91: Update meesc board to new SoC access

2010-07-08 Thread Daniel Gorsulowski
* convert meesc board to use c stucture SoC access
* change gpio access to at91_gpio syntax
* moved CONFIG_SYS_HZ below board and cpu defines (purely cosmetic)

Signed-off-by: Daniel Gorsulowski daniel.gorsulow...@esd.eu
---
 board/esd/meesc/meesc.c |  118 ---
 include/configs/meesc.h |9 ++--
 2 files changed, 65 insertions(+), 62 deletions(-)

diff --git a/board/esd/meesc/meesc.c b/board/esd/meesc/meesc.c
index a1b66cb..1477fab 100644
--- a/board/esd/meesc/meesc.c
+++ b/board/esd/meesc/meesc.c
@@ -1,12 +1,12 @@
 /*
+ * (C) Copyright 2010
+ * Daniel Gorsulowski daniel.gorsulow...@esd.eu
+ * esd electronic system design gmbh www.esd.eu
+ *
  * (C) Copyright 2007-2008
  * Stelian Pop stelian@leadtechdesign.com
  * Lead Tech Design www.leadtechdesign.com
  *
- * (C) Copyright 2009
- * Daniel Gorsulowski daniel.gorsulow...@esd.eu
- * esd electronic system design gmbh www.esd.eu
- *
  * See file CREDITS for list of people who contributed to this
  * project.
  *
@@ -28,13 +28,13 @@
 
 #include common.h
 #include asm/arch/at91sam9263.h
-#include asm/arch/at91sam9_matrix.h
 #include asm/arch/at91sam9_smc.h
 #include asm/arch/at91_common.h
 #include asm/arch/at91_pmc.h
 #include asm/arch/at91_rstc.h
+#include asm/arch/at91_matrix.h
+#include asm/arch/at91_pio.h
 #include asm/arch/clk.h
-#include asm/arch/gpio.h
 #include asm/arch/hardware.h
 #include asm/arch/io.h
 #include netdev.h
@@ -52,10 +52,10 @@ int get_hw_rev(void)
if (hw_rev = 0)
return hw_rev;
 
-   hw_rev = at91_get_gpio_value(AT91_PIN_PB19);
-   hw_rev |= at91_get_gpio_value(AT91_PIN_PB20)  1;
-   hw_rev |= at91_get_gpio_value(AT91_PIN_PB21)  2;
-   hw_rev |= at91_get_gpio_value(AT91_PIN_PB22)  3;
+   hw_rev = at91_get_pio_value(AT91_PIO_PORTB, 19);
+   hw_rev |= at91_get_pio_value(AT91_PIO_PORTB, 20)  1;
+   hw_rev |= at91_get_pio_value(AT91_PIO_PORTB, 21)  2;
+   hw_rev |= at91_get_pio_value(AT91_PIO_PORTB, 22)  3;
 
if (hw_rev == 15)
hw_rev = 0;
@@ -67,44 +67,44 @@ int get_hw_rev(void)
 static void meesc_nand_hw_init(void)
 {
unsigned long csa;
+   at91_smc_t  *smc= (at91_smc_t *) AT91_SMC0_BASE;
+   at91_matrix_t   *matrix = (at91_matrix_t *) AT91_MATRIX_BASE;
 
/* Enable CS3 */
-   csa = at91_sys_read(AT91_MATRIX_EBI0CSA);
-   at91_sys_write(AT91_MATRIX_EBI0CSA,
-   csa | AT91_MATRIX_EBI0_CS3A_SMC_SMARTMEDIA);
+   csa = readl(matrix-csa[0]) | AT91_MATRIX_CSA_EBI_CS3A;
+   writel(csa, matrix-csa[0]);
 
/* Configure SMC CS3 for NAND/SmartMedia */
-   at91_sys_write(AT91_SMC_SETUP(3),
-   AT91_SMC_NWESETUP_(1) | AT91_SMC_NCS_WRSETUP_(0) |
-   AT91_SMC_NRDSETUP_(1) | AT91_SMC_NCS_RDSETUP_(0));
-   at91_sys_write(AT91_SMC_PULSE(3),
-   AT91_SMC_NWEPULSE_(3) | AT91_SMC_NCS_WRPULSE_(3) |
-   AT91_SMC_NRDPULSE_(3) | AT91_SMC_NCS_RDPULSE_(3));
-   at91_sys_write(AT91_SMC_CYCLE(3),
-   AT91_SMC_NWECYCLE_(5) | AT91_SMC_NRDCYCLE_(5));
-   at91_sys_write(AT91_SMC_MODE(3),
-   AT91_SMC_READMODE | AT91_SMC_WRITEMODE |
-   AT91_SMC_EXNWMODE_DISABLE |
-#ifdef CONFIG_SYS_NAND_DBW_16
-   AT91_SMC_DBW_16 |
-#else /* CONFIG_SYS_NAND_DBW_8 */
-   AT91_SMC_DBW_8 |
-#endif
-   AT91_SMC_TDF_(2));
+   writel(AT91_SMC_SETUP_NWE(1) | AT91_SMC_SETUP_NCS_WR(0) |
+   AT91_SMC_SETUP_NRD(1) | AT91_SMC_SETUP_NCS_RD(0),
+   smc-cs[3].setup);
+
+   writel(AT91_SMC_PULSE_NWE(3) | AT91_SMC_PULSE_NCS_WR(3) |
+   AT91_SMC_PULSE_NRD(3) | AT91_SMC_PULSE_NCS_RD(3),
+   smc-cs[3].pulse);
+
+   writel(AT91_SMC_CYCLE_NWE(5) | AT91_SMC_CYCLE_NRD(5),
+   smc-cs[3].cycle);
+   writel(AT91_SMC_MODE_RM_NRD | AT91_SMC_MODE_WM_NWE |
+   AT91_SMC_MODE_EXNW_DISABLE |
+  AT91_SMC_MODE_DBW_8 |
+  AT91_SMC_MODE_TDF_CYCLE(2),
+   smc-cs[3].mode);
 
/* Configure RDY/BSY */
-   at91_set_gpio_input(CONFIG_SYS_NAND_READY_PIN, 1);
+   at91_set_pio_input(CONFIG_SYS_NAND_READY_PIN, 1);
 
/* Enable NandFlash */
-   at91_set_gpio_output(CONFIG_SYS_NAND_ENABLE_PIN, 1);
+   at91_set_pio_output(CONFIG_SYS_NAND_ENABLE_PIN, 1);
 }
 #endif /* CONFIG_CMD_NAND */
 
 #ifdef CONFIG_MACB
 static void meesc_macb_hw_init(void)
 {
+   at91_pmc_t  *pmc= (at91_pmc_t *) AT91_PMC_BASE;
/* Enable clock */
-   at91_sys_write(AT91_PMC_PCER, 1  AT91SAM9263_ID_EMAC);
+   writel(1  AT91SAM9263_ID_EMAC, pmc-pcer);
at91_macb_hw_init();
 }
 #endif
@@ -117,26 +117,27 @@ static void meesc_macb_hw_init(void)
  */
 static void meesc_ethercat_hw_init(void)
 {
+   at91_smc_t  *smc1   = (at91_smc_t *) AT91_SMC1_BASE;
+
/* Configure SMC EBI1_CS0 for EtherCAT */
-   at91_sys_write

[U-Boot] [PATCH 1/1] at91: boards cleanup for deprecated CONFIG_CMD_AUTOSCRIPT

2010-03-17 Thread Daniel Gorsulowski
CONFIG_CMD_AUTOSCRIPT support is deprecated and non-existing
This clean up patch removes the references for esd boards

Signed-off-by: Daniel Gorsulowski daniel.gorsulow...@esd.eu
---
 include/configs/meesc.h  |1 -
 include/configs/otc570.h |1 -
 2 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/include/configs/meesc.h b/include/configs/meesc.h
index d002b97..e085f4a 100644
--- a/include/configs/meesc.h
+++ b/include/configs/meesc.h
@@ -82,7 +82,6 @@
  */
 #include config_cmd_default.h
 #undef CONFIG_CMD_BDI
-#undef CONFIG_CMD_AUTOSCRIPT
 #undef CONFIG_CMD_FPGA
 #undef CONFIG_CMD_LOADS
 #undef CONFIG_CMD_IMLS
diff --git a/include/configs/otc570.h b/include/configs/otc570.h
index 8e27eba..89d0b15 100644
--- a/include/configs/otc570.h
+++ b/include/configs/otc570.h
@@ -130,7 +130,6 @@
  * Command line configuration.
  */
 #include config_cmd_default.h
-#undef CONFIG_CMD_AUTOSCRIPT
 #undef CONFIG_CMD_FPGA
 #undef CONFIG_CMD_LOADS
 #undef CONFIG_CMD_IMLS
-- 
1.5.3

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Use of deprecated CONFIG_CMD_AUTOSCRIPT

2010-03-17 Thread Daniel Gorsulowski
Hello Wolfgang,

Wolfgang Denk wrote:
 
 Hello,
 
 the following boards maintained by you stioll reference the deprecated
 (and non-existing) CONFIG_CMD_AUTOSCRIPT.  Please submit clean-up
 patches to extinguish all references to AUTOSCR:
 
...
   meesc
...
   otc570
...

I sent a patch to fix my esd boards.

Regards,
Daniel
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/1] AT91: Update otc570 board to new SoC access

2010-03-05 Thread Daniel Gorsulowski
Hello Tom

Daniel Gorsulowski wrote:
 * convert otc570 board to use c stucture SoC access
 * change gpio access to at91_gpio syntax
 
 Signed-off-by: Daniel Gorsulowski daniel.gorsulow...@esd.eu
 ---
 This patch requires Jens Scharsigs new SoC access patchset.
 http://lists.denx.de/pipermail/u-boot/2010-February/067424.html
 http://lists.denx.de/pipermail/u-boot/2010-February/067425.html
 http://lists.denx.de/pipermail/u-boot/2010-February/067426.html
 http://lists.denx.de/pipermail/u-boot/2010-February/067427.html
 http://lists.denx.de/pipermail/u-boot/2010-February/067428.html
 http://lists.denx.de/pipermail/u-boot/2010-February/067429.html
 http://lists.denx.de/pipermail/u-boot/2010-February/067430.html
 http://lists.denx.de/pipermail/u-boot/2010-February/067431.html
 http://lists.denx.de/pipermail/u-boot/2010-February/067432.html
 
...

I recognized, you didn't apply this patch yet. Is there any reason, or did you
simply slip this patch?

Btw. I'm also missing this patch:
http://lists.denx.de/pipermail/u-boot/2010-February/067779.html

Best regards,
Daniel Gorsulowski
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] please unsubscribe me

2010-02-18 Thread Daniel Gorsulowski
Mike Norrix wrote:
 This is way too much email, please unsubsubscribe me Thanks

Visit http://lists.denx.de/mailman/listinfo/u-boot and unsubsubscribe yourself.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH ARM] updates the at91 main_clock calculation

2010-02-17 Thread Daniel Gorsulowski
Am 16.02.2010 16:23, schrieb Tom:
 Daniel Gorsulowski wrote:
 Jens Scharsig wrote:
  * updates the conditional main_clock calculation (if AT91_MAIN_CLOCK 
 defined) to c structure SoC access
  * add need register flags


 Signed-off-by: Jens Scharsig js_at...@scharsoft.de
 ---
  cpu/arm926ejs/at91/clock.c   |7 ---
  include/asm-arm/arch-at91/at91_pmc.h |3 +++
  2 files changed, 7 insertions(+), 3 deletions(-)

 ...

 Thank you, now the updated otc570 builds without errors.
 I didn't check, whether the board boots, but I guess it does.

 Were you going to check in the next couple of days ?
 Tom
 

Checked... board boots.

Btw. there are some warnings during build:
mkimage.c: In function ‘main’:
mkimage.c:204: warning: dereferencing type-punned pointer will break
strict-aliasing rules
mkimage.c:222: warning: dereferencing type-punned pointer will break
strict-aliasing rules
soft_i2c.c: In function 'send_reset':
soft_i2c.c:103: warning: unused variable 'pio'
soft_i2c.c: In function 'send_start':
soft_i2c.c:130: warning: unused variable 'pio'
soft_i2c.c: In function 'send_stop':
soft_i2c.c:147: warning: unused variable 'pio'
soft_i2c.c: In function 'send_ack':
soft_i2c.c:166: warning: unused variable 'pio'
soft_i2c.c: In function 'write_byte':
soft_i2c.c:185: warning: unused variable 'pio'
soft_i2c.c: In function 'read_byte':
soft_i2c.c:259: warning: unused variable 'pio'
atmel_dataflash_spi.c:25:2: warning: #warning Please update to use C structur
SoC access !
atmel_usart.c:21:2: warning: #warning Please update to use C structur SoC 
access !
ohci-at91.c:30:2: warning: #warning Please update to use C structur SoC access !

Regards,
Daniel
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH ARM] updates the at91 main_clock calculation

2010-02-15 Thread Daniel Gorsulowski
Jens Scharsig wrote:
  * updates the conditional main_clock calculation (if AT91_MAIN_CLOCK 
 defined) to c structure SoC access
  * add need register flags
 
 
 Signed-off-by: Jens Scharsig js_at...@scharsoft.de
 ---
  cpu/arm926ejs/at91/clock.c   |7 ---
  include/asm-arm/arch-at91/at91_pmc.h |3 +++
  2 files changed, 7 insertions(+), 3 deletions(-)
 
...

Thank you, now the updated otc570 builds without errors.
I didn't check, whether the board boots, but I guess it does.

Regards,
Daniel Gorsulowski
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/9 V4] add new CONFIG_AT91_LEGACY

2010-02-13 Thread Daniel Gorsulowski
Tom wrote:
 Daniel Gorsulowski wrote:
 Tom wrote:
 Daniel Gorsulowski wrote:
 Hello Tom,

 Tom wrote:
 Jens Scharsig wrote:
 * add's the new temporary CONFIG_AT91_LEGACY to all board configs
  This will need for backward compatiblity, while change the SoC access
  to c structures. If CONFIG_AT91_LEGACY is defined, the deprecated
  SoC is used.
...
 You probably recognized that I did not sent a patch with CONFIG_AT91_LEGACY
 support but I updated the otc570 board to new SoC access.
 http://lists.denx.de/pipermail/u-boot/2010-February/067691.html
 I guess, this is the best solution.

 
 Daniel,
 I still see an error wrt otc570.
 
 Jens,
 I have pushed your patchset of around 2/4 to arm/master.
 
 There will be an error in the otc570 build.
 Tom
 

If you are talking about errors in clock.c, I know about them.
Please take a look at the comments in my otc570 patch. Regarding to Jens
patchset I wrote:

 Apart from a tiny change, I give them an ACK. See
 http://lists.denx.de/pipermail/u-boot/2010-February/067674.html
 and
 http://lists.denx.de/pipermail/u-boot/2010-February/067680.html

Best regards
Daniel Gorsulowski
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 5/9 V4] convert common files to new SoC access

2010-02-11 Thread Daniel Gorsulowski
Daniel Gorsulowski wrote:

snip

 - tmp = at91_sys_read(AT91_CKGR_MCFR);
 - } while (!(tmp  AT91_PMC_MAINRDY));
 - main_clock = (tmp  AT91_PMC_MAINF) * (AT91_SLOW_CLOCK / 16);
 + tmp = readl(pmc-mcfr);
 + } while (!(tmp  AT91_PMC_IXR_MCKRDY));
 + main_clock = (tmp  (0x   0)) * (AT91_SLOW_CLOCK / 16);
   }
  #endif
   main_clk_rate_hz = main_clock;
 --
 
 I replaced AT91_PMC_MAINF with (0x   0), because AT91_PMC_MAINF in not
 available anymore. Maybe you find a better solution...
 

Sorry, I committed before testing.
AT91_PMC_IXR_MCKRDY is wrong. It should be replaced by 0x0001 or an
appropriate #define

Daniel
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/1] AT91: Update otc570 board to new SoC access

2010-02-11 Thread Daniel Gorsulowski
* convert otc570 board to use c stucture SoC access
* change gpio access to at91_gpio syntax

Signed-off-by: Daniel Gorsulowski daniel.gorsulow...@esd.eu
---
This patch requires Jens Scharsigs new SoC access patchset.
http://lists.denx.de/pipermail/u-boot/2010-February/067424.html
http://lists.denx.de/pipermail/u-boot/2010-February/067425.html
http://lists.denx.de/pipermail/u-boot/2010-February/067426.html
http://lists.denx.de/pipermail/u-boot/2010-February/067427.html
http://lists.denx.de/pipermail/u-boot/2010-February/067428.html
http://lists.denx.de/pipermail/u-boot/2010-February/067429.html
http://lists.denx.de/pipermail/u-boot/2010-February/067430.html
http://lists.denx.de/pipermail/u-boot/2010-February/067431.html
http://lists.denx.de/pipermail/u-boot/2010-February/067432.html

Apart from a tiny change, I give them an ACK. See
http://lists.denx.de/pipermail/u-boot/2010-February/067674.html
and
http://lists.denx.de/pipermail/u-boot/2010-February/067680.html

 board/esd/otc570/otc570.c |  180 -
 include/configs/otc570.h  |   25 +++---
 2 files changed, 107 insertions(+), 98 deletions(-)

diff --git a/board/esd/otc570/otc570.c b/board/esd/otc570/otc570.c
index 056df37..9883d5e 100644
--- a/board/esd/otc570/otc570.c
+++ b/board/esd/otc570/otc570.c
@@ -28,13 +28,13 @@
 
 #include common.h
 #include asm/arch/at91sam9263.h
-#include asm/arch/at91sam9_matrix.h
 #include asm/arch/at91sam9_smc.h
 #include asm/arch/at91_common.h
 #include asm/arch/at91_pmc.h
 #include asm/arch/at91_rstc.h
+#include asm/arch/at91_matrix.h
+#include asm/arch/at91_pio.h
 #include asm/arch/clk.h
-#include asm/arch/gpio.h
 #include asm/arch/hardware.h
 #include asm/arch/io.h
 #include atmel_lcdc.h
@@ -58,10 +58,10 @@ int get_hw_rev(void)
if (hw_rev = 0)
return hw_rev;
 
-   hw_rev = at91_get_gpio_value(AT91_PIN_PB19);
-   hw_rev |= at91_get_gpio_value(AT91_PIN_PB20)  1;
-   hw_rev |= at91_get_gpio_value(AT91_PIN_PB21)  2;
-   hw_rev |= at91_get_gpio_value(AT91_PIN_PB22)  3;
+   hw_rev = at91_get_pio_value(AT91_PIO_PORTB, 19);
+   hw_rev |= at91_get_pio_value(AT91_PIO_PORTB, 20)  1;
+   hw_rev |= at91_get_pio_value(AT91_PIO_PORTB, 21)  2;
+   hw_rev |= at91_get_pio_value(AT91_PIO_PORTB, 22)  3;
 
if (hw_rev == 15)
hw_rev = 0;
@@ -73,40 +73,44 @@ int get_hw_rev(void)
 static void otc570_nand_hw_init(void)
 {
unsigned long csa;
+   at91_smc_t  *smc= (at91_smc_t *) AT91_SMC0_BASE;
+   at91_matrix_t   *matrix = (at91_matrix_t *) AT91_MATRIX_BASE;
 
/* Enable CS3 */
-   csa = at91_sys_read(AT91_MATRIX_EBI0CSA);
-   at91_sys_write(AT91_MATRIX_EBI0CSA,
-   csa | AT91_MATRIX_EBI0_CS3A_SMC_SMARTMEDIA);
+   csa = readl(matrix-csa[0]) | AT91_MATRIX_CSA_EBI_CS3A;
+   writel(csa, matrix-csa[0]);
 
/* Configure SMC CS3 for NAND/SmartMedia */
-   at91_sys_write(AT91_SMC_SETUP(3),
-   AT91_SMC_NWESETUP_(1) | AT91_SMC_NCS_WRSETUP_(0) |
-   AT91_SMC_NRDSETUP_(1) | AT91_SMC_NCS_RDSETUP_(0));
-   at91_sys_write(AT91_SMC_PULSE(3),
-   AT91_SMC_NWEPULSE_(3) | AT91_SMC_NCS_WRPULSE_(3) |
-   AT91_SMC_NRDPULSE_(3) | AT91_SMC_NCS_RDPULSE_(3));
-   at91_sys_write(AT91_SMC_CYCLE(3),
-   AT91_SMC_NWECYCLE_(5) | AT91_SMC_NRDCYCLE_(5));
-   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));
+   writel(AT91_SMC_SETUP_NWE(1) | AT91_SMC_SETUP_NCS_WR(0) |
+   AT91_SMC_SETUP_NRD(1) | AT91_SMC_SETUP_NCS_RD(0),
+   smc-cs[3].setup);
+
+   writel(AT91_SMC_PULSE_NWE(3) | AT91_SMC_PULSE_NCS_WR(3) |
+   AT91_SMC_PULSE_NRD(3) | AT91_SMC_PULSE_NCS_RD(3),
+   smc-cs[3].pulse);
+
+   writel(AT91_SMC_CYCLE_NWE(5) | AT91_SMC_CYCLE_NRD(5),
+   smc-cs[3].cycle);
+   writel(AT91_SMC_MODE_RM_NRD | AT91_SMC_MODE_WM_NWE |
+   AT91_SMC_MODE_EXNW_DISABLE |
+  AT91_SMC_MODE_DBW_8 |
+  AT91_SMC_MODE_TDF_CYCLE(2),
+   smc-cs[3].mode);
 
/* Configure RDY/BSY */
-   at91_set_gpio_input(CONFIG_SYS_NAND_READY_PIN, 1);
+   at91_set_pio_input(CONFIG_SYS_NAND_READY_PIN, 1);
 
/* Enable NandFlash */
-   at91_set_gpio_output(CONFIG_SYS_NAND_ENABLE_PIN, 1);
+   at91_set_pio_output(CONFIG_SYS_NAND_ENABLE_PIN, 1);
 }
 #endif /* CONFIG_CMD_NAND */
 
 #ifdef CONFIG_MACB
 static void otc570_macb_hw_init(void)
 {
+   at91_pmc_t  *pmc= (at91_pmc_t *) AT91_PMC_BASE;
/* Enable clock */
-   at91_sys_write(AT91_PMC_PCER, 1  AT91SAM9263_ID_EMAC);
+   writel(1  AT91SAM9263_ID_EMAC, pmc-pcer);
at91_macb_hw_init();
 }
 #endif
@@ -119,26 +123,27 @@ static void otc570_macb_hw_init(void)
  */
 static

Re: [U-Boot] [PATCH 1/9 V4] add new CONFIG_AT91_LEGACY

2010-02-11 Thread Daniel Gorsulowski
Tom wrote:
 Daniel Gorsulowski wrote:
 Hello Tom,

 Tom wrote:
 Jens Scharsig wrote:
 * add's the new temporary CONFIG_AT91_LEGACY to all board configs
  This will need for backward compatiblity, while change the SoC access
  to c structures. If CONFIG_AT91_LEGACY is defined, the deprecated
  SoC is used.


 Signed-off-by: Jens Scharsig js_at...@scharsoft.de
 This looks good.
 The only problem is the new at91 target otc570 is breaking.

 Please take a look at errors in otc570

 otc570 :

 at91sam9263_devices.c: In function 'at91_serial0_hw_init':
 at91sam9263_devices.c:40: warning: implicit declaration of function 
 'at91_set_a_periph'
 at91sam9263_devices.c: In function 'at91_spi0_hw_init':
 at91sam9263_devices.c:96: warning: implicit declaration of function 
 'at91_set_b_periph'
 at91sam9263_devices.c:116: warning: implicit declaration of function 
 'at91_set_pio_output'
 clock.c: In function 'at91_clock_init':
 clock.c:160: warning: implicit declaration of function 'at91_sys_read'
 clock.c:160: error: 'AT91_CKGR_MCFR' undeclared (first use in this function)
 clock.c:160: error: (Each undeclared identifier is reported only once
 clock.c:160: error: for each function it appears in.)

 Tom

 This is caused by missing defines in include\configs\otc570.h:
 #define CONFIG_AT91_LEGACY
 and
 #define CONFIG_AT91_GPIO 1

 Should I send a patch to fix this, or should I wait for Jens patches coming
 mainline?

 
 Please send a patch.
 It should be a 2-3 liner.
 I will combine it with Jens' patchset and push them together.
 Tom
 
You probably recognized that I did not sent a patch with CONFIG_AT91_LEGACY
support but I updated the otc570 board to new SoC access.
http://lists.denx.de/pipermail/u-boot/2010-February/067691.html
I guess, this is the best solution.

Best regards,
Daniel Gorsulowski
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 5/9 V4] convert common files to new SoC access

2010-02-10 Thread Daniel Gorsulowski
Hello Jens,

Jens Scharsig wrote:
  * add's a warning to all files, which need update to new SoC access
  * convert common files in cpu/../at91 and a lot of drivers to use
c stucture SoC access
 
 
 Signed-off-by: Jens Scharsig js_at...@scharsoft.de

snip

 diff --git a/drivers/i2c/soft_i2c.c b/drivers/i2c/soft_i2c.c
 index 9a48783..e0cf1e1 100644
 --- a/drivers/i2c/soft_i2c.c
 +++ b/drivers/i2c/soft_i2c.c
 @@ -30,14 +30,15 @@
  #include ioports.h
  #include asm/io.h
  #endif
 -#ifdef   CONFIG_AT91RM9200   /* need this for the at91rm9200 
 */
 +#if defined(CONFIG_AT91RM9200) || \
 + defined(CONFIG_AT91SAM9260) ||  defined(CONFIG_AT91SAM9261) || \
 + defined(CONFIG_AT91SAM9263)
  #include asm/io.h
  #include asm/arch/hardware.h
 -#endif
 -#ifdef CONFIG_AT91SAM9263/* only valid for AT91SAM9263 */
 -#include asm/arch/at91_pmc.h
Please don't remove this include. It breaks build on AT91SAM9263 boards who have
CONFIG_AT91_LEGACY enabled. (e.g. new otc570 board)
 +#include asm/arch/at91_pio.h
 +#ifdef CONFIG_AT91_LEGACY
  #include asm/arch/gpio.h
 -#include asm/arch/io.h
dito
 +#endif
  #endif
  #ifdef   CONFIG_IXP425   /* only valid for IXP425 */
  #include asm/arch/ixp425.h

Best regards,
Daniel Gorsulowski
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/9 V4] add new CONFIG_AT91_LEGACY

2010-02-10 Thread Daniel Gorsulowski
Hello Tom,

Tom wrote:
 Jens Scharsig wrote:
 * add's the new temporary CONFIG_AT91_LEGACY to all board configs
  This will need for backward compatiblity, while change the SoC access
  to c structures. If CONFIG_AT91_LEGACY is defined, the deprecated
  SoC is used.


 Signed-off-by: Jens Scharsig js_at...@scharsoft.de
 
 This looks good.
 The only problem is the new at91 target otc570 is breaking.
 
 Please take a look at errors in otc570
 
 otc570 :
 
 at91sam9263_devices.c: In function 'at91_serial0_hw_init':
 at91sam9263_devices.c:40: warning: implicit declaration of function 
 'at91_set_a_periph'
 at91sam9263_devices.c: In function 'at91_spi0_hw_init':
 at91sam9263_devices.c:96: warning: implicit declaration of function 
 'at91_set_b_periph'
 at91sam9263_devices.c:116: warning: implicit declaration of function 
 'at91_set_pio_output'
 clock.c: In function 'at91_clock_init':
 clock.c:160: warning: implicit declaration of function 'at91_sys_read'
 clock.c:160: error: 'AT91_CKGR_MCFR' undeclared (first use in this function)
 clock.c:160: error: (Each undeclared identifier is reported only once
 clock.c:160: error: for each function it appears in.)
 
 Tom

This is caused by missing defines in include\configs\otc570.h:
#define CONFIG_AT91_LEGACY
and
#define CONFIG_AT91_GPIO1

Should I send a patch to fix this, or should I wait for Jens patches coming
mainline?

Best regards,
Daniel Gorsulowski
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 5/9 V4] convert common files to new SoC access

2010-02-10 Thread Daniel Gorsulowski
Daniel Gorsulowski wrote:
 Hello Jens,
 
 Jens Scharsig wrote:
  * add's a warning to all files, which need update to new SoC access
  * convert common files in cpu/../at91 and a lot of drivers to use
c stucture SoC access


 Signed-off-by: Jens Scharsig js_at...@scharsoft.de
 
 snip
 
 diff --git a/drivers/i2c/soft_i2c.c b/drivers/i2c/soft_i2c.c
 index 9a48783..e0cf1e1 100644
 --- a/drivers/i2c/soft_i2c.c
 +++ b/drivers/i2c/soft_i2c.c
 @@ -30,14 +30,15 @@
  #include ioports.h
  #include asm/io.h
  #endif
 -#ifdef  CONFIG_AT91RM9200   /* need this for the at91rm9200 
 */
 +#if defined(CONFIG_AT91RM9200) || \
 +defined(CONFIG_AT91SAM9260) ||  defined(CONFIG_AT91SAM9261) || \
 +defined(CONFIG_AT91SAM9263)
  #include asm/io.h
  #include asm/arch/hardware.h
 -#endif
 -#ifdef CONFIG_AT91SAM9263   /* only valid for AT91SAM9263 */
 -#include asm/arch/at91_pmc.h
 Please don't remove this include. It breaks build on AT91SAM9263 boards who 
 have
 CONFIG_AT91_LEGACY enabled. (e.g. new otc570 board)
 +#include asm/arch/at91_pio.h
 +#ifdef CONFIG_AT91_LEGACY
  #include asm/arch/gpio.h
 -#include asm/arch/io.h
 dito
 +#endif
  #endif
  #ifdef  CONFIG_IXP425   /* only valid for IXP425 */
  #include asm/arch/ixp425.h

I Updated my otc570 board to new SoC access, hence these includes are not needed
anymore.
I can ack this patch as it is.

Best regards,
Daniel Gorsulowski
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 5/9 V4] convert common files to new SoC access

2010-02-10 Thread Daniel Gorsulowski
Hello Jens,

Jens Scharsig wrote:
  * add's a warning to all files, which need update to new SoC access
  * convert common files in cpu/../at91 and a lot of drivers to use
c stucture SoC access

snip

 diff --git a/cpu/arm926ejs/at91/clock.c b/cpu/arm926ejs/at91/clock.c
 index 574f488..7e03907 100644
 --- a/cpu/arm926ejs/at91/clock.c
 +++ b/cpu/arm926ejs/at91/clock.c

snip

IMHO you slipped the following:

diff --git a/cpu/arm926ejs/at91/clock.c b/cpu/arm926ejs/at91/clock.c
index 7e03907..b6f434a 100644
--- a/cpu/arm926ejs/at91/clock.c
+++ b/cpu/arm926ejs/at91/clock.c
@@ -157,9 +157,9 @@ int at91_clock_init(unsigned long main_clock)
 */
if (!main_clock) {
do {
-   tmp = at91_sys_read(AT91_CKGR_MCFR);
-   } while (!(tmp  AT91_PMC_MAINRDY));
-   main_clock = (tmp  AT91_PMC_MAINF) * (AT91_SLOW_CLOCK / 16);
+   tmp = readl(pmc-mcfr);
+   } while (!(tmp  AT91_PMC_IXR_MCKRDY));
+   main_clock = (tmp  (0x   0)) * (AT91_SLOW_CLOCK / 16);
}
 #endif
main_clk_rate_hz = main_clock;
--

I replaced AT91_PMC_MAINF with (0x   0), because AT91_PMC_MAINF in not
available anymore. Maybe you find a better solution...

Best regards,
Daniel Gorsulowski
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] at91: Add esd gmbh OTC570 board support

2010-01-25 Thread Daniel Gorsulowski
Hello Tom,

thanks for reviewing...

Tom wrote:
 Daniel Gorsulowski wrote:
 This patch adds support for esd gmbh OTC570 board.
 The OTC570 is based on an Atmel AT91SAM9263 SoC.

 Signed-off-by: Daniel Gorsulowski daniel.gorsulow...@esd.eu
 
 For u-boot-video.
 Maybe some u-boot commands that could be common.
 
snip
 +
 +/*
 + * U-Boot commands
 + */
 +
 +/* Set brightness */
 +int do_blbright(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 +{
 +unsigned long value = 0xff;
 +
 +if (argc  1) {
 +value = simple_strtoul(argv[1], NULL, 0);
 +if ((value = 0)  (value = 255)) {
 +printf(Writing value %02lX ..., value);
 +__raw_writel(value, (panel_info.mmio +
 +ATMEL_LCDC_CONTRAST_VAL));
 +puts(done\n);
 +} else {
 +puts(Invalid value! );
 +puts(Valid values are 0 ... 255 or 0x0 ... 0xFF\n);
 +return -1;
 +}
 +} else {
 +puts(No value given! );
 +puts(Valid values are 0 ... 255 or 0x0 ... 0xFF\n);
 +return -1;
 +}
 +return 0;
 +}
 +U_BOOT_CMD(
 +blbright,   2,  1,  do_blbright,
 +sets display brightness,
 +\n
 +);
 +
 +/* Switch backlight power */
 +int do_blpower(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 +{
 +int i = 0;
 +if (argc  1) {
 +i = argv[1][0] == '0';
 +if (i) {
 +puts(Switching backlight off... );
 +lcd_disable();
 +} else {
 +puts(Switching backlight on... );
 +lcd_enable();
 +}
 +puts(done\n);
 +} else
 +puts(No value given!\n);
 +return 0;
 +}
 +U_BOOT_CMD(
 +blpower,2,  1,  do_blpower,
 +switches display-backlight on or off,
 +\n
 +);
 
 These video commands look common enough that maybe they should
 go into common/*  Is there anything that already does this?

I'll think about, how to make these commands common. Until then I
can live without them, so I'll remove them for now.

snip
 index 5b8c3c3..c91e19d 100644
 --- a/tools/Makefile
 +++ b/tools/Makefile
 @@ -102,6 +102,9 @@ endif
  ifeq ($(VENDOR),atmel)
  LOGO_BMP= logos/atmel.bmp
  endif
 +ifeq ($(VENDOR),esd)
 +LOGO_BMP= logos/esd.bmp
 +endif
 
 There are a number of esd board.
 Is this bmp ok for all of them ?
 
Yes, this bmp is common for all esd boards that have a LCD and provide a bootup
logo
  ifeq ($(VENDOR),ronetix)
  LOGO_BMP= logos/ronetix.bmp
  endif
 diff --git a/tools/logos/esd.bmp b/tools/logos/esd.bmp
snip

All other other suggestions I applyed in v2.

Regards,
Daniel
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2] at91: Add esd gmbh OTC570 board support

2010-01-25 Thread Daniel Gorsulowski
This patch adds support for esd gmbh OTC570 board.
The OTC570 is based on an Atmel AT91SAM9263 SoC.

Signed-off-by: Daniel Gorsulowski daniel.gorsulow...@esd.eu
---
v2: Applyed suggestions according to
http://lists.denx.de/pipermail/u-boot/2010-January/066948.html
- removed video commands they should go into common
- swapped copyright places
- removed some #ifdef / #ifndef
- converted element initializations in panel_info
- replaced some puts() with printf()
- moved CONFIG_SYS_HZ below board and cpu defines

 MAINTAINERS  |1 +
 MAKEALL  |1 +
 Makefile |3 +
 board/esd/otc570/Makefile|   55 +++
 board/esd/otc570/config.mk   |1 +
 board/esd/otc570/otc570.c|  365 ++
 board/esd/otc570/partition.c |   37 +
 include/configs/otc570.h |  246 
 tools/Makefile   |3 +
 tools/logos/esd.bmp  |  Bin 0 - 35078 bytes
 10 files changed, 712 insertions(+), 0 deletions(-)
 create mode 100644 board/esd/otc570/Makefile
 create mode 100644 board/esd/otc570/config.mk
 create mode 100644 board/esd/otc570/otc570.c
 create mode 100644 board/esd/otc570/partition.c
 create mode 100644 include/configs/otc570.h
 create mode 100644 tools/logos/esd.bmp

diff --git a/MAINTAINERS b/MAINTAINERS
index e8ba4bc..0c2b1b1 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -574,6 +574,7 @@ Peter Figuli pep...@etc.sk
 Daniel Gorsulowski daniel.gorsulow...@esd.eu
 
meesc   ARM926EJS (AT91SAM9263 SoC)
+   otc570  ARM926EJS (AT91SAM9263 SoC)
 
 Sedji Gaouaousedji.gaou...@atmel.com
at91sam9g10ek   ARM926EJS (AT91SAM9G10 SoC)
diff --git a/MAKEALL b/MAKEALL
index dd635bd..eefd3dd 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -654,6 +654,7 @@ LIST_at91= \
meesc   \
mp2usb  \
m501sk  \
+   otc570  \
pm9261  \
pm9263  \
SBC35_A9G20 \
diff --git a/Makefile b/Makefile
index 1ab197b..5fda1b9 100644
--- a/Makefile
+++ b/Makefile
@@ -2862,6 +2862,9 @@ at91sam9g45ekes_config:   unconfig
fi;
@$(MKCONFIG) -a at91sam9m10g45ek arm arm926ejs at91sam9m10g45ek atmel 
at91
 
+otc570_config  :   unconfig
+   @$(MKCONFIG) $(@:_config=) arm arm926ejs otc570 esd at91
+
 pm9263_config  :   unconfig
@$(MKCONFIG) $(@:_config=) arm arm926ejs pm9263 ronetix at91
 
diff --git a/board/esd/otc570/Makefile b/board/esd/otc570/Makefile
new file mode 100644
index 000..755c5ee
--- /dev/null
+++ b/board/esd/otc570/Makefile
@@ -0,0 +1,55 @@
+#
+# (C) Copyright 2003-2008
+# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+#
+# (C) Copyright 2008
+# Stelian Pop stelian@leadtechdesign.com
+# Lead Tech Design www.leadtechdesign.com
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# 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 $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).a
+
+COBJS-y+= $(BOARD).o
+COBJS-$(CONFIG_HAS_DATAFLASH)  += partition.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS-y))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(obj).depend $(OBJS) $(SOBJS)
+   $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
+
+clean:
+   rm -f $(SOBJS) $(OBJS)
+
+distclean: clean
+   rm -f $(LIB) core *.bak $(obj).depend
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/esd/otc570/config.mk b/board/esd/otc570/config.mk
new file mode 100644
index 000..ff2cfd1
--- /dev/null
+++ b/board/esd/otc570/config.mk
@@ -0,0 +1 @@
+TEXT_BASE = 0x23f0
diff --git a/board/esd/otc570/otc570.c b/board/esd/otc570/otc570.c
new file mode 100644
index 000..056df37
--- /dev/null
+++ b/board/esd/otc570/otc570.c
@@ -0,0 +1,365 @@
+/*
+ * (C) Copyright 2010
+ * Daniel Gorsulowski daniel.gorsulow...@esd.eu
+ * esd electronic system design gmbh

Re: [U-Boot] Linux Kernel without Ethernet (missed MAC)

2010-01-19 Thread Daniel Gorsulowski
Hi Arno,

Arno Steffen wrote:
 Changing my OMAP EVM board to newest uboot 2009-11 I do have a problem
 with ethernet.
 Although the kernel could be loaded via tftp perfectly, the upcoming
 kernel complains about invalid MAC.
 
 Kernel command line: mem=128M console=ttyS0,115200n8
 root=/dev/mtdblock8 rw rootfstype=jffs2 ip=dhcp
 ...
On ARM, I solved that problem as follows:

1. Add ethaddr=$(ethaddr) to your kernel command line. e.g.:
   mem=128M console=ttyS0,115200n8 ethaddr=$(ethaddr)

2. Apply this patch on linux kernel (approved on v2.6.31):

diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index 92fe36d..cddf67a 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -14,6 +14,7 @@
 #include linux/kernel.h
 #include linux/types.h
 #include linux/slab.h
+#include linux/string.h
 #include linux/init.h
 #include linux/netdevice.h
 #include linux/etherdevice.h
@@ -81,9 +82,14 @@ static void __init macb_get_hwaddr(struct macb *bp)
u32 bottom;
u16 top;
u8 addr[6];
+   char *ptr = NULL;
+   char *ptr_end;
+   char ethaddr[17];
+   int i;

bottom = macb_readl(bp, SA1B);
top = macb_readl(bp, SA1T);
+   ptr = strstr(boot_command_line, ethaddr=);

addr[0] = bottom  0xff;
addr[1] = (bottom  8)  0xff;
@@ -94,6 +100,16 @@ static void __init macb_get_hwaddr(struct macb *bp)

if (is_valid_ether_addr(addr)) {
memcpy(bp-dev-dev_addr, addr, sizeof(addr));
+   } else if (ptr) {
+   memcpy(ethaddr, ptr + 8, 17 * sizeof(char));
+   printk(KERN_NOTICE ethaddr parsed from commandline: %s\n, 
ethaddr);
+   ptr_end = ethaddr;
+   for (i = 0; i = 5; i++) {
+   addr[i] = simple_strtol(ptr_end, ptr_end, 16) |
+   simple_strtol(ptr_end, ptr_end, 16)  
4;
+   ptr_end++; /* skip : in  ethaddr */
+   }
+   memcpy(bp-dev-dev_addr, addr, sizeof(addr));
} else {
dev_info(bp-pdev-dev, invalid hw address, using random\n);
random_ether_addr(bp-dev-dev_addr);

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] at91: Add esd gmbh OTC570 board support

2010-01-18 Thread Daniel Gorsulowski
This patch adds support for esd gmbh OTC570 board.
The OTC570 is based on an Atmel AT91SAM9263 SoC.

Signed-off-by: Daniel Gorsulowski daniel.gorsulow...@esd.eu
---
 MAINTAINERS  |1 +
 MAKEALL  |1 +
 Makefile |3 +
 board/esd/otc570/Makefile|   55 ++
 board/esd/otc570/config.mk   |1 +
 board/esd/otc570/otc570.c|  429 ++
 board/esd/otc570/partition.c |   37 
 include/configs/otc570.h |  247 
 tools/Makefile   |3 +
 tools/logos/esd.bmp  |  Bin 0 - 35078 bytes
 10 files changed, 777 insertions(+), 0 deletions(-)
 create mode 100644 board/esd/otc570/Makefile
 create mode 100644 board/esd/otc570/config.mk
 create mode 100644 board/esd/otc570/otc570.c
 create mode 100644 board/esd/otc570/partition.c
 create mode 100644 include/configs/otc570.h
 create mode 100644 tools/logos/esd.bmp

diff --git a/MAINTAINERS b/MAINTAINERS
index e8ba4bc..0c2b1b1 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -574,6 +574,7 @@ Peter Figuli pep...@etc.sk
 Daniel Gorsulowski daniel.gorsulow...@esd.eu
 
meesc   ARM926EJS (AT91SAM9263 SoC)
+   otc570  ARM926EJS (AT91SAM9263 SoC)
 
 Sedji Gaouaousedji.gaou...@atmel.com
at91sam9g10ek   ARM926EJS (AT91SAM9G10 SoC)
diff --git a/MAKEALL b/MAKEALL
index dd635bd..eefd3dd 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -654,6 +654,7 @@ LIST_at91= \
meesc   \
mp2usb  \
m501sk  \
+   otc570  \
pm9261  \
pm9263  \
SBC35_A9G20 \
diff --git a/Makefile b/Makefile
index 1ab197b..5fda1b9 100644
--- a/Makefile
+++ b/Makefile
@@ -2862,6 +2862,9 @@ at91sam9g45ekes_config:   unconfig
fi;
@$(MKCONFIG) -a at91sam9m10g45ek arm arm926ejs at91sam9m10g45ek atmel 
at91
 
+otc570_config  :   unconfig
+   @$(MKCONFIG) $(@:_config=) arm arm926ejs otc570 esd at91
+
 pm9263_config  :   unconfig
@$(MKCONFIG) $(@:_config=) arm arm926ejs pm9263 ronetix at91
 
diff --git a/board/esd/otc570/Makefile b/board/esd/otc570/Makefile
new file mode 100644
index 000..755c5ee
--- /dev/null
+++ b/board/esd/otc570/Makefile
@@ -0,0 +1,55 @@
+#
+# (C) Copyright 2003-2008
+# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+#
+# (C) Copyright 2008
+# Stelian Pop stelian@leadtechdesign.com
+# Lead Tech Design www.leadtechdesign.com
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# 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 $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).a
+
+COBJS-y+= $(BOARD).o
+COBJS-$(CONFIG_HAS_DATAFLASH)  += partition.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS-y))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(obj).depend $(OBJS) $(SOBJS)
+   $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
+
+clean:
+   rm -f $(SOBJS) $(OBJS)
+
+distclean: clean
+   rm -f $(LIB) core *.bak $(obj).depend
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/esd/otc570/config.mk b/board/esd/otc570/config.mk
new file mode 100644
index 000..ff2cfd1
--- /dev/null
+++ b/board/esd/otc570/config.mk
@@ -0,0 +1 @@
+TEXT_BASE = 0x23f0
diff --git a/board/esd/otc570/otc570.c b/board/esd/otc570/otc570.c
new file mode 100644
index 000..fee27ca
--- /dev/null
+++ b/board/esd/otc570/otc570.c
@@ -0,0 +1,429 @@
+/*
+ * (C) Copyright 2007-2008
+ * Stelian Pop stelian@leadtechdesign.com
+ * Lead Tech Design www.leadtechdesign.com
+ *
+ * (C) Copyright 2010
+ * Daniel Gorsulowski daniel.gorsulow...@esd.eu
+ * esd electronic system design gmbh www.esd.eu
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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

[U-Boot] [PATCH resend] at91: Enable slow master clock on meesc board

2009-11-23 Thread Daniel Gorsulowski
In some cases, we need low speed master clock. So depending on the
mdiv variable, the processor clock is divided by 2 (default) or 4.

Signed-off-by: Daniel Gorsulowski daniel.gorsulow...@esd.eu
---
 board/esd/meesc/meesc.c |   24 
 include/configs/meesc.h |1 +
 2 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/board/esd/meesc/meesc.c b/board/esd/meesc/meesc.c
index efba60d..4f6c5b7 100644
--- a/board/esd/meesc/meesc.c
+++ b/board/esd/meesc/meesc.c
@@ -219,6 +219,30 @@ u32 get_board_rev(void)
 }
 #endif
 
+#ifdef CONFIG_MISC_INIT_R
+int misc_init_r(void)
+{
+   char *str;
+   char buf[32];
+
+   /*
+* In some cases, we need low speed master clock. So depending on the
+* mdiv variable, the processor clock is divided by 2 (default) or 4.
+*/
+   if ((str = getenv(mdiv))  (!strcmp(str, 4))) {
+   at91_sys_write(AT91_PMC_MCKR,
+   (at91_sys_read(AT91_PMC_MCKR)  ~AT91_PMC_MDIV) |
+   AT91SAM9_PMC_MDIV_4);
+   at91_clock_init(0);
+   serial_setbrg();
+   printf(Setting master clock to %s MHz\n,
+   strmhz(buf, get_mck_clk_rate()));
+   }
+
+   return 0;
+}
+#endif /* CONFIG_MISC_INIT_R */
+
 int board_init(void)
 {
/* Peripheral Clock Enable Register */
diff --git a/include/configs/meesc.h b/include/configs/meesc.h
index b996854..034e81c 100644
--- a/include/configs/meesc.h
+++ b/include/configs/meesc.h
@@ -48,6 +48,7 @@
 
 #define CONFIG_SKIP_LOWLEVEL_INIT
 #define CONFIG_SKIP_RELOCATE_UBOOT
+#define CONFIG_MISC_INIT_R /* Call misc_init_r */
 
 #define CONFIG_ARCH_CPU_INIT
 
-- 
1.5.3

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] at91: Enable slow master clock on meesc board

2009-11-03 Thread Daniel Gorsulowski
In some cases, we need low speed master clock. So depending on the
mdiv variable, the processor clock is divided by 2 (default) or 4.

Signed-off-by: Daniel Gorsulowski daniel.gorsulow...@esd.eu
---
PS: Tom, are you still temporary at91 custodian?

 board/esd/meesc/meesc.c |   24 
 include/configs/meesc.h |1 +
 2 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/board/esd/meesc/meesc.c b/board/esd/meesc/meesc.c
index efba60d..4f6c5b7 100644
--- a/board/esd/meesc/meesc.c
+++ b/board/esd/meesc/meesc.c
@@ -219,6 +219,30 @@ u32 get_board_rev(void)
 }
 #endif
 
+#ifdef CONFIG_MISC_INIT_R
+int misc_init_r(void)
+{
+   char *str;
+   char buf[32];
+
+   /*
+* In some cases, we need low speed master clock. So depending on the
+* mdiv variable, the processor clock is divided by 2 (default) or 4.
+*/
+   if ((str = getenv(mdiv))  (!strcmp(str, 4))) {
+   at91_sys_write(AT91_PMC_MCKR,
+   (at91_sys_read(AT91_PMC_MCKR)  ~AT91_PMC_MDIV) |
+   AT91SAM9_PMC_MDIV_4);
+   at91_clock_init(0);
+   serial_setbrg();
+   printf(Setting master clock to %s MHz\n,
+   strmhz(buf, get_mck_clk_rate()));
+   }
+
+   return 0;
+}
+#endif /* CONFIG_MISC_INIT_R */
+
 int board_init(void)
 {
/* Peripheral Clock Enable Register */
diff --git a/include/configs/meesc.h b/include/configs/meesc.h
index b996854..034e81c 100644
--- a/include/configs/meesc.h
+++ b/include/configs/meesc.h
@@ -48,6 +48,7 @@
 
 #define CONFIG_SKIP_LOWLEVEL_INIT
 #define CONFIG_SKIP_RELOCATE_UBOOT
+#define CONFIG_MISC_INIT_R /* Call misc_init_r */
 
 #define CONFIG_ARCH_CPU_INIT
 
-- 
1.5.3

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v5] at91: Update MEESC board support

2009-09-29 Thread Daniel Gorsulowski
This patch implements several updates:
-disable CONFIG_ENV_OVERWRITE
-add new hardware style variants and set the arch numbers appropriate
-pass the serial# and hardware revision to the kernel
-removed unused macros from include/configs/meesc.h
-fixed multiline comment style

Signed-off-by: Daniel Gorsulowski daniel.gorsulow...@esd.eu
---
v2: - don't write the ethernet address to the EMAC module anymore

v3: - removed function meesc_set_arch_number and moved code to checkboard()
- reworked function get_board_serial()
- removed unused macros from include/configs/meesc.h

v4: - fixed commit message (to many characters)
- fixed indentation in switch-case statement
- fixed multiline comment style

v5: - changed error message on invalid hw_type (FATAL to ERROR)

 board/esd/meesc/meesc.c |   65 +-
 include/configs/meesc.h |   25 ++
 2 files changed, 66 insertions(+), 24 deletions(-)

diff --git a/board/esd/meesc/meesc.c b/board/esd/meesc/meesc.c
index 636d0ed..efba60d 100644
--- a/board/esd/meesc/meesc.c
+++ b/board/esd/meesc/meesc.c
@@ -126,8 +126,10 @@ static void meesc_ethercat_hw_init(void)
AT91_SMC_NRDPULSE_(4) | AT91_SMC_NCS_RDPULSE_(9));
at91_sys_write(AT91_SMC1_CYCLE(0),
AT91_SMC_NWECYCLE_(10) | AT91_SMC_NRDCYCLE_(5));
-   /* Configure behavior at external wait signal, byte-select mode, 16 bit
-   data bus width, none data float wait states and TDF optimization */
+   /*
+* Configure behavior at external wait signal, byte-select mode, 16 bit
+* data bus width, none data float wait states and TDF optimization
+*/
at91_sys_write(AT91_SMC1_MODE(0),
AT91_SMC_READMODE | AT91_SMC_EXNWMODE_READY |
AT91_SMC_BAT_SELECT | AT91_SMC_DBW_16 | AT91_SMC_TDF_(0) |
@@ -156,8 +158,32 @@ int board_eth_init(bd_t *bis)
 int checkboard(void)
 {
char str[32];
-
-   puts(Board: esd CAN-EtherCAT Gateway);
+   u_char hw_type; /* hardware type */
+
+   /* read the Type register of the ET1100 controller */
+   hw_type = readb(CONFIG_ET1100_BASE);
+
+   switch (hw_type) {
+   case 0x11:
+   case 0x3F:
+   /* ET1100 present, arch number of MEESC-Board */
+   gd-bd-bi_arch_number = MACH_TYPE_MEESC;
+   puts(Board: CAN-EtherCAT Gateway);
+   break;
+   case 0xFF:
+   /* no ET1100 present, arch number of EtherCAN/2-Board */
+   gd-bd-bi_arch_number = MACH_TYPE_ETHERCAN2;
+   puts(Board: EtherCAN/2 Gateway);
+   /* switch on LED1D */
+   at91_set_gpio_output(AT91_PIN_PB12, 1);
+   break;
+   default:
+   /* assume, no ET1100 present, arch number of EtherCAN/2-Board */
+   gd-bd-bi_arch_number = MACH_TYPE_ETHERCAN2;
+   printf(ERROR! Read invalid hw_type: %02X\n, hw_type);
+   puts(Board: EtherCAN/2 Gateway);
+   break;
+   }
if (getenv_r(serial#, str, sizeof(str))  0) {
puts(, serial# );
puts(str);
@@ -167,6 +193,32 @@ int checkboard(void)
return 0;
 }
 
+#ifdef CONFIG_SERIAL_TAG
+void get_board_serial(struct tag_serialnr *serialnr)
+{
+   char *str;
+
+   char *serial = getenv(serial#);
+   if (serial) {
+   str = strchr(serial, '_');
+   if (str  (strlen(str) = 4)) {
+   serialnr-high = (*(str + 1)  8) | *(str + 2);
+   serialnr-low = simple_strtoul(str + 3, NULL, 16);
+   }
+   } else {
+   serialnr-high = 0;
+   serialnr-low = 0;
+   }
+}
+#endif
+
+#ifdef CONFIG_REVISION_TAG
+u32 get_board_rev(void)
+{
+   return hw_rev | 0x100;
+}
+#endif
+
 int board_init(void)
 {
/* Peripheral Clock Enable Register */
@@ -174,8 +226,8 @@ int board_init(void)
1  AT91SAM9263_ID_PIOB |
1  AT91SAM9263_ID_PIOCDE);
 
-   /* arch number of MEESC-Board */
-   gd-bd-bi_arch_number = MACH_TYPE_MEESC;
+   /* initialize ET1100 Controller */
+   meesc_ethercat_hw_init();
 
/* adress of boot parameters */
gd-bd-bi_boot_params = PHYS_SDRAM + 0x100;
@@ -184,7 +236,6 @@ int board_init(void)
 #ifdef CONFIG_CMD_NAND
meesc_nand_hw_init();
 #endif
-   meesc_ethercat_hw_init();
 #ifdef CONFIG_HAS_DATAFLASH
at91_spi0_hw_init(1  0);
 #endif
diff --git a/include/configs/meesc.h b/include/configs/meesc.h
index 8253172..b996854 100644
--- a/include/configs/meesc.h
+++ b/include/configs/meesc.h
@@ -36,13 +36,14 @@
 #define CONFIG_MEESC   1   /* Board is esd MEESC */
 #define CONFIG_ARM926EJS   1   /* This is an ARM926EJS Core */
 #define CONFIG_AT91SAM9263 1   /* It's an AT91SAM9263 SoC */
-#define

Re: [U-Boot] [PATCH v4] at91: Update MEESC board support

2009-09-29 Thread Daniel Gorsulowski
Hello Tom,

Tom wrote:
 Daniel Gorsulowski wrote:
 This patch implements several updates:
 -disable CONFIG_ENV_OVERWRITE
 -add new hardware style variants and set the arch numbers appropriate
 -pass the serial# and hardware revision to the kernel
 -removed unused macros from include/configs/meesc.h
 -fixed multiline comment style

 Signed-off-by: Daniel Gorsulowski daniel.gorsulow...@esd.eu
 ---
 v2: - don't write the ethernet address to the EMAC module anymore

 v3: - removed function meesc_set_arch_number and moved code to checkboard()
 - reworked function get_board_serial()
 - removed unused macros from include/configs/meesc.h

 v4: - fixed commit message (to many characters)
 - fixed indentation in switch-case statement
 - fixed multiline comment style

  board/esd/meesc/meesc.c |   65 
 +-
  include/configs/meesc.h |   25 ++
  2 files changed, 66 insertions(+), 24 deletions(-)

 diff --git a/board/esd/meesc/meesc.c b/board/esd/meesc/meesc.c
 index 636d0ed..7cdc04a 100644
 --- a/board/esd/meesc/meesc.c
 +++ b/board/esd/meesc/meesc.c
 @@ -126,8 +126,10 @@ static void meesc_ethercat_hw_init(void)
  AT91_SMC_NRDPULSE_(4) | AT91_SMC_NCS_RDPULSE_(9));
  at91_sys_write(AT91_SMC1_CYCLE(0),
  AT91_SMC_NWECYCLE_(10) | AT91_SMC_NRDCYCLE_(5));
 -/* Configure behavior at external wait signal, byte-select mode, 16 bit
 -data bus width, none data float wait states and TDF optimization */
 +/*
 + * Configure behavior at external wait signal, byte-select mode, 16 bit
 + * data bus width, none data float wait states and TDF optimization
 + */
  at91_sys_write(AT91_SMC1_MODE(0),
  AT91_SMC_READMODE | AT91_SMC_EXNWMODE_READY |
  AT91_SMC_BAT_SELECT | AT91_SMC_DBW_16 | AT91_SMC_TDF_(0) |
 @@ -156,8 +158,32 @@ int board_eth_init(bd_t *bis)
  int checkboard(void)
  {
  char str[32];
 -
 -puts(Board: esd CAN-EtherCAT Gateway);
 +u_char hw_type; /* hardware type */
 +
 +/* read the Type register of the ET1100 controller */
 +hw_type = readb(CONFIG_ET1100_BASE);
 +
 +switch (hw_type) {
 +case 0x11:
 +case 0x3F:
 +/* ET1100 present, arch number of MEESC-Board */
 +gd-bd-bi_arch_number = MACH_TYPE_MEESC;
 +puts(Board: CAN-EtherCAT Gateway);
 +break;
 +case 0xFF:
 +/* no ET1100 present, arch number of EtherCAN/2-Board */
 +gd-bd-bi_arch_number = MACH_TYPE_ETHERCAN2;
 +puts(Board: EtherCAN/2 Gateway);
 +/* switch on LED1D */
 +at91_set_gpio_output(AT91_PIN_PB12, 1);
 +break;
 +default:
 +/* assume, no ET1100 present, arch number of EtherCAN/2-Board */
 +gd-bd-bi_arch_number = MACH_TYPE_ETHERCAN2;
 +printf(FATAL! Read invalid hw_type: %02X\n, hw_type);
 +puts(Board: EtherCAN/2 Gateway);
 
 You may want to soften this FATAL to ERROR
 I would expect a FATAL to be followed by a call to hang()
 
Ok, I'll change this to ERROR
 +break;
 +}
  if (getenv_r(serial#, str, sizeof(str))  0) {
  puts(, serial# );
  puts(str);
 @@ -167,6 +193,32 @@ int checkboard(void)
  return 0;
  }
  
 +#ifdef CONFIG_SERIAL_TAG
 +void get_board_serial(struct tag_serialnr *serialnr)
 +{
 +char *str;
 +
 +char *serial = getenv(serial#);
 +if (serial) {
 +str = strchr(serial, '_');
 +if (str  (strlen(str) = 4)) {
 +serialnr-high = (*(str + 1)  8) | *(str + 2);
 +serialnr-low = simple_strtoul(str + 3, NULL, 16);
 
 How is serial# set?
 It seems like this is available if the user explicitly does a `setenv 
 serial`
 So at best this is a placeholder for future function.
 The logic that decodes the variable assumes a format that a user is
 not going, in general, to use.
The serial# is set by factory start-up operation, so the expected format is
guaranteed.
And because of disabled CONFIG_ENV_OVERWRITE, it can never be changed
again by the user. (Moreover, the user has no access to the serial console)
 
 
 Tom

Regards, Daniel
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v4] at91: Update MEESC board support

2009-09-28 Thread Daniel Gorsulowski
This patch implements several updates:
-disable CONFIG_ENV_OVERWRITE
-add new hardware style variants and set the arch numbers appropriate
-pass the serial# and hardware revision to the kernel
-removed unused macros from include/configs/meesc.h
-fixed multiline comment style

Signed-off-by: Daniel Gorsulowski daniel.gorsulow...@esd.eu
---
v2: - don't write the ethernet address to the EMAC module anymore

v3: - removed function meesc_set_arch_number and moved code to checkboard()
- reworked function get_board_serial()
- removed unused macros from include/configs/meesc.h

v4: - fixed commit message (to many characters)
- fixed indentation in switch-case statement
- fixed multiline comment style

 board/esd/meesc/meesc.c |   65 +-
 include/configs/meesc.h |   25 ++
 2 files changed, 66 insertions(+), 24 deletions(-)

diff --git a/board/esd/meesc/meesc.c b/board/esd/meesc/meesc.c
index 636d0ed..7cdc04a 100644
--- a/board/esd/meesc/meesc.c
+++ b/board/esd/meesc/meesc.c
@@ -126,8 +126,10 @@ static void meesc_ethercat_hw_init(void)
AT91_SMC_NRDPULSE_(4) | AT91_SMC_NCS_RDPULSE_(9));
at91_sys_write(AT91_SMC1_CYCLE(0),
AT91_SMC_NWECYCLE_(10) | AT91_SMC_NRDCYCLE_(5));
-   /* Configure behavior at external wait signal, byte-select mode, 16 bit
-   data bus width, none data float wait states and TDF optimization */
+   /*
+* Configure behavior at external wait signal, byte-select mode, 16 bit
+* data bus width, none data float wait states and TDF optimization
+*/
at91_sys_write(AT91_SMC1_MODE(0),
AT91_SMC_READMODE | AT91_SMC_EXNWMODE_READY |
AT91_SMC_BAT_SELECT | AT91_SMC_DBW_16 | AT91_SMC_TDF_(0) |
@@ -156,8 +158,32 @@ int board_eth_init(bd_t *bis)
 int checkboard(void)
 {
char str[32];
-
-   puts(Board: esd CAN-EtherCAT Gateway);
+   u_char hw_type; /* hardware type */
+
+   /* read the Type register of the ET1100 controller */
+   hw_type = readb(CONFIG_ET1100_BASE);
+
+   switch (hw_type) {
+   case 0x11:
+   case 0x3F:
+   /* ET1100 present, arch number of MEESC-Board */
+   gd-bd-bi_arch_number = MACH_TYPE_MEESC;
+   puts(Board: CAN-EtherCAT Gateway);
+   break;
+   case 0xFF:
+   /* no ET1100 present, arch number of EtherCAN/2-Board */
+   gd-bd-bi_arch_number = MACH_TYPE_ETHERCAN2;
+   puts(Board: EtherCAN/2 Gateway);
+   /* switch on LED1D */
+   at91_set_gpio_output(AT91_PIN_PB12, 1);
+   break;
+   default:
+   /* assume, no ET1100 present, arch number of EtherCAN/2-Board */
+   gd-bd-bi_arch_number = MACH_TYPE_ETHERCAN2;
+   printf(FATAL! Read invalid hw_type: %02X\n, hw_type);
+   puts(Board: EtherCAN/2 Gateway);
+   break;
+   }
if (getenv_r(serial#, str, sizeof(str))  0) {
puts(, serial# );
puts(str);
@@ -167,6 +193,32 @@ int checkboard(void)
return 0;
 }
 
+#ifdef CONFIG_SERIAL_TAG
+void get_board_serial(struct tag_serialnr *serialnr)
+{
+   char *str;
+
+   char *serial = getenv(serial#);
+   if (serial) {
+   str = strchr(serial, '_');
+   if (str  (strlen(str) = 4)) {
+   serialnr-high = (*(str + 1)  8) | *(str + 2);
+   serialnr-low = simple_strtoul(str + 3, NULL, 16);
+   }
+   } else {
+   serialnr-high = 0;
+   serialnr-low = 0;
+   }
+}
+#endif
+
+#ifdef CONFIG_REVISION_TAG
+u32 get_board_rev(void)
+{
+   return hw_rev | 0x100;
+}
+#endif
+
 int board_init(void)
 {
/* Peripheral Clock Enable Register */
@@ -174,8 +226,8 @@ int board_init(void)
1  AT91SAM9263_ID_PIOB |
1  AT91SAM9263_ID_PIOCDE);
 
-   /* arch number of MEESC-Board */
-   gd-bd-bi_arch_number = MACH_TYPE_MEESC;
+   /* initialize ET1100 Controller */
+   meesc_ethercat_hw_init();
 
/* adress of boot parameters */
gd-bd-bi_boot_params = PHYS_SDRAM + 0x100;
@@ -184,7 +236,6 @@ int board_init(void)
 #ifdef CONFIG_CMD_NAND
meesc_nand_hw_init();
 #endif
-   meesc_ethercat_hw_init();
 #ifdef CONFIG_HAS_DATAFLASH
at91_spi0_hw_init(1  0);
 #endif
diff --git a/include/configs/meesc.h b/include/configs/meesc.h
index 8253172..b996854 100644
--- a/include/configs/meesc.h
+++ b/include/configs/meesc.h
@@ -36,13 +36,14 @@
 #define CONFIG_MEESC   1   /* Board is esd MEESC */
 #define CONFIG_ARM926EJS   1   /* This is an ARM926EJS Core */
 #define CONFIG_AT91SAM9263 1   /* It's an AT91SAM9263 SoC */
-#define CONFIG_ENV_OVERWRITE   1   /* necessary on prototypes

[U-Boot] [PATCH v3 RESEND] at91: Update MEESC board support

2009-09-22 Thread Daniel Gorsulowski
This patch implements several updates:
-disable CONFIG_ENV_OVERWRITE
-add new hardware style variants and set the arch numbers appropriate (autodet.)
-pass the serial# and hardware revision to the kernel
-removed unused macros from include/configs/meesc.h

Signed-off-by: Daniel Gorsulowski daniel.gorsulow...@esd.eu
---
v2: - don't write the ethernet address to the EMAC module anymore

v3: - removed function meesc_set_arch_number and moved code to checkboard()
- reworked function get_board_serial()
- removed unused macros from include/configs/meesc.h

 board/esd/meesc/meesc.c |   62 +++
 include/configs/meesc.h |   25 ++-
 2 files changed, 65 insertions(+), 22 deletions(-)

diff --git a/board/esd/meesc/meesc.c b/board/esd/meesc/meesc.c
index 636d0ed..045fbe2 100644
--- a/board/esd/meesc/meesc.c
+++ b/board/esd/meesc/meesc.c
@@ -156,8 +156,35 @@ int board_eth_init(bd_t *bis)
 int checkboard(void)
 {
char str[32];
-
-   puts(Board: esd CAN-EtherCAT Gateway);
+   u_char hw_type; /* hardware type */
+
+   /* read the Type register of the ET1100 controller */
+   hw_type = readb(CONFIG_ET1100_BASE);
+
+   switch (hw_type) {
+   case 0x11:
+   case 0x3F:
+   /* ET1100 present,
+  arch number of MEESC-Board */
+   gd-bd-bi_arch_number = MACH_TYPE_MEESC;
+   puts(Board: CAN-EtherCAT Gateway);
+   break;
+   case 0xFF:
+   /* no ET1100 present,
+  arch number of EtherCAN/2-Board */
+   gd-bd-bi_arch_number = MACH_TYPE_ETHERCAN2;
+   puts(Board: EtherCAN/2 Gateway);
+   /* switch on LED1D */
+   at91_set_gpio_output(AT91_PIN_PB12, 1);
+   break;
+   default:
+   /* assume, no ET1100 present,
+  arch number of EtherCAN/2-Board */
+   gd-bd-bi_arch_number = MACH_TYPE_ETHERCAN2;
+   printf(FATAL! Read invalid hw_type: %02X\n, hw_type);
+   puts(Board: EtherCAN/2 Gateway);
+   break;
+   }
if (getenv_r(serial#, str, sizeof(str))  0) {
puts(, serial# );
puts(str);
@@ -167,6 +194,32 @@ int checkboard(void)
return 0;
 }
 
+#ifdef CONFIG_SERIAL_TAG
+void get_board_serial(struct tag_serialnr *serialnr)
+{
+   char *str;
+
+   char *serial = getenv(serial#);
+   if (serial) {
+   str = strchr(serial, '_');
+   if (str  (strlen(str) = 4)) {
+   serialnr-high = (*(str + 1)  8) | *(str + 2);
+   serialnr-low = simple_strtoul(str + 3, NULL, 16);
+   }
+   } else {
+   serialnr-high = 0;
+   serialnr-low = 0;
+   }
+}
+#endif
+
+#ifdef CONFIG_REVISION_TAG
+u32 get_board_rev(void)
+{
+   return hw_rev | 0x100;
+}
+#endif
+
 int board_init(void)
 {
/* Peripheral Clock Enable Register */
@@ -174,8 +227,8 @@ int board_init(void)
1  AT91SAM9263_ID_PIOB |
1  AT91SAM9263_ID_PIOCDE);
 
-   /* arch number of MEESC-Board */
-   gd-bd-bi_arch_number = MACH_TYPE_MEESC;
+   /* initialize ET1100 Controller */
+   meesc_ethercat_hw_init();
 
/* adress of boot parameters */
gd-bd-bi_boot_params = PHYS_SDRAM + 0x100;
@@ -184,7 +237,6 @@ int board_init(void)
 #ifdef CONFIG_CMD_NAND
meesc_nand_hw_init();
 #endif
-   meesc_ethercat_hw_init();
 #ifdef CONFIG_HAS_DATAFLASH
at91_spi0_hw_init(1  0);
 #endif
diff --git a/include/configs/meesc.h b/include/configs/meesc.h
index 8253172..b996854 100644
--- a/include/configs/meesc.h
+++ b/include/configs/meesc.h
@@ -36,13 +36,14 @@
 #define CONFIG_MEESC   1   /* Board is esd MEESC */
 #define CONFIG_ARM926EJS   1   /* This is an ARM926EJS Core */
 #define CONFIG_AT91SAM9263 1   /* It's an AT91SAM9263 SoC */
-#define CONFIG_ENV_OVERWRITE   1   /* necessary on prototypes */
 #define CONFIG_DISPLAY_BOARDINFO   1
 #define CONFIG_DISPLAY_CPUINFO 1   /* display cpu info and speed */
 #define CONFIG_PREBOOT /* enable preboot variable */
 #define CONFIG_CMDLINE_TAG 1   /* enable passing of ATAGs */
 #define CONFIG_SETUP_MEMORY_TAGS   1
 #define CONFIG_INITRD_TAG  1
+#define CONFIG_SERIAL_TAG  1
+#define CONFIG_REVISION_TAG1
 #undef CONFIG_USE_IRQ  /* don't need IRQ/FIQ stuff */
 
 #define CONFIG_SKIP_LOWLEVEL_INIT
@@ -138,12 +139,13 @@
 #define CONFIG_SYS_USE_DATAFLASH   1
 #undef CONFIG_SYS_USE_NANDFLASH

Re: [U-Boot] [PATCH v3] at91: Update MEESC board support

2009-09-21 Thread Daniel Gorsulowski
Dear Wolfgang Denk and Jean-Christophe PLAGNIOL-VILLARD,

Daniel Gorsulowski wrote:
 This patch implements several updates:
 -disable CONFIG_ENV_OVERWRITE
 -add new hardware style variants and set the arch numbers appropriate 
 (autodet.)
 -pass the serial# and hardware revision to the kernel
 -removed unused macros from include/configs/meesc.h
 
 Signed-off-by: Daniel Gorsulowski daniel.gorsulow...@esd.eu
 ---
 v2: - don't write the ethernet address to the EMAC module anymore
 
 v3: - removed function meesc_set_arch_number and moved code to checkboard()
 - reworked function get_board_serial()
 - removed unused macros from include/configs/meesc.h
 
  board/esd/meesc/meesc.c |   62 
 +++
  include/configs/meesc.h |   25 ++-
  2 files changed, 65 insertions(+), 22 deletions(-)
 
snip

what about this patch? No more comments, no NACK, no applied to...?

Best regards,
Daniel Gorsulowski
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/1] at91: Update MEESC board support

2009-09-11 Thread Daniel Gorsulowski
Dear Wolfgang Denk,

Wolfgang Denk wrote:
 Dear Daniel Gorsulowski,
 
 In message 4aa90821.1060...@esd.eu you wrote:
 -  /* arch number of MEESC-Board */
 -  gd-bd-bi_arch_number = MACH_TYPE_MEESC;
 +  /* initialize ET1100 Controller */
 +  meesc_ethercat_hw_init();
 I thought we had agreed not to initialize the Ethernet hardware if it
 not used by U-Boot?

 We had, but this does not initialize unused hardware. This is needed for
 detecting hw_type and setting correct arch_number.
 
 meesc_ethercat_hw_init() is needed for ... setting correct
 arch_number ??
 
 Best regards,
 
 Wolfgang Denk
 
Please take a look at function checkboard().
There is a call hw_type = readb(CONFIG_ET1100_BASE); to read the ET1100
type register. The read value is used to determine the correct arch_number.
  valid value (ET1100 present)  -- arch_number = MACH_TYPE_MEESC
  invalid value (no ET1100 present) -- arch_number = MACH_TYPE_ETHERCAN2

For accessing the ET1100 type register, it is mandatory to initialize the
memory controller. Thus, meesc_ethercat_hw_init() is needed and does not
initialize unused hardware!


Btw. the function meesc_ethercat_hw_init() is not new in this patch. I
entirely moved the function call.


Best regards,
Daniel Gorsulowski
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/1] at91: Update MEESC board support

2009-09-10 Thread Daniel Gorsulowski
Dear Wolfgang Denk,

Wolfgang Denk wrote:
 Dear Daniel Gorsulowski,
 
 In message 12524805241911-git-send-email-daniel.gorsulow...@esd.eu you 
 wrote:
 This patch implements several updates:
 -Disable CONFIG_ENV_OVERWRITE
 -Add new hardware style variants and set the arch numbers appropriate 
 (autodetect)
 -Pass the serial# and hardware revision to the kernel

 Signed-off-by: Daniel Gorsulowski daniel.gorsulow...@esd.eu
 ---
 
 You should indicate that this is version 2 of an earlier patch, and
 describe what has been changed compared to earlier versions.
 
 And as it's a single patch, it makes no sense to number it, i. e.
 please omit the 1/1 part.
 
I'll do so.

 +static void meesc_set_arch_number(void)
 +{
 +/* read the Type register of the ET1100 controller */
 +hw_type = readb(CONFIG_ET1100_BASE);
 +
 +switch (hw_type) {
 +case 0x11:
 +case 0x3F:
 +/* ET1100 present,
 +   arch number of MEESC-Board */
 +gd-bd-bi_arch_number = MACH_TYPE_MEESC;
 +break;
 +case 0xFF:
 +/* no ET1100 present,
 +   arch number of EtherCAN/2-Board */
 +gd-bd-bi_arch_number = MACH_TYPE_ETHERCAN2;
 +break;
 +default:
 +/* assume, no ET1100 present,
 +   arch number of EtherCAN/2-Board */
 +gd-bd-bi_arch_number = MACH_TYPE_ETHERCAN2;
 +break;
 +}
 
 You have the same switch() in checkboard() - maybe you move this code
 there, so you can avoid the whole function?

Good idea...

 +#ifdef CONFIG_SERIAL_TAG
 +void get_board_serial(struct tag_serialnr *serialnr)
 +{
 +char *str;
 +
 +str = strchr(getenv(serial#), '_');
 +if (str) {
 +serialnr-high =(*(str + 1)  8) | *(str + 2);
 +serialnr-low = simple_strtoul(str + 3, NULL, 16);
 
 Hm... that looks dangerous to me. Who tells you that the value of the
 serial# envrionment variable has that many characters?
 
You are right, I'll rework it.

  int board_init(void)
  {
  /* Peripheral Clock Enable Register */
 @@ -174,8 +234,15 @@ int board_init(void)
  1  AT91SAM9263_ID_PIOB |
  1  AT91SAM9263_ID_PIOCDE);
  
 -/* arch number of MEESC-Board */
 -gd-bd-bi_arch_number = MACH_TYPE_MEESC;
 +/* initialize ET1100 Controller */
 +meesc_ethercat_hw_init();
 
 I thought we had agreed not to initialize the Ethernet hardware if it
 not used by U-Boot?
 
We had, but this does not initialize unused hardware. This is needed for
detecting hw_type and setting correct arch_number.
 
 Best regards,
 
 Wolfgang Denk
 
Kind regards,
Daniel Gorsulowski
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v3] at91: Update MEESC board support

2009-09-10 Thread Daniel Gorsulowski
This patch implements several updates:
-disable CONFIG_ENV_OVERWRITE
-add new hardware style variants and set the arch numbers appropriate (autodet.)
-pass the serial# and hardware revision to the kernel
-removed unused macros from include/configs/meesc.h

Signed-off-by: Daniel Gorsulowski daniel.gorsulow...@esd.eu
---
v2: - don't write the ethernet address to the EMAC module anymore

v3: - removed function meesc_set_arch_number and moved code to checkboard()
- reworked function get_board_serial()
- removed unused macros from include/configs/meesc.h

 board/esd/meesc/meesc.c |   62 +++
 include/configs/meesc.h |   25 ++-
 2 files changed, 65 insertions(+), 22 deletions(-)

diff --git a/board/esd/meesc/meesc.c b/board/esd/meesc/meesc.c
index 636d0ed..045fbe2 100644
--- a/board/esd/meesc/meesc.c
+++ b/board/esd/meesc/meesc.c
@@ -156,8 +156,35 @@ int board_eth_init(bd_t *bis)
 int checkboard(void)
 {
char str[32];
-
-   puts(Board: esd CAN-EtherCAT Gateway);
+   u_char hw_type; /* hardware type */
+
+   /* read the Type register of the ET1100 controller */
+   hw_type = readb(CONFIG_ET1100_BASE);
+
+   switch (hw_type) {
+   case 0x11:
+   case 0x3F:
+   /* ET1100 present,
+  arch number of MEESC-Board */
+   gd-bd-bi_arch_number = MACH_TYPE_MEESC;
+   puts(Board: CAN-EtherCAT Gateway);
+   break;
+   case 0xFF:
+   /* no ET1100 present,
+  arch number of EtherCAN/2-Board */
+   gd-bd-bi_arch_number = MACH_TYPE_ETHERCAN2;
+   puts(Board: EtherCAN/2 Gateway);
+   /* switch on LED1D */
+   at91_set_gpio_output(AT91_PIN_PB12, 1);
+   break;
+   default:
+   /* assume, no ET1100 present,
+  arch number of EtherCAN/2-Board */
+   gd-bd-bi_arch_number = MACH_TYPE_ETHERCAN2;
+   printf(FATAL! Read invalid hw_type: %02X\n, hw_type);
+   puts(Board: EtherCAN/2 Gateway);
+   break;
+   }
if (getenv_r(serial#, str, sizeof(str))  0) {
puts(, serial# );
puts(str);
@@ -167,6 +194,32 @@ int checkboard(void)
return 0;
 }
 
+#ifdef CONFIG_SERIAL_TAG
+void get_board_serial(struct tag_serialnr *serialnr)
+{
+   char *str;
+
+   char *serial = getenv(serial#);
+   if (serial) {
+   str = strchr(serial, '_');
+   if (str  (strlen(str) = 4)) {
+   serialnr-high = (*(str + 1)  8) | *(str + 2);
+   serialnr-low = simple_strtoul(str + 3, NULL, 16);
+   }
+   } else {
+   serialnr-high = 0;
+   serialnr-low = 0;
+   }
+}
+#endif
+
+#ifdef CONFIG_REVISION_TAG
+u32 get_board_rev(void)
+{
+   return hw_rev | 0x100;
+}
+#endif
+
 int board_init(void)
 {
/* Peripheral Clock Enable Register */
@@ -174,8 +227,8 @@ int board_init(void)
1  AT91SAM9263_ID_PIOB |
1  AT91SAM9263_ID_PIOCDE);
 
-   /* arch number of MEESC-Board */
-   gd-bd-bi_arch_number = MACH_TYPE_MEESC;
+   /* initialize ET1100 Controller */
+   meesc_ethercat_hw_init();
 
/* adress of boot parameters */
gd-bd-bi_boot_params = PHYS_SDRAM + 0x100;
@@ -184,7 +237,6 @@ int board_init(void)
 #ifdef CONFIG_CMD_NAND
meesc_nand_hw_init();
 #endif
-   meesc_ethercat_hw_init();
 #ifdef CONFIG_HAS_DATAFLASH
at91_spi0_hw_init(1  0);
 #endif
diff --git a/include/configs/meesc.h b/include/configs/meesc.h
index 8253172..b996854 100644
--- a/include/configs/meesc.h
+++ b/include/configs/meesc.h
@@ -36,13 +36,14 @@
 #define CONFIG_MEESC   1   /* Board is esd MEESC */
 #define CONFIG_ARM926EJS   1   /* This is an ARM926EJS Core */
 #define CONFIG_AT91SAM9263 1   /* It's an AT91SAM9263 SoC */
-#define CONFIG_ENV_OVERWRITE   1   /* necessary on prototypes */
 #define CONFIG_DISPLAY_BOARDINFO   1
 #define CONFIG_DISPLAY_CPUINFO 1   /* display cpu info and speed */
 #define CONFIG_PREBOOT /* enable preboot variable */
 #define CONFIG_CMDLINE_TAG 1   /* enable passing of ATAGs */
 #define CONFIG_SETUP_MEMORY_TAGS   1
 #define CONFIG_INITRD_TAG  1
+#define CONFIG_SERIAL_TAG  1
+#define CONFIG_REVISION_TAG1
 #undef CONFIG_USE_IRQ  /* don't need IRQ/FIQ stuff */
 
 #define CONFIG_SKIP_LOWLEVEL_INIT
@@ -138,12 +139,13 @@
 #define CONFIG_SYS_USE_DATAFLASH   1
 #undef CONFIG_SYS_USE_NANDFLASH

[U-Boot] [PATCH 1/1] at91: Update MEESC board support

2009-09-09 Thread Daniel Gorsulowski
This patch implements several updates:
-Disable CONFIG_ENV_OVERWRITE
-Add new hardware style variants and set the arch numbers appropriate 
(autodetect)
-Pass the serial# and hardware revision to the kernel

Signed-off-by: Daniel Gorsulowski daniel.gorsulow...@esd.eu
---
 board/esd/meesc/meesc.c |   74 --
 include/configs/meesc.h |6 +++-
 2 files changed, 75 insertions(+), 5 deletions(-)

diff --git a/board/esd/meesc/meesc.c b/board/esd/meesc/meesc.c
index 636d0ed..ecf903d 100644
--- a/board/esd/meesc/meesc.c
+++ b/board/esd/meesc/meesc.c
@@ -46,6 +46,7 @@ DECLARE_GLOBAL_DATA_PTR;
  */
 
 static int hw_rev = -1;/* hardware revision */
+static u_char hw_type; /* hardware type */
 
 int get_hw_rev(void)
 {
@@ -63,6 +64,30 @@ int get_hw_rev(void)
return hw_rev;
 }
 
+static void meesc_set_arch_number(void)
+{
+   /* read the Type register of the ET1100 controller */
+   hw_type = readb(CONFIG_ET1100_BASE);
+
+   switch (hw_type) {
+   case 0x11:
+   case 0x3F:
+   /* ET1100 present,
+  arch number of MEESC-Board */
+   gd-bd-bi_arch_number = MACH_TYPE_MEESC;
+   break;
+   case 0xFF:
+   /* no ET1100 present,
+  arch number of EtherCAN/2-Board */
+   gd-bd-bi_arch_number = MACH_TYPE_ETHERCAN2;
+   break;
+   default:
+   /* assume, no ET1100 present,
+  arch number of EtherCAN/2-Board */
+   gd-bd-bi_arch_number = MACH_TYPE_ETHERCAN2;
+   break;
+   }
+}
 #ifdef CONFIG_CMD_NAND
 static void meesc_nand_hw_init(void)
 {
@@ -157,7 +182,19 @@ int checkboard(void)
 {
char str[32];
 
-   puts(Board: esd CAN-EtherCAT Gateway);
+   switch (hw_type) {
+   case 0x11:
+   case 0x3F:
+   puts(Board: CAN-EtherCAT Gateway);
+   break;
+   case 0xFF:
+   puts(Board: EtherCAN/2 Gateway);
+   break;
+   default:
+   printf(FATAL! Read invalid hw_type: %02X\n, hw_type);
+   puts(Board: EtherCAN/2 Gateway);
+   break;
+   }
if (getenv_r(serial#, str, sizeof(str))  0) {
puts(, serial# );
puts(str);
@@ -167,6 +204,29 @@ int checkboard(void)
return 0;
 }
 
+#ifdef CONFIG_SERIAL_TAG
+void get_board_serial(struct tag_serialnr *serialnr)
+{
+   char *str;
+
+   str = strchr(getenv(serial#), '_');
+   if (str) {
+   serialnr-high =(*(str + 1)  8) | *(str + 2);
+   serialnr-low = simple_strtoul(str + 3, NULL, 16);
+   } else {
+   serialnr-high =0;
+   serialnr-low = 0;
+   }
+}
+#endif
+
+#ifdef CONFIG_REVISION_TAG
+u32 get_board_rev(void)
+{
+   return hw_rev | 0x100;
+}
+#endif
+
 int board_init(void)
 {
/* Peripheral Clock Enable Register */
@@ -174,8 +234,15 @@ int board_init(void)
1  AT91SAM9263_ID_PIOB |
1  AT91SAM9263_ID_PIOCDE);
 
-   /* arch number of MEESC-Board */
-   gd-bd-bi_arch_number = MACH_TYPE_MEESC;
+   /* initialize ET1100 Controller */
+   meesc_ethercat_hw_init();
+
+   /* set arch number by hardware type */
+   meesc_set_arch_number();
+
+   /* switch on LED1D, if running on EtherCAN/2 hardware */
+   if (hw_type == 0xFF)
+   at91_set_gpio_output(AT91_PIN_PB12, 1);
 
/* adress of boot parameters */
gd-bd-bi_boot_params = PHYS_SDRAM + 0x100;
@@ -184,7 +251,6 @@ int board_init(void)
 #ifdef CONFIG_CMD_NAND
meesc_nand_hw_init();
 #endif
-   meesc_ethercat_hw_init();
 #ifdef CONFIG_HAS_DATAFLASH
at91_spi0_hw_init(1  0);
 #endif
diff --git a/include/configs/meesc.h b/include/configs/meesc.h
index 8253172..b81e24a 100644
--- a/include/configs/meesc.h
+++ b/include/configs/meesc.h
@@ -36,13 +36,14 @@
 #define CONFIG_MEESC   1   /* Board is esd MEESC */
 #define CONFIG_ARM926EJS   1   /* This is an ARM926EJS Core */
 #define CONFIG_AT91SAM9263 1   /* It's an AT91SAM9263 SoC */
-#define CONFIG_ENV_OVERWRITE   1   /* necessary on prototypes */
 #define CONFIG_DISPLAY_BOARDINFO   1
 #define CONFIG_DISPLAY_CPUINFO 1   /* display cpu info and speed */
 #define CONFIG_PREBOOT /* enable preboot variable */
 #define CONFIG_CMDLINE_TAG 1   /* enable passing of ATAGs */
 #define CONFIG_SETUP_MEMORY_TAGS   1
 #define CONFIG_INITRD_TAG  1
+#define CONFIG_SERIAL_TAG  1
+#define

Re: [U-Boot] [PATCH 1/1] at91: Update MEESC board support

2009-09-09 Thread Daniel Gorsulowski
Hello,

Daniel Gorsulowski wrote:
 Hello Wolfgang, Jean-Christophe,
 
 Wolfgang Denk wrote:
 Dear Daniel,

 In message 20090904211358.gr30...@game.jcrosoft.org Jean-Christophe wrote:
 +#ifdef CONFIG_REVISION_TAG
 +u32 get_board_rev(void)
 +{
 +  return hw_rev | 0x100;
 +}
 +#endif
 +
 +int misc_init_r(void)
 +{
 +#ifdef CONFIG_MACB
 +  u32 hwaddr_btm;
 +  u16 hwaddr_top;
 +  u8 mac[6];
 +
 +  /* Set ethernet address */
 +  if (!eth_getenv_enetaddr(ethaddr, mac)) {
 +  puts(Missing environment variable 'ethaddr'\n);
 +} else {
 +  hwaddr_btm = mac[0] | mac[1]  8 | mac[2]  16 | mac[3]  24;
 +  hwaddr_top = mac[4] | mac[5]  8;
 +  writel(hwaddr_btm, (void *)(AT91SAM9263_BASE_EMAC + MACB_SA1B));
 +  writel(hwaddr_top, (void *)(AT91SAM9263_BASE_EMAC + MACB_SA1T));
 nack this will be done when u-boot will need to use the macb#
 Just imagine: U-boot boots a Linux kernel from NAND flash. It does NOT need 
 the
 ethernet interface, so it does NOT initialize ethernet, so the ethernet 
 address
 will NOT be written to the EMAC module!
 As a result, Linux will assign a random address, that is not acceptable!
 Jean-Christophe means: The Etherent interface must not be always
 initialized, but only when it is needed and used within U-Boot itself,
 i. e. if U-boot is performing anetwork command. See also item 2 at
 http://www.denx.de/wiki/U-Boot/DesignPrinciples  and
 http://www.denx.de/wiki/view/DULG/EthernetDoesNotWorkInLinux

 Best regards,

 Wolfgang Denk

 I know about it.
 
 But this patch does NOT initialize the Ethernet Interface. It JUST write
 the ethernet address to the EMAC module!
 
 So please ACK this patch.
 
 
 Regards,
 Daniel Gorsulowski

it was worth an attempt...
I made a new patch without the MACB stuff, see separate mail.

Now I parse the ethaddr through the kernel commandline. The kernel patch is
temporary available at http://paste.debian.net/46114/ (maybe someone is
interested in it)

Regards,
Daniel Gorsulowski
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] ARM mach-types.h sync request

2009-09-07 Thread Daniel Gorsulowski
Wolfgang Denk schrieb:
 Dear Daniel Gorsulowski,
 
 In message 4aa0f7b2.2010...@esd.eu you wrote:
 Hi,

 according to http://lists.denx.de/pipermail/u-boot/2008-September/040553.html
 I request an update.

 It is needed for MACH_TYPE_ETHERCAN2 (based on MEESC board, patch will come
 soon.)

 The last kernel source was synced on 2009-06-20, and is also outdated. So
 please sync against http://www.arm.linux.org.uk/developer/machines/
 
 Done. Hope this helps.
 
 Best regards,
 
 Wolfgang Denk

Thank you!

Best regards,
Daniel Gorsulowski
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/1] at91: Update MEESC board support

2009-09-07 Thread Daniel Gorsulowski
Hello Wolfgang, Jean-Christophe,

Wolfgang Denk wrote:
 Dear Daniel,
 
 In message 20090904211358.gr30...@game.jcrosoft.org Jean-Christophe wrote:
 +#ifdef CONFIG_REVISION_TAG
 +u32 get_board_rev(void)
 +{
 +   return hw_rev | 0x100;
 +}
 +#endif
 +
 +int misc_init_r(void)
 +{
 +#ifdef CONFIG_MACB
 +   u32 hwaddr_btm;
 +   u16 hwaddr_top;
 +   u8 mac[6];
 +
 +   /* Set ethernet address */
 +   if (!eth_getenv_enetaddr(ethaddr, mac)) {
 +   puts(Missing environment variable 'ethaddr'\n);
 +} else {
 +   hwaddr_btm = mac[0] | mac[1]  8 | mac[2]  16 | mac[3]  24;
 +   hwaddr_top = mac[4] | mac[5]  8;
 +   writel(hwaddr_btm, (void *)(AT91SAM9263_BASE_EMAC + MACB_SA1B));
 +   writel(hwaddr_top, (void *)(AT91SAM9263_BASE_EMAC + MACB_SA1T));
 nack this will be done when u-boot will need to use the macb#
Just imagine: U-boot boots a Linux kernel from NAND flash. It does NOT need the
ethernet interface, so it does NOT initialize ethernet, so the ethernet address
will NOT be written to the EMAC module!
As a result, Linux will assign a random address, that is not acceptable!
 
 Jean-Christophe means: The Etherent interface must not be always
 initialized, but only when it is needed and used within U-Boot itself,
 i. e. if U-boot is performing anetwork command. See also item 2 at
 http://www.denx.de/wiki/U-Boot/DesignPrinciples  and
 http://www.denx.de/wiki/view/DULG/EthernetDoesNotWorkInLinux
 
 Best regards,
 
 Wolfgang Denk
 
I know about it.

But this patch does NOT initialize the Ethernet Interface. It JUST write
the ethernet address to the EMAC module!

So please ACK this patch.


Regards,
Daniel Gorsulowski
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] How to burn new U-Boot over network

2009-09-07 Thread Daniel Gorsulowski
alex889 wrote:
 Hi,
 I'm working on the DM365evm,
 and i was wondering if there is a way to burn new U-Boot version over
 network, instead of Code Composer and a JTAG?

 Thanks,
 Alex

Hi Alex,

of course it's possible!
But it depends on the location of your U-Boot.

I.e. your U-Boot is located in dataflash or NAND flash:

tftp $(loadaddress) $(img)
protect off $(start) $(end)
erase $(start) $(end)
cp.b $(loadaddress) $(start) $(filesize)

$(loadaddress) - the temporary RAM address for downloading new U-Boot
$(img) - the path to your new U-Boot image (i.e. 
/tftpboot/update/u-boot.img)
$(start)   - the flash address, where U-Boot is located
$(end) - $(start) + maximum size of U-Boot (erasesize)
$(filesize)- set automatically after tftp transfer

Regards
Daniel

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] ARM mach-types.h sync request

2009-09-04 Thread Daniel Gorsulowski
Hi,

according to http://lists.denx.de/pipermail/u-boot/2008-September/040553.html
I request an update.

It is needed for MACH_TYPE_ETHERCAN2 (based on MEESC board, patch will come
soon.)

The last kernel source was synced on 2009-06-20, and is also outdated. So
please sync against http://www.arm.linux.org.uk/developer/machines/

Best regards
Daniel Gorsulowski
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 0/2] arm nomadik: gpio and i2c

2009-07-28 Thread Daniel Gorsulowski
Hello Heiko,

Heiko Schocher wrote:
 Hello Alessandro,
 
 Alessandro Rubini wrote:
 This adds gpio and i2c support for the Nomadik evaluation kit. They
 are needed to turn on the LCD backlight in order to later add LCD
 support.

 I have one doubt and some questions on gpio:

 To use soft_i2c I need to define some macros in the config file.
 Instead of writing hard numbers there I called the gpio functions, but
 the config file is inluded from asm sources as well.  I don't think my
 approach is beautiful at all (both #ifndef __ASSEMBLY__ and #include
 ../board/), but I didn't find a better solution.
 
 Yes, thats a problem ... if we had a GPIO Framework it would be solved
 by including gpio.h ...
 
 Or, maybe, we can make a soft_i2c.h which which gets only included
 if saying CONFIG_I2C_SOFT_INCLUDE is defined. soft_i2c.h defines for
 example:
 
 #define I2C_SDA(x)i2c_soft_sda(bit)
 
 void i2c_soft_sda(int pin);
 
 and you can define this function i2c_soft_sda(int pin) in your board
 specific code ... maybe a cleaner option?
 
 to speak in c, I tried the following patch on the suen3 plattform,
 where I have actually a similiar problem, and this worked fine :-)
 
 [PATCH] i2c, soft: added soft_i2c.h
 
 In case you must define functions for the I2C_XXX
 defines, it is necessary to have a soft_i2c.h, which
 defines functions for this macros. This functions can
 then be programmed in board specific code. To activate
 this it must be CONFIG_I2C_SOFT_INCLUDE defined in the
 board config file.
 
 Signed-off-by: Heiko Schocher h...@denx.de
 ---
  drivers/i2c/soft_i2c.c |3 +++
  include/soft_i2c.h |   16 
  2 files changed, 19 insertions(+), 0 deletions(-)
  create mode 100644 include/soft_i2c.h
 
 diff --git a/drivers/i2c/soft_i2c.c b/drivers/i2c/soft_i2c.c
 index 59883a5..30e24f3 100644
 --- a/drivers/i2c/soft_i2c.c
 +++ b/drivers/i2c/soft_i2c.c
 @@ -43,6 +43,9 @@
  #if defined(CONFIG_MPC852T) || defined(CONFIG_MPC866)
  #include asm/io.h
  #endif
 +#if defined(CONFIG_SOFT_I2C_INCLUDE)
 +#include soft_i2c.h
 +#endif
  #include i2c.h
 
  /* #define   DEBUG_I2C   */
 diff --git a/include/soft_i2c.h b/include/soft_i2c.h
 new file mode 100644
 index 000..39f9a35
 --- /dev/null
 +++ b/include/soft_i2c.h
 @@ -0,0 +1,16 @@
 +#ifndef _CONFIG_SOFT_I2C
 +#define _CONFIG_SOFT_I2C
 +#define I2C_ACTIVE   i2c_soft_active();
 +#define I2C_TRISTATE i2c_soft_tristate();
 +#define I2C_READ i2c_soft_read();
 +#define I2C_SDA(bit) i2c_soft_sda(bit);
 +#define I2C_SCL(bit) i2c_soft_scl(bit);
 +#define  I2C_DELAY   i2c_soft_delay();
 +
 +void i2c_soft_active(void);
 +void i2c_soft_tristate(void);
 +int  i2c_soft_read(void);
 +void i2c_soft_sda(int value);
 +void i2c_soft_scl(int value);
 +void i2c_soft_delay(void);
 +#endif
 -- 1.6.0.GIT Maybe you can try it too?
  I would like to add a gpio command, and I've found no generic gpio
  stuff.  Only one board (cm-bf527) has a gpio commands, but quite a few
  have similar commands to set leds or other bits.  Is time ripe for a
  generic gpio driver with board-specific limits and operations? Would
  that be interesting for u-boot-next?  Should I process with a board-specific
  gpio command by now?

 I vote for making a gpio framework, but that will take a while I think ...
 Hmm.. maybe we use my proposal for such a soft_i2c.h, so I think, it is
 okay for such a board specific gpio (unless we have a gpio framework).

 bye
 Heiko

I tried your patch on AT91SAM9263EK based OTC-570 board (patch will come to ML
within next merge window). It worked fine on it.
But some boards (the OTC-570 too) need a i2c_soft_init() function. So I extended
your patch as follows:

[PATCH] i2c, soft: added soft_i2c.h

In case you must define functions for the I2C_XXX
defines, it is necessary to have a soft_i2c.h, which
defines functions for this macros. This functions can
then be programmed in board specific code. To activate
this it must be CONFIG_I2C_SOFT_INCLUDE defined in the
board config file.

Signed-off-by: Heiko Schocher h...@denx.de
---
 drivers/i2c/soft_i2c.c |3 +++
 include/soft_i2c.h |   20 
 2 files changed, 23 insertions(+), 0 deletions(-)
 create mode 100644 include/soft_i2c.h

diff --git a/drivers/i2c/soft_i2c.c b/drivers/i2c/soft_i2c.c
index 59883a5..30e24f3 100644
--- a/drivers/i2c/soft_i2c.c
+++ b/drivers/i2c/soft_i2c.c
@@ -43,6 +43,9 @@
 #if defined(CONFIG_MPC852T) || defined(CONFIG_MPC866)
 #include asm/io.h
 #endif
+#if defined(CONFIG_SOFT_I2C_INCLUDE)
+#include soft_i2c.h
+#endif
 #include i2c.h

 /* #define DEBUG_I2C   */
diff --git a/include/soft_i2c.h b/include/soft_i2c.h
new file mode 100644
index 000..c1b770d
--- /dev/null
+++ b/include/soft_i2c.h
@@ -0,0 +1,20 @@
+#ifndef _CONFIG_SOFT_I2C
+#define _CONFIG_SOFT_I2C
+#ifdef CONFIG_SOFT_I2C_INIT
+#define I2C_INIT   i2c_soft_init()
+#endif
+#define I2C_ACTIVE i2c_soft_active()
+#define I2C_TRISTATE   i2c_soft_tristate()
+#define I2C_READ   

Re: [U-Boot] [PATCH v2] Make linking against libgcc configurable

2009-07-24 Thread Daniel Gorsulowski
Heiko Schocher wrote:
 Hello Daniel,
 
Hello Heiko,

First, I would like to apologize for top posting in my last 3 mails.
I am anxious to avoid that in the feature.

 Daniel Gorsulowski wrote:
 Sorry, it was my misstake.

 By cp and applying yout patch I missed the changes in lib_arm/Makefile.
 But as i wrote, _lshrdi3.a does not compile.
 
 Why do you use cp, and not better tools?

Thank you, now I learned using git-am as well by patches, created with
git-format-patch, as by emails from my mailbox.

 Compiling the meesc board with actual u-boot and the patches
 from Wolfgang, Dirk and me, works fine for me:
 
 [...@pollux u-boot]$ make mrproper
 [...@pollux u-boot]$ make meesc_config
 Configuring for meesc board...
 [...@pollux u-boot]$ make USE_PRIVATE_LIBGCC=yes -s all
 [...@pollux u-boot]$
 [...@pollux u-boot]$ ls -al u-boot.bin
 -rwxrwxr-x 1 hs hs 136820 23. Jul 17:25 u-boot.bin
...
 
After re-applying the patches by git-am, everything workes fine for me too.
Sorry for confusing...

 bye
 Heiko

Bye, Daniel
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] Make linking against libgcc configurable

2009-07-23 Thread Daniel Gorsulowski
Hi Wolfgang,

buid on meesc board (arm) is still broken.
It's roughly the same problem, as Heiko Schocher reported in
4a6854b1.5000...@denx.de. But his patch doesn't fix the problem either.

dani...@debby:~/git/u-boot$ make USE_PRIVATE_LIBGCC=yes
...
drivers/mtd/nand/libnand.a(nand_base.o): In function `nand_do_write_oob':
/data/home/danielg/git/u-boot/drivers/mtd/nand/nand_base.c:2019: undefined 
reference to `__lshrdi3'
drivers/mtd/nand/libnand.a(nand_base.o): In function `nand_erase_nand':
/data/home/danielg/git/u-boot/drivers/mtd/nand/nand_base.c:2199: undefined 
reference to `__lshrdi3'
/data/home/danielg/git/u-boot/drivers/mtd/nand/nand_base.c:2198: undefined 
reference to `__lshrdi3'
drivers/mtd/nand/libnand.a(nand_base.o): In function `nand_do_read_oob':
/data/home/danielg/git/u-boot/drivers/mtd/nand/nand_base.c:1519: undefined 
reference to `__lshrdi3'
drivers/mtd/nand/libnand.a(nand_bbt.o): In function `search_bbt':
/data/home/danielg/git/u-boot/drivers/mtd/nand/nand_bbt.c:482: undefined 
reference to `__lshrdi3'
drivers/mtd/nand/libnand.a(nand_bbt.o):/data/home/danielg/git/u-boot/drivers/mtd/nand/nand_bbt.c:413:
 more undefined references to `__lshrdi3' follow
lib_generic/libgeneric.a(vsprintf.o): In function `put_dec':
/data/home/danielg/git/u-boot/lib_generic/vsprintf.c:242: undefined reference 
to `__umoddi3'
/data/home/danielg/git/u-boot/lib_generic/vsprintf.c:242: undefined reference 
to `__udivdi3'
lib_generic/libgeneric.a(vsprintf.o): In function `number':
/data/home/danielg/git/u-boot/lib_generic/vsprintf.c:306: undefined reference 
to `__lshrdi3'
make: *** [u-boot] Error 1

Best regards, Daniel


Wolfgang Denk wrote:
 Many (especially ARM) tool chains seem to come with broken or
 otherwise unusable (for the purposes of builing U-Boot) run-time
 support libraries `libgcc.a'. By using the USE_PRIVATE_LIBGCC
 setting we allow to use alternative libraries instead.
 
 USE_PRIVATE_LIBGCC can either be set as an environment variable in
 the shell, or as a command line argument when running make, i. e.
   $ make USE_PRIVATE_LIBGCC=yes
 or
   $ USE_PRIVATE_LIBGCC=yes
   $ export USE_PRIVATE_LIBGCC
   $ make
 
 The value of USE_PRIVATE_LIBGCC is the name of the directory which
 contains the alternative run-time support library `libgcc.a'. The
 special value yes selects the directory $(OBJTREE)/lib_$(ARCH) .
 
 Note that not all architectures provide an alternative `libgcc.a' in
 their lib_$(ARCH) directories - so far, only ARM does.
 
 Signed-off-by: Wolfgang Denk w...@denx.de
...
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] Make linking against libgcc configurable

2009-07-23 Thread Daniel Gorsulowski
Hello Heiko,

Dirks patch reduces the errors, but I still get:

drivers/mtd/nand/libnand.a(nand_base.o): In function `nand_do_write_oob':
/data/home/danielg/git/u-boot/drivers/mtd/nand/nand_base.c:2019: undefined 
reference to `__lshrdi3'
drivers/mtd/nand/libnand.a(nand_base.o): In function `nand_erase_nand':
/data/home/danielg/git/u-boot/drivers/mtd/nand/nand_base.c:2199: undefined 
reference to `__lshrdi3'
/data/home/danielg/git/u-boot/drivers/mtd/nand/nand_base.c:2198: undefined 
reference to `__lshrdi3'
drivers/mtd/nand/libnand.a(nand_base.o): In function `nand_do_read_oob':
/data/home/danielg/git/u-boot/drivers/mtd/nand/nand_base.c:1519: undefined 
reference to `__lshrdi3'
drivers/mtd/nand/libnand.a(nand_bbt.o): In function `search_bbt':
/data/home/danielg/git/u-boot/drivers/mtd/nand/nand_bbt.c:482: undefined 
reference to `__lshrdi3'
drivers/mtd/nand/libnand.a(nand_bbt.o):/data/home/danielg/git/u-boot/drivers/mtd/nand/nand_bbt.c:413:
 more undefined references to `__lshrdi3' follow
make: *** [u-boot] Error 1

I noticed, that lib_arm/_lshrdi3.a is not beeing compiled.
So i added 'GLSOBJS += _lshrdi3.S' to lib_arm/Makefile (this line is missing
in your patch, i guess). But _lshrdi3.a still does not compile.

So I took a look at lib_arm/.depend:
_ashldi3.o: _ashldi3.S
_ashrdi3.o: _ashrdi3.S
_divsi3.o: _divsi3.S
_lshrdi3.o: _lshrdi3.S
_modsi3.o: _modsi3.S
_udivsi3.o: _udivsi3.S
_umodsi3.o: _umodsi3.S

I have no explanation for that, do you have?

bye, Daniel


Heiko Schocher wrote:
 Hello Daniel,
 
 Daniel Gorsulowski wrote:
 buid on meesc board (arm) is still broken.
 It's roughly the same problem, as Heiko Schocher reported in
 4a6854b1.5000...@denx.de. But his patch doesn't fix the problem either.

 dani...@debby:~/git/u-boot$ make USE_PRIVATE_LIBGCC=yes
 ...
 drivers/mtd/nand/libnand.a(nand_base.o): In function `nand_do_write_oob':
 /data/home/danielg/git/u-boot/drivers/mtd/nand/nand_base.c:2019: undefined 
 reference to `__lshrdi3'
 drivers/mtd/nand/libnand.a(nand_base.o): In function `nand_erase_nand':
 /data/home/danielg/git/u-boot/drivers/mtd/nand/nand_base.c:2199: undefined 
 reference to `__lshrdi3'
 /data/home/danielg/git/u-boot/drivers/mtd/nand/nand_base.c:2198: undefined 
 reference to `__lshrdi3'
 drivers/mtd/nand/libnand.a(nand_base.o): In function `nand_do_read_oob':
 /data/home/danielg/git/u-boot/drivers/mtd/nand/nand_base.c:1519: undefined 
 reference to `__lshrdi3'
 drivers/mtd/nand/libnand.a(nand_bbt.o): In function `search_bbt':
 /data/home/danielg/git/u-boot/drivers/mtd/nand/nand_bbt.c:482: undefined 
 reference to `__lshrdi3'
 drivers/mtd/nand/libnand.a(nand_bbt.o):/data/home/danielg/git/u-boot/drivers/mtd/nand/nand_bbt.c:413:
  more undefined references to `__lshrdi3' follow
 lib_generic/libgeneric.a(vsprintf.o): In function `put_dec':
 /data/home/danielg/git/u-boot/lib_generic/vsprintf.c:242: undefined 
 reference to `__umoddi3'
 /data/home/danielg/git/u-boot/lib_generic/vsprintf.c:242: undefined 
 reference to `__udivdi3'
 
 Maybe you need also this fix from Dirk Behme
 
 http://lists.denx.de/pipermail/u-boot/2009-July/057265.html
 
 I see on this Hardware is CONFIG_SYS_64BIT_VSPRINTF activated ... so
 I think, the above patch will fix this. Can you give this a try?
 
 bye
 Heiko
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] Make linking against libgcc configurable

2009-07-23 Thread Daniel Gorsulowski
Sorry, it was my misstake.

By cp and applying yout patch I missed the changes in lib_arm/Makefile.
But as i wrote, _lshrdi3.a does not compile.

Daniel

Daniel Gorsulowski wrote:
 So i added 'GLSOBJS += _lshrdi3.S' to lib_arm/Makefile (this line is missing
 in your patch, i guess). But _lshrdi3.a still does not compile.

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/2] at91: Add CAN init function

2009-06-30 Thread Daniel Gorsulowski
To enable CAN init, CONFIG_CAN has to be defined in the board config file
and at91_can_hw_init() has to be called in the board specific code.

CAN is available on AT91SAM9263 and AT91CAP9 SoC.

Signed-off-by: Daniel Gorsulowski daniel.gorsulow...@esd.eu
---
 cpu/arm926ejs/at91/at91cap9_devices.c|   15 +++
 cpu/arm926ejs/at91/at91sam9263_devices.c |   15 +++
 include/asm-arm/arch-at91/at91_common.h  |1 +
 3 files changed, 31 insertions(+), 0 deletions(-)

diff --git a/cpu/arm926ejs/at91/at91cap9_devices.c 
b/cpu/arm926ejs/at91/at91cap9_devices.c
index c0024ac..39e405f 100644
--- a/cpu/arm926ejs/at91/at91cap9_devices.c
+++ b/cpu/arm926ejs/at91/at91cap9_devices.c
@@ -3,6 +3,10 @@
  * Stelian Pop stelian@leadtechdesign.com
  * Lead Tech Design www.leadtechdesign.com
  *
+ * (C) Copyright 2009
+ * Daniel Gorsulowski daniel.gorsulow...@esd.eu
+ * esd electronic system design gmbh www.esd.eu
+ *
  * See file CREDITS for list of people who contributed to this
  * project.
  *
@@ -174,3 +178,14 @@ void at91_macb_hw_init(void)
 #endif
 }
 #endif
+
+#ifdef CONFIG_AT91_CAN
+void at91_can_hw_init(void)
+{
+   at91_set_A_periph(AT91_PIN_PA12, 0);/* CAN_TX */
+   at91_set_A_periph(AT91_PIN_PA13, 1);/* CAN_RX */
+
+   /* Enable clock */
+   at91_sys_write(AT91_PMC_PCER, 1  AT91CAP9_ID_CAN);
+}
+#endif
diff --git a/cpu/arm926ejs/at91/at91sam9263_devices.c 
b/cpu/arm926ejs/at91/at91sam9263_devices.c
index 0f2613e..f72efdf 100644
--- a/cpu/arm926ejs/at91/at91sam9263_devices.c
+++ b/cpu/arm926ejs/at91/at91sam9263_devices.c
@@ -3,6 +3,10 @@
  * Stelian Pop stelian@leadtechdesign.com
  * Lead Tech Design www.leadtechdesign.com
  *
+ * (C) Copyright 2009
+ * Daniel Gorsulowski daniel.gorsulow...@esd.eu
+ * esd electronic system design gmbh www.esd.eu
+ *
  * See file CREDITS for list of people who contributed to this
  * project.
  *
@@ -182,3 +186,14 @@ void at91_uhp_hw_init(void)
at91_set_gpio_output(AT91_PIN_PA24, 0);
 }
 #endif
+
+#ifdef CONFIG_AT91_CAN
+void at91_can_hw_init(void)
+{
+   at91_set_A_periph(AT91_PIN_PA13, 0);/* CAN_TX */
+   at91_set_A_periph(AT91_PIN_PA14, 1);/* CAN_RX */
+
+   /* Enable clock */
+   at91_sys_write(AT91_PMC_PCER, 1  AT91SAM9263_ID_CAN);
+}
+#endif
diff --git a/include/asm-arm/arch-at91/at91_common.h 
b/include/asm-arm/arch-at91/at91_common.h
index 9c4e019..01840ee 100644
--- a/include/asm-arm/arch-at91/at91_common.h
+++ b/include/asm-arm/arch-at91/at91_common.h
@@ -25,6 +25,7 @@
 #ifndef AT91_COMMON_H
 #define AT91_COMMON_H
 
+void at91_can_hw_init(void);
 void at91_macb_hw_init(void);
 void at91_serial_hw_init(void);
 void at91_serial0_hw_init(void);
-- 
1.5.3

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] at91: Add esd gmbh MEESC board support

2009-06-29 Thread Daniel Gorsulowski
Jean-Christophe PLAGNIOL-VILLARD wrote:
 On 12:21 Tue 23 Jun , Daniel Gorsulowski wrote:
 This patch adds support for esd gmbh MEESC board.
 The MEESC is based on an Atmel AT91SAM9263 SoC.

 Signed-off-by: Daniel Gorsulowski daniel.gorsulow...@esd.eu
 ---

 Jean-Christophe: This patch requires an up-to-date mach-types.h,
 please sync it.

 diff --git a/board/esd/meesc/meesc.c b/board/esd/meesc/meesc.c
 new file mode 100644
 index 000..557a51c
 --- /dev/null
 +++ b/board/esd/meesc/meesc.c
 @@ -0,0 +1,211 @@
 +/*
 + * (C) Copyright 2007-2008
 + * Stelian Pop stelian@leadtechdesign.com
 + * Lead Tech Design www.leadtechdesign.com
 + *
 + * (C) Copyright 2009
 + * Daniel Gorsulowski daniel.gorsulow...@esd.eu
 + * esd electronic system design gmbh www.esd.eu
 + *
 + * See file CREDITS for list of people who contributed to this
 + * project.
 + *
 + * 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 asm/arch/at91sam9263.h
 +#include asm/arch/at91sam9263_matrix.h
 please use asm/arch/at91sam9_matrix.h
ok
 +#include asm/arch/at91sam9_smc.h
 +#include asm/arch/at91_common.h
 +#include asm/arch/at91_pmc.h
 +#include asm/arch/at91_rstc.h
 +#include asm/arch/clk.h
 +#include asm/arch/gpio.h
 +#include asm/arch/hardware.h
 +#include asm/arch/io.h
 +#include netdev.h
 +
 +DECLARE_GLOBAL_DATA_PTR;
 +
 +/*
 + * Miscelaneous platform dependent initialisations
 + */
 it will be better to only read it only and store it in a static
I only use it once, but if you really mean, I'll change it.
 +int get_hw_rev(void)
 +{
 +int rev = at91_get_gpio_value(AT91_PIN_PB19);
 please add an empty line
ok
 +rev |= at91_get_gpio_value(AT91_PIN_PB20)  1;
 +rev |= at91_get_gpio_value(AT91_PIN_PB21)  2;
 +rev |= at91_get_gpio_value(AT91_PIN_PB22)  3;
 +
 +if (rev == 15)
 +rev = 0;
 +
 +return rev;
 +}
 +
 snip
 +
 +int checkboard(void)
 +{
 +char str[32];
 +char buf[32];
 +
 +puts(Board: esd CAN-EtherCAT Gateway);
 +if (getenv_r(serial#, str, sizeof(str))  0) {
 +puts(, serial# );
 +puts(str);
 +}
 +printf(\nHardware-revision: 1.%d\n, get_hw_rev());
 +printf(Crystal frequency:\t%8s MHz\n,
 +strmhz(buf, get_main_clk_rate()));
 +printf(CPU clock:\t\t%8s MHz\n,
 +strmhz(buf, get_cpu_clk_rate()));
 +#ifdef CONFIG_SHOW_VERBOSE_CLOCKINFO
 +printf(Master clock:\t\t%8s MHz\n,
 +strmhz(buf, get_mck_clk_rate()));
 +printf(PLL A clock:\t\t%8s MHz\n,
 +strmhz(buf, get_plla_clk_rate()));
 +printf(PLL B Reg.:\t\t0x%08X\n,
 +at91_sys_read(AT91_CKGR_PLLBR));
 +printf(PLL B clock:\t\t%8s MHz\n,
 +strmhz(buf, get_pllb_clk_rate()));
 +#endif
 +printf(Mach-type: %lu\n, gd-bd-bi_arch_number);
 +return 0;
 +}
 please use cpu_info when it's possible to avoid copy  paste
 
Coud you explain a few more? I can't find a function called 'cpu_info'.
 +int board_init(void)
 +{
 +/* Enable Ctrlc */
 +console_init_f();
 no need
Ok, I'll remove it
 +
 +/* Peripheral Clock Enable Register */
 +at91_sys_write(AT91_PMC_PCER,   1  AT91SAM9263_ID_PIOA |
 +1  AT91SAM9263_ID_PIOB |
 +1  AT91SAM9263_ID_PIOCDE |
 +1  AT91SAM9263_ID_CAN);
 +
 +/* arch number of MEESC-Board */
 +gd-bd-bi_arch_number = MACH_TYPE_MEESC;
 +
 +/* adress of boot parameters */
 +gd-bd-bi_boot_params = PHYS_SDRAM + 0x100;
 +
 +at91_serial_hw_init();
 +#ifdef CONFIG_CMD_NAND
 +meesc_nand_hw_init();
 +#endif
 +meesc_ethercat_hw_init();
 +#ifdef CONFIG_HAS_DATAFLASH
 +at91_spi0_hw_init(1  0);
 +#endif
 +#ifdef CONFIG_MACB
 +meesc_macb_hw_init();
 +#endif
 +at91_set_A_periph(AT91_PIN_PA13, 0);/* CAN_TX */
 +at91_set_A_periph(AT91_PIN_PA14, 1);/* CAN_RX */
 please add a at91_can_hw_init function
Ok, I'll do this by a separate patch
 +return 0;
 +}
 snio
 +
 +#ifndef __CONFIG_H
 +#define __CONFIG_H
 +
 +/* Common stuff */
 +#define AT91_CPU_NAME   AT91SAM9263
 please

[U-Boot] [PATCH] at91: Add CAN init function

2009-06-29 Thread Daniel Gorsulowski
To enable CAN init, CONFIG_CAN has to be defined in the board config file
and at91_can_hw_init() has to be called in the board specific code.

CAN is available on AT91SAM9263 and AT91CAP9 SoC.

Signed-off-by: Daniel Gorsulowski daniel.gorsulow...@esd.eu
---
 cpu/arm926ejs/at91/at91cap9_devices.c|   11 +++
 cpu/arm926ejs/at91/at91sam9263_devices.c |   11 +++
 include/asm-arm/arch-at91/at91_common.h  |1 +
 3 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/cpu/arm926ejs/at91/at91cap9_devices.c 
b/cpu/arm926ejs/at91/at91cap9_devices.c
index c0024ac..ede55f4 100644
--- a/cpu/arm926ejs/at91/at91cap9_devices.c
+++ b/cpu/arm926ejs/at91/at91cap9_devices.c
@@ -174,3 +174,14 @@ void at91_macb_hw_init(void)
 #endif
 }
 #endif
+
+#ifdef CONFIG_CAN
+void at91_can_hw_init(void)
+{
+   at91_set_A_periph(AT91_PIN_PA12, 0);/* CAN_TX */
+   at91_set_A_periph(AT91_PIN_PA13, 1);/* CAN_RX */
+
+   /* Enable clock */
+   at91_sys_write(AT91_PMC_PCER, 1  AT91CAP9_ID_CAN);
+}
+#endif
diff --git a/cpu/arm926ejs/at91/at91sam9263_devices.c 
b/cpu/arm926ejs/at91/at91sam9263_devices.c
index 0f2613e..3990dde 100644
--- a/cpu/arm926ejs/at91/at91sam9263_devices.c
+++ b/cpu/arm926ejs/at91/at91sam9263_devices.c
@@ -182,3 +182,14 @@ void at91_uhp_hw_init(void)
at91_set_gpio_output(AT91_PIN_PA24, 0);
 }
 #endif
+
+#ifdef CONFIG_CAN
+void at91_can_hw_init(void)
+{
+   at91_set_A_periph(AT91_PIN_PA13, 0);/* CAN_TX */
+   at91_set_A_periph(AT91_PIN_PA14, 1);/* CAN_RX */
+
+   /* Enable clock */
+   at91_sys_write(AT91_PMC_PCER, 1  AT91SAM9263_ID_CAN);
+}
+#endif
diff --git a/include/asm-arm/arch-at91/at91_common.h 
b/include/asm-arm/arch-at91/at91_common.h
index 9c4e019..01840ee 100644
--- a/include/asm-arm/arch-at91/at91_common.h
+++ b/include/asm-arm/arch-at91/at91_common.h
@@ -25,6 +25,7 @@
 #ifndef AT91_COMMON_H
 #define AT91_COMMON_H
 
+void at91_can_hw_init(void);
 void at91_macb_hw_init(void);
 void at91_serial_hw_init(void);
 void at91_serial0_hw_init(void);
-- 
1.5.3

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] at91: Add esd gmbh MEESC board support

2009-06-29 Thread Daniel Gorsulowski
Daniel Gorsulowski wrote:
 Jean-Christophe PLAGNIOL-VILLARD wrote:
 snip
 +
 +int checkboard(void)
 +{
 +   char str[32];
 +   char buf[32];
 +
 +   puts(Board: esd CAN-EtherCAT Gateway);
 +   if (getenv_r(serial#, str, sizeof(str))  0) {
 +   puts(, serial# );
 +   puts(str);
 +   }
 +   printf(\nHardware-revision: 1.%d\n, get_hw_rev());
 +   printf(Crystal frequency:\t%8s MHz\n,
 +   strmhz(buf, get_main_clk_rate()));
 +   printf(CPU clock:\t\t%8s MHz\n,
 +   strmhz(buf, get_cpu_clk_rate()));
 +#ifdef CONFIG_SHOW_VERBOSE_CLOCKINFO
 +   printf(Master clock:\t\t%8s MHz\n,
 +   strmhz(buf, get_mck_clk_rate()));
 +   printf(PLL A clock:\t\t%8s MHz\n,
 +   strmhz(buf, get_plla_clk_rate()));
 +   printf(PLL B Reg.:\t\t0x%08X\n,
 +   at91_sys_read(AT91_CKGR_PLLBR));
 +   printf(PLL B clock:\t\t%8s MHz\n,
 +   strmhz(buf, get_pllb_clk_rate()));
 +#endif
 +   printf(Mach-type: %lu\n, gd-bd-bi_arch_number);
 +   return 0;
 +}
 please use cpu_info when it's possible to avoid copy  paste

 Coud you explain a few more? I can't find a function called 'cpu_info'.
Found config option CONFIG_DISPLAY_CPUINFO and enabled it, thank you for
the hint.

Best regards,
Daniel Gorsulowski

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] at91: Add esd gmbh MEESC board support

2009-06-29 Thread Daniel Gorsulowski
This patch adds support for esd gmbh MEESC board.
The MEESC is based on an Atmel AT91SAM9263 SoC.

Signed-off-by: Daniel Gorsulowski daniel.gorsulow...@esd.eu
---
 MAINTAINERS |4 +
 MAKEALL |1 +
 Makefile|3 +
 board/esd/meesc/Makefile|   55 
 board/esd/meesc/config.mk   |1 +
 board/esd/meesc/meesc.c |  197 +++
 board/esd/meesc/partition.c |   37 
 include/configs/meesc.h |  188 +
 8 files changed, 486 insertions(+), 0 deletions(-)
 create mode 100644 board/esd/meesc/Makefile
 create mode 100644 board/esd/meesc/config.mk
 create mode 100644 board/esd/meesc/meesc.c
 create mode 100644 board/esd/meesc/partition.c
 create mode 100644 include/configs/meesc.h

diff --git a/MAINTAINERS b/MAINTAINERS
index f36a1cc..c9066a9 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -530,6 +530,10 @@ Peter Figuli pep...@etc.sk
 
wepep250xscale
 
+Daniel Gorsulowski daniel.gorsulow...@esd.eu
+
+   meesc   ARM926EJS (AT91SAM9263 SoC)
+
 Marius Gröger m...@sysgo.de
 
impa7   ARM720T (EP7211)
diff --git a/MAKEALL b/MAKEALL
index 063ebfc..47eb5af 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -583,6 +583,7 @@ LIST_at91= \
cmc_pu2 \
csb637  \
kb9202  \
+   meesc   \
mp2usb  \
m501sk  \
pm9261  \
diff --git a/Makefile b/Makefile
index 0d92d67..282b9fd 100644
--- a/Makefile
+++ b/Makefile
@@ -2769,6 +2769,9 @@ at91sam9rlek_config   :   unconfig
fi;
@$(MKCONFIG) -a at91sam9rlek arm arm926ejs at91sam9rlek atmel at91
 
+meesc_config   :   unconfig
+   @$(MKCONFIG) $(@:_config=) arm arm926ejs meesc esd at91
+
 pm9261_config  :   unconfig
@$(MKCONFIG) $(@:_config=) arm arm926ejs pm9261 ronetix at91
 
diff --git a/board/esd/meesc/Makefile b/board/esd/meesc/Makefile
new file mode 100644
index 000..2dd6b25
--- /dev/null
+++ b/board/esd/meesc/Makefile
@@ -0,0 +1,55 @@
+#
+# (C) Copyright 2003-2008
+# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+#
+# (C) Copyright 2008
+# Stelian Pop stelian@leadtechdesign.com
+# Lead Tech Design www.leadtechdesign.com
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# 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 $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).a
+
+COBJS-y+= $(BOARD).o
+COBJS-$(CONFIG_HAS_DATAFLASH) += partition.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS-y))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(obj).depend $(OBJS) $(SOBJS)
+   $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
+
+clean:
+   rm -f $(SOBJS) $(OBJS)
+
+distclean: clean
+   rm -f $(LIB) core *.bak $(obj).depend
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/esd/meesc/config.mk b/board/esd/meesc/config.mk
new file mode 100644
index 000..9ce161e
--- /dev/null
+++ b/board/esd/meesc/config.mk
@@ -0,0 +1 @@
+TEXT_BASE = 0x21f0
diff --git a/board/esd/meesc/meesc.c b/board/esd/meesc/meesc.c
new file mode 100644
index 000..cb567ac
--- /dev/null
+++ b/board/esd/meesc/meesc.c
@@ -0,0 +1,197 @@
+/*
+ * (C) Copyright 2007-2008
+ * Stelian Pop stelian@leadtechdesign.com
+ * Lead Tech Design www.leadtechdesign.com
+ *
+ * (C) Copyright 2009
+ * Daniel Gorsulowski daniel.gorsulow...@esd.eu
+ * esd electronic system design gmbh www.esd.eu
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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

[U-Boot] [PATCH] at91: Add esd gmbh MEESC board support

2009-06-23 Thread Daniel Gorsulowski
This patch adds support for esd gmbh MEESC board.
The MEESC is based on an Atmel AT91SAM9263 SoC.

Signed-off-by: Daniel Gorsulowski daniel.gorsulow...@esd.eu
---

Jean-Christophe: This patch requires an up-to-date mach-types.h,
please sync it.

 MAINTAINERS |4 +
 MAKEALL |1 +
 Makefile|3 +
 board/esd/meesc/Makefile|   55 +++
 board/esd/meesc/config.mk   |1 +
 board/esd/meesc/meesc.c |  211 +++
 board/esd/meesc/partition.c |   37 
 include/configs/meesc.h |  185 +
 8 files changed, 497 insertions(+), 0 deletions(-)
 create mode 100644 board/esd/meesc/Makefile
 create mode 100644 board/esd/meesc/config.mk
 create mode 100644 board/esd/meesc/meesc.c
 create mode 100644 board/esd/meesc/partition.c
 create mode 100644 include/configs/meesc.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 9379c7e..449443a 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -532,6 +532,10 @@ Peter Figuli pep...@etc.sk
 
wepep250xscale
 
+Daniel Gorsulowski daniel.gorsulow...@esd.eu
+
+   meesc   ARM926EJS (AT91SAM9263 SoC)
+
 Marius Gröger m...@sysgo.de
 
impa7   ARM720T (EP7211)
diff --git a/MAKEALL b/MAKEALL
index f4599d6..eb7b0d7 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -587,6 +587,7 @@ LIST_at91= \
cmc_pu2 \
csb637  \
kb9202  \
+   meesc   \
mp2usb  \
m501sk  \
pm9263  \
diff --git a/Makefile b/Makefile
index 46871d0..a5db70d 100644
--- a/Makefile
+++ b/Makefile
@@ -2787,6 +2787,9 @@ at91sam9rlek_config   :   unconfig
fi;
@$(MKCONFIG) -a at91sam9rlek arm arm926ejs at91sam9rlek atmel at91
 
+meesc_config   :   unconfig
+   @$(MKCONFIG) $(@:_config=) arm arm926ejs meesc esd at91
+
 pm9263_config  :   unconfig
@$(MKCONFIG) $(@:_config=) arm arm926ejs pm9263 ronetix at91
 
diff --git a/board/esd/meesc/Makefile b/board/esd/meesc/Makefile
new file mode 100644
index 000..2dd6b25
--- /dev/null
+++ b/board/esd/meesc/Makefile
@@ -0,0 +1,55 @@
+#
+# (C) Copyright 2003-2008
+# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+#
+# (C) Copyright 2008
+# Stelian Pop stelian@leadtechdesign.com
+# Lead Tech Design www.leadtechdesign.com
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# 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 $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).a
+
+COBJS-y+= $(BOARD).o
+COBJS-$(CONFIG_HAS_DATAFLASH) += partition.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS-y))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(obj).depend $(OBJS) $(SOBJS)
+   $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
+
+clean:
+   rm -f $(SOBJS) $(OBJS)
+
+distclean: clean
+   rm -f $(LIB) core *.bak $(obj).depend
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/esd/meesc/config.mk b/board/esd/meesc/config.mk
new file mode 100644
index 000..9ce161e
--- /dev/null
+++ b/board/esd/meesc/config.mk
@@ -0,0 +1 @@
+TEXT_BASE = 0x21f0
diff --git a/board/esd/meesc/meesc.c b/board/esd/meesc/meesc.c
new file mode 100644
index 000..557a51c
--- /dev/null
+++ b/board/esd/meesc/meesc.c
@@ -0,0 +1,211 @@
+/*
+ * (C) Copyright 2007-2008
+ * Stelian Pop stelian@leadtechdesign.com
+ * Lead Tech Design www.leadtechdesign.com
+ *
+ * (C) Copyright 2009
+ * Daniel Gorsulowski daniel.gorsulow...@esd.eu
+ * esd electronic system design gmbh www.esd.eu
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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

[U-Boot] ARM mach-types.h sync request

2009-06-08 Thread Daniel Gorsulowski
Dear Jean-Christophe PLAGNIOL-VILLARD,

please sync include/asm-arm/mach-types.h with mach-types.h
from latest kernel source to enable support for boards
MEESC (number 2165) and OTC570 (number 2166).

Thanks!

Best regards,
Daniel Gorsulowski
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] at91: Add support for MEESC board of esd gmbh

2009-05-25 Thread Daniel Gorsulowski
 patch for this board soon.

Best regards,
Daniel Gorsulowski

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] at91: Extended soft_i2c driver for AT91SAM9263 SoC

2009-05-25 Thread Daniel Gorsulowski
Dear Jean-Christophe,

Jean-Christophe PLAGNIOL-VILLARD schrieb:
 On 13:20 Mon 18 May , Daniel Gorsulowski wrote:
 While hard_i2c support is not available
 (see http://lists.denx.de/pipermail/u-boot/2009-March/049751.html),
 this patch enables soft_i2c on AT91SAM9263 SoC.

 Signed-off-by: Daniel Gorsulowski daniel.gorsulow...@esd.eu
 ---
 where do you use it?
 
 Best Regards,
 J.
I'll use I2C on an other AT91SAM9263 based board, called OTC570.
The patch is not ready yet (first working on MEESC implementation), but
it will come soon.

Best regards,
Daniel Gorsulowski
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] at91: Add support for MEESC board of esd gmbh

2009-05-18 Thread Daniel Gorsulowski
This patch is a rebase against branch arm/next and adds support for
MEESC board of esd gmbh.
The MEESC is based on an Atmel AT91SAM9263 SoC.

Signed-off-by: Daniel Gorsulowski daniel.gorsulow...@esd.eu
---
 MAINTAINERS   |4 +
 MAKEALL   |1 +
 Makefile  |3 +
 board/esd/meesc/Makefile  |   54 ++
 board/esd/meesc/config.mk |1 +
 board/esd/meesc/meesc.c   |  239 +
 include/configs/meesc.h   |  191 
 7 files changed, 493 insertions(+), 0 deletions(-)
 create mode 100644 board/esd/meesc/Makefile
 create mode 100644 board/esd/meesc/config.mk
 create mode 100644 board/esd/meesc/meesc.c
 create mode 100644 include/configs/meesc.h

diff --git a/MAINTAINERS b/MAINTAINERS
index bf076b9..9795625 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -529,6 +529,10 @@ Peter Figuli pep...@etc.sk
 
wepep250xscale
 
+Daniel Gorsulowski daniel.gorsulow...@esd.eu
+
+   meesc   ARM926EJS (AT91SAM9263 SoC)
+
 Marius Gröger m...@sysgo.de
 
impa7   ARM720T (EP7211)
diff --git a/MAKEALL b/MAKEALL
index c98d03a..e220615 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -583,6 +583,7 @@ LIST_at91= \
cmc_pu2 \
csb637  \
kb9202  \
+   meesc   \
mp2usb  \
m501sk  \
pm9263  \
diff --git a/Makefile b/Makefile
index 81a5cd0..4ed145c 100644
--- a/Makefile
+++ b/Makefile
@@ -2760,6 +2760,9 @@ at91sam9rlek_config   :   unconfig
fi;
@$(MKCONFIG) -a at91sam9rlek arm arm926ejs at91sam9rlek atmel at91
 
+meesc_config   :   unconfig
+   @$(MKCONFIG) $(@:_config=) arm arm926ejs meesc esd at91
+
 pm9263_config  :   unconfig
@$(MKCONFIG) $(@:_config=) arm arm926ejs pm9263 ronetix at91
 
diff --git a/board/esd/meesc/Makefile b/board/esd/meesc/Makefile
new file mode 100644
index 000..b7f60fa
--- /dev/null
+++ b/board/esd/meesc/Makefile
@@ -0,0 +1,54 @@
+#
+# (C) Copyright 2003-2008
+# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+#
+# (C) Copyright 2008
+# Stelian Pop stelian@leadtechdesign.com
+# Lead Tech Design www.leadtechdesign.com
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# 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 $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).a
+
+COBJS-y+= $(BOARD).o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS-y))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(obj).depend $(OBJS) $(SOBJS)
+   $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
+
+clean:
+   rm -f $(SOBJS) $(OBJS)
+
+distclean: clean
+   rm -f $(LIB) core *.bak $(obj).depend
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/esd/meesc/config.mk b/board/esd/meesc/config.mk
new file mode 100644
index 000..9ce161e
--- /dev/null
+++ b/board/esd/meesc/config.mk
@@ -0,0 +1 @@
+TEXT_BASE = 0x21f0
diff --git a/board/esd/meesc/meesc.c b/board/esd/meesc/meesc.c
new file mode 100644
index 000..18880c8
--- /dev/null
+++ b/board/esd/meesc/meesc.c
@@ -0,0 +1,239 @@
+/*
+ * (C) Copyright 2007-2008
+ * Stelian Pop stelian@leadtechdesign.com
+ * Lead Tech Design www.leadtechdesign.com
+ *
+ * (C) Copyright 2008
+ * Ulf Samuelsson ulf.samuels...@atmel.com
+ *
+ * (C) Copyright 2009
+ * Daniel Gorsulowski daniel.gorsulow...@esd.eu
+ * esd electronic system design gmbh www.esd.eu
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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

[U-Boot] [PATCH] at91: Extended soft_i2c driver for AT91SAM9263 SoC

2009-05-18 Thread Daniel Gorsulowski
While hard_i2c support is not available
(see http://lists.denx.de/pipermail/u-boot/2009-March/049751.html),
this patch enables soft_i2c on AT91SAM9263 SoC.

Signed-off-by: Daniel Gorsulowski daniel.gorsulow...@esd.eu
---
 drivers/i2c/soft_i2c.c |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/i2c/soft_i2c.c b/drivers/i2c/soft_i2c.c
index 59883a5..9a48783 100644
--- a/drivers/i2c/soft_i2c.c
+++ b/drivers/i2c/soft_i2c.c
@@ -34,6 +34,11 @@
 #include asm/io.h
 #include asm/arch/hardware.h
 #endif
+#ifdef CONFIG_AT91SAM9263  /* only valid for AT91SAM9263 */
+#include asm/arch/at91_pmc.h
+#include asm/arch/gpio.h
+#include asm/arch/io.h
+#endif
 #ifdef CONFIG_IXP425   /* only valid for IXP425 */
 #include asm/arch/ixp425.h
 #endif
-- 
1.6.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 12/13] at91: add hardware i2c drivers

2009-05-14 Thread Daniel Gorsulowski
Dear Jean-Christophe,

On Friday 27 March 2009 23:30 you wrote:
 Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagn...@jcrosoft.com
 ---
  cpu/arm926ejs/at91/Makefile|6 +
  .../arm926ejs/at91/at91cap9_i2c.c  |   31 ++--
  .../arm926ejs/at91/at91sam9260_i2c.c   |   31 ++--
  .../arm926ejs/at91/at91sam9261_i2c.c   |   31 ++--
  .../arm926ejs/at91/at91sam9263_i2c.c   |   31 ++--
  .../clk.h = cpu/arm926ejs/at91/at91sam9rl_i2c.c   |   37 ++--
  drivers/i2c/Makefile   |1 +
  drivers/i2c/atmel_i2c.c|  234 
 
  include/asm-arm/arch-at91/at91_common.h|2 +
  include/asm-arm/arch-at91/at91_twi.h   |   68 ++
  include/asm-arm/arch-at91/clk.h|4 +
  include/asm-arm/arch-at91/hardware.h   |5 +
  12 files changed, 405 insertions(+), 76 deletions(-)
  copy include/asm-arm/arch-at91/at91_common.h = 
 cpu/arm926ejs/at91/at91cap9_i2c.c (61%)
  copy include/asm-arm/arch-at91/at91_common.h = 
 cpu/arm926ejs/at91/at91sam9260_i2c.c (61%)
  copy include/asm-arm/arch-at91/at91_common.h = 
 cpu/arm926ejs/at91/at91sam9261_i2c.c (61%)
  copy include/asm-arm/arch-at91/at91_common.h = 
 cpu/arm926ejs/at91/at91sam9263_i2c.c (61%)
  copy include/asm-arm/arch-at91/clk.h = cpu/arm926ejs/at91/at91sam9rl_i2c.c 
 (52%)
  create mode 100644 drivers/i2c/atmel_i2c.c
  create mode 100644 include/asm-arm/arch-at91/at91_twi.h
 
...

Do you aim to commit a new clean patch for this issue?
Hard I2C support would be a really nice feature!

Best regards,
Daniel Gorsulowski
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] at91: Add command to control GPIO LEDs from the console

2009-05-14 Thread Daniel Gorsulowski
This patch allows any at91 board implementing the GPIO LED API
to control vendor specific LEDs from the console.

Adding configuration items CONFIG_AT91_LED and CONFIG_CMD_LED
enables the command.
Moreover the GPIO Pins have to be defined by CONFIG_GPIO_LEDS
See doc/README.LED for detailed information.

Usage:
led [LED_number] [on|off]

Signed-off-by: Daniel Gorsulowski daniel.gorsulow...@esd.eu
---
 cpu/arm926ejs/at91/Makefile |1 +
 cpu/arm926ejs/at91/cmd_led.c|   60 +++
 cpu/arm926ejs/at91/led.c|   29 +++
 doc/README.LED  |   40 ++
 include/asm-arm/arch-at91/led.h |   42 +++
 5 files changed, 172 insertions(+), 0 deletions(-)
 create mode 100644 cpu/arm926ejs/at91/cmd_led.c
 create mode 100644 include/asm-arm/arch-at91/led.h

diff --git a/cpu/arm926ejs/at91/Makefile b/cpu/arm926ejs/at91/Makefile
index e300d97..adfd192 100644
--- a/cpu/arm926ejs/at91/Makefile
+++ b/cpu/arm926ejs/at91/Makefile
@@ -54,6 +54,7 @@ ifdef CONFIG_AT91SAM9RL
 COBJS-y+= at91sam9rl_serial.o
 COBJS-$(CONFIG_HAS_DATAFLASH)  += at91sam9rl_spi.o
 endif
+COBJS-$(CONFIG_CMD_LED)+= cmd_led.o
 COBJS-$(CONFIG_AT91_LED)   += led.o
 COBJS-y += clock.o
 COBJS-y += cpu.o
diff --git a/cpu/arm926ejs/at91/cmd_led.c b/cpu/arm926ejs/at91/cmd_led.c
new file mode 100644
index 000..45d634b
--- /dev/null
+++ b/cpu/arm926ejs/at91/cmd_led.c
@@ -0,0 +1,60 @@
+/*
+ * (C) Copyright 2009
+ * Daniel Gorsulowski daniel.gorsulow...@esd.eu
+ * esd electronic system design gmbh www.esd.eu
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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 command.h
+#include asm/arch/led.h
+
+int do_led(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+{
+   ulong led_nr;
+   unsigned on;
+
+   /* Validate arguments */
+   led_nr = simple_strtoul(argv[1], NULL, 10);
+   if (led_nr  CONFIG_LED_MAX) {
+   printf(Usage:\n%s\n, cmdtp-usage);
+   return 1;
+   }
+
+   if (strcmp(argv[2], off) == 0) {
+   on = 1;
+   } else if (strcmp(argv[2], on) == 0) {
+   on = 0;
+   } else {
+   printf(Usage:\n%s\n, cmdtp-usage);
+   return 1;
+   }
+
+   user_led(led_nr - 1, on);
+
+   return 0;
+}
+
+U_BOOT_CMD(
+   led, 3, 1, do_led,
+   [LED_number] [on|off],
+   [LED_number] [on|off] turns LED on/off
+);
diff --git a/cpu/arm926ejs/at91/led.c b/cpu/arm926ejs/at91/led.c
index be68f59..b41a7c4 100644
--- a/cpu/arm926ejs/at91/led.c
+++ b/cpu/arm926ejs/at91/led.c
@@ -3,6 +3,10 @@
  * Stelian Pop stelian@leadtechdesign.com
  * Lead Tech Design www.leadtechdesign.com
  *
+ * (C) Copyright 2009
+ * Daniel Gorsulowski daniel.gorsulow...@esd.eu
+ * esd electronic system design gmbh www.esd.eu
+ *
  * See file CREDITS for list of people who contributed to this
  * project.
  *
@@ -27,6 +31,31 @@
 #include asm/arch/gpio.h
 #include asm/arch/io.h
 
+#ifdef CONFIG_AT91_LED
+
+#if defined(CONFIG_AT91RM9200)
+#include asm/arch/at91rm9200.h
+#elif defined(CONFIG_AT91SAM9260) || defined(CONFIG_AT91SAM9G20)
+#include asm/arch/at91sam9260.h
+#elif defined(CONFIG_AT91SAM9261)
+#include asm/arch/at91sam9261.h
+#elif defined(CONFIG_AT91SAM9263)
+#include asm/arch/at91sam9263.h
+#elif defined(CONFIG_AT91SAM9RL)
+#include asm/arch/at91sam9rl.h
+#elif defined(CONFIG_AT91CAP9)
+#include asm/arch/at91cap9.h
+#endif
+
+#include asm/arch/led.h
+
+void user_led(ulong led_nr, unsigned on)
+{
+   at91_set_gpio_value(leds[led_nr], on);
+}
+
+#endif /* CONFIG_AT91_LED */
+
 #ifdef CONFIG_RED_LED
 void red_LED_on(void)
 {
diff --git a/doc/README.LED b/doc/README.LED
index 1221177..06a741e 100644
--- a/doc/README.LED
+++ b/doc/README.LED
@@ -76,3 +76,43 @@ TBD : Describe older board dependent macros similar to what 
is done for
 CONFIG_TQM8xxL.
 
 TBD : Describe general support via asm/status_led.h
+
+
+GPIO LEDs
+
+
+GPIO LEDs are presently only supported by at91.
+this README describes the usage of the GPIO LED API.
+
+The API is defined by the include file

Re: [U-Boot] [PATCH 1/1] at91: Add command to control up to 3 GPIO LEDs from the console

2009-05-14 Thread Daniel Gorsulowski
The folowing patch tries to fix all defects of the previous patch.
The new led command is _not_ limited to 3 LEDs any more, but it
is still restricted to at91 architectures.

Best regards,
Daniel Gorsulowski
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/1] at91: Add command to control up to 3 GPIO LEDs from the console

2009-05-07 Thread Daniel Gorsulowski
Dear Wolfgang Denk,

Wolfgang Denk wrote:
 Dear Daniel Gorsulowski,
 
 In message 1241619669338-git-send-email-daniel.gorsulow...@esd.eu you wrote:
 This patch allows any at91 board, implementing the GPIO LED API,
 to control the LEDs from the console.

 led [ 1 | 2 | 3 | all ]  [ on | off ]

 Adding configuration items CONFIG_AT91_LED and CONFIG_CMD_LED
 enables the command.
 Moreover the GPIO Pins have to be defined by CONFIG_USER1_LED ...
 CONFIG_USER3_LED.
 
 Signed-off-by: line missing.
 
Sorry, I'll fix that by the next patch.
 ---
  common/Makefile |1 +
  common/cmd_led.c|   86 
 +++
  cpu/arm926ejs/at91/led.c|   79 +++
  include/asm-arm/arch-at91/led.h |   52 +++
  4 files changed, 218 insertions(+), 0 deletions(-)
  create mode 100644 common/cmd_led.c
  create mode 100644 include/asm-arm/arch-at91/led.h

 diff --git a/common/Makefile b/common/Makefile
 index b9f4ca7..e0f571c 100644
 --- a/common/Makefile
 +++ b/common/Makefile
 @@ -103,6 +103,7 @@ COBJS-$(CONFIG_CMD_IMMAP) += cmd_immap.o
  COBJS-$(CONFIG_CMD_IRQ) += cmd_irq.o
  COBJS-$(CONFIG_CMD_ITEST) += cmd_itest.o
  COBJS-$(CONFIG_CMD_JFFS2) += cmd_jffs2.o
 +COBJS-$(CONFIG_CMD_LED) += cmd_led.o
  COBJS-$(CONFIG_CMD_LICENSE) += cmd_license.o
  COBJS-y += cmd_load.o
  COBJS-$(CONFIG_LOGBUFFER) += cmd_log.o
 diff --git a/common/cmd_led.c b/common/cmd_led.c
 
 Ummm... common is for, well, for common stuff. If this code is
 specific to AT91 only, it should not go into common.
 
IMHO this code is not specific to AT91 only. Well, other architectures does not
support the CONFIG_CMD_LED yet, but they could be implemented later.
 
 ...
 +U_BOOT_CMD(
 +led, 3, 1, do_led,
 +[1|2|3|all] [on|off],
 +[1|2|3|all] [on|off] sets/clears led 1,2,3
 
 Do you really say I set a LED? I clear a LED?  I don't think so.
 
Ok, I'll write turns led 1,2,3 on/off.
 diff --git a/include/asm-arm/arch-at91/led.h 
 b/include/asm-arm/arch-at91/led.h
 new file mode 100644
 index 000..878b2cf
 --- /dev/null
 +++ b/include/asm-arm/arch-at91/led.h
 @@ -0,0 +1,52 @@
 +/*
 + * (C) Copyright 2000-2004
 + * Wolfgang Denk, DENX Software Engineering, w...@denx.de.
 
 You claim that I have written any of this code?  I decline.
 
I took that structure from include/status_led.h, so i picked you up to the list.
But if you mean, I'll remove these lines.
 
 Best regards,
 
 Wolfgang Denk

Best Regards,
Daniel Gorsulowski
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/1] at91: Add command to control up to 3 GPIO LEDs from the console

2009-05-07 Thread Daniel Gorsulowski
Hi Stefan,

Stefan Roese wrote:
 Hi Daniel,
 
 On Wednesday 06 May 2009, Daniel Gorsulowski wrote:
 This patch allows any at91 board, implementing the GPIO LED API,
 to control the LEDs from the console.

 led [ 1 | 2 | 3 | all ]  [ on | off ]
 
 Why limit this to a max of 3 LED's? If this is a generic command (which I 
 like 
 btw) then we should support a user/board defined number of LED's. In your 
 case 
 it's 3, but the infrastructure should support any number.
 
 More comments below.
 
 snip
 
...
 
 I suggest to use something like this here:
 
   led_nr = simple_strtoul(argv[1], NULL, 10);
   if (led_nr  CONFIG_LED_MAX) {
   printf (Usage:\n%s\n, cmdtp-usage);
   return 1;
   }
 
   if (strcmp(argv[2], off) == 0) {
   on = 1;
   } else if (strcmp(argv[2], on) == 0) {
   on = 0;
   } else {
   printf (Usage:\n%s\n, cmdtp-usage);
   return 1;
   }
 
   user_led(led_nr, on);
 
 No ugly #ifdef's in this case. What do you think?
 
 Best regards,
 Stefan
 
I agree with you.
Please give me some days, to implement your basic approaches.
I've many other things to do and it's not that easy (for me)
to create a tidy patch.

Best regards,
Daniel
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/1] at91: Add command to control up to 3 GPIO LEDs from the console

2009-05-07 Thread Daniel Gorsulowski
Wolfgang Denk schrieb:
 Dear Daniel Gorsulowski,
 
 In message 4a02792b.8060...@esd.eu you wrote:
 Ummm... common is for, well, for common stuff. If this code is
 specific to AT91 only, it should not go into common.

 IMHO this code is not specific to AT91 only. Well, other architectures does 
 not
 support the CONFIG_CMD_LED yet, but they could be implemented later.
 
 This is not quite correct. Actually several boards already support
 this, or very similar functions:
 
 board/amcc/taihu/taihu.c:static int do_led_ctl(cmd_tbl_t* cmd_tp, int flags, 
 int argc, char *argv[])
 board/amcc/taishan/lcd.c:static int do_led_test_off(cmd_tbl_t * cmdtp, int 
 flag, int argc, char *argv[])
 board/amcc/taishan/lcd.c:static int do_led_test_on(cmd_tbl_t * cmdtp, int 
 flag, int argc, char *argv[])
 board/cm5200/cmd_cm5200.c:int do_led(char *argv[])
 board/pcs440ep/pcs440ep.c:int do_led (cmd_tbl_t *cmdtp, int flag, int argc, 
 char *argv[])
 board/pn62/cmd_pn62.c:int do_led (cmd_tbl_t *cmdtp, int flag, int argc, char 
 *argv[])
 board/tqc/tqm5200/cmd_stk52xx.c:int do_led(char *argv[])
 board/trab/trab_fkt.c:int do_led (char **);
 board/trab/trab_fkt.c:int do_led (char **argv)
 
Can you tell me a better place for at91 specific code?
I think lib_arm is not the proper place for it. I meant to place it in
arm926ejs/at91, what do you mean?
 
...
 
 Best regards,
 
 Wolfgang Denk
 
Best regards,
Daniel Gorsulowski
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/1] at91: Add command to control up to 3 GPIO LEDs from the console

2009-05-06 Thread Daniel Gorsulowski
This patch allows any at91 board, implementing the GPIO LED API,
to control the LEDs from the console.

led [ 1 | 2 | 3 | all ]  [ on | off ]

Adding configuration items CONFIG_AT91_LED and CONFIG_CMD_LED
enables the command.
Moreover the GPIO Pins have to be defined by CONFIG_USER1_LED ...
CONFIG_USER3_LED.
---
 common/Makefile |1 +
 common/cmd_led.c|   86 +++
 cpu/arm926ejs/at91/led.c|   79 +++
 include/asm-arm/arch-at91/led.h |   52 +++
 4 files changed, 218 insertions(+), 0 deletions(-)
 create mode 100644 common/cmd_led.c
 create mode 100644 include/asm-arm/arch-at91/led.h

diff --git a/common/Makefile b/common/Makefile
index b9f4ca7..e0f571c 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -103,6 +103,7 @@ COBJS-$(CONFIG_CMD_IMMAP) += cmd_immap.o
 COBJS-$(CONFIG_CMD_IRQ) += cmd_irq.o
 COBJS-$(CONFIG_CMD_ITEST) += cmd_itest.o
 COBJS-$(CONFIG_CMD_JFFS2) += cmd_jffs2.o
+COBJS-$(CONFIG_CMD_LED) += cmd_led.o
 COBJS-$(CONFIG_CMD_LICENSE) += cmd_license.o
 COBJS-y += cmd_load.o
 COBJS-$(CONFIG_LOGBUFFER) += cmd_log.o
diff --git a/common/cmd_led.c b/common/cmd_led.c
new file mode 100644
index 000..f914d2d
--- /dev/null
+++ b/common/cmd_led.c
@@ -0,0 +1,86 @@
+/*
+ * (C) Copyright 2008
+ * Ulf Samuelsson ulf.samuelsson at atmel.com
+ *
+ * (C) Copyright 2009
+ * Daniel Gorsulowski daniel.gorsulow...@esd.eu
+ * esd electronic system design gmbh www.esd.eu
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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 command.h
+#include asm/arch/led.h
+
+int do_led(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+{
+   int led;
+
+   /* Validate arguments */
+   if ((argc != 3)) {
+   printf(Usage:\n%s\n, cmdtp-usage);
+   return 1;
+   }
+   if (strcmp(argv[1], 1) == 0) {
+   led = (1  0);
+   } else if (strcmp(argv[1], 2) == 0) {
+   led = (1  1);
+   } else if (strcmp(argv[1], 3) == 0) {
+   led = (1  2);
+   } else if (strcmp(argv[1], all) == 0) {
+   led = 31;
+   } else {
+   printf (Usage:\n%s\n, cmdtp-usage);
+   return 1;
+   }
+
+   if (strcmp(argv[2], off) == 0) {
+#ifdef CONFIG_USER1_LED
+   if(led  1) user1_led_off();
+#endif
+#ifdef CONFIG_USER2_LED
+   if(led  2) user2_led_off();
+#endif
+#ifdef CONFIG_USER3_LED
+   if(led  4) user3_led_off();
+#endif
+   } else if (strcmp(argv[2], on) == 0) {
+#ifdef CONFIG_USER1_LED
+   if(led  1) user1_led_on();
+#endif
+#ifdef CONFIG_USER2_LED
+   if(led  2) user2_led_on();
+#endif
+#ifdef CONFIG_USER3_LED
+   if(led  4) user3_led_on();
+#endif
+   } else {
+   printf (Usage:\n%s\n, cmdtp-usage);
+   return 1;
+   }
+   return 0;
+}
+
+U_BOOT_CMD(
+   led, 3, 1, do_led,
+   [1|2|3|all] [on|off],
+   [1|2|3|all] [on|off] sets/clears led 1,2,3
+);
diff --git a/cpu/arm926ejs/at91/led.c b/cpu/arm926ejs/at91/led.c
index be68f59..46a74fe 100644
--- a/cpu/arm926ejs/at91/led.c
+++ b/cpu/arm926ejs/at91/led.c
@@ -3,6 +3,10 @@
  * Stelian Pop stelian@leadtechdesign.com
  * Lead Tech Design www.leadtechdesign.com
  *
+ * (C) Copyright 2009
+ * Daniel Gorsulowski daniel.gorsulow...@esd.eu
+ * esd electronic system design gmbh www.esd.eu
+ *
  * See file CREDITS for list of people who contributed to this
  * project.
  *
@@ -27,6 +31,81 @@
 #include asm/arch/gpio.h
 #include asm/arch/io.h
 
+#ifdef CONFIG_AT91_LED
+
+#if defined(CONFIG_AT91RM9200)
+#include asm/arch/at91rm9200.h
+#elif defined(CONFIG_AT91SAM9260) || defined(CONFIG_AT91SAM9G20)
+#include asm/arch/at91sam9260.h
+#elif defined(CONFIG_AT91SAM9261)
+#include asm/arch/at91sam9261.h
+#elif defined(CONFIG_AT91SAM9263)
+#include asm/arch/at91sam9263.h
+#elif defined(CONFIG_AT91SAM9RL)
+#include asm/arch/at91sam9rl.h
+#elif defined(CONFIG_AT91CAP9)
+#include asm/arch/at91cap9.h
+#endif
+
+#include asm/arch/led.h
+
+void at91_led_init(void)
+{
+   /* Enable clock */
+   at91_sys_write(AT91_PMC_PCER, 1

Re: [U-Boot] Bug in new at91 clock framework?

2009-04-23 Thread Daniel Gorsulowski
Jean-Christophe PLAGNIOL-VILLARD schrieb:
 On 12:15 Wed 22 Apr , Daniel Gorsulowski wrote:
 Hello Jean-Christophe,

 I'm not sure, but I think there is a bug in your new at91 clock framework.
 My board does only boot, if CONFIG_USB_ATMEL is defined. But the board does
 not have any usb-ports, so there is no need to define CONFIG_USB_ATMEL.
 The board is based on an Atmel AT91SAM9263 SoC.
 I've seen in with the one on my clock branch
 but if you use the one for the pull request normaly not
 
 I've test it on my 9263EK
 
 Best Regards,
 J.
 

I'm working on git://git.denx.de/u-boot-at91.git branch clock
I also have an AT91SAM9263-EK, but with a 16.0 MHz main oscillator.
Everything is fine, as long as no changes were made. But if I undef
CONFIG_USB_ATMEL and CONFIG_CMD_USB, the board does not boot. Only
some cryptical characters appear after the RomBOOT term. It's the
same behavior as on my own board.

If i do the same on git://git.denx.de/u-boot.git branch master,
everything works fine. (as well AT91SAM9263-EK as my board)
Do you have any advice for debugging that problem?

Best regards,
Daniel Gorsulowski
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Bug in new at91 clock framework?

2009-04-23 Thread Daniel Gorsulowski
Jean-Christophe PLAGNIOL-VILLARD schrieb:
 I'm working on git://git.denx.de/u-boot-at91.git branch clock
 I also have an AT91SAM9263-EK, but with a 16.0 MHz main oscillator.
 Everything is fine, as long as no changes were made. But if I undef
 CONFIG_USB_ATMEL and CONFIG_CMD_USB, the board does not boot. Only
 some cryptical characters appear after the RomBOOT term. It's the
 same behavior as on my own board.
 use git://git.denx.de/u-boot-at91.git branch master
 
 Best Regards,
 J.
 
Thank you, it works now. But I have to apply the attached patch.
Otherwise, I get a compiler error
cpu/arm926ejs/at91/libat91.a(clock.o): In function `at91_clock_init':
/data/home/danielg/git/u-boot-at91_new/cpu/arm926ejs/at91/clock.c:167: 
undefined reference to `at91_pll_rate'

---
 From 730db691fabf958d1b3d74e678f7f47a0776df16 Mon Sep 17 00:00:00 2001
From: Daniel Gorsulowski daniel.gorsulow...@esd.eu
Date: Thu, 23 Apr 2009 15:37:16 +0200
Subject: [PATCH] at91: fixed cpu/arm926ejs/at91/clock.c

Signed-off-by: Daniel Gorsulowski daniel.gorsulow...@esd.eu
---
  cpu/arm926ejs/at91/clock.c |2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/cpu/arm926ejs/at91/clock.c b/cpu/arm926ejs/at91/clock.c
index 31e53b3..f776f70 100644
--- a/cpu/arm926ejs/at91/clock.c
+++ b/cpu/arm926ejs/at91/clock.c
@@ -126,6 +126,7 @@ static unsigned at91_pll_calc(unsigned main_freq, unsigned 
out_freq)
  fail:
return 0;
  }
+#endif

  static u32 at91_pll_rate(u32 freq, u32 reg)
  {
@@ -141,7 +142,6 @@ static u32 at91_pll_rate(u32 freq, u32 reg)

return freq;
  }
-#endif

  int at91_clock_init(unsigned long main_clock)
  {
-- 
1.6.1


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Bug in new at91 clock framework?

2009-04-22 Thread Daniel Gorsulowski
Hello Jean-Christophe,

I'm not sure, but I think there is a bug in your new at91 clock framework.
My board does only boot, if CONFIG_USB_ATMEL is defined. But the board does
not have any usb-ports, so there is no need to define CONFIG_USB_ATMEL.
The board is based on an Atmel AT91SAM9263 SoC.

Is that possible, or do i have to fix my lowlevel_init?

Best Regards,
Daniel Gorsulowski
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 2/2] at91: Add support for MEESC board of esd gmbh

2009-04-07 Thread Daniel Gorsulowski
This patch adds support for MEESC board of esd gmbh.
The MEESC is based on an Atmel AT91SAM9263 SoC.

Signed-off-by: Daniel Gorsulowski daniel.gorsulow...@esd.eu
---
 MAINTAINERS   |4 +
 MAKEALL   |1 +
 Makefile  |3 +
 board/esd/meesc/Makefile  |   54 
 board/esd/meesc/config.mk |1 +
 board/esd/meesc/meesc.c   |  300 +
 board/esd/meesc/meesc.h   |   32 +
 include/configs/meesc.h   |  191 
 8 files changed, 586 insertions(+), 0 deletions(-)
 create mode 100644 board/esd/meesc/Makefile
 create mode 100644 board/esd/meesc/config.mk
 create mode 100644 board/esd/meesc/meesc.c
 create mode 100644 board/esd/meesc/meesc.h
 create mode 100644 include/configs/meesc.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 03d59b9..b5ec88b 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -525,6 +525,10 @@ Peter Figuli pep...@etc.sk
 
wepep250xscale
 
+Daniel Gorsulowski daniel.gorsulow...@esd.eu
+
+   meesc   ARM926EJS (AT91SAM9263 SoC)
+
 Marius Gröger m...@sysgo.de
 
impa7   ARM720T (EP7211)
diff --git a/MAKEALL b/MAKEALL
index e4eb42b..20bde48 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -580,6 +580,7 @@ LIST_at91= \
cmc_pu2 \
csb637  \
kb9202  \
+   meesc   \
mp2usb  \
m501sk  \
 
diff --git a/Makefile b/Makefile
index 49b83c0..f78dd25 100644
--- a/Makefile
+++ b/Makefile
@@ -2747,6 +2747,9 @@ at91sam9rlek_config   :   unconfig
fi;
@$(MKCONFIG) -a at91sam9rlek arm arm926ejs at91sam9rlek atmel at91
 
+meesc_config   :   unconfig
+   @$(MKCONFIG) $(@:_config=) arm arm926ejs meesc esd at91
+
 
 ## ARM Integrator boards - see doc/README-integrator for more info.
 integratorap_config\
diff --git a/board/esd/meesc/Makefile b/board/esd/meesc/Makefile
new file mode 100644
index 000..b7f60fa
--- /dev/null
+++ b/board/esd/meesc/Makefile
@@ -0,0 +1,54 @@
+#
+# (C) Copyright 2003-2008
+# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+#
+# (C) Copyright 2008
+# Stelian Pop stelian@leadtechdesign.com
+# Lead Tech Design www.leadtechdesign.com
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# 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 $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).a
+
+COBJS-y+= $(BOARD).o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS-y))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(obj).depend $(OBJS) $(SOBJS)
+   $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
+
+clean:
+   rm -f $(SOBJS) $(OBJS)
+
+distclean: clean
+   rm -f $(LIB) core *.bak $(obj).depend
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/esd/meesc/config.mk b/board/esd/meesc/config.mk
new file mode 100644
index 000..9ce161e
--- /dev/null
+++ b/board/esd/meesc/config.mk
@@ -0,0 +1 @@
+TEXT_BASE = 0x21f0
diff --git a/board/esd/meesc/meesc.c b/board/esd/meesc/meesc.c
new file mode 100644
index 000..390d52f
--- /dev/null
+++ b/board/esd/meesc/meesc.c
@@ -0,0 +1,300 @@
+/*
+ * (C) Copyright 2007-2008
+ * Stelian Pop stelian@leadtechdesign.com
+ * Lead Tech Design www.leadtechdesign.com
+ *
+ * (C) Copyright 2009
+ * Daniel Gorsulowski daniel.gorsulow...@esd.eu
+ * esd electronic system design gmbh www.esd.eu
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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

[U-Boot] [PATCH 1/2] at91: Add command to control up to 5 user-leds from the console

2009-04-07 Thread Daniel Gorsulowski
This patch bases on patch of Ulf Samuelsson
([PATCH 1/1] ARM: Add command to control coloured led from the console,
Wed Jan 7 21:09:55 CET 2009)
It allows any board implementing the user LED API
to control the LEDs from the console.

led [ 1 | 2 | 3 | 4 | 5 | all ]  [ on | off ]

Adding configuration item CONFIG_CMD_LED enables the command.
The items CONFIG_LED1...5 configure the associated gpio-pins.

Signed-off-by: Daniel Gorsulowski daniel.gorsulow...@esd.eu
---
 common/Makefile   |1 +
 common/cmd_led.c  |  105 +
 cpu/arm926ejs/at91/Makefile   |1 +
 cpu/arm926ejs/at91/user_led.c |  102 +++
 include/user_led.h|   60 +++
 5 files changed, 269 insertions(+), 0 deletions(-)
 create mode 100644 common/cmd_led.c
 create mode 100644 cpu/arm926ejs/at91/user_led.c
 create mode 100644 include/user_led.h

diff --git a/common/Makefile b/common/Makefile
index b9f4ca7..e0f571c 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -103,6 +103,7 @@ COBJS-$(CONFIG_CMD_IMMAP) += cmd_immap.o
 COBJS-$(CONFIG_CMD_IRQ) += cmd_irq.o
 COBJS-$(CONFIG_CMD_ITEST) += cmd_itest.o
 COBJS-$(CONFIG_CMD_JFFS2) += cmd_jffs2.o
+COBJS-$(CONFIG_CMD_LED) += cmd_led.o
 COBJS-$(CONFIG_CMD_LICENSE) += cmd_license.o
 COBJS-y += cmd_load.o
 COBJS-$(CONFIG_LOGBUFFER) += cmd_log.o
diff --git a/common/cmd_led.c b/common/cmd_led.c
new file mode 100644
index 000..248f3a9
--- /dev/null
+++ b/common/cmd_led.c
@@ -0,0 +1,105 @@
+/*
+ * (C) Copyright 2008
+ * Ulf Samuelsson ulf.samuelsson at atmel.com
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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
+ */
+
+/*
+ * This file provides a shell like 'test' function to return
+ * true/false from an integer or string compare of two memory
+ * locations or a location and a scalar/literal.
+ * A few parts were lifted from bash 'test' command
+ */
+
+#include common.h
+#include config.h
+#include command.h
+#include user_led.h
+
+int do_led (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+{
+   int led;
+
+   /* Validate arguments */
+   if ((argc != 3)) {
+   printf(Usage:\n%s\n, cmdtp-usage);
+   return 1;
+   }
+   if (strcmp(argv[1], 1) == 0) {
+   led = (1  0);
+   } else if (strcmp(argv[1], 2) == 0) {
+   led = (1  1);
+   } else if (strcmp(argv[1], 3) == 0) {
+   led = (1  2);
+   } else if (strcmp(argv[1], 4) == 0) {
+   led = (1  3);
+   } else if (strcmp(argv[1], 5) == 0) {
+   led = (1  4);
+   } else if (strcmp(argv[1], all) == 0) {
+   led = 31;
+   } else {
+   printf (Usage:\n%s\n, cmdtp-usage);
+   return 1;
+   }
+
+   if (strcmp(argv[2], off) == 0) {
+#ifdef CONFIG_LED1
+   if(led  1) user_LED1_off();
+#endif
+#ifdef CONFIG_LED2
+   if(led  2) user_LED2_off();
+#endif
+#ifdef CONFIG_LED3
+   if(led  4) user_LED3_off();
+#endif
+#ifdef CONFIG_LED4
+   if(led  8) user_LED4_off();
+#endif
+#ifdef CONFIG_LED5
+   if(led  16) user_LED5_off();
+#endif
+   } else if (strcmp(argv[2], on) == 0) {
+#ifdef CONFIG_LED1
+   if(led  1) user_LED1_on();
+#endif
+#ifdef CONFIG_LED2
+   if(led  2) user_LED2_on();
+#endif
+#ifdef CONFIG_LED3
+   if(led  4) user_LED3_on();
+#endif
+#ifdef CONFIG_LED4
+   if(led  8) user_LED4_on();
+#endif
+#ifdef CONFIG_LED5
+   if(led  16) user_LED5_on();
+#endif
+   } else {
+   printf (Usage:\n%s\n, cmdtp-usage);
+   return 1;
+   }
+   return 0;
+}
+
+U_BOOT_CMD(
+   led, 3, 1, do_led,
+   [1|2|3|4|5|all] [on|off],
+   [1|2|3|4|5|all] [on|off] sets/clears led 1,2,3,4,5
+);
diff --git a/cpu/arm926ejs/at91/Makefile b/cpu/arm926ejs/at91/Makefile
index 34e7461..f404cf1 100644
--- a/cpu/arm926ejs/at91/Makefile
+++ b/cpu/arm926ejs/at91/Makefile
@@ -55,6 +55,7 @@ COBJS-y   += at91sam9rl_serial.o
 COBJS-$(CONFIG_HAS_DATAFLASH)  += at91sam9rl_spi.o
 endif
 COBJS-$(CONFIG_AT91_LED)   += led.o
+COBJS-$(CONFIG_USER_LED

Re: [U-Boot] [PATCH 2/2] at91: Add support for esd MEESC board

2009-04-06 Thread Daniel Gorsulowski
Hi Jean-Christophe,

Jean-Christophe PLAGNIOL-VILLARD wrote:
 On 10:24 Fri 27 Mar , Daniel Gorsulowski wrote:
 This patch adds support for MEESC board from esd gmbh.
 The MEESC is based on an Atmel AT91SAM9263 SoC.

 Signed-off-by: Daniel Gorsulowski daniel.gorsulow...@esd.eu
 ---
 please rebase your patch against
 
 git://git.denx.de/u-boot-at91.git branch clock
 
 Best Regards,
 J.

sorry, but my board does not boot by this branch.
Followed by the bootstrapper-RomBOOT-prompt just some cryptical characters
appear. Seems like the cpu clock is not initialized correctly.
The board uses an 16.0 Mhz crystal.
I configured as followed:

/* ARM asynchronous clock */
#define AT91_CPU_NAME   AT91SAM9263
#define AT91_MAIN_CLOCK 1600/* 16.0 MHz crystal */
#define CONFIG_SYS_HZ   1000/* decrementer freq */

#define CONFIG_MEESC1   /* Board is esd MEESC */
#define CONFIG_ARM926EJS1   /* This is an ARM926EJS Core */
#define CONFIG_AT91SAM9263  1   /* It's an AT91SAM9263 SoC*/
#define CONFIG_ARCH_CPU_INIT1
...


If I build from git://git.denx.de/u-boot.git branch master after applying
my patches, the board boots up correctly.

Best Regards,
Daniel
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/2] at91: Improved Atmel AT45DB081 dataflash support

2009-03-27 Thread Daniel Gorsulowski
This patch improves Atmel AT45DB081 dataflash support.

Signed-off-by: Daniel Gorsulowski daniel.gorsulow...@esd.eu
---
 drivers/mtd/dataflash.c |7 ---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/dataflash.c b/drivers/mtd/dataflash.c
index 96cd395..4b768e7 100644
--- a/drivers/mtd/dataflash.c
+++ b/drivers/mtd/dataflash.c
@@ -199,7 +199,7 @@ void dataflash_print_info (void)
 
for (i = 0; i  CONFIG_SYS_MAX_DATAFLASH_BANKS; i++) {
if (dataflash_info[i].id != 0) {
-   printf(DataFlash:);
+   printf(DataFlash: );
switch (dataflash_info[i].id) {
case AT45DB021:
printf(AT45DB021\n);
@@ -207,11 +207,12 @@ void dataflash_print_info (void)
case AT45DB161:
printf(AT45DB161\n);
break;
-
+   case AT45DB081:
+   printf(AT45DB081\n);
+   break;
case AT45DB321:
printf(AT45DB321\n);
break;
-
case AT45DB642:
printf(AT45DB642\n);
break;
-- 
1.6.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


  1   2   >