arm: add Calxeda Highbank support
Subsystems (7)
v3 cover arm: add Calxeda Highbank support
Hi,
v3:
reset: add missing wfi
gpio: move probe to board
add oftree probe support
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 ddec6455ac75cad442be1247ae265b539c54ebfe:
amba: add oftree probe support (2013-02-13 02:35:56 +0800)
are available in the git repository at:
git://git.jcrosoft.org/barebox.git delivery/highbank
for you to fetch changes up to 1d6b912a9a89b0bdf7915026d938f40aba13b581:
highbank: use the provided dtb by the firmware to probe barebox device and mem size (2013-02-13 02:35:56 +0800)
----------------------------------------------------------------
Jean-Christophe PLAGNIOL-VILLARD (6):
ahci-generic: add oftree support
of: make of_add_memory available for other board
highbank: add xgmac support
arm: add highbank support
highbank: add l2x0 support
highbank: use the provided dtb by the firmware to probe barebox device and mem size
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/bin/init_board | 7 +++ arch/arm/boards/highbank/env/config | 34 +++++++++++ arch/arm/boards/highbank/init.c | 86 ++++++++++++++++++++++++++ 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 | 49 +++++++++++++++ arch/arm/mach-highbank/core.h | 2 + arch/arm/mach-highbank/devices.c | 74 +++++++++++++++++++++++ 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 | 17 ++++++ arch/arm/mach-highbank/include/mach/gpio.h | 1 + arch/arm/mach-highbank/reset.c | 21 +++++++ arch/arm/mach-highbank/smc.S | 27 +++++++++ arch/arm/mach-highbank/sysregs.h | 52 ++++++++++++++++ drivers/ata/ahci.c | 9 +++ drivers/net/Kconfig | 3 + drivers/net/Makefile | 1 + drivers/net/xgmac.c | 740 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ drivers/of/base.c | 20 ++++-- include/of.h | 6 ++ 28 files changed, 1344 insertions(+), 6 deletions(-) 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/bin/init_board 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
PATCH v3 1/6 ahci-generic: add oftree support
calxeda use the generic driver but have it's own compatible cf Linux kernel Documentation
--- drivers/ata/ahci.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/ata/ahci.c +9 -0
@@ -671,10 +671,19 @@ static int ahci_probe(struct device_d *dev)return ret; } +static __maybe_unused struct of_device_id ahci_dt_ids[] = { + { + .compatible ="calxeda,hb-ahci" , + }, { +/* sentinel */ + } +}; +static struct driver_d ahci_driver = { .name ="ahci" , .probe = ahci_probe, .info = ahci_info, + .of_compatible =DRV_OF_COMPAT (ahci_dt_ids), };static int ahci_init (void )
Signature · 7 lines
1.7.10.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v3 2/6 of: make of_add_memory available for other board
so when the first stage booloader of firmware provide the dtb we can use it to probe the memory
also allow to print what we probe
--- drivers/of/base.c | 20 ++++++++++++++------ include/of.h | 6 ++++++ 2 files changed, 20 insertions(+), 6 deletions(-)
drivers/of/base.c +14 -6
@@ -734,18 +734,23 @@ u64 dt_mem_next_cell(int s, const __be32 **cellp)return of_read_number (p, s); } -static int of_add_memory (struct device_node *node) +int of_add_memory (struct device_node *node,bool dump) {int na, nc;const __be32 *reg, *endp;int len, r =0 ;static char str[6 ]; +struct property *type; + + type =of_find_property (node,"device_type" ); +if (!type) +return -ENXIO ;of_bus_count_cells (node, &na, &nc); reg =of_get_property (node,"reg" , &len);if (!reg) -return 0 ; +return -EINVAL ; endp = reg + (len /sizeof (__be32));
@@ -762,6 +767,9 @@ static int of_add_memory(struct device_node *node)barebox_add_memory_bank (str, base, size); +if (dump) +pr_info ("%s: %s: 0x%llx@0x%llx\n" , node->name, str, size, base); + r++; }
@@ -770,7 +778,7 @@ static int of_add_memory(struct device_node *node)static int add_of_device_resource (struct device_node *node) { -struct property *reg, *type; +struct property *reg;u64 address, size;struct resource *res;struct device_d *dev;
@@ -783,9 +791,9 @@ static int add_of_device_resource(struct device_node *node)list_add_tail (&node->phandles, &phandle_list); } - type =of_find_property (node,"device_type" ); -if (type) -return of_add_memory (node); + ret =of_add_memory (node, false); +if (ret != -ENXIO ) +return ret; reg =of_find_property (node,"reg" );if (!reg)
include/of.h +6 -0
@@ -132,6 +132,7 @@ int of_alias_get_id(struct device_node *np, const char *stem);int of_device_is_stdout_path (struct device_d *dev);const char *of_get_model (void );void *of_flatten_dtb (void ); +int of_add_memory (struct device_node *node,bool dump);#else static inline int of_parse_partitions (const char *cdevname,struct device_node *node)
@@ -163,6 +164,11 @@ static inline void *of_flatten_dtb(void) {return NULL ; } + +static inline int of_add_memory (struct device_node *node,bool dump) +{ +return -EINVAL ; +}#endif #endif /* __OF_H */
Signature · 7 lines
1.7.10.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH 2/6] of: make of_add_memory available for other board
Quoted 22 lines · Jean-Christophe PLAGNIOL-VILLARD
so when the first stage booloader of firmware provide the dtb we can use it to probe the memory
also allow to print what we probe
Cc Rob Herring <[email protected]>Signed-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>--- drivers/of/base.c | 20 ++++++++++++++------ include/of.h | 6 ++++++ 2 files changed, 20 insertions(+), 6 deletions(-)drivers/of/base.c +1
-1@@ -734,18 +734,23 @@ u64 dt_mem_next_cell(int s, const __be32 **cellp)return of_read_number (p, s); } -static int of_add_memory (struct device_node *node) +int of_add_memory (struct device_node *node,bool dump)
drivers/of/base.c u64 dt_mem_next_cell(int s, const __be32 **cellp) · line 747
Quoted 10 lines
drivers/of/base.c +5
-0{int na, nc;const __be32 *reg, *endp;int len, r =0 ;static char str[6 ]; +struct property *type; + + type =of_find_property (node,"device_type" ); +if (!type) +return -ENXIO ;
Could you add the missing check here if device_type is 'memory'?
Sascha
Signature · 9 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH 2/6] of: make of_add_memory available for other board
Quoted 21 lines · Sascha Hauer
Quoted 20 lines · Jean-Christophe PLAGNIOL-VILLARD
so when the first stage booloader of firmware provide the dtb we can use it to probe the memory
also allow to print what we probe
Cc Rob Herring <[email protected]>Signed-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>--- drivers/of/base.c | 20 ++++++++++++++------ include/of.h | 6 ++++++ 2 files changed, 20 insertions(+), 6 deletions(-)drivers/of/base.c +0
-0@@ -734,18 +734,23 @@ u64 dt_mem_next_cell(int s, const __be32 **cellp)return of_read_number (p, s); }
Quoted 14 lines
drivers/of/base.c u64 dt_mem_next_cell(int s, const __be32 **cellp) · line 747
Quoted 12 lines
drivers/of/base.c +6
-1-static int of_add_memory (struct device_node *node) +int of_add_memory (struct device_node *node,bool dump) {int na, nc;const __be32 *reg, *endp;int len, r =0 ;static char str[6 ]; +struct property *type; + + type =of_find_property (node,"device_type" ); +if (!type) +return -ENXIO ;Could you add the missing check here if
device_typeis 'memory'?
ok
Best Regards,
J.
Quoted 8 lines
Sascha
Signature · 4 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
PATCH 1/1 of_add_memory: check the device_type is memory
In reply to Sascha Hauer--- drivers/of/base.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
drivers/of/base.c +7 -4
@@ -738,12 +738,15 @@ int of_add_memory(struct device_node *node, bool dump) {int na, nc;const __be32 *reg, *endp; -int len, r =0 ; +int len, r =0 , ret;static char str[6 ]; -struct property *type; +const char *device_type; - type =of_find_property (node,"device_type" ); -if (!type) + ret =of_property_read_string (node,"device_type" , &device_type); +if (ret) +return -ENXIO ; + +if (strcmp (device_type,"memory" ))return -ENXIO ;of_bus_count_cells (node, &na, &nc);
Signature · 7 lines
1.7.10.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v3 3/6 highbank: add xgmac support
In reply to Jean-Christophe PLAGNIOL-VILLARD--- 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
@@ -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
@@ -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
PATCH v3 4/6 arm: add highbank support
In reply to Jean-Christophe PLAGNIOL-VILLARDcurrently 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 | 50 ++++++++++++++++ arch/arm/boards/highbank/lowlevel.c | 17 ++++++ arch/arm/configs/highbank_defconfig | 60 +++++++++++++++++++ arch/arm/mach-highbank/Kconfig | 18 ++++++ arch/arm/mach-highbank/Makefile | 3 + arch/arm/mach-highbank/core.c | 49 ++++++++++++++++ arch/arm/mach-highbank/devices.c | 74 ++++++++++++++++++++++++ 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 | 17 ++++++ arch/arm/mach-highbank/include/mach/gpio.h | 1 + arch/arm/mach-highbank/reset.c | 21 +++++++ arch/arm/mach-highbank/sysregs.h | 52 +++++++++++++++++ 18 files changed, 451 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
@@ -46,6 +46,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
@@ -123,6 +133,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
@@ -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
@@ -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
@@ -0,0 +1,5 @@ + +#ifndef __CONFIG_H +#define __CONFIG_H + +#endif /* __CONFIG_H */
arch/arm/boards/highbank/env/config new file +34 -0
@@ -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 +50 -0
50 lines not on this page · raw message
arch/arm/boards/highbank/lowlevel.c new file +17 -0
@@ -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 barebox_arm_reset_vector (void ) +{ +arm_cpu_lowlevel_init (); +barebox_arm_entry (0x00000000 ,SZ_512M ,0 ); +}
arch/arm/configs/highbank_defconfig new file +60 -0
60 lines not on this page · raw message
arch/arm/mach-highbank/Kconfig new file +18 -0
@@ -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
@@ -0,0 +1,3 @@ +obj-y += core.o +obj-y += devices.o +obj-y += reset.o
arch/arm/mach-highbank/core.c new file +49 -0
49 lines not on this page · raw message
arch/arm/mach-highbank/devices.c new file +74 -0
74 lines not on this page · raw message
arch/arm/mach-highbank/include/mach/clkdev.h new file +7 -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) + +#endif
arch/arm/mach-highbank/include/mach/debug_ll.h new file +26 -0
@@ -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 +17 -0
@@ -0,0 +1,17 @@ +/* +* 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); +void highbank_register_gpio (unsigned id); + +#endif /* __ASM_ARCH_DEVICES_H__ */
arch/arm/mach-highbank/include/mach/gpio.h new file +1 -0
@@ -0,0 +1 @@ +#include <asm-generic/gpio.h>
arch/arm/mach-highbank/reset.c new file +21 -0
@@ -0,0 +1,21 @@ +/* +* 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 __noreturn reset_cpu (ulong addr) +{ +hingbank_set_pwr_hard_reset (); + asm(" wfi" ); + +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
PATCH v3 5/6 highbank: add l2x0 support
In reply to Jean-Christophe PLAGNIOL-VILLARDnot 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
@@ -49,6 +49,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
@@ -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
@@ -0,0 +1,2 @@ + +extern void highbank_smc1 (int fn,int arg);
arch/arm/mach-highbank/smc.S new file +27 -0
@@ -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
PATCH v3 6/6 highbank: use the provided dtb by the firmware to probe barebox device and mem size
In reply to Jean-Christophe PLAGNIOL-VILLARDthe dtb is at 0x1000
if no dtb present use C code device
keep in C the timer/gpio/uart
have a nice tree
barebox 2013.02.0-00294-g6802ddf #124 Wed Feb 13 02:31:01 CST 2013
Board: Calxeda Highbank
memory: ram0: 0xff900000@0x0
highbank: dtb probed memory size
registered netconsole as cs1
malloc space: 0x03500000 -> 0x03efffff (size 10 MiB) Open /dev/env0 No such file or directory
no valid environment found on /dev/env0. Using default environment running /env/bin/init...
ahci ffe08000.sata: port 0: SATA link ok
ahci ffe08000.sata: port 0: Spinning up device...
ahci ffe08000.sata: port 0: ok.
ahci ffe08000.sata: registered /dev/ata0
eth0: got preset MAC address: 52:54:00:12:34:56
eth1: got preset MAC address: 52:54:00:12:34:57
Hit any key to stop autoboot: 3
[barebox@Calxeda Highbank]:/
# devinfo
devices:
`---- platform
`---- mem0
`---- 0x00000000-0x3fffffff: /dev/ram0
`---- 0x00001000-0x00010fff: /dev/dtb
`---- mem1
`---- 0x00000000-0x000051af: /dev/defaultenv
`---- mem2
`---- 0x00000000-0xfffffffe: /dev/mem
`---- cs1
`---- fff10600.timer
`---- fff10620.watchdog
`---- fff11000.interrupt-controller
`---- l2-cache
`---- ffe08000.sata
`---- 0x00000000-0x3fffffff: /dev/ata0
`---- 0x00100000-0x014fffff: /dev/ata0.0
`---- 0x01500000-0x3fffffff: /dev/ata0.1
`---- ffe0e000.sdhci
`---- fff00000.memory-controller
`---- mem3
`---- fff3c000.sregs
`---- fff3c200.sregs
`---- fff50000.ethernet
`---- eth0
`---- fff51000.ethernet
`---- eth1
`---- amba
`---- sp804
`---- uart-pl011
`---- cs0
`---- fff30000.gpio
`---- fff31000.gpio
`---- fff32000.gpio
`---- fff33000.gpio
`---- fff35000.rtc
`---- fs
`---- ramfs0
`---- devfs0
`---- net
`---- globaldrivers:
uart-pl011
sp804pl061_gpio
ramfs
devfs
tftp
hb-xgmac
ahci
mem
[barebox@Calxeda Highbank]:/
#
--- arch/arm/boards/highbank/env/bin/init_board | 7 ++++ arch/arm/boards/highbank/init.c | 52 ++++++++++++++++++++++----- arch/arm/configs/highbank_defconfig | 1 + 3 files changed, 52 insertions(+), 8 deletions(-) create mode 100644 arch/arm/boards/highbank/env/bin/init_board
arch/arm/boards/highbank/env/bin/init_board new file +7 -0
@@ -0,0 +1,7 @@ +#!/bin/sh + +if [ -e /dev/dtb ] +then + oftree -l /dev/dtb + oftree -p +fi
arch/arm/boards/highbank/init.c +44 -8
67 lines not on this page · raw message
arch/arm/configs/highbank_defconfig +1 -0
@@ -37,6 +37,7 @@ CONFIG_CMD_UIMAGE=y CONFIG_CMD_RESET=y CONFIG_CMD_GO=y CONFIG_CMD_OFTREE=y +CONFIG_CMD_OFTREE_PROBE=y CONFIG_CMD_MTEST=y CONFIG_CMD_MTEST_ALTERNATIVE=y CONFIG_CMD_TIMEOUT=y
Signature · 7 lines
1.7.10.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Sascha Hauer
AppliedQuoted 20 lines · Jean-Christophe PLAGNIOL-VILLARD
Hi,
v3:
reset: add missing wfi
gpio: move probe to board
add oftree probe supportv2:
fix cc tag so Rob can receive the patch
add oftree support to xgmacThe 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
Quoted 7 lines
The following changes since commit
ddec6455ac75cad442be1247ae265b539c54ebfe:amba: add oftree probe support (2013-02-13 02:35:56 +0800)
are available in the git repository at:
git://git.jcrosoft.org/barebox.gitdelivery/highbank
Applied, thanks
Sascha
Quoted 73 lines
for you to fetch changes up to
1d6b912a9a89b0bdf7915026d938f40aba13b581:highbank: use the provided dtb by the firmware to probe barebox device and mem size (2013-02-13 02:35:56 +0800)
----------------------------------------------------------------
Jean-Christophe PLAGNIOL-VILLARD (6):
ahci-generic: add oftree support
of: makeof_add_memoryavailable for other board
highbank: add xgmac support
arm: add highbank support
highbank: add l2x0 support
highbank: use the provided dtb by the firmware to probe barebox device and mem sizearch/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/bin/init_board | 7 +++ arch/arm/boards/highbank/env/config | 34 +++++++++++ arch/arm/boards/highbank/init.c | 86 ++++++++++++++++++++++++++ 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 | 49 +++++++++++++++ arch/arm/mach-highbank/core.h | 2 + arch/arm/mach-highbank/devices.c | 74 +++++++++++++++++++++++ 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 | 17 ++++++ arch/arm/mach-highbank/include/mach/gpio.h | 1 + arch/arm/mach-highbank/reset.c | 21 +++++++ arch/arm/mach-highbank/smc.S | 27 +++++++++ arch/arm/mach-highbank/sysregs.h | 52 ++++++++++++++++ drivers/ata/ahci.c | 9 +++ drivers/net/Kconfig | 3 + drivers/net/Makefile | 1 + drivers/net/xgmac.c | 740 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ drivers/of/base.c | 20 ++++-- include/of.h | 6 ++ 28 files changed, 1344 insertions(+), 6 deletions(-) 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/bin/init_board 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.cBest Regards,
J._______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Signature · 9 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox