Skip to contentSkip to conversation

arm: add Calxeda Highbank support

PATCH Superseded Jean-Christophe PLAGNIOL-VILLARD 2 participants 6 messages Feb 11, 2013 – Feb 13, 2013

Subsystems (5)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover arm: add Calxeda Highbank support

Hi,

v2:
fix cc tag so Rob can receive the patch
add oftree support to xgmac

The following patch serie add the support of the Quad Core Cortex-A9 Highbank from Calxeda

As I do not have the real hardware this is only tested on qemu

Rob could confirm if this work on real hw

This patch serie depends on the amba sp804 patch and the ahci patch serie

The following changes since commit ad65d793bbaccc4b97422c612322d3d9885c8cfd:

ahci: handle COMINIT received during spin-up (2013-02-11 07:45:37 +0800)

are available in the git repository at:

git://git.jcrosoft.org/barebox.git delivery/highbank

for you to fetch changes up to 48648694bbf909d53034c5b5c6ed019506ea5999:

highbank: add l2x0 support (2013-02-11 12:02:58 +0800)

----------------------------------------------------------------
Jean-Christophe PLAGNIOL-VILLARD (3):
highbank: add xgmac support
arm: add highbank support
highbank: add l2x0 support

 arch/arm/Kconfig                               |   12 ++
 arch/arm/Makefile                              |    2 +
 arch/arm/boards/highbank/Makefile              |    4 +
 arch/arm/boards/highbank/config.h              |    5 +
 arch/arm/boards/highbank/env/config            |   34 +++++
 arch/arm/boards/highbank/init.c                |   46 +++++++
 arch/arm/boards/highbank/lowlevel.c            |   17 +++
 arch/arm/configs/highbank_defconfig            |   61 +++++++++
 arch/arm/mach-highbank/Kconfig                 |   18 +++
 arch/arm/mach-highbank/Makefile                |    4 +
 arch/arm/mach-highbank/cache-l2x0.c            |   45 +++++++
 arch/arm/mach-highbank/core.c                  |   50 ++++++++
 arch/arm/mach-highbank/core.h                  |    2 +
 arch/arm/mach-highbank/devices.c               |   50 ++++++++
 arch/arm/mach-highbank/include/mach/clkdev.h   |    7 ++
 arch/arm/mach-highbank/include/mach/debug_ll.h |   26 ++++
 arch/arm/mach-highbank/include/mach/devices.h  |   16 +++
 arch/arm/mach-highbank/include/mach/gpio.h     |    1 +
 arch/arm/mach-highbank/reset.c                 |   22 ++++
 arch/arm/mach-highbank/smc.S                   |   27 ++++
 arch/arm/mach-highbank/sysregs.h               |   52 ++++++++
 drivers/net/Kconfig                            |    3 +
 drivers/net/Makefile                           |    1 +
 drivers/net/xgmac.c                            |  740 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 24 files changed, 1245 insertions(+)
 create mode 100644 arch/arm/boards/highbank/Makefile
 create mode 100644 arch/arm/boards/highbank/config.h
 create mode 100644 arch/arm/boards/highbank/env/config
 create mode 100644 arch/arm/boards/highbank/init.c
 create mode 100644 arch/arm/boards/highbank/lowlevel.c
 create mode 100644 arch/arm/configs/highbank_defconfig
 create mode 100644 arch/arm/mach-highbank/Kconfig
 create mode 100644 arch/arm/mach-highbank/Makefile
 create mode 100644 arch/arm/mach-highbank/cache-l2x0.c
 create mode 100644 arch/arm/mach-highbank/core.c
 create mode 100644 arch/arm/mach-highbank/core.h
 create mode 100644 arch/arm/mach-highbank/devices.c
 create mode 100644 arch/arm/mach-highbank/include/mach/clkdev.h
 create mode 100644 arch/arm/mach-highbank/include/mach/debug_ll.h
 create mode 100644 arch/arm/mach-highbank/include/mach/devices.h
 create mode 100644 arch/arm/mach-highbank/include/mach/gpio.h
 create mode 100644 arch/arm/mach-highbank/reset.c
 create mode 100644 arch/arm/mach-highbank/smc.S
 create mode 100644 arch/arm/mach-highbank/sysregs.h
 create mode 100644 drivers/net/xgmac.c

Best Regards,
J.

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#1 lore raw

PATCH v2 1/3 highbank: add xgmac support

---
 drivers/net/Kconfig  |    3 +
 drivers/net/Makefile |    1 +
 drivers/net/xgmac.c  |  740 ++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 744 insertions(+)
 create mode 100644 drivers/net/xgmac.c
drivers/net/Kconfig +3 -0
index cf6ceee..bcf245d 100644
@@ -27,6 +27,9 @@ menu "Network drivers"
 
 source "drivers/net/phy/Kconfig"
 
+config DRIVER_NET_CALXEDA_XGMAC
+	bool "Calxeda xgmac"
+
 config DRIVER_NET_CS8900
 	bool "cs8900 ethernet driver"
 	depends on HAS_CS8900
drivers/net/Makefile +1 -0
index 6e1aeaa..42136f8 100644
@@ -1,3 +1,4 @@
+obj-$(CONFIG_DRIVER_NET_CALXEDA_XGMAC)	+= xgmac.o
 obj-$(CONFIG_DRIVER_NET_CS8900)		+= cs8900.o
 obj-$(CONFIG_DRIVER_NET_CPSW)		+= cpsw.o
 obj-$(CONFIG_DRIVER_NET_SMC911X)	+= smc911x.o
drivers/net/xgmac.c new file +740 -0

740 lines not on this page · raw message

Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#2 lore raw

PATCH v2 2/3 arm: add highbank support

currently only tested under qemu

qemu-system-arm -M highbank -nographic -m 4089 -kernel build/highbank/arch/arm/pbl/zbarebox -tftp "." -drive id=disk,if=ide,file=disk.img -device ide-drive,drive=disk,bus=ide.0

with:
- timer (AMBA SP804)
- uart (AMBA PL011)
- gpio (AMBA PL061)
- ahci
- net (XGMAC)

---
 arch/arm/Kconfig                               |   11 +++++
 arch/arm/Makefile                              |    2 +
 arch/arm/boards/highbank/Makefile              |    4 ++
 arch/arm/boards/highbank/config.h              |    5 ++
 arch/arm/boards/highbank/env/config            |   34 +++++++++++++
 arch/arm/boards/highbank/init.c                |   46 ++++++++++++++++++
 arch/arm/boards/highbank/lowlevel.c            |   17 +++++++
 arch/arm/configs/highbank_defconfig            |   61 ++++++++++++++++++++++++
 arch/arm/mach-highbank/Kconfig                 |   18 +++++++
 arch/arm/mach-highbank/Makefile                |    3 ++
 arch/arm/mach-highbank/core.c                  |   50 +++++++++++++++++++
 arch/arm/mach-highbank/devices.c               |   50 +++++++++++++++++++
 arch/arm/mach-highbank/include/mach/clkdev.h   |    7 +++
 arch/arm/mach-highbank/include/mach/debug_ll.h |   26 ++++++++++
 arch/arm/mach-highbank/include/mach/devices.h  |   16 +++++++
 arch/arm/mach-highbank/include/mach/gpio.h     |    1 +
 arch/arm/mach-highbank/reset.c                 |   22 +++++++++
 arch/arm/mach-highbank/sysregs.h               |   52 ++++++++++++++++++++
 18 files changed, 425 insertions(+)
 create mode 100644 arch/arm/boards/highbank/Makefile
 create mode 100644 arch/arm/boards/highbank/config.h
 create mode 100644 arch/arm/boards/highbank/env/config
 create mode 100644 arch/arm/boards/highbank/init.c
 create mode 100644 arch/arm/boards/highbank/lowlevel.c
 create mode 100644 arch/arm/configs/highbank_defconfig
 create mode 100644 arch/arm/mach-highbank/Kconfig
 create mode 100644 arch/arm/mach-highbank/Makefile
 create mode 100644 arch/arm/mach-highbank/core.c
 create mode 100644 arch/arm/mach-highbank/devices.c
 create mode 100644 arch/arm/mach-highbank/include/mach/clkdev.h
 create mode 100644 arch/arm/mach-highbank/include/mach/debug_ll.h
 create mode 100644 arch/arm/mach-highbank/include/mach/devices.h
 create mode 100644 arch/arm/mach-highbank/include/mach/gpio.h
 create mode 100644 arch/arm/mach-highbank/reset.c
 create mode 100644 arch/arm/mach-highbank/sysregs.h
arch/arm/Kconfig +11 -0
index 5ae5bd0..c10b9da 100644
@@ -49,6 +49,16 @@ config ARCH_EP93XX
 	select CPU_ARM920T
 	select GENERIC_GPIO
 
+config ARCH_HIGHBANK
+	bool "Calxeda Highbank"
+	select HAS_DEBUG_LL
+	select CPU_V7
+	select ARM_AMBA
+	select AMBA_SP804
+	select CLKDEV_LOOKUP
+	select COMMON_CLK
+	select GPIOLIB
+
 config ARCH_IMX
 	bool "Freescale iMX-based"
 	select GENERIC_GPIO
@@ -126,6 +136,7 @@ source arch/arm/mach-at91/Kconfig
 source arch/arm/mach-bcm2835/Kconfig
 source arch/arm/mach-clps711x/Kconfig
 source arch/arm/mach-ep93xx/Kconfig
+source arch/arm/mach-highbank/Kconfig
 source arch/arm/mach-imx/Kconfig
 source arch/arm/mach-mxs/Kconfig
 source arch/arm/mach-netx/Kconfig
arch/arm/Makefile +2 -0
index 73631ba..15bebf1 100644
@@ -55,6 +55,7 @@ machine-$(CONFIG_ARCH_AT91)		:= at91
 machine-$(CONFIG_ARCH_BCM2835)		:= bcm2835
 machine-$(CONFIG_ARCH_CLPS711X)		:= clps711x
 machine-$(CONFIG_ARCH_EP93XX)		:= ep93xx
+machine-$(CONFIG_ARCH_HIGHBANK)		:= highbank
 machine-$(CONFIG_ARCH_IMX)		:= imx
 machine-$(CONFIG_ARCH_MXS)		:= mxs
 machine-$(CONFIG_ARCH_NOMADIK)		:= nomadik
@@ -99,6 +100,7 @@ board-$(CONFIG_MACH_EUKREA_CPUIMX51SD)		:= eukrea_cpuimx51
 board-$(CONFIG_MACH_FREESCALE_MX25_3STACK)	:= freescale-mx25-3-stack
 board-$(CONFIG_MACH_FREESCALE_MX35_3STACK)	:= freescale-mx35-3-stack
 board-$(CONFIG_MACH_GE863)			:= telit-evk-pro3
+board-$(CONFIG_MACH_HIGHBANK)			:= highbank
 board-$(CONFIG_MACH_IMX21ADS)			:= imx21ads
 board-$(CONFIG_MACH_IMX27ADS)			:= imx27ads
 board-$(CONFIG_MACH_IMX233_OLINUXINO)	:= imx233-olinuxino
arch/arm/boards/highbank/Makefile new file +4 -0
new file mode 100644
index 0000000..98921a4
@@ -0,0 +1,4 @@
+obj-y += init.o
+
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
arch/arm/boards/highbank/config.h new file +5 -0
new file mode 100644
index 0000000..25bb18f
@@ -0,0 +1,5 @@
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+#endif	/* __CONFIG_H */
arch/arm/boards/highbank/env/config new file +34 -0
new file mode 100644
index 0000000..3fec087
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+# use 'dhcp' to do dhcp in barebox and in kernel
+# use 'none' if you want to skip kernel ip autoconfiguration
+ip=dhcp
+global.dhcp.vendor_id=barebox-highbank
+
+# or set your networking parameters here
+#eth0.ipaddr=a.b.c.d
+#eth0.netmask=a.b.c.d
+#eth0.gateway=a.b.c.d
+#eth0.serverip=a.b.c.d
+
+# can be either 'nfs', 'tftp' or 'nor'
+kernel_loc=tftp
+# can be either 'net', 'nor' or 'initrd'
+rootfs_loc=initrd
+
+# can be either 'jffs2' or 'ubifs'
+rootfs_type=ubifs
+rootfsimage=root.$rootfs_type
+
+kernelimage=zImage
+#kernelimage=uImage
+#kernelimage=Image
+#kernelimage=Image.lzo
+
+autoboot_timeout=3
+
+bootargs="console=ttyAMA0,115200n8 CONSOLE=/dev/ttyAMA0"
+
+# set a fancy prompt (if support is compiled in)
+PS1="\e[1;31m[barebox@\h]:\w\e[0m\n# "
+
arch/arm/boards/highbank/init.c new file +46 -0

46 lines not on this page · raw message

arch/arm/boards/highbank/lowlevel.c new file +17 -0
new file mode 100644
index 0000000..2ee57a9
@@ -0,0 +1,17 @@
+/*
+ * Copyright (C) 2013 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
+ *
+ * GPLv2 only
+ */
+
+#include <common.h>
+#include <sizes.h>
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+#include <asm/system_info.h>
+
+void __naked reset(void)
+{
+	common_reset();
+	barebox_arm_entry(0x00000000, SZ_512M, 0);
+}
arch/arm/configs/highbank_defconfig new file +61 -0

61 lines not on this page · raw message

arch/arm/mach-highbank/Kconfig new file +18 -0
new file mode 100644
index 0000000..47c6405
@@ -0,0 +1,18 @@
+if ARCH_HIGHBANK
+
+config ARCH_TEXT_BASE
+	hex
+	default 0x03f00000
+
+config BOARDINFO
+	default "Calxeda Highbank" if MACH_HIGHBANK
+
+choice
+	prompt "Calxeda Board type"
+
+config MACH_HIGHBANK
+	bool "Calxeda Highbank"
+
+endchoice
+
+endif
arch/arm/mach-highbank/Makefile new file +3 -0
new file mode 100644
index 0000000..3f01cbb
@@ -0,0 +1,3 @@
+obj-y += core.o
+obj-y += devices.o
+obj-y += reset.o
arch/arm/mach-highbank/core.c new file +50 -0

50 lines not on this page · raw message

arch/arm/mach-highbank/devices.c new file +50 -0

50 lines not on this page · raw message

arch/arm/mach-highbank/include/mach/clkdev.h new file +7 -0
new file mode 100644
index 0000000..04b37a8
@@ -0,0 +1,7 @@
+#ifndef __ASM_MACH_CLKDEV_H
+#define __ASM_MACH_CLKDEV_H
+
+#define __clk_get(clk) ({ 1; })
+#define __clk_put(clk) do { } while (0)
+
+#endif
arch/arm/mach-highbank/include/mach/debug_ll.h new file +26 -0
new file mode 100644
index 0000000..4cdbb3c
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2013 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
+ *
+ * GPLv2 only
+ */
+
+#ifndef __MACH_DEBUG_LL_H__
+#define   __MACH_DEBUG_LL_H__
+
+#include <linux/amba/serial.h>
+#include <io.h>
+
+#define UART_BASE 0xfff36000
+
+static inline void PUTC_LL(char c)
+{
+	/* Wait until there is space in the FIFO */
+	while (readl(UART_BASE + UART01x_FR) & UART01x_FR_TXFF);
+
+	/* Send the character */
+	writel(c, UART_BASE + UART01x_DR);
+
+	/* Wait to make sure it hits the line, in case we die too soon. */
+	while (readl(UART_BASE + UART01x_FR) & UART01x_FR_TXFF);
+}
+#endif
arch/arm/mach-highbank/include/mach/devices.h new file +16 -0
new file mode 100644
index 0000000..4c12198
@@ -0,0 +1,16 @@
+/*
+ * Copyright (C) 2013 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
+ *
+ * GPLv2 only
+ */
+
+#ifndef __ASM_ARCH_DEVICES_H__
+#define __ASM_ARCH_DEVICES_H__
+
+void highbank_add_ddram(u32 size);
+
+void highbank_register_uart(void);
+void highbank_register_ahci(void);
+void highbank_register_xgmac(unsigned id);
+
+#endif /* __ASM_ARCH_DEVICES_H__ */
arch/arm/mach-highbank/include/mach/gpio.h new file +1 -0
new file mode 100644
index 0000000..306ab4c
@@ -0,0 +1 @@
+#include <asm-generic/gpio.h>
arch/arm/mach-highbank/reset.c new file +22 -0
new file mode 100644
index 0000000..3306170
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2013 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
+ *
+ * GPLv2 only
+ */
+
+#include <common.h>
+#include <io.h>
+#include <linux/amba/sp805.h>
+
+#include <mach/devices.h>
+
+#include "sysregs.h"
+
+void __iomem *sregs_base = IOMEM(0xfff3c00);
+
+void __noreturn reset_cpu(ulong addr)
+{
+	hignbank_set_pwr_hard_reset();
+
+	while(1);
+}
arch/arm/mach-highbank/sysregs.h new file +52 -0

52 lines not on this page · raw message

Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#3 lore raw

Re: [PATCH 2/3] arm: add highbank support

Quoted 11 lines · Jean-Christophe PLAGNIOL-VILLARD

currently only tested under qemu

qemu-system-arm -M highbank -nographic -m 4089 -kernel build/highbank/arch/arm/pbl/zbarebox -tftp "." -drive id=disk,if=ide,file=disk.img -device ide-drive,drive=disk,bus=ide.0

with:
- timer (AMBA SP804)
- uart (AMBA PL011)
- gpio (AMBA PL061)
- ahci
- net (XGMAC)

Quoted 2 lines

Looks pretty good. A couple of comments below.

Quoted 44 lines
---
 arch/arm/Kconfig                               |   11 +++++
 arch/arm/Makefile                              |    2 +
 arch/arm/boards/highbank/Makefile              |    4 ++
 arch/arm/boards/highbank/config.h              |    5 ++
 arch/arm/boards/highbank/env/config            |   34 +++++++++++++
 arch/arm/boards/highbank/init.c                |   46 ++++++++++++++++++
 arch/arm/boards/highbank/lowlevel.c            |   17 +++++++
 arch/arm/configs/highbank_defconfig            |   61 ++++++++++++++++++++++++
 arch/arm/mach-highbank/Kconfig                 |   18 +++++++
 arch/arm/mach-highbank/Makefile                |    3 ++
 arch/arm/mach-highbank/core.c                  |   50 +++++++++++++++++++
 arch/arm/mach-highbank/devices.c               |   50 +++++++++++++++++++
 arch/arm/mach-highbank/include/mach/clkdev.h   |    7 +++
 arch/arm/mach-highbank/include/mach/debug_ll.h |   26 ++++++++++
 arch/arm/mach-highbank/include/mach/devices.h  |   16 +++++++
 arch/arm/mach-highbank/include/mach/gpio.h     |    1 +
 arch/arm/mach-highbank/reset.c                 |   22 +++++++++
 arch/arm/mach-highbank/sysregs.h               |   52 ++++++++++++++++++++
 18 files changed, 425 insertions(+)
 create mode 100644 arch/arm/boards/highbank/Makefile
 create mode 100644 arch/arm/boards/highbank/config.h
 create mode 100644 arch/arm/boards/highbank/env/config
 create mode 100644 arch/arm/boards/highbank/init.c
 create mode 100644 arch/arm/boards/highbank/lowlevel.c
 create mode 100644 arch/arm/configs/highbank_defconfig
 create mode 100644 arch/arm/mach-highbank/Kconfig
 create mode 100644 arch/arm/mach-highbank/Makefile
 create mode 100644 arch/arm/mach-highbank/core.c
 create mode 100644 arch/arm/mach-highbank/devices.c
 create mode 100644 arch/arm/mach-highbank/include/mach/clkdev.h
 create mode 100644 arch/arm/mach-highbank/include/mach/debug_ll.h
 create mode 100644 arch/arm/mach-highbank/include/mach/devices.h
 create mode 100644 arch/arm/mach-highbank/include/mach/gpio.h
 create mode 100644 arch/arm/mach-highbank/reset.c
 create mode 100644 arch/arm/mach-highbank/sysregs.h
arch/arm/Kconfig +0 -0
index 5ae5bd0..c10b9da 100644
@@ -49,6 +49,16 @@ config ARCH_EP93XX
 	select CPU_ARM920T
 	select GENERIC_GPIO

arch/arm/Kconfig config ARCH_EP93XX · line 60

Quoted 10 lines
arch/arm/Kconfig +9 -0
 
+config ARCH_HIGHBANK
+	bool "Calxeda Highbank"
+	select HAS_DEBUG_LL
+	select CPU_V7
+	select ARM_AMBA
+	select AMBA_SP804
+	select CLKDEV_LOOKUP
+	select COMMON_CLK
+	select GPIOLIB

GPIO is generally not accessible and needs to be checked whether enabled in the DT. Accessing it will cause an abort.

Quoted 386 lines
arch/arm/Kconfig +2 -0
+
 config ARCH_IMX
 	bool "Freescale iMX-based"
 	select GENERIC_GPIO
@@ -126,6 +136,7 @@ source arch/arm/mach-at91/Kconfig
 source arch/arm/mach-bcm2835/Kconfig
 source arch/arm/mach-clps711x/Kconfig
 source arch/arm/mach-ep93xx/Kconfig
+source arch/arm/mach-highbank/Kconfig
 source arch/arm/mach-imx/Kconfig
 source arch/arm/mach-mxs/Kconfig
 source arch/arm/mach-netx/Kconfig
arch/arm/Makefile +2 -0
index 73631ba..15bebf1 100644
@@ -55,6 +55,7 @@ machine-$(CONFIG_ARCH_AT91)		:= at91
 machine-$(CONFIG_ARCH_BCM2835)		:= bcm2835
 machine-$(CONFIG_ARCH_CLPS711X)		:= clps711x
 machine-$(CONFIG_ARCH_EP93XX)		:= ep93xx
+machine-$(CONFIG_ARCH_HIGHBANK)		:= highbank
 machine-$(CONFIG_ARCH_IMX)		:= imx
 machine-$(CONFIG_ARCH_MXS)		:= mxs
 machine-$(CONFIG_ARCH_NOMADIK)		:= nomadik
@@ -99,6 +100,7 @@ board-$(CONFIG_MACH_EUKREA_CPUIMX51SD)		:= eukrea_cpuimx51
 board-$(CONFIG_MACH_FREESCALE_MX25_3STACK)	:= freescale-mx25-3-stack
 board-$(CONFIG_MACH_FREESCALE_MX35_3STACK)	:= freescale-mx35-3-stack
 board-$(CONFIG_MACH_GE863)			:= telit-evk-pro3
+board-$(CONFIG_MACH_HIGHBANK)			:= highbank
 board-$(CONFIG_MACH_IMX21ADS)			:= imx21ads
 board-$(CONFIG_MACH_IMX27ADS)			:= imx27ads
 board-$(CONFIG_MACH_IMX233_OLINUXINO)	:= imx233-olinuxino
arch/arm/boards/highbank/Makefile new file +4 -0
new file mode 100644
index 0000000..98921a4
@@ -0,0 +1,4 @@
+obj-y += init.o
+
+obj-y += lowlevel.o
+pbl-y += lowlevel.o
arch/arm/boards/highbank/config.h new file +5 -0
new file mode 100644
index 0000000..25bb18f
@@ -0,0 +1,5 @@
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+#endif	/* __CONFIG_H */
arch/arm/boards/highbank/env/config new file +34 -0
new file mode 100644
index 0000000..3fec087
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+# use 'dhcp' to do dhcp in barebox and in kernel
+# use 'none' if you want to skip kernel ip autoconfiguration
+ip=dhcp
+global.dhcp.vendor_id=barebox-highbank
+
+# or set your networking parameters here
+#eth0.ipaddr=a.b.c.d
+#eth0.netmask=a.b.c.d
+#eth0.gateway=a.b.c.d
+#eth0.serverip=a.b.c.d
+
+# can be either 'nfs', 'tftp' or 'nor'
+kernel_loc=tftp
+# can be either 'net', 'nor' or 'initrd'
+rootfs_loc=initrd
+
+# can be either 'jffs2' or 'ubifs'
+rootfs_type=ubifs
+rootfsimage=root.$rootfs_type
+
+kernelimage=zImage
+#kernelimage=uImage
+#kernelimage=Image
+#kernelimage=Image.lzo
+
+autoboot_timeout=3
+
+bootargs="console=ttyAMA0,115200n8 CONSOLE=/dev/ttyAMA0"
+
+# set a fancy prompt (if support is compiled in)
+PS1="\e[1;31m[barebox@\h]:\w\e[0m\n# "
+
arch/arm/boards/highbank/init.c new file +46 -0
new file mode 100644
index 0000000..e28fae4
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2013 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
+ *
+ * GPLv2 only
+ */
+
+#include <common.h>
+#include <init.h>
+#include <asm/armlinux.h>
+#include <asm/system_info.h>
+#include <generated/mach-types.h>
+#include <mach/devices.h>
+#include <environment.h>
+#include <partition.h>
+#include <sizes.h>
+#include <io.h>
+
+static int highbank_mem_init(void)
+{
+	highbank_add_ddram(4089 << 20);
+
+	return 0;
+}
+mem_initcall(highbank_mem_init);
+
+static int highbank_devices_init(void)
+{
+	highbank_register_ahci();
+	highbank_register_xgmac(0);
+	highbank_register_xgmac(1);
+
+	armlinux_set_bootparams((void *)(0x00000100));
+
+	devfs_add_partition("nvram", 0x00000, SZ_16K, DEVFS_PARTITION_FIXED, "env0");
+
+	return 0;
+}
+device_initcall(highbank_devices_init);
+
+static int highbank_console_init(void)
+{
+	highbank_register_uart();
+
+	return 0;
+}
+console_initcall(highbank_console_init);
arch/arm/boards/highbank/lowlevel.c new file +17 -0
new file mode 100644
index 0000000..2ee57a9
@@ -0,0 +1,17 @@
+/*
+ * Copyright (C) 2013 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
+ *
+ * GPLv2 only
+ */
+
+#include <common.h>
+#include <sizes.h>
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+#include <asm/system_info.h>
+
+void __naked reset(void)
+{
+	common_reset();
+	barebox_arm_entry(0x00000000, SZ_512M, 0);
+}
arch/arm/configs/highbank_defconfig new file +61 -0
new file mode 100644
index 0000000..e0725ed
@@ -0,0 +1,61 @@
+CONFIG_ARCH_HIGHBANK=y
+CONFIG_AEABI=y
+CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y
+CONFIG_PBL_IMAGE=y
+CONFIG_MMU=y
+CONFIG_MALLOC_SIZE=0xa00000
+CONFIG_MALLOC_TLSF=y
+CONFIG_PROMPT="vexpress: "
+CONFIG_LONGHELP=y
+CONFIG_GLOB=y
+CONFIG_HUSH_FANCY_PROMPT=y
+CONFIG_CMDLINE_EDITING=y
+CONFIG_AUTO_COMPLETE=y
+CONFIG_MENU=y
+CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
+CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/highbank/env"
+CONFIG_CMD_EDIT=y
+CONFIG_CMD_SLEEP=y
+CONFIG_CMD_SAVEENV=y
+CONFIG_CMD_EXPORT=y
+CONFIG_CMD_PRINTENV=y
+CONFIG_CMD_READLINE=y
+CONFIG_CMD_MENU=y
+CONFIG_CMD_MENU_MANAGEMENT=y
+CONFIG_CMD_PASSWD=y
+CONFIG_CMD_TFTP=y
+CONFIG_CMD_ECHO_E=y
+CONFIG_CMD_LOADB=y
+CONFIG_CMD_MEMINFO=y
+CONFIG_CMD_BOOTM_SHOW_TYPE=y
+CONFIG_CMD_BOOTM_VERBOSE=y
+CONFIG_CMD_BOOTM_INITRD=y
+CONFIG_CMD_BOOTM_OFTREE=y
+CONFIG_CMD_BOOTM_OFTREE_UIMAGE=y
+CONFIG_CMD_UIMAGE=y
+# CONFIG_CMD_BOOTU is not set
+CONFIG_CMD_RESET=y
+CONFIG_CMD_GO=y
+CONFIG_CMD_OFTREE=y
+CONFIG_CMD_MTEST=y
+CONFIG_CMD_MTEST_ALTERNATIVE=y
+CONFIG_CMD_TIMEOUT=y
+CONFIG_CMD_PARTITION=y
+CONFIG_CMD_UNCOMPRESS=y
+CONFIG_CMD_CLK=y
+CONFIG_NET=y
+CONFIG_NET_DHCP=y
+CONFIG_NET_NFS=y
+CONFIG_NET_PING=y
+CONFIG_NET_NETCONSOLE=y
+CONFIG_NET_RESOLV=y
+CONFIG_SERIAL_AMBA_PL011=y
+CONFIG_DRIVER_NET_CALXEDA_XGMAC=y
+# CONFIG_SPI is not set
+CONFIG_DISK=y
+CONFIG_DISK_AHCI=y
+CONFIG_DISK_AHCI_GENERIC=y
+CONFIG_GPIO_PL061=y
+CONFIG_FS_TFTP=y
+CONFIG_SHA1=y
+CONFIG_SHA256=y
arch/arm/mach-highbank/Kconfig new file +18 -0
new file mode 100644
index 0000000..47c6405
@@ -0,0 +1,18 @@
+if ARCH_HIGHBANK
+
+config ARCH_TEXT_BASE
+	hex
+	default 0x03f00000
+
+config BOARDINFO
+	default "Calxeda Highbank" if MACH_HIGHBANK
+
+choice
+	prompt "Calxeda Board type"
+
+config MACH_HIGHBANK
+	bool "Calxeda Highbank"
+
+endchoice
+
+endif
arch/arm/mach-highbank/Makefile new file +3 -0
new file mode 100644
index 0000000..3f01cbb
@@ -0,0 +1,3 @@
+obj-y += core.o
+obj-y += devices.o
+obj-y += reset.o
arch/arm/mach-highbank/core.c new file +50 -0
new file mode 100644
index 0000000..4bb9bd4
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2009 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
+ *
+ * GPLv2 only
+ */
+
+#include <common.h>
+#include <init.h>
+#include <io.h>
+
+#include <linux/clk.h>
+#include <linux/clkdev.h>
+#include <linux/amba/bus.h>
+
+#include <asm/hardware/arm_timer.h>
+#include <asm/hardware/sp810.h>
+
+#include <mach/devices.h>
+
+static void highbank_clk_init(void)
+{
+	struct clk *clk;
+
+	clk = clk_fixed("dummy_apb_pclk", 0);
+	clk_register_clkdev(clk, "apb_pclk", NULL);
+
+	clk = clk_fixed("pclk", 150000000);
+	clk_register_clkdev(clk, NULL, "sp804");
+	clk_register_clkdev(clk, NULL, "uart-pl011");
+
+}
+
+static void highbank_sp804_init(void)
+{
+	amba_apb_device_add(NULL, "sp804", DEVICE_ID_SINGLE, 0xfff34000, 4096, NULL, 0);
+}
+
+static int highbank_init(void)
+{
+	highbank_clk_init();
+	highbank_sp804_init();
+
+	amba_apb_device_add(NULL, "pl061_gpio", 0, 0xfff30000, 4096, NULL, 0);
+	amba_apb_device_add(NULL, "pl061_gpio", 1, 0xfff31000, 4096, NULL, 0);
+	amba_apb_device_add(NULL, "pl061_gpio", 2, 0xfff32000, 4096, NULL, 0);
+	amba_apb_device_add(NULL, "pl061_gpio", 3, 0xfff33000, 4096, NULL, 0);
+
+	return 0;
+}
+postcore_initcall(highbank_init);
arch/arm/mach-highbank/devices.c new file +50 -0
new file mode 100644
index 0000000..d9a174e
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2013 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
+ *
+ * GPLv2 only
+ */
+
+#include <common.h>
+#include <sizes.h>
+
+#include <linux/amba/bus.h>
+
+#include <asm/memory.h>
+
+#include <mach/devices.h>
+
+void highbank_add_ddram(u32 size)
+{
+	arm_add_mem_device("ram1", 0x00000000, size);
+	add_mem_device("nvram", 0xfff88000, SZ_32K, IORESOURCE_MEM_WRITEABLE);
+}
+
+void highbank_register_uart(void)
+{
+	amba_apb_device_add(NULL, "uart-pl011", DEVICE_ID_SINGLE, 0xfff36000, 4096, NULL, 0);
+}
+
+void highbank_register_ahci(void)
+{
+	add_generic_device("ahci", DEVICE_ID_SINGLE, NULL, 0xffe08000,
+			0x10000, IORESOURCE_MEM, NULL);
+}
+
+void highbank_register_xgmac(unsigned id)
+{
+	resource_size_t start;
+
+	switch (id) {
+	case 0:
+		start = 0xfff50000;
+		break;
+	case 1:
+		start = 0xfff51000;
+		break;
+	default:
+		return;
+	}
+
+	add_generic_device("hb-xgmac", id, NULL, start, 0x1000,
+				IORESOURCE_MEM, NULL);
+}
arch/arm/mach-highbank/include/mach/clkdev.h new file +0 -0
new file mode 100644
index 0000000..04b37a8

arch/arm/mach-highbank/include/mach/clkdev.h line 5

Quoted 5 lines
arch/arm/mach-highbank/include/mach/clkdev.h new file +5 -0
@@ -0,0 +1,7 @@
+#ifndef __ASM_MACH_CLKDEV_H
+#define __ASM_MACH_CLKDEV_H
+
+#define __clk_get(clk) ({ 1; })
+#define __clk_put(clk) do { } while (0)

Does any board really do anything with these?

Quoted 22 lines
arch/arm/mach-highbank/include/mach/clkdev.h new file +2 -0
+
+#endif
arch/arm/mach-highbank/include/mach/debug_ll.h new file +14 -0
new file mode 100644
index 0000000..4cdbb3c
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2013 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
+ *
+ * GPLv2 only
+ */
+
+#ifndef __MACH_DEBUG_LL_H__
+#define   __MACH_DEBUG_LL_H__
+
+#include <linux/amba/serial.h>
+#include <io.h>
+
+#define UART_BASE 0xfff36000
+

arch/arm/mach-highbank/include/mach/debug_ll.h line 24

Quoted 10 lines
arch/arm/mach-highbank/include/mach/debug_ll.h new file +10 -0
+static inline void PUTC_LL(char c)
+{
+	/* Wait until there is space in the FIFO */
+	while (readl(UART_BASE + UART01x_FR) & UART01x_FR_TXFF);
+
+	/* Send the character */
+	writel(c, UART_BASE + UART01x_DR);
+
+	/* Wait to make sure it hits the line, in case we die too soon. */
+	while (readl(UART_BASE + UART01x_FR) & UART01x_FR_TXFF);

This could be generalized to common pl011 code.

Quoted 48 lines
arch/arm/mach-highbank/include/mach/debug_ll.h new file +2 -0
+}
+#endif
arch/arm/mach-highbank/include/mach/devices.h new file +16 -0
new file mode 100644
index 0000000..4c12198
@@ -0,0 +1,16 @@
+/*
+ * Copyright (C) 2013 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
+ *
+ * GPLv2 only
+ */
+
+#ifndef __ASM_ARCH_DEVICES_H__
+#define __ASM_ARCH_DEVICES_H__
+
+void highbank_add_ddram(u32 size);
+
+void highbank_register_uart(void);
+void highbank_register_ahci(void);
+void highbank_register_xgmac(unsigned id);
+
+#endif /* __ASM_ARCH_DEVICES_H__ */
arch/arm/mach-highbank/include/mach/gpio.h new file +1 -0
new file mode 100644
index 0000000..306ab4c
@@ -0,0 +1 @@
+#include <asm-generic/gpio.h>
arch/arm/mach-highbank/reset.c new file +11 -0
new file mode 100644
index 0000000..3306170
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2013 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
+ *
+ * GPLv2 only
+ */
+
+#include <common.h>
+#include <io.h>
+#include <linux/amba/sp805.h>
+
+#include <mach/devices.h>

arch/arm/mach-highbank/reset.c line 21

Quoted 10 lines
arch/arm/mach-highbank/reset.c new file +10 -0
+
+#include "sysregs.h"
+
+void __iomem *sregs_base = IOMEM(0xfff3c00);
+
+void __noreturn reset_cpu(ulong addr)
+{
+	hignbank_set_pwr_hard_reset();
+
+	while(1);

This needs a wfi to actually trigger the reset.

Quoted 29 lines
arch/arm/mach-highbank/reset.c new file +1 -0
+}
arch/arm/mach-highbank/sysregs.h new file +22 -0
new file mode 100644
index 0000000..ad27c1e
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2011 Calxeda, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * 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/>.
+ */
+#ifndef _MACH_HIGHBANK__SYSREGS_H_
+#define _MACH_HIGHBANK__SYSREGS_H_
+
+#include <io.h>
+
+extern void __iomem *sregs_base;
+

arch/arm/mach-highbank/sysregs.h line 32

Quoted 10 lines
arch/arm/mach-highbank/sysregs.h new file +10 -0
+#define HB_SREG_A9_PWR_REQ		0xf00
+#define HB_SREG_A9_BOOT_STAT		0xf04
+#define HB_SREG_A9_BOOT_DATA		0xf08
+
+#define HB_PWR_SUSPEND			0
+#define HB_PWR_SOFT_RESET		1
+#define HB_PWR_HARD_RESET		2
+#define HB_PWR_SHUTDOWN			3
+
+static inline void hignbank_set_pwr_suspend(void)

Same typo as recently fixed in the kernel:
s/hignbank/highbank/

Quoted 11 lines
arch/arm/mach-highbank/sysregs.h new file +10 -0
+{
+	writel(HB_PWR_SUSPEND, sregs_base + HB_SREG_A9_PWR_REQ);
+}
+
+static inline void hignbank_set_pwr_shutdown(void)
+{
+	writel(HB_PWR_SHUTDOWN, sregs_base + HB_SREG_A9_PWR_REQ);
+}
+
+static inline void hignbank_set_pwr_soft_reset(void)

arch/arm/mach-highbank/sysregs.h line 52

Quoted 10 lines
arch/arm/mach-highbank/sysregs.h new file +10 -0
+{
+	writel(HB_PWR_SOFT_RESET, sregs_base + HB_SREG_A9_PWR_REQ);
+}
+
+static inline void hignbank_set_pwr_hard_reset(void)
+{
+	writel(HB_PWR_HARD_RESET, sregs_base + HB_SREG_A9_PWR_REQ);
+}
+
+#endif

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#4 lore raw

Re: [PATCH 2/3] arm: add highbank support

Quoted 62 lines · Rob Herring
Quoted 11 lines · Jean-Christophe PLAGNIOL-VILLARD

currently only tested under qemu

qemu-system-arm -M highbank -nographic -m 4089 -kernel build/highbank/arch/arm/pbl/zbarebox -tftp "." -drive id=disk,if=ide,file=disk.img -device ide-drive,drive=disk,bus=ide.0

with:
- timer (AMBA SP804)
- uart (AMBA PL011)
- gpio (AMBA PL061)
- ahci
- net (XGMAC)

Quoted 2 lines

Looks pretty good. A couple of comments below.

Quoted 45 lines
---
 arch/arm/Kconfig                               |   11 +++++
 arch/arm/Makefile                              |    2 +
 arch/arm/boards/highbank/Makefile              |    4 ++
 arch/arm/boards/highbank/config.h              |    5 ++
 arch/arm/boards/highbank/env/config            |   34 +++++++++++++
 arch/arm/boards/highbank/init.c                |   46 ++++++++++++++++++
 arch/arm/boards/highbank/lowlevel.c            |   17 +++++++
 arch/arm/configs/highbank_defconfig            |   61 ++++++++++++++++++++++++
 arch/arm/mach-highbank/Kconfig                 |   18 +++++++
 arch/arm/mach-highbank/Makefile                |    3 ++
 arch/arm/mach-highbank/core.c                  |   50 +++++++++++++++++++
 arch/arm/mach-highbank/devices.c               |   50 +++++++++++++++++++
 arch/arm/mach-highbank/include/mach/clkdev.h   |    7 +++
 arch/arm/mach-highbank/include/mach/debug_ll.h |   26 ++++++++++
 arch/arm/mach-highbank/include/mach/devices.h  |   16 +++++++
 arch/arm/mach-highbank/include/mach/gpio.h     |    1 +
 arch/arm/mach-highbank/reset.c                 |   22 +++++++++
 arch/arm/mach-highbank/sysregs.h               |   52 ++++++++++++++++++++
 18 files changed, 425 insertions(+)
 create mode 100644 arch/arm/boards/highbank/Makefile
 create mode 100644 arch/arm/boards/highbank/config.h
 create mode 100644 arch/arm/boards/highbank/env/config
 create mode 100644 arch/arm/boards/highbank/init.c
 create mode 100644 arch/arm/boards/highbank/lowlevel.c
 create mode 100644 arch/arm/configs/highbank_defconfig
 create mode 100644 arch/arm/mach-highbank/Kconfig
 create mode 100644 arch/arm/mach-highbank/Makefile
 create mode 100644 arch/arm/mach-highbank/core.c
 create mode 100644 arch/arm/mach-highbank/devices.c
 create mode 100644 arch/arm/mach-highbank/include/mach/clkdev.h
 create mode 100644 arch/arm/mach-highbank/include/mach/debug_ll.h
 create mode 100644 arch/arm/mach-highbank/include/mach/devices.h
 create mode 100644 arch/arm/mach-highbank/include/mach/gpio.h
 create mode 100644 arch/arm/mach-highbank/reset.c
 create mode 100644 arch/arm/mach-highbank/sysregs.h
arch/arm/Kconfig +0 -0
index 5ae5bd0..c10b9da 100644
@@ -49,6 +49,16 @@ config ARCH_EP93XX
 	select CPU_ARM920T
 	select GENERIC_GPIO
 
Quoted 12 lines

arch/arm/Kconfig config ARCH_EP93XX · line 60

Quoted 9 lines
arch/arm/Kconfig +9 -0
+config ARCH_HIGHBANK
+	bool "Calxeda Highbank"
+	select HAS_DEBUG_LL
+	select CPU_V7
+	select ARM_AMBA
+	select AMBA_SP804
+	select CLKDEV_LOOKUP
+	select COMMON_CLK
+	select GPIOLIB

GPIO is generally not accessible and needs to be checked whether enabled in the DT. Accessing it will cause an abort.

ok so I move the code to the board

Quoted 20 lines
Quoted 20 lines
arch/arm/Kconfig +2 -0
+
 config ARCH_IMX
 	bool "Freescale iMX-based"
 	select GENERIC_GPIO
@@ -126,6 +136,7 @@ source arch/arm/mach-at91/Kconfig
 source arch/arm/mach-bcm2835/Kconfig
 source arch/arm/mach-clps711x/Kconfig
 source arch/arm/mach-ep93xx/Kconfig
+source arch/arm/mach-highbank/Kconfig
 source arch/arm/mach-imx/Kconfig
 source arch/arm/mach-mxs/Kconfig
 source arch/arm/mach-netx/Kconfig
arch/arm/Makefile +0 -0
index 73631ba..15bebf1 100644
arch/arm/mach-highbank/include/mach/clkdev.h new file +0 -0
new file mode 100644
index 0000000..04b37a8
Quoted 8 lines

arch/arm/mach-highbank/include/mach/clkdev.h line 5

Quoted 6 lines
arch/arm/mach-highbank/include/mach/clkdev.h new file +5 -0
@@ -0,0 +1,7 @@
+#ifndef __ASM_MACH_CLKDEV_H
+#define __ASM_MACH_CLKDEV_H
+
+#define __clk_get(clk) ({ 1; })
+#define __clk_put(clk) do { } while (0)

Does any board really do anything with these?

will handle factorisation on the top

Quoted 27 lines
Quoted 27 lines
arch/arm/mach-highbank/include/mach/clkdev.h new file +2 -0
+
+#endif
arch/arm/mach-highbank/include/mach/debug_ll.h new file +18 -0
new file mode 100644
index 0000000..4cdbb3c
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2013 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
+ *
+ * GPLv2 only
+ */
+
+#ifndef __MACH_DEBUG_LL_H__
+#define   __MACH_DEBUG_LL_H__
+
+#include <linux/amba/serial.h>
+#include <io.h>
+
+#define UART_BASE 0xfff36000
+
+static inline void PUTC_LL(char c)
+{
+	/* Wait until there is space in the FIFO */
+	while (readl(UART_BASE + UART01x_FR) & UART01x_FR_TXFF);
Quoted 8 lines

arch/arm/mach-highbank/include/mach/debug_ll.h line 24

Quoted 6 lines
arch/arm/mach-highbank/include/mach/debug_ll.h new file +6 -0
+
+	/* Send the character */
+	writel(c, UART_BASE + UART01x_DR);
+
+	/* Wait to make sure it hits the line, in case we die too soon. */
+	while (readl(UART_BASE + UART01x_FR) & UART01x_FR_TXFF);

This could be generalized to common pl011 code.

ditto

Quoted 53 lines
Quoted 53 lines
arch/arm/mach-highbank/include/mach/debug_ll.h new file +2 -0
+}
+#endif
arch/arm/mach-highbank/include/mach/devices.h new file +16 -0
new file mode 100644
index 0000000..4c12198
@@ -0,0 +1,16 @@
+/*
+ * Copyright (C) 2013 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
+ *
+ * GPLv2 only
+ */
+
+#ifndef __ASM_ARCH_DEVICES_H__
+#define __ASM_ARCH_DEVICES_H__
+
+void highbank_add_ddram(u32 size);
+
+void highbank_register_uart(void);
+void highbank_register_ahci(void);
+void highbank_register_xgmac(unsigned id);
+
+#endif /* __ASM_ARCH_DEVICES_H__ */
arch/arm/mach-highbank/include/mach/gpio.h new file +1 -0
new file mode 100644
index 0000000..306ab4c
@@ -0,0 +1 @@
+#include <asm-generic/gpio.h>
arch/arm/mach-highbank/reset.c new file +15 -0
new file mode 100644
index 0000000..3306170
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2013 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
+ *
+ * GPLv2 only
+ */
+
+#include <common.h>
+#include <io.h>
+#include <linux/amba/sp805.h>
+
+#include <mach/devices.h>
+
+#include "sysregs.h"
+
+void __iomem *sregs_base = IOMEM(0xfff3c00);
Quoted 8 lines

arch/arm/mach-highbank/reset.c line 21

Quoted 6 lines
arch/arm/mach-highbank/reset.c new file +6 -0
+
+void __noreturn reset_cpu(ulong addr)
+{
+	hignbank_set_pwr_hard_reset();
+
+	while(1);

This needs a wfi to actually trigger the reset.

ok

Quoted 35 lines
Quoted 35 lines
arch/arm/mach-highbank/reset.c new file +1 -0
+}
arch/arm/mach-highbank/sysregs.h new file +27 -0
new file mode 100644
index 0000000..ad27c1e
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2011 Calxeda, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * 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/>.
+ */
+#ifndef _MACH_HIGHBANK__SYSREGS_H_
+#define _MACH_HIGHBANK__SYSREGS_H_
+
+#include <io.h>
+
+extern void __iomem *sregs_base;
+
+#define HB_SREG_A9_PWR_REQ		0xf00
+#define HB_SREG_A9_BOOT_STAT		0xf04
+#define HB_SREG_A9_BOOT_DATA		0xf08
+
+#define HB_PWR_SUSPEND			0
Quoted 8 lines

arch/arm/mach-highbank/sysregs.h line 32

Quoted 5 lines
arch/arm/mach-highbank/sysregs.h new file +5 -0
+#define HB_PWR_SOFT_RESET		1
+#define HB_PWR_HARD_RESET		2
+#define HB_PWR_SHUTDOWN			3
+
+static inline void hignbank_set_pwr_suspend(void)

Same typo as recently fixed in the kernel:
s/hignbank/highbank/

will fix

Quoted 14 lines
Quoted 14 lines
arch/arm/mach-highbank/sysregs.h new file +13 -0
+{
+	writel(HB_PWR_SUSPEND, sregs_base + HB_SREG_A9_PWR_REQ);
+}
+
+static inline void hignbank_set_pwr_shutdown(void)
+{
+	writel(HB_PWR_SHUTDOWN, sregs_base + HB_SREG_A9_PWR_REQ);
+}
+
+static inline void hignbank_set_pwr_soft_reset(void)
+{
+	writel(HB_PWR_SOFT_RESET, sregs_base + HB_SREG_A9_PWR_REQ);
+}
Quoted 9 lines

arch/arm/mach-highbank/sysregs.h line 52

Quoted 8 lines
arch/arm/mach-highbank/sysregs.h new file +7 -0
+
+static inline void hignbank_set_pwr_hard_reset(void)
+{
+	writel(HB_PWR_HARD_RESET, sregs_base + HB_SREG_A9_PWR_REQ);
+}
+
+#endif

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#5 lore raw

PATCH v2 3/3 highbank: add l2x0 support

In reply to Jean-Christophe PLAGNIOL-VILLARD

not enable as on qemu this generate a undefined instruction exception

---
 arch/arm/Kconfig                    |    1 +
 arch/arm/mach-highbank/Makefile     |    1 +
 arch/arm/mach-highbank/cache-l2x0.c |   45 +++++++++++++++++++++++++++++++++++
 arch/arm/mach-highbank/core.h       |    2 ++
 arch/arm/mach-highbank/smc.S        |   27 +++++++++++++++++++++
 5 files changed, 76 insertions(+)
 create mode 100644 arch/arm/mach-highbank/cache-l2x0.c
 create mode 100644 arch/arm/mach-highbank/core.h
 create mode 100644 arch/arm/mach-highbank/smc.S
arch/arm/Kconfig +1 -0
index c10b9da..2ff544e 100644
@@ -52,6 +52,7 @@ config ARCH_EP93XX
 config ARCH_HIGHBANK
 	bool "Calxeda Highbank"
 	select HAS_DEBUG_LL
+	select ARCH_HAS_L2X0
 	select CPU_V7
 	select ARM_AMBA
 	select AMBA_SP804
arch/arm/mach-highbank/Makefile +1 -0
index 3f01cbb..6a7330f 100644
@@ -1,3 +1,4 @@
 obj-y += core.o
 obj-y += devices.o
 obj-y += reset.o
+obj-$(CONFIG_CACHE_L2X0) += cache-l2x0.o smc.o
arch/arm/mach-highbank/cache-l2x0.c new file +45 -0

45 lines not on this page · raw message

arch/arm/mach-highbank/core.h new file +2 -0
new file mode 100644
index 0000000..e3f19b2
@@ -0,0 +1,2 @@
+
+extern void highbank_smc1(int fn, int arg);
arch/arm/mach-highbank/smc.S new file +27 -0
new file mode 100644
index 0000000..b2118b4
@@ -0,0 +1,27 @@
+/*
+ * Copied from omap44xx-smc.S Copyright (C) 2010 Texas Instruments, Inc.
+ * Copyright 2012 Calxeda, Inc.
+ *
+ * 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.
+ */
+
+#include <linux/linkage.h>
+
+/*
+ * This is common routine to manage secure monitor API
+ * used to modify the PL310 secure registers.
+ * 'r0' contains the value to be modified and 'r12' contains
+ * the monitor API number.
+ * Function signature : void highbank_smc1(u32 fn, u32 arg)
+ */
+
+ENTRY(highbank_smc1)
+	stmfd	sp!, {r4-r11, lr}
+	mov	r12, r0
+	mov	r0, r1
+	dsb
+	smc	#0
+	ldmfd	sp!, {r4-r11, pc}
+ENDPROC(highbank_smc1)
Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox