u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 0/6] Highbank platform updates
@ 2012-02-02  2:57 Rob Herring
  2012-02-02  2:57 ` [U-Boot] [PATCH 1/6] ARM: highbank: fix us_to_tick calculation Rob Herring
                   ` (6 more replies)
  0 siblings, 7 replies; 9+ messages in thread
From: Rob Herring @ 2012-02-02  2:57 UTC (permalink / raw)
  To: u-boot

From: Rob Herring <rob.herring@calxeda.com>

This is a collection of updates to Calxeda highbank platform that adds
environment in nvram, boot counter, reset and bootcmd selection support.

Regards,
Rob

Jason Hobbs (1):
  ARM: highbank: change env config to use nvram

Rob Herring (5):
  ARM: highbank: fix us_to_tick calculation
  ARM: highbank: change TEXT_BASE to 0x8000
  ARM: highbank: Add boot counter support
  ARM: highbank: add reset support
  ARM: highbank: setup env from boot source register

 arch/arm/cpu/armv7/highbank/Makefile    |    2 +-
 arch/arm/cpu/armv7/highbank/bootcount.c |   36 +++++++++++++++++++++++++++++++
 arch/arm/cpu/armv7/highbank/config.mk   |    1 +
 arch/arm/cpu/armv7/highbank/timer.c     |    4 +-
 board/highbank/highbank.c               |   22 +++++++++++++++++++
 include/configs/highbank.h              |   21 +++++++++--------
 6 files changed, 73 insertions(+), 13 deletions(-)
 create mode 100644 arch/arm/cpu/armv7/highbank/bootcount.c
 create mode 100644 arch/arm/cpu/armv7/highbank/config.mk

-- 
1.7.5.4

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

* [U-Boot] [PATCH 1/6] ARM: highbank: fix us_to_tick calculation
  2012-02-02  2:57 [U-Boot] [PATCH 0/6] Highbank platform updates Rob Herring
@ 2012-02-02  2:57 ` Rob Herring
  2012-02-02  2:57 ` [U-Boot] [PATCH 2/6] ARM: highbank: change TEXT_BASE to 0x8000 Rob Herring
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Rob Herring @ 2012-02-02  2:57 UTC (permalink / raw)
  To: u-boot

From: Rob Herring <rob.herring@calxeda.com>

udelay calls were off due to failing to convert us to ns. Fix this and drop
the unnecessary shifts since NS_PER_TICK is only 7ns.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
 arch/arm/cpu/armv7/highbank/timer.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/cpu/armv7/highbank/timer.c b/arch/arm/cpu/armv7/highbank/timer.c
index d8a0288..d5b6cb6 100644
--- a/arch/arm/cpu/armv7/highbank/timer.c
+++ b/arch/arm/cpu/armv7/highbank/timer.c
@@ -66,10 +66,10 @@ static inline unsigned long long time_to_tick(unsigned long long time)
 
 static inline unsigned long long us_to_tick(unsigned long long us)
 {
-	unsigned long long tick = us << 16;
+	unsigned long long tick = us * 1000;
 	tick += NS_PER_TICK - 1;
 	do_div(tick, NS_PER_TICK);
-	return tick >> 16;
+	return tick;
 }
 
 unsigned long long get_ticks(void)
-- 
1.7.5.4

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

* [U-Boot] [PATCH 2/6] ARM: highbank: change TEXT_BASE to 0x8000
  2012-02-02  2:57 [U-Boot] [PATCH 0/6] Highbank platform updates Rob Herring
  2012-02-02  2:57 ` [U-Boot] [PATCH 1/6] ARM: highbank: fix us_to_tick calculation Rob Herring
@ 2012-02-02  2:57 ` Rob Herring
  2012-02-02  2:57 ` [U-Boot] [PATCH 3/6] ARM: highbank: Add boot counter support Rob Herring
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Rob Herring @ 2012-02-02  2:57 UTC (permalink / raw)
  To: u-boot

From: Rob Herring <rob.herring@calxeda.com>

Make some space at the beginning of RAM so the FDT can be loaded to a
known fixed address at 0x1000.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
 include/configs/highbank.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/configs/highbank.h b/include/configs/highbank.h
index 5604733..e717273 100644
--- a/include/configs/highbank.h
+++ b/include/configs/highbank.h
@@ -120,7 +120,7 @@
 #define CONFIG_ENV_IS_NOWHERE
 
 #define CONFIG_SYS_SDRAM_BASE		0x00000000
-#define CONFIG_SYS_TEXT_BASE		0x00001000
+#define CONFIG_SYS_TEXT_BASE		0x00008000
 #define CONFIG_SYS_INIT_SP_ADDR		0x01000000
 #define CONFIG_SKIP_LOWLEVEL_INIT
 
-- 
1.7.5.4

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

* [U-Boot] [PATCH 3/6] ARM: highbank: Add boot counter support
  2012-02-02  2:57 [U-Boot] [PATCH 0/6] Highbank platform updates Rob Herring
  2012-02-02  2:57 ` [U-Boot] [PATCH 1/6] ARM: highbank: fix us_to_tick calculation Rob Herring
  2012-02-02  2:57 ` [U-Boot] [PATCH 2/6] ARM: highbank: change TEXT_BASE to 0x8000 Rob Herring
@ 2012-02-02  2:57 ` Rob Herring
  2012-02-02  2:57 ` [U-Boot] [PATCH 4/6] ARM: highbank: add reset support Rob Herring
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Rob Herring @ 2012-02-02  2:57 UTC (permalink / raw)
  To: u-boot

From: Rob Herring <rob.herring@calxeda.com>

Add boot counter support using an sysreg which is persistent across reset.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
 arch/arm/cpu/armv7/highbank/Makefile    |    2 +-
 arch/arm/cpu/armv7/highbank/bootcount.c |   36 +++++++++++++++++++++++++++++++
 board/highbank/highbank.c               |    1 +
 include/configs/highbank.h              |    3 ++
 4 files changed, 41 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/cpu/armv7/highbank/bootcount.c

diff --git a/arch/arm/cpu/armv7/highbank/Makefile b/arch/arm/cpu/armv7/highbank/Makefile
index 76faeb0..917c3a3 100644
--- a/arch/arm/cpu/armv7/highbank/Makefile
+++ b/arch/arm/cpu/armv7/highbank/Makefile
@@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk
 
 LIB	= $(obj)lib$(SOC).o
 
-COBJS	:= timer.o
+COBJS	:= timer.o bootcount.o
 SOBJS	:=
 
 SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
diff --git a/arch/arm/cpu/armv7/highbank/bootcount.c b/arch/arm/cpu/armv7/highbank/bootcount.c
new file mode 100644
index 0000000..9ca0656
--- /dev/null
+++ b/arch/arm/cpu/armv7/highbank/bootcount.c
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2011 Calxeda, Inc.
+ *
+ * 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 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <common.h>
+#include <asm/io.h>
+
+#ifdef CONFIG_BOOTCOUNT_LIMIT
+void bootcount_store(ulong a)
+{
+	writel((BOOTCOUNT_MAGIC & 0xffff0000) | a, CONFIG_SYS_BOOTCOUNT_ADDR);
+}
+
+ulong bootcount_load(void)
+{
+	u32 tmp = readl(CONFIG_SYS_BOOTCOUNT_ADDR);
+
+	if ((tmp & 0xffff0000) != (BOOTCOUNT_MAGIC & 0xffff0000))
+		return 0;
+	else
+		return tmp & 0x0000ffff;
+}
+#endif
diff --git a/board/highbank/highbank.c b/board/highbank/highbank.c
index b0aa182..2de0091 100644
--- a/board/highbank/highbank.c
+++ b/board/highbank/highbank.c
@@ -20,6 +20,7 @@
 #include <scsi.h>
 
 #include <asm/sizes.h>
+#include <asm/io.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
diff --git a/include/configs/highbank.h b/include/configs/highbank.h
index e717273..801f4ae 100644
--- a/include/configs/highbank.h
+++ b/include/configs/highbank.h
@@ -41,6 +41,9 @@
 #define CONFIG_BAUDRATE			38400
 #define CONFIG_SYS_BAUDRATE_TABLE	{ 9600, 19200, 38400, 57600, 115200 }
 
+#define CONFIG_BOOTCOUNT_LIMIT
+#define CONFIG_SYS_BOOTCOUNT_ADDR	0xfff3cf0c
+
 #define CONFIG_MISC_INIT_R
 #define CONFIG_SCSI_AHCI
 #define CONFIG_SCSI_AHCI_PLAT
-- 
1.7.5.4

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

* [U-Boot] [PATCH 4/6] ARM: highbank: add reset support
  2012-02-02  2:57 [U-Boot] [PATCH 0/6] Highbank platform updates Rob Herring
                   ` (2 preceding siblings ...)
  2012-02-02  2:57 ` [U-Boot] [PATCH 3/6] ARM: highbank: Add boot counter support Rob Herring
@ 2012-02-02  2:57 ` Rob Herring
  2012-02-02  2:57 ` [U-Boot] [PATCH 5/6] ARM: highbank: change env config to use nvram Rob Herring
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Rob Herring @ 2012-02-02  2:57 UTC (permalink / raw)
  To: u-boot

From: Rob Herring <rob.herring@calxeda.com>

Implement reset for highbank platform. Reset is triggered via a wfi
instruction, so enabling armv7 for the compiler is necessary.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
 arch/arm/cpu/armv7/highbank/config.mk |    1 +
 board/highbank/highbank.c             |    8 ++++++++
 2 files changed, 9 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/cpu/armv7/highbank/config.mk

diff --git a/arch/arm/cpu/armv7/highbank/config.mk b/arch/arm/cpu/armv7/highbank/config.mk
new file mode 100644
index 0000000..935a147
--- /dev/null
+++ b/arch/arm/cpu/armv7/highbank/config.mk
@@ -0,0 +1 @@
+PLATFORM_CPPFLAGS += -march=armv7-a
diff --git a/board/highbank/highbank.c b/board/highbank/highbank.c
index 2de0091..b771cc8 100644
--- a/board/highbank/highbank.c
+++ b/board/highbank/highbank.c
@@ -22,6 +22,12 @@
 #include <asm/sizes.h>
 #include <asm/io.h>
 
+#define HB_SREG_A9_PWR_REQ		0xfff3cf00
+#define HB_PWR_SUSPEND			0
+#define HB_PWR_SOFT_RESET		1
+#define HB_PWR_HARD_RESET		2
+#define HB_PWR_SHUTDOWN			3
+
 DECLARE_GLOBAL_DATA_PTR;
 
 /*
@@ -67,4 +73,6 @@ void dram_init_banksize(void)
 
 void reset_cpu(ulong addr)
 {
+	writel(HB_PWR_HARD_RESET, HB_SREG_A9_PWR_REQ);
+	asm("	wfi");
 }
-- 
1.7.5.4

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

* [U-Boot] [PATCH 5/6] ARM: highbank: change env config to use nvram
  2012-02-02  2:57 [U-Boot] [PATCH 0/6] Highbank platform updates Rob Herring
                   ` (3 preceding siblings ...)
  2012-02-02  2:57 ` [U-Boot] [PATCH 4/6] ARM: highbank: add reset support Rob Herring
@ 2012-02-02  2:57 ` Rob Herring
  2012-02-02  2:57 ` [U-Boot] [PATCH 6/6] ARM: highbank: setup env from boot source register Rob Herring
  2012-02-18 16:02 ` [U-Boot] [PATCH 0/6] Highbank platform updates Albert ARIBAUD
  6 siblings, 0 replies; 9+ messages in thread
From: Rob Herring @ 2012-02-02  2:57 UTC (permalink / raw)
  To: u-boot

From: Jason Hobbs <jason.hobbs@calxeda.com>

Update the highbank config to use env from NVRAM. Also remove extra env
settings as they are not used unless the default env is used.

Signed-off-by: Jason Hobbs <jason.hobbs@calxeda.com>
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
 include/configs/highbank.h |   16 +++++++---------
 1 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/include/configs/highbank.h b/include/configs/highbank.h
index 801f4ae..7f93d5e 100644
--- a/include/configs/highbank.h
+++ b/include/configs/highbank.h
@@ -93,12 +93,6 @@
 
 #define CONFIG_SYS_LOAD_ADDR		0x800000
 
-#define CONFIG_EXTRA_ENV_SETTINGS	\
-		"fdtaddr_r=0x600000\0" \
-		"pxefile_addr_r=0x700000\0" \
-		"kernel_addr_r=0x800000\0" \
-		"ramdisk_addr_r=0x01000000\0" \
-
 /*-----------------------------------------------------------------------
  * Stack sizes
  *
@@ -118,9 +112,13 @@
 #define CONFIG_SYS_MEMTEST_START	0x100000
 #define CONFIG_SYS_MEMTEST_END		(PHYS_SDRAM_1_SIZE - 0x100000)
 
-/* Room required on the stack for the environment data */
-#define CONFIG_ENV_SIZE			0x2000
-#define CONFIG_ENV_IS_NOWHERE
+/* Environment data setup 
+*/
+#define CONFIG_ENV_IS_IN_NVRAM
+#define CONFIG_SYS_NVRAM_BASE_ADDR	0xfff88000	/* NVRAM base address */
+#define CONFIG_SYS_NVRAM_SIZE		0x8000		/* NVRAM size */
+#define CONFIG_ENV_SIZE			0x2000		/* Size of Environ */
+#define CONFIG_ENV_ADDR			CONFIG_SYS_NVRAM_BASE_ADDR
 
 #define CONFIG_SYS_SDRAM_BASE		0x00000000
 #define CONFIG_SYS_TEXT_BASE		0x00008000
-- 
1.7.5.4

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

* [U-Boot] [PATCH 6/6] ARM: highbank: setup env from boot source register
  2012-02-02  2:57 [U-Boot] [PATCH 0/6] Highbank platform updates Rob Herring
                   ` (4 preceding siblings ...)
  2012-02-02  2:57 ` [U-Boot] [PATCH 5/6] ARM: highbank: change env config to use nvram Rob Herring
@ 2012-02-02  2:57 ` Rob Herring
  2012-02-18 16:02 ` [U-Boot] [PATCH 0/6] Highbank platform updates Albert ARIBAUD
  6 siblings, 0 replies; 9+ messages in thread
From: Rob Herring @ 2012-02-02  2:57 UTC (permalink / raw)
  To: u-boot

From: Rob Herring <rob.herring@calxeda.com>

Add support to read the boot src register and set bootcmd env from the
selected bootcmdX env setting.

Based on Linkstation boot choice selection.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
 board/highbank/highbank.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/board/highbank/highbank.c b/board/highbank/highbank.c
index b771cc8..e2dce53 100644
--- a/board/highbank/highbank.c
+++ b/board/highbank/highbank.c
@@ -23,6 +23,7 @@
 #include <asm/io.h>
 
 #define HB_SREG_A9_PWR_REQ		0xfff3cf00
+#define HB_SREG_A9_BOOT_SRC_STAT	0xfff3cf04
 #define HB_PWR_SUSPEND			0
 #define HB_PWR_SOFT_RESET		1
 #define HB_PWR_HARD_RESET		2
@@ -54,8 +55,20 @@ int board_eth_init(bd_t *bis)
 
 int misc_init_r(void)
 {
+	char envbuffer[16];
+	u32 boot_choice;
+
 	ahci_init(0xffe08000);
 	scsi_scan(1);
+
+	boot_choice = readl(HB_SREG_A9_BOOT_SRC_STAT) & 0xff;
+	sprintf(envbuffer, "bootcmd%d", boot_choice);
+	if (getenv(envbuffer)) {
+		sprintf(envbuffer, "run bootcmd%d", boot_choice);
+		setenv("bootcmd", envbuffer);
+	} else
+		setenv("bootcmd", "");
+
 	return 0;
 }
 
-- 
1.7.5.4

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

* [U-Boot] [PATCH 0/6] Highbank platform updates
  2012-02-02  2:57 [U-Boot] [PATCH 0/6] Highbank platform updates Rob Herring
                   ` (5 preceding siblings ...)
  2012-02-02  2:57 ` [U-Boot] [PATCH 6/6] ARM: highbank: setup env from boot source register Rob Herring
@ 2012-02-18 16:02 ` Albert ARIBAUD
  2012-02-21 22:55   ` Rob Herring
  6 siblings, 1 reply; 9+ messages in thread
From: Albert ARIBAUD @ 2012-02-18 16:02 UTC (permalink / raw)
  To: u-boot

Hi Rob,

Le 02/02/2012 03:57, Rob Herring a ?crit :
> From: Rob Herring<rob.herring@calxeda.com>
>
> This is a collection of updates to Calxeda highbank platform that adds
> environment in nvram, boot counter, reset and bootcmd selection support.
>
> Regards,
> Rob
>
> Jason Hobbs (1):
>    ARM: highbank: change env config to use nvram
>
> Rob Herring (5):
>    ARM: highbank: fix us_to_tick calculation
>    ARM: highbank: change TEXT_BASE to 0x8000
>    ARM: highbank: Add boot counter support
>    ARM: highbank: add reset support
>    ARM: highbank: setup env from boot source register
>
>   arch/arm/cpu/armv7/highbank/Makefile    |    2 +-
>   arch/arm/cpu/armv7/highbank/bootcount.c |   36 +++++++++++++++++++++++++++++++
>   arch/arm/cpu/armv7/highbank/config.mk   |    1 +
>   arch/arm/cpu/armv7/highbank/timer.c     |    4 +-
>   board/highbank/highbank.c               |   22 +++++++++++++++++++
>   include/configs/highbank.h              |   21 +++++++++--------
>   6 files changed, 73 insertions(+), 13 deletions(-)
>   create mode 100644 arch/arm/cpu/armv7/highbank/bootcount.c
>   create mode 100644 arch/arm/cpu/armv7/highbank/config.mk

Of all these, only the us/ns fix could go to /master and into 2012.03, 
the rest being improvements, not fixes. I'd rather have the whole patch 
set go in together, though. Can the us/ns fix wait until after the 
2012.03 release?

Amicalement,
-- 
Albert.

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

* [U-Boot] [PATCH 0/6] Highbank platform updates
  2012-02-18 16:02 ` [U-Boot] [PATCH 0/6] Highbank platform updates Albert ARIBAUD
@ 2012-02-21 22:55   ` Rob Herring
  0 siblings, 0 replies; 9+ messages in thread
From: Rob Herring @ 2012-02-21 22:55 UTC (permalink / raw)
  To: u-boot

Albert,

On 02/18/2012 10:02 AM, Albert ARIBAUD wrote:
> Hi Rob,
> 
> Le 02/02/2012 03:57, Rob Herring a ?crit :
>> From: Rob Herring<rob.herring@calxeda.com>
>>
>> This is a collection of updates to Calxeda highbank platform that adds
>> environment in nvram, boot counter, reset and bootcmd selection support.
>>
>> Regards,
>> Rob
>>
>> Jason Hobbs (1):
>>    ARM: highbank: change env config to use nvram
>>
>> Rob Herring (5):
>>    ARM: highbank: fix us_to_tick calculation
>>    ARM: highbank: change TEXT_BASE to 0x8000
>>    ARM: highbank: Add boot counter support
>>    ARM: highbank: add reset support
>>    ARM: highbank: setup env from boot source register
>>
>>   arch/arm/cpu/armv7/highbank/Makefile    |    2 +-
>>   arch/arm/cpu/armv7/highbank/bootcount.c |   36
>> +++++++++++++++++++++++++++++++
>>   arch/arm/cpu/armv7/highbank/config.mk   |    1 +
>>   arch/arm/cpu/armv7/highbank/timer.c     |    4 +-
>>   board/highbank/highbank.c               |   22 +++++++++++++++++++
>>   include/configs/highbank.h              |   21 +++++++++--------
>>   6 files changed, 73 insertions(+), 13 deletions(-)
>>   create mode 100644 arch/arm/cpu/armv7/highbank/bootcount.c
>>   create mode 100644 arch/arm/cpu/armv7/highbank/config.mk
> 
> Of all these, only the us/ns fix could go to /master and into 2012.03,
> the rest being improvements, not fixes. I'd rather have the whole patch
> set go in together, though. Can the us/ns fix wait until after the
> 2012.03 release?

Without the fix boot delay is broken and SATA has intermittent timeout
errors, so I'd prefer the fix go in for 2012.03.

Rob

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

end of thread, other threads:[~2012-02-21 22:55 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-02  2:57 [U-Boot] [PATCH 0/6] Highbank platform updates Rob Herring
2012-02-02  2:57 ` [U-Boot] [PATCH 1/6] ARM: highbank: fix us_to_tick calculation Rob Herring
2012-02-02  2:57 ` [U-Boot] [PATCH 2/6] ARM: highbank: change TEXT_BASE to 0x8000 Rob Herring
2012-02-02  2:57 ` [U-Boot] [PATCH 3/6] ARM: highbank: Add boot counter support Rob Herring
2012-02-02  2:57 ` [U-Boot] [PATCH 4/6] ARM: highbank: add reset support Rob Herring
2012-02-02  2:57 ` [U-Boot] [PATCH 5/6] ARM: highbank: change env config to use nvram Rob Herring
2012-02-02  2:57 ` [U-Boot] [PATCH 6/6] ARM: highbank: setup env from boot source register Rob Herring
2012-02-18 16:02 ` [U-Boot] [PATCH 0/6] Highbank platform updates Albert ARIBAUD
2012-02-21 22:55   ` Rob Herring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).