public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 00/12] ARM: rpi_b: many minor enhancements
@ 2012-07-04  2:02 Stephen Warren
  2012-07-04  2:02 ` [U-Boot] [PATCH 01/12] ARM: arm1176: enable instruction cache in arch_cpu_init() Stephen Warren
                   ` (11 more replies)
  0 siblings, 12 replies; 16+ messages in thread
From: Stephen Warren @ 2012-07-04  2:02 UTC (permalink / raw)
  To: u-boot

This is a slew of various small patches I've accumulated for the Raspberry
Pi. They assume that the following have already been applied:

2230151 ARM: bcm2835: add Raspberry Pi model B board
3a43ab2 ARM: add basic support for the Broadcom BCM2835 SoC

Stephen Warren (12):
  ARM: arm1176: enable instruction cache in arch_cpu_init()
  ARM: rpi_b: enable CONFIG_ARCH_CPU_INIT for icache
  ARM: rpi_b: define CONFIG_MACH_TYPE
  ARM: rpi_b: include config_cmd_default.h
  ARM: rpi_b: enable CONFIG_OF_LIBFDT
  ARM: rpi_b: set bi_boot_params
  ARM: rpi_b: add ATAG support for bootm/bootz
  ARM: rpi_b: drop RAM size to 128M
  ARM: rpi_b: move stack to top of RAM
  ARM: rpi_b: re-order rpi_b.h to keep related defines adjacent
  ARM: bcm2835: implement reset using watchdog
  ARM: rpi_b: enabled bootz command

 arch/arm/cpu/arm1176/bcm2835/reset.c     |   18 +++++++++++----
 arch/arm/cpu/arm1176/cpu.c               |    7 ++++++
 arch/arm/include/asm/arch-bcm2835/wdog.h |   37 ++++++++++++++++++++++++++++++
 board/raspberrypi/rpi_b/rpi_b.c          |    4 +++-
 include/configs/rpi_b.h                  |   34 +++++++++++++++++++++++----
 5 files changed, 89 insertions(+), 11 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-bcm2835/wdog.h

-- 
1.7.9.5

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [U-Boot] [PATCH 01/12] ARM: arm1176: enable instruction cache in arch_cpu_init()
  2012-07-04  2:02 [U-Boot] [PATCH 00/12] ARM: rpi_b: many minor enhancements Stephen Warren
@ 2012-07-04  2:02 ` Stephen Warren
  2012-07-04  2:02 ` [U-Boot] [PATCH 02/12] ARM: rpi_b: enable CONFIG_ARCH_CPU_INIT for icache Stephen Warren
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 16+ messages in thread
From: Stephen Warren @ 2012-07-04  2:02 UTC (permalink / raw)
  To: u-boot

Note that this affects all users of the ARM1176 CPU that enable
CONFIG_ARCH_CPU_INIT, not just the BCM2835 SoC, potentially such as
tnetv107x.

Cc: Cyril Chemparathy <cyril@ti.com>
Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
---
 arch/arm/cpu/arm1176/cpu.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm/cpu/arm1176/cpu.c b/arch/arm/cpu/arm1176/cpu.c
index c0fd114..532a90b 100644
--- a/arch/arm/cpu/arm1176/cpu.c
+++ b/arch/arm/cpu/arm1176/cpu.c
@@ -65,3 +65,10 @@ static void cache_flush (void)
 	/* mem barrier to sync things */
 	asm ("mcr p15, 0, %0, c7, c10, 4": :"r" (0));
 }
+
+int arch_cpu_init(void)
+{
+	icache_enable();
+
+	return 0;
+}
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [U-Boot] [PATCH 02/12] ARM: rpi_b: enable CONFIG_ARCH_CPU_INIT for icache
  2012-07-04  2:02 [U-Boot] [PATCH 00/12] ARM: rpi_b: many minor enhancements Stephen Warren
  2012-07-04  2:02 ` [U-Boot] [PATCH 01/12] ARM: arm1176: enable instruction cache in arch_cpu_init() Stephen Warren
@ 2012-07-04  2:02 ` Stephen Warren
  2012-07-04  2:02 ` [U-Boot] [PATCH 03/12] ARM: rpi_b: define CONFIG_MACH_TYPE Stephen Warren
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 16+ messages in thread
From: Stephen Warren @ 2012-07-04  2:02 UTC (permalink / raw)
  To: u-boot

This causes arch_cpu_init() to be called, which enables the icache.

Extracted from work by Oleksandr Tymoshenko <gonzo@bluezbox.com>.

Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
---
 include/configs/rpi_b.h |    1 +
 1 file changed, 1 insertion(+)

diff --git a/include/configs/rpi_b.h b/include/configs/rpi_b.h
index f547027..8bdd014 100644
--- a/include/configs/rpi_b.h
+++ b/include/configs/rpi_b.h
@@ -22,6 +22,7 @@
 /* Architecture, CPU, etc.*/
 #define CONFIG_ARM1176
 #define CONFIG_BCM2835
+#define CONFIG_ARCH_CPU_INIT
 
 /* Timer */
 #define CONFIG_SYS_HZ			1000000
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [U-Boot] [PATCH 03/12] ARM: rpi_b: define CONFIG_MACH_TYPE
  2012-07-04  2:02 [U-Boot] [PATCH 00/12] ARM: rpi_b: many minor enhancements Stephen Warren
  2012-07-04  2:02 ` [U-Boot] [PATCH 01/12] ARM: arm1176: enable instruction cache in arch_cpu_init() Stephen Warren
  2012-07-04  2:02 ` [U-Boot] [PATCH 02/12] ARM: rpi_b: enable CONFIG_ARCH_CPU_INIT for icache Stephen Warren
@ 2012-07-04  2:02 ` Stephen Warren
  2012-07-04  2:02 ` [U-Boot] [PATCH 04/12] ARM: rpi_b: include config_cmd_default.h Stephen Warren
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 16+ messages in thread
From: Stephen Warren @ 2012-07-04  2:02 UTC (permalink / raw)
  To: u-boot

Use MACH_TYPE_BCM2708 as the Linux machine type for the Raspberry Pi.

The Raspberry Pi actually uses a BCM2835. However, the 2835 this is
apparently a SKU in a series for which the BCM2708 is the first or perhaps
primary version, such that the 2708 name has historically been used for
this purpose.

Extracted from work by Oleksandr Tymoshenko <gonzo@bluezbox.com>.

Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
---
 include/configs/rpi_b.h |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/configs/rpi_b.h b/include/configs/rpi_b.h
index 8bdd014..a8883d3 100644
--- a/include/configs/rpi_b.h
+++ b/include/configs/rpi_b.h
@@ -23,6 +23,11 @@
 #define CONFIG_ARM1176
 #define CONFIG_BCM2835
 #define CONFIG_ARCH_CPU_INIT
+/*
+ * 2835 is a SKU in a series for which the 2708 is the first or primary SoC,
+ * so 2708 has historically been used rather than a dedicated 2835 ID.
+ */
+#define CONFIG_MACH_TYPE		MACH_TYPE_BCM2708
 
 /* Timer */
 #define CONFIG_SYS_HZ			1000000
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [U-Boot] [PATCH 04/12] ARM: rpi_b: include config_cmd_default.h
  2012-07-04  2:02 [U-Boot] [PATCH 00/12] ARM: rpi_b: many minor enhancements Stephen Warren
                   ` (2 preceding siblings ...)
  2012-07-04  2:02 ` [U-Boot] [PATCH 03/12] ARM: rpi_b: define CONFIG_MACH_TYPE Stephen Warren
@ 2012-07-04  2:02 ` Stephen Warren
  2012-07-09 12:21   ` Tom Rini
  2012-07-04  2:02 ` [U-Boot] [PATCH 05/12] ARM: rpi_b: enable CONFIG_OF_LIBFDT Stephen Warren
                   ` (7 subsequent siblings)
  11 siblings, 1 reply; 16+ messages in thread
From: Stephen Warren @ 2012-07-04  2:02 UTC (permalink / raw)
  To: u-boot

This enables a more typical default set of commands. Remove explicit
enables for commands already in the default list.

Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
---
 include/configs/rpi_b.h |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/include/configs/rpi_b.h b/include/configs/rpi_b.h
index a8883d3..9268efb 100644
--- a/include/configs/rpi_b.h
+++ b/include/configs/rpi_b.h
@@ -80,7 +80,11 @@
 #define CONFIG_AUTO_COMPLETE
 
 /* Commands */
-#define CONFIG_CMD_MEMORY
-#define CONFIG_CMD_MISC
+#include "config_cmd_default.h"
+/* Some things don't make sense on this HW or yet */
+#undef CONFIG_CMD_FPGA
+#undef CONFIG_CMD_NET
+#undef CONFIG_CMD_NFS
+#undef CONFIG_CMD_SAVEENV
 
 #endif
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [U-Boot] [PATCH 05/12] ARM: rpi_b: enable CONFIG_OF_LIBFDT
  2012-07-04  2:02 [U-Boot] [PATCH 00/12] ARM: rpi_b: many minor enhancements Stephen Warren
                   ` (3 preceding siblings ...)
  2012-07-04  2:02 ` [U-Boot] [PATCH 04/12] ARM: rpi_b: include config_cmd_default.h Stephen Warren
@ 2012-07-04  2:02 ` Stephen Warren
  2012-07-09 12:24   ` Tom Rini
  2012-07-04  2:02 ` [U-Boot] [PATCH 06/12] ARM: rpi_b: set bi_boot_params Stephen Warren
                   ` (6 subsequent siblings)
  11 siblings, 1 reply; 16+ messages in thread
From: Stephen Warren @ 2012-07-04  2:02 UTC (permalink / raw)
  To: u-boot

This allows bootm/bootz to pass a device tree to the kernel.

Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
---
 include/configs/rpi_b.h |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/configs/rpi_b.h b/include/configs/rpi_b.h
index 9268efb..52379b9 100644
--- a/include/configs/rpi_b.h
+++ b/include/configs/rpi_b.h
@@ -87,4 +87,7 @@
 #undef CONFIG_CMD_NFS
 #undef CONFIG_CMD_SAVEENV
 
+/* Device tree support for bootm/bootz */
+#define CONFIG_OF_LIBFDT
+
 #endif
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [U-Boot] [PATCH 06/12] ARM: rpi_b: set bi_boot_params
  2012-07-04  2:02 [U-Boot] [PATCH 00/12] ARM: rpi_b: many minor enhancements Stephen Warren
                   ` (4 preceding siblings ...)
  2012-07-04  2:02 ` [U-Boot] [PATCH 05/12] ARM: rpi_b: enable CONFIG_OF_LIBFDT Stephen Warren
@ 2012-07-04  2:02 ` Stephen Warren
  2012-07-04  2:02 ` [U-Boot] [PATCH 07/12] ARM: rpi_b: add ATAG support for bootm/bootz Stephen Warren
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 16+ messages in thread
From: Stephen Warren @ 2012-07-04  2:02 UTC (permalink / raw)
  To: u-boot

This defines where ATAGs will be written to when booting a Linux kernel.

Extracted from work by Oleksandr Tymoshenko <gonzo@bluezbox.com>.

Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
---
 board/raspberrypi/rpi_b/rpi_b.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/board/raspberrypi/rpi_b/rpi_b.c b/board/raspberrypi/rpi_b/rpi_b.c
index f39440f..26df74b 100644
--- a/board/raspberrypi/rpi_b/rpi_b.c
+++ b/board/raspberrypi/rpi_b/rpi_b.c
@@ -28,5 +28,7 @@ int dram_init(void)
 
 int board_init(void)
 {
+	gd->bd->bi_boot_params = 0x100;
+
 	return 0;
 }
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [U-Boot] [PATCH 07/12] ARM: rpi_b: add ATAG support for bootm/bootz
  2012-07-04  2:02 [U-Boot] [PATCH 00/12] ARM: rpi_b: many minor enhancements Stephen Warren
                   ` (5 preceding siblings ...)
  2012-07-04  2:02 ` [U-Boot] [PATCH 06/12] ARM: rpi_b: set bi_boot_params Stephen Warren
@ 2012-07-04  2:02 ` Stephen Warren
  2012-07-04  2:02 ` [U-Boot] [PATCH 08/12] ARM: rpi_b: drop RAM size to 128M Stephen Warren
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 16+ messages in thread
From: Stephen Warren @ 2012-07-04  2:02 UTC (permalink / raw)
  To: u-boot

Newer kernels use device tree, so this isn't that useful. However, old
kernels all use board files, so this might still see some use.

Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
---
 include/configs/rpi_b.h |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/configs/rpi_b.h b/include/configs/rpi_b.h
index 52379b9..b9595f9 100644
--- a/include/configs/rpi_b.h
+++ b/include/configs/rpi_b.h
@@ -89,5 +89,9 @@
 
 /* Device tree support for bootm/bootz */
 #define CONFIG_OF_LIBFDT
+/* ATAGs support for bootm/bootz */
+#define CONFIG_SETUP_MEMORY_TAGS
+#define CONFIG_CMDLINE_TAG
+#define CONFIG_INITRD_TAG
 
 #endif
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [U-Boot] [PATCH 08/12] ARM: rpi_b: drop RAM size to 128M
  2012-07-04  2:02 [U-Boot] [PATCH 00/12] ARM: rpi_b: many minor enhancements Stephen Warren
                   ` (6 preceding siblings ...)
  2012-07-04  2:02 ` [U-Boot] [PATCH 07/12] ARM: rpi_b: add ATAG support for bootm/bootz Stephen Warren
@ 2012-07-04  2:02 ` Stephen Warren
       [not found]   ` <930F248225E0FA44A2AE486086E959AEA56E33@SJEXCHMB06.corp.ad.broadcom.com>
  2012-07-04  2:02 ` [U-Boot] [PATCH 09/12] ARM: rpi_b: move stack to top of RAM Stephen Warren
                   ` (3 subsequent siblings)
  11 siblings, 1 reply; 16+ messages in thread
From: Stephen Warren @ 2012-07-04  2:02 UTC (permalink / raw)
  To: u-boot

The board really has 256M. However, the VC (VideoCore co-processor) shares
the RAM, and uses a configurable portion at the top. We tell U-Boot that a
smaller amount of RAM is present in order to avoid stomping on the area
the VC uses.

Extracted from work by Oleksandr Tymoshenko <gonzo@bluezbox.com>.

Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
---
 board/raspberrypi/rpi_b/rpi_b.c |    2 +-
 include/configs/rpi_b.h         |    7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/board/raspberrypi/rpi_b/rpi_b.c b/board/raspberrypi/rpi_b/rpi_b.c
index 26df74b..688b0aa 100644
--- a/board/raspberrypi/rpi_b/rpi_b.c
+++ b/board/raspberrypi/rpi_b/rpi_b.c
@@ -21,7 +21,7 @@ DECLARE_GLOBAL_DATA_PTR;
 
 int dram_init(void)
 {
-	gd->ram_size = SZ_256M;
+	gd->ram_size = CONFIG_SYS_SDRAM_SIZE;
 
 	return 0;
 }
diff --git a/include/configs/rpi_b.h b/include/configs/rpi_b.h
index b9595f9..9f74731 100644
--- a/include/configs/rpi_b.h
+++ b/include/configs/rpi_b.h
@@ -36,6 +36,13 @@
 #define CONFIG_NR_DRAM_BANKS		1
 #define CONFIG_SYS_TEXT_BASE		0x00008000
 #define CONFIG_SYS_SDRAM_BASE		0x00000000
+/*
+ * The board really has 256M. However, the VC (VideoCore co-processor) shares
+ * the RAM, and uses a configurable portion at the top. We tell U-Boot that a
+ * smaller amount of RAM is present in order to avoid stomping on the area
+ * the VC uses.
+ */
+#define CONFIG_SYS_SDRAM_SIZE		SZ_128M
 #define CONFIG_SYS_UBOOT_BASE		CONFIG_SYS_TEXT_BASE
 #define CONFIG_SYS_INIT_RAM_SIZE	SZ_4K
 #define CONFIG_SYS_INIT_SP_ADDR		(CONFIG_SYS_SDRAM_BASE + \
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [U-Boot] [PATCH 09/12] ARM: rpi_b: move stack to top of RAM
  2012-07-04  2:02 [U-Boot] [PATCH 00/12] ARM: rpi_b: many minor enhancements Stephen Warren
                   ` (7 preceding siblings ...)
  2012-07-04  2:02 ` [U-Boot] [PATCH 08/12] ARM: rpi_b: drop RAM size to 128M Stephen Warren
@ 2012-07-04  2:02 ` Stephen Warren
  2012-07-04  2:02 ` [U-Boot] [PATCH 10/12] ARM: rpi_b: re-order rpi_b.h to keep related defines adjacent Stephen Warren
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 16+ messages in thread
From: Stephen Warren @ 2012-07-04  2:02 UTC (permalink / raw)
  To: u-boot

Move the top-of-stack from 32k to near the top of RAM. This leaves the
bottom of RAM free for ATAGs, or U-Boot scripts to use as they see fit.

Extracted from work by Oleksandr Tymoshenko <gonzo@bluezbox.com>.

Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
---
 include/configs/rpi_b.h |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/include/configs/rpi_b.h b/include/configs/rpi_b.h
index 9f74731..93dd701 100644
--- a/include/configs/rpi_b.h
+++ b/include/configs/rpi_b.h
@@ -44,9 +44,8 @@
  */
 #define CONFIG_SYS_SDRAM_SIZE		SZ_128M
 #define CONFIG_SYS_UBOOT_BASE		CONFIG_SYS_TEXT_BASE
-#define CONFIG_SYS_INIT_RAM_SIZE	SZ_4K
 #define CONFIG_SYS_INIT_SP_ADDR		(CONFIG_SYS_SDRAM_BASE + \
-					 CONFIG_SYS_INIT_RAM_SIZE - \
+					 CONFIG_SYS_SDRAM_SIZE - \
 					 GENERATED_GBL_DATA_SIZE)
 #define CONFIG_SYS_MALLOC_LEN		SZ_4M
 #define CONFIG_SYS_MEMTEST_START	0x00100000
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [U-Boot] [PATCH 10/12] ARM: rpi_b: re-order rpi_b.h to keep related defines adjacent
  2012-07-04  2:02 [U-Boot] [PATCH 00/12] ARM: rpi_b: many minor enhancements Stephen Warren
                   ` (8 preceding siblings ...)
  2012-07-04  2:02 ` [U-Boot] [PATCH 09/12] ARM: rpi_b: move stack to top of RAM Stephen Warren
@ 2012-07-04  2:02 ` Stephen Warren
  2012-07-04  2:02 ` [U-Boot] [PATCH 11/12] ARM: bcm2835: implement reset using watchdog Stephen Warren
  2012-07-04  2:02 ` [U-Boot] [PATCH 12/12] ARM: rpi_b: enabled bootz command Stephen Warren
  11 siblings, 0 replies; 16+ messages in thread
From: Stephen Warren @ 2012-07-04  2:02 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
---
 include/configs/rpi_b.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/configs/rpi_b.h b/include/configs/rpi_b.h
index 93dd701..edffda2 100644
--- a/include/configs/rpi_b.h
+++ b/include/configs/rpi_b.h
@@ -35,6 +35,7 @@
 /* Memory layout */
 #define CONFIG_NR_DRAM_BANKS		1
 #define CONFIG_SYS_TEXT_BASE		0x00008000
+#define CONFIG_SYS_UBOOT_BASE		CONFIG_SYS_TEXT_BASE
 #define CONFIG_SYS_SDRAM_BASE		0x00000000
 /*
  * The board really has 256M. However, the VC (VideoCore co-processor) shares
@@ -43,7 +44,6 @@
  * the VC uses.
  */
 #define CONFIG_SYS_SDRAM_SIZE		SZ_128M
-#define CONFIG_SYS_UBOOT_BASE		CONFIG_SYS_TEXT_BASE
 #define CONFIG_SYS_INIT_SP_ADDR		(CONFIG_SYS_SDRAM_BASE + \
 					 CONFIG_SYS_SDRAM_SIZE - \
 					 GENERATED_GBL_DATA_SIZE)
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [U-Boot] [PATCH 11/12] ARM: bcm2835: implement reset using watchdog
  2012-07-04  2:02 [U-Boot] [PATCH 00/12] ARM: rpi_b: many minor enhancements Stephen Warren
                   ` (9 preceding siblings ...)
  2012-07-04  2:02 ` [U-Boot] [PATCH 10/12] ARM: rpi_b: re-order rpi_b.h to keep related defines adjacent Stephen Warren
@ 2012-07-04  2:02 ` Stephen Warren
  2012-07-04  2:02 ` [U-Boot] [PATCH 12/12] ARM: rpi_b: enabled bootz command Stephen Warren
  11 siblings, 0 replies; 16+ messages in thread
From: Stephen Warren @ 2012-07-04  2:02 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
---
 arch/arm/cpu/arm1176/bcm2835/reset.c     |   18 +++++++++++----
 arch/arm/include/asm/arch-bcm2835/wdog.h |   37 ++++++++++++++++++++++++++++++
 2 files changed, 50 insertions(+), 5 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-bcm2835/wdog.h

diff --git a/arch/arm/cpu/arm1176/bcm2835/reset.c b/arch/arm/cpu/arm1176/bcm2835/reset.c
index 69c9577..8c37ad9 100644
--- a/arch/arm/cpu/arm1176/bcm2835/reset.c
+++ b/arch/arm/cpu/arm1176/bcm2835/reset.c
@@ -16,12 +16,20 @@
 
 #include <common.h>
 #include <asm/io.h>
+#include <asm/arch/wdog.h>
+
+#define RESET_TIMEOUT 10
 
 void reset_cpu(ulong addr)
 {
-	/*
-	 * We should probably use the WDT module here, but an unaligned
-	 * access will do the trick for now.
-	 */
-	readl(1);
+	struct bcm2835_wdog_regs *regs =
+		(struct bcm2835_wdog_regs *)BCM2835_WDOG_PHYSADDR;
+	uint32_t rstc;
+
+	rstc = readl(&regs->rstc);
+	rstc &= ~BCM2835_WDOG_RSTC_WRCFG_MASK;
+	rstc |= BCM2835_WDOG_RSTC_WRCFG_FULL_RESET;
+
+	writel(BCM2835_WDOG_PASSWORD | RESET_TIMEOUT, &regs->wdog);
+	writel(BCM2835_WDOG_PASSWORD | rstc, &regs->rstc);
 }
diff --git a/arch/arm/include/asm/arch-bcm2835/wdog.h b/arch/arm/include/asm/arch-bcm2835/wdog.h
new file mode 100644
index 0000000..d750a62
--- /dev/null
+++ b/arch/arm/include/asm/arch-bcm2835/wdog.h
@@ -0,0 +1,37 @@
+/*
+ * (C) Copyright 2012 Stephen Warren
+ *
+ * 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
+ * version 2 as published by the Free Software Foundation.
+ *
+ * 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.
+ */
+
+#ifndef _BCM2835_TIMER_H
+#define _BCM2835_TIMER_H
+
+#define BCM2835_WDOG_PHYSADDR			0x20100000
+
+struct bcm2835_wdog_regs {
+	u32 unknown0[7];
+	u32 rstc;
+	u32 unknown1;
+	u32 wdog;
+};
+
+#define BCM2835_WDOG_PASSWORD			0x5a000000
+
+#define BCM2835_WDOG_RSTC_WRCFG_MASK		0x00000030
+#define BCM2835_WDOG_RSTC_WRCFG_FULL_RESET	0x00000020
+
+#define BCM2835_WDOG_WDOG_TIMEOUT_MASK		0x0000ffff
+
+#endif
+
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [U-Boot] [PATCH 12/12] ARM: rpi_b: enabled bootz command
  2012-07-04  2:02 [U-Boot] [PATCH 00/12] ARM: rpi_b: many minor enhancements Stephen Warren
                   ` (10 preceding siblings ...)
  2012-07-04  2:02 ` [U-Boot] [PATCH 11/12] ARM: bcm2835: implement reset using watchdog Stephen Warren
@ 2012-07-04  2:02 ` Stephen Warren
  11 siblings, 0 replies; 16+ messages in thread
From: Stephen Warren @ 2012-07-04  2:02 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
---
 include/configs/rpi_b.h |    1 +
 1 file changed, 1 insertion(+)

diff --git a/include/configs/rpi_b.h b/include/configs/rpi_b.h
index edffda2..ee4887f 100644
--- a/include/configs/rpi_b.h
+++ b/include/configs/rpi_b.h
@@ -87,6 +87,7 @@
 
 /* Commands */
 #include "config_cmd_default.h"
+#define CONFIG_CMD_BOOTZ
 /* Some things don't make sense on this HW or yet */
 #undef CONFIG_CMD_FPGA
 #undef CONFIG_CMD_NET
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [U-Boot] [PATCH 08/12] ARM: rpi_b: drop RAM size to 128M
       [not found]   ` <930F248225E0FA44A2AE486086E959AEA56E33@SJEXCHMB06.corp.ad.broadcom.com>
@ 2012-07-04  2:27     ` Stephen Warren
  0 siblings, 0 replies; 16+ messages in thread
From: Stephen Warren @ 2012-07-04  2:27 UTC (permalink / raw)
  To: u-boot

On 07/03/2012 08:09 PM, Naren (Narendra) Sankar wrote:
> This should not be hard-coded.
> 
> The current board has 256MB but still allows the VC to use different RAM configuration splits. So the u-boot/Linux partition can get more than 128MB.

While that's true, I believe there's currently no runtime API available
to retrieve the memory split information. When such an API is available,
we can remove the hard-coded limit and use the API instead.

Such an API has been requested; see:
https://github.com/raspberrypi/firmware/issues/47

> And it is possible to support up to 1GB of DRAM on this platform.

The hard-coding is in a location specific to the Raspberry-Pi model B.
So, it doesn't impose any restrictions on any other boards using the
same SoC. While the BCM2835 SoC may allow more memory, the RPi B
specifically only supports exactly 256MB.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [U-Boot] [PATCH 04/12] ARM: rpi_b: include config_cmd_default.h
  2012-07-04  2:02 ` [U-Boot] [PATCH 04/12] ARM: rpi_b: include config_cmd_default.h Stephen Warren
@ 2012-07-09 12:21   ` Tom Rini
  0 siblings, 0 replies; 16+ messages in thread
From: Tom Rini @ 2012-07-09 12:21 UTC (permalink / raw)
  To: u-boot

On Tue, Jul 03, 2012 at 08:02:47PM -0600, Stephen Warren wrote:

> This enables a more typical default set of commands. Remove explicit
> enables for commands already in the default list.
> 
> Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
> ---
>  include/configs/rpi_b.h |    8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/include/configs/rpi_b.h b/include/configs/rpi_b.h
> index a8883d3..9268efb 100644
> --- a/include/configs/rpi_b.h
> +++ b/include/configs/rpi_b.h
> @@ -80,7 +80,11 @@
>  #define CONFIG_AUTO_COMPLETE
>  
>  /* Commands */
> -#define CONFIG_CMD_MEMORY
> -#define CONFIG_CMD_MISC
> +#include "config_cmd_default.h"

OK, the README says "config_cmd_default.h" but every other user does
<config_cmd_default.h>.

-- 
Tom

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [U-Boot] [PATCH 05/12] ARM: rpi_b: enable CONFIG_OF_LIBFDT
  2012-07-04  2:02 ` [U-Boot] [PATCH 05/12] ARM: rpi_b: enable CONFIG_OF_LIBFDT Stephen Warren
@ 2012-07-09 12:24   ` Tom Rini
  0 siblings, 0 replies; 16+ messages in thread
From: Tom Rini @ 2012-07-09 12:24 UTC (permalink / raw)
  To: u-boot

On Tue, Jul 03, 2012 at 08:02:48PM -0600, Stephen Warren wrote:
> This allows bootm/bootz to pass a device tree to the kernel.
> 
> Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>

FWIW, I would combine this, 6 and 7 into a single commit and say "Enable
booting the Linux Kernel" and in the body mention that today we use
ATAGS and as the code moves into mainline device trees will be used and
required, so enable both for now.  This is roughly what I'm saying in my
to-post series enhancing the am335x_evm support.

-- 
Tom

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2012-07-09 12:24 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-04  2:02 [U-Boot] [PATCH 00/12] ARM: rpi_b: many minor enhancements Stephen Warren
2012-07-04  2:02 ` [U-Boot] [PATCH 01/12] ARM: arm1176: enable instruction cache in arch_cpu_init() Stephen Warren
2012-07-04  2:02 ` [U-Boot] [PATCH 02/12] ARM: rpi_b: enable CONFIG_ARCH_CPU_INIT for icache Stephen Warren
2012-07-04  2:02 ` [U-Boot] [PATCH 03/12] ARM: rpi_b: define CONFIG_MACH_TYPE Stephen Warren
2012-07-04  2:02 ` [U-Boot] [PATCH 04/12] ARM: rpi_b: include config_cmd_default.h Stephen Warren
2012-07-09 12:21   ` Tom Rini
2012-07-04  2:02 ` [U-Boot] [PATCH 05/12] ARM: rpi_b: enable CONFIG_OF_LIBFDT Stephen Warren
2012-07-09 12:24   ` Tom Rini
2012-07-04  2:02 ` [U-Boot] [PATCH 06/12] ARM: rpi_b: set bi_boot_params Stephen Warren
2012-07-04  2:02 ` [U-Boot] [PATCH 07/12] ARM: rpi_b: add ATAG support for bootm/bootz Stephen Warren
2012-07-04  2:02 ` [U-Boot] [PATCH 08/12] ARM: rpi_b: drop RAM size to 128M Stephen Warren
     [not found]   ` <930F248225E0FA44A2AE486086E959AEA56E33@SJEXCHMB06.corp.ad.broadcom.com>
2012-07-04  2:27     ` Stephen Warren
2012-07-04  2:02 ` [U-Boot] [PATCH 09/12] ARM: rpi_b: move stack to top of RAM Stephen Warren
2012-07-04  2:02 ` [U-Boot] [PATCH 10/12] ARM: rpi_b: re-order rpi_b.h to keep related defines adjacent Stephen Warren
2012-07-04  2:02 ` [U-Boot] [PATCH 11/12] ARM: bcm2835: implement reset using watchdog Stephen Warren
2012-07-04  2:02 ` [U-Boot] [PATCH 12/12] ARM: rpi_b: enabled bootz command Stephen Warren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox