[U-Boot] [PATCH v1 0/3] sparc: Add support for Gaisler GR712RC-BOARD Development Kit

This patch series add support for the Aeroflex Gaisler GR712RC-BOARD Development Kit. It builds on top of the previous SPARC architecture update series.
Francois Retief (3): sparc: Make LEON serial drivers use readl/writel macros sparc: Add MDIO support to GRETH driver sparc: Add support for gr712rc-board
arch/sparc/Kconfig | 8 + arch/sparc/cpu/leon2/serial.c | 121 +++++----- arch/sparc/cpu/leon3/serial.c | 93 ++++---- arch/sparc/include/asm/io.h | 43 ++-- board/gaisler/gr712rc_board/Kconfig | 9 + board/gaisler/gr712rc_board/MAINTAINERS | 6 + board/gaisler/gr712rc_board/Makefile | 8 + board/gaisler/gr712rc_board/README | 24 ++ board/gaisler/gr712rc_board/gr712rc_board.c | 68 ++++++ common/cmd_bdinfo.c | 4 + configs/gr712rc_board_defconfig | 3 + drivers/net/greth.c | 57 +++++ include/configs/gr712rc_board.h | 333 ++++++++++++++++++++++++++++ include/configs/gr_cpci_ax2000.h | 4 - include/configs/gr_ep2s60.h | 4 - include/configs/gr_xc3s_1500.h | 4 - include/configs/grsim.h | 3 - 17 files changed, 650 insertions(+), 142 deletions(-) create mode 100644 board/gaisler/gr712rc_board/Kconfig create mode 100644 board/gaisler/gr712rc_board/MAINTAINERS create mode 100644 board/gaisler/gr712rc_board/Makefile create mode 100644 board/gaisler/gr712rc_board/README create mode 100644 board/gaisler/gr712rc_board/gr712rc_board.c create mode 100644 configs/gr712rc_board_defconfig create mode 100644 include/configs/gr712rc_board.h
-- 1.9.3
________________________________ Disclaimer and confidentiality note – refer to our website for further details: www.spaceteq.co.za http://www.spaceteq.co.za/home/emaildisclaimer/

Update the LEON2/3 serial driver to make use of the readl and writel macros as well as the WATCHDOG_RESET() macro.
Also, added readl/writel and friends to the asm/io.h file.
Lastly, removed baudrate scaler macro variables from board config. It is now calculated in the serial driver using the global data variable.
Signed-off-by: Francois Retief fgretief@spaceteq.co.za ---
arch/sparc/cpu/leon2/serial.c | 121 ++++++++++++++++++--------------------- arch/sparc/cpu/leon3/serial.c | 93 ++++++++++++++++-------------- arch/sparc/include/asm/io.h | 43 ++++++++------ include/configs/gr_cpci_ax2000.h | 4 -- include/configs/gr_ep2s60.h | 4 -- include/configs/gr_xc3s_1500.h | 4 -- include/configs/grsim.h | 3 - 7 files changed, 130 insertions(+), 142 deletions(-)
diff --git a/arch/sparc/cpu/leon2/serial.c b/arch/sparc/cpu/leon2/serial.c index 5cfbb9e..9fe4fdd 100644 --- a/arch/sparc/cpu/leon2/serial.c +++ b/arch/sparc/cpu/leon2/serial.c @@ -7,66 +7,68 @@ */
#include <common.h> +#include <asm/io.h> #include <asm/processor.h> -#include <asm/leon.h> #include <serial.h> -#include <linux/compiler.h> +#include <watchdog.h>
DECLARE_GLOBAL_DATA_PTR;
-static int leon2_serial_init(void) +static inline LEON2_Uart_regs *leon2_get_uart_regs(void) { LEON2_regs *leon2 = (LEON2_regs *) LEON2_PREGS; - LEON2_Uart_regs *regs; - unsigned int tmp;
- /* Init LEON2 UART - * - * Set scaler / baud rate - * - * Receiver & transmitter enable - */ #if LEON2_CONSOLE_SELECT == LEON_CONSOLE_UART1 - regs = (LEON2_Uart_regs *) & leon2->UART_Channel_1; + return (LEON2_Uart_regs *)&leon2->UART_Channel_1; #else - regs = (LEON2_Uart_regs *) & leon2->UART_Channel_2; + return (LEON2_Uart_regs *)&leon2->UART_Channel_2; #endif +}
- regs->UART_Scaler = CONFIG_SYS_LEON2_UART1_SCALER; +static int leon2_serial_init(void) +{ + LEON2_Uart_regs *uart = leon2_get_uart_regs(); + unsigned int tmp;
- /* Let bit 11 be unchanged (debug bit for GRMON) */ - tmp = READ_WORD(regs->UART_Control); + /* Init LEON2 UART */ + if (!uart) + return -1;
- regs->UART_Control = ((tmp & LEON2_UART_CTRL_DBG) | - (LEON2_UART1_LOOPBACK_ENABLE << 7) | - (LEON2_UART1_FLOWCTRL_ENABLE << 6) | - (LEON2_UART1_PARITY_ENABLE << 5) | - (LEON2_UART1_ODDPAR_ENABLE << 4) | - LEON2_UART_CTRL_RE | LEON2_UART_CTRL_TE); + /* Set scaler / baud rate */ + tmp = (((CONFIG_SYS_CLK_FREQ * 10)/(CONFIG_BAUDRATE * 8)) - 5) / 10; + writel(tmp, &uart->UART_Scaler); + + /* Let bit 11 be unchanged (debug bit for GRMON) */ + tmp = readl(&uart->UART_Control) & LEON2_UART_CTRL_DBG; + tmp |= (LEON2_UART1_LOOPBACK_ENABLE << 7); + tmp |= (LEON2_UART1_FLOWCTRL_ENABLE << 6); + tmp |= (LEON2_UART1_PARITY_ENABLE << 5); + tmp |= (LEON2_UART1_ODDPAR_ENABLE << 4); + /* Receiver & transmitter enable */ + tmp |= (LEON2_UART_CTRL_RE | LEON2_UART_CTRL_TE); + writel(tmp, &uart->UART_Control);
return 0; }
static void leon2_serial_putc_raw(const char c) { - LEON2_regs *leon2 = (LEON2_regs *) LEON2_PREGS; - LEON2_Uart_regs *regs; + LEON2_Uart_regs *uart = leon2_get_uart_regs();
-#if LEON2_CONSOLE_SELECT == LEON_CONSOLE_UART1 - regs = (LEON2_Uart_regs *) & leon2->UART_Channel_1; -#else - regs = (LEON2_Uart_regs *) & leon2->UART_Channel_2; -#endif + if (!uart) + return;
/* Wait for last character to go. */ - while (!(READ_WORD(regs->UART_Status) & LEON2_UART_STAT_THE)) ; + while (!(readl(&uart->UART_Status) & LEON2_UART_STAT_THE)) + WATCHDOG_RESET();
/* Send data */ - regs->UART_Channel = c; + writel(c, &uart->UART_Channel);
#ifdef LEON_DEBUG /* Wait for data to be sent */ - while (!(READ_WORD(regs->UART_Status) & LEON2_UART_STAT_TSE)) ; + while (!(readl(&uart->UART_Status) & LEON2_UART_STAT_TSE)) + WATCHDOG_RESET(); #endif }
@@ -80,56 +82,43 @@ static void leon2_serial_putc(const char c)
static int leon2_serial_getc(void) { - LEON2_regs *leon2 = (LEON2_regs *) LEON2_PREGS; - LEON2_Uart_regs *regs; + LEON2_Uart_regs *uart = leon2_get_uart_regs();
-#if LEON2_CONSOLE_SELECT == LEON_CONSOLE_UART1 - regs = (LEON2_Uart_regs *) & leon2->UART_Channel_1; -#else - regs = (LEON2_Uart_regs *) & leon2->UART_Channel_2; -#endif + if (!uart) + return 0;
- /* Wait for a character to arrive. */ - while (!(READ_WORD(regs->UART_Status) & LEON2_UART_STAT_DR)) ; + /* Wait for a character to arrive */ + while (!(readl(&uart->UART_Status) & LEON2_UART_STAT_DR)) + WATCHDOG_RESET();
- /* read data */ - return READ_WORD(regs->UART_Channel); + /* Read character data */ + return readl(&uart->UART_Channel); }
static int leon2_serial_tstc(void) { - LEON2_regs *leon2 = (LEON2_regs *) LEON2_PREGS; - LEON2_Uart_regs *regs; + LEON2_Uart_regs *uart = leon2_get_uart_regs();
-#if LEON2_CONSOLE_SELECT == LEON_CONSOLE_UART1 - regs = (LEON2_Uart_regs *) & leon2->UART_Channel_1; -#else - regs = (LEON2_Uart_regs *) & leon2->UART_Channel_2; -#endif + if (!uart) + return 0;
- return (READ_WORD(regs->UART_Status) & LEON2_UART_STAT_DR); + return readl(&uart->UART_Status) & LEON2_UART_STAT_DR; }
-/* set baud rate for uart */ static void leon2_serial_setbrg(void) { - /* update baud rate settings, read it from gd->baudrate */ + LEON2_Uart_regs *uart = leon2_get_uart_regs(); unsigned int scaler; - LEON2_regs *leon2 = (LEON2_regs *) LEON2_PREGS; - LEON2_Uart_regs *regs;
-#if LEON2_CONSOLE_SELECT == LEON_CONSOLE_UART1 - regs = (LEON2_Uart_regs *) & leon2->UART_Channel_1; -#else - regs = (LEON2_Uart_regs *) & leon2->UART_Channel_2; -#endif + if (!uart) + return; + + if (!gd->baudrate) + gd->baudrate = CONFIG_BAUDRATE; + + scaler = (((CONFIG_SYS_CLK_FREQ * 10)/(gd->baudrate * 8)) - 5) / 10;
- if (gd->baudrate > 0) { - scaler = - (((CONFIG_SYS_CLK_FREQ * 10) / (gd->baudrate * 8)) - - 5) / 10; - regs->UART_Scaler = scaler; - } + writel(scaler, &uart->UART_Scaler); }
static struct serial_device leon2_serial_drv = { diff --git a/arch/sparc/cpu/leon3/serial.c b/arch/sparc/cpu/leon3/serial.c index bca6b65..bd3b09b 100644 --- a/arch/sparc/cpu/leon3/serial.c +++ b/arch/sparc/cpu/leon3/serial.c @@ -7,11 +7,10 @@ */
#include <common.h> -#include <asm/processor.h> -#include <asm/leon.h> +#include <asm/io.h> #include <ambapp.h> #include <serial.h> -#include <linux/compiler.h> +#include <watchdog.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -19,48 +18,49 @@ ambapp_dev_apbuart *leon3_apbuart = NULL;
static int leon3_serial_init(void) { + ambapp_dev_apbuart *uart; ambapp_apbdev apbdev; unsigned int tmp;
/* find UART */ - if (ambapp_apb_first(VENDOR_GAISLER, GAISLER_APBUART, &apbdev) == 1) { + if (ambapp_apb_first(VENDOR_GAISLER, GAISLER_APBUART, &apbdev) != 1) + return -1; /* didn't find hardware */
- leon3_apbuart = (ambapp_dev_apbuart *) apbdev.address; + /* found apbuart, let's init .. */ + uart = (ambapp_dev_apbuart *) apbdev.address;
- /* found apbuart, let's init... - * - * Set scaler / baud rate - * - * Receiver & transmitter enable - */ - leon3_apbuart->scaler = CONFIG_SYS_GRLIB_APBUART_SCALER; + /* Set scaler / baud rate */ + tmp = (((CONFIG_SYS_CLK_FREQ * 10)/(CONFIG_BAUDRATE * 8)) - 5) / 10; + writel(tmp, &uart->scaler);
- /* Let bit 11 be unchanged (debug bit for GRMON) */ - tmp = READ_WORD(leon3_apbuart->ctrl); + /* Let bit 11 be unchanged (debug bit for GRMON) */ + tmp = readl(&uart->ctrl) & LEON_REG_UART_CTRL_DBG; + /* Receiver & transmitter enable */ + tmp |= LEON_REG_UART_CTRL_RE | LEON_REG_UART_CTRL_TE; + writel(tmp, &uart->ctrl);
- leon3_apbuart->ctrl = ((tmp & LEON_REG_UART_CTRL_DBG) | - LEON_REG_UART_CTRL_RE | - LEON_REG_UART_CTRL_TE); - - return 0; - } - return -1; /* didn't find hardware */ + leon3_apbuart = uart; + return 0; }
static void leon3_serial_putc_raw(const char c) { - if (!leon3_apbuart) + ambapp_dev_apbuart * const uart = leon3_apbuart; + + if (!uart) return;
/* Wait for last character to go. */ - while (!(READ_WORD(leon3_apbuart->status) & LEON_REG_UART_STATUS_THE)) ; + while (!(readl(&uart->status) & LEON_REG_UART_STATUS_THE)) + WATCHDOG_RESET();
/* Send data */ - leon3_apbuart->data = c; + writel(c, &uart->data);
#ifdef LEON_DEBUG /* Wait for data to be sent */ - while (!(READ_WORD(leon3_apbuart->status) & LEON_REG_UART_STATUS_TSE)) ; + while (!(readl(&uart->status) & LEON_REG_UART_STATUS_TSE)) + WATCHDOG_RESET(); #endif }
@@ -74,36 +74,43 @@ static void leon3_serial_putc(const char c)
static int leon3_serial_getc(void) { - if (!leon3_apbuart) + ambapp_dev_apbuart * const uart = leon3_apbuart; + + if (!uart) return 0;
- /* Wait for a character to arrive. */ - while (!(READ_WORD(leon3_apbuart->status) & LEON_REG_UART_STATUS_DR)) ; + /* Wait for a character to arrive */ + while (!(readl(&uart->status) & LEON_REG_UART_STATUS_DR)) + WATCHDOG_RESET();
- /* read data */ - return READ_WORD(leon3_apbuart->data); + /* Read character data */ + return readl(&uart->data); }
static int leon3_serial_tstc(void) { - if (leon3_apbuart) - return (READ_WORD(leon3_apbuart->status) & - LEON_REG_UART_STATUS_DR); - return 0; + ambapp_dev_apbuart * const uart = leon3_apbuart; + + if (!uart) + return 0; + + return readl(&uart->status) & LEON_REG_UART_STATUS_DR; }
-/* set baud rate for uart */ static void leon3_serial_setbrg(void) { - /* update baud rate settings, read it from gd->baudrate */ + ambapp_dev_apbuart * const uart = leon3_apbuart; unsigned int scaler; - if (leon3_apbuart && (gd->baudrate > 0)) { - scaler = - (((CONFIG_SYS_CLK_FREQ * 10) / (gd->baudrate * 8)) - - 5) / 10; - leon3_apbuart->scaler = scaler; - } - return; + + if (!uart) + return; + + if (!gd->baudrate) + gd->baudrate = CONFIG_BAUDRATE; + + scaler = (((CONFIG_SYS_CLK_FREQ * 10)/(gd->baudrate * 8)) - 5) / 10; + + writel(scaler, &uart->scaler); }
static struct serial_device leon3_serial_drv = { diff --git a/arch/sparc/include/asm/io.h b/arch/sparc/include/asm/io.h index f7b89c8..93aff1d 100644 --- a/arch/sparc/include/asm/io.h +++ b/arch/sparc/include/asm/io.h @@ -12,31 +12,30 @@ /* Nothing to sync, total store ordering (TSO)... */ #define sync()
+/* + * Generic virtual read/write. + */ + +#ifndef CONFIG_SYS_HAS_NO_CACHE + /* Forces a cache miss on read/load. * On some architectures we need to bypass the cache when reading * I/O registers so that we are not reading the same status word * over and over again resulting in a hang (until an IRQ if lucky) - * */ -#ifndef CONFIG_SYS_HAS_NO_CACHE -#define READ_BYTE(var) SPARC_NOCACHE_READ_BYTE((unsigned int)(var)) -#define READ_HWORD(var) SPARC_NOCACHE_READ_HWORD((unsigned int)(var)) -#define READ_WORD(var) SPARC_NOCACHE_READ((unsigned int)(var)) -#define READ_DWORD(var) SPARC_NOCACHE_READ_DWORD((unsigned int)(var)) +#define __arch_getb(a) SPARC_NOCACHE_READ_BYTE((unsigned int)(a)) +#define __arch_getw(a) SPARC_NOCACHE_READ_HWORD((unsigned int)(a)) +#define __arch_getl(a) SPARC_NOCACHE_READ((unsigned int)(a)) +#define __arch_getq(a) SPARC_NOCACHE_READ_DWORD((unsigned int)(a)) + #else -#define READ_BYTE(var) (var) -#define READ_HWORD(var) (var) -#define READ_WORD(var) (var) -#define READ_DWORD(var) (var) -#endif
-/* - * Generic virtual read/write. - */ -#define __arch_getb(a) (READ_BYTE(a)) -#define __arch_getw(a) (READ_HWORD(a)) -#define __arch_getl(a) (READ_WORD(a)) -#define __arch_getq(a) (READ_DWORD(a)) +#define __arch_getb(a) (*(volatile unsigned char *)(a)) +#define __arch_getw(a) (*(volatile unsigned short *)(a)) +#define __arch_getl(a) (*(volatile unsigned int *)(a)) +#define __arch_getq(a) (*(volatile unsigned long long *)(a)) + +#endif /* CONFIG_SYS_HAS_NO_CACHE */
#define __arch_putb(v,a) (*(volatile unsigned char *)(a) = (v)) #define __arch_putw(v,a) (*(volatile unsigned short *)(a) = (v)) @@ -51,6 +50,14 @@ #define __raw_readl(a) __arch_getl(a) #define __raw_readq(a) __arch_getq(a)
+#define writeb __raw_writeb +#define writew __raw_writew +#define writel __raw_writel + +#define readb __raw_readb +#define readw __raw_readw +#define readl __raw_readl + /* * Given a physical address and a length, return a virtual address * that can be used to access the memory range with the caching diff --git a/include/configs/gr_cpci_ax2000.h b/include/configs/gr_cpci_ax2000.h index 3029f42..344aea1 100644 --- a/include/configs/gr_cpci_ax2000.h +++ b/include/configs/gr_cpci_ax2000.h @@ -343,10 +343,6 @@ #define CONFIG_SYS_GRLIB_DDR2_CFG1 0x00000000 #define CONFIG_SYS_GRLIB_DDR2_CFG3 0x00000000
-/* Calculate scaler register value from default baudrate */ -#define CONFIG_SYS_GRLIB_APBUART_SCALER \ - ((((CONFIG_SYS_CLK_FREQ*10)/(CONFIG_BAUDRATE*8))-5)/10) - /* Identification string */ #define CONFIG_IDENT_STRING " Gaisler LEON3 GR-CPCI-AX2000"
diff --git a/include/configs/gr_ep2s60.h b/include/configs/gr_ep2s60.h index 32ee7c9..4460dde 100644 --- a/include/configs/gr_ep2s60.h +++ b/include/configs/gr_ep2s60.h @@ -318,10 +318,6 @@ #define CONFIG_SYS_GRLIB_DDR2_CFG1 0x00000000 #define CONFIG_SYS_GRLIB_DDR2_CFG3 0x00000000
-/* Calculate scaler register value from default baudrate */ -#define CONFIG_SYS_GRLIB_APBUART_SCALER \ - ((((CONFIG_SYS_CLK_FREQ*10)/(CONFIG_BAUDRATE*8))-5)/10) - /* Identification string */ #define CONFIG_IDENT_STRING " Gaisler LEON3 EP2S60"
diff --git a/include/configs/gr_xc3s_1500.h b/include/configs/gr_xc3s_1500.h index 565310e..e546ed6 100644 --- a/include/configs/gr_xc3s_1500.h +++ b/include/configs/gr_xc3s_1500.h @@ -283,10 +283,6 @@ #define CONFIG_SYS_GRLIB_DDR2_CFG1 0x00000000 #define CONFIG_SYS_GRLIB_DDR2_CFG3 0x00000000
-/* Calculate scaler register value from default baudrate */ -#define CONFIG_SYS_GRLIB_APBUART_SCALER \ - ((((CONFIG_SYS_CLK_FREQ*10)/(CONFIG_BAUDRATE*8))-5)/10) - /* Identification string */ #define CONFIG_IDENT_STRING " Gaisler LEON3 GR-XC3S-1500"
diff --git a/include/configs/grsim.h b/include/configs/grsim.h index 3b70983..a7b9dae 100644 --- a/include/configs/grsim.h +++ b/include/configs/grsim.h @@ -310,9 +310,6 @@ #define CONFIG_SYS_GRLIB_DDR2_CFG1 0x00000000 #define CONFIG_SYS_GRLIB_DDR2_CFG3 0x00000000
-#define CONFIG_SYS_GRLIB_APBUART_SCALER \ - ((((CONFIG_SYS_CLK_FREQ*10)/(CONFIG_BAUDRATE*8))-5)/10) - /* default kernel command line */ #define CONFIG_DEFAULT_KERNEL_COMMAND_LINE "console=ttyS0,38400\0\0"
-- 1.9.3
________________________________ Disclaimer and confidentiality note – refer to our website for further details: www.spaceteq.co.za http://www.spaceteq.co.za/home/emaildisclaimer/

Added MDIO support to the Aeroflex Gaisler GRETH driver. The result is that we can now use the CONFIG_CMD_MII commands to access the PHY chip.
Signed-off-by: Francois Retief fgretief@spaceteq.co.za ---
drivers/net/greth.c | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+)
diff --git a/drivers/net/greth.c b/drivers/net/greth.c index 7784684..5f5abd6 100644 --- a/drivers/net/greth.c +++ b/drivers/net/greth.c @@ -18,6 +18,8 @@ #include <asm/processor.h> #include <ambapp.h> #include <asm/leon.h> +#include <miiphy.h> +#include <errno.h>
#include "greth.h"
@@ -52,6 +54,7 @@ typedef struct { greth_regs *regs; int irq; struct eth_device *dev; + struct mii_dev *bus;
/* Hardware info */ unsigned char phyaddr; @@ -124,6 +127,57 @@ static void write_mii(int phyaddr, int regaddr, int data, volatile greth_regs *
}
+#ifdef CONFIG_MII + +static int greth_mdio_read(struct mii_dev *bus, int port_addr, int dev_addr, int regnum) +{ + greth_regs *regs = (greth_regs *)bus->priv; + + debug("GRETH: mdio_read (port_addr=%d, dev_addr=%d, reg=%d)\n", port_addr, dev_addr, regnum); + + return read_mii(port_addr, regnum, regs); +} + +static int greth_mdio_write(struct mii_dev *bus, int port_addr, int dev_addr, int regnum, u16 value) +{ + greth_regs *regs = (greth_regs *)bus->priv; + + debug("GRETH: mdio_write (port_addr=%d, dev_addr=%d, reg=%d, value=%d)\n", port_addr, dev_addr, regnum, value); + + write_mii(port_addr, regnum, value, regs); + return 0; +} + +static int greth_mdio_reset(struct mii_dev *bus) +{ + puts("GRETH: Reset PHY via MDIO reset\n"); + return 0; +} + +int greth_mdio_register(greth_priv *greth, bd_t *bis) +{ + struct mii_dev *bus = mdio_alloc(); + + if (!bus) { + printf("GRETH: Failed to allocate MDIO bus\n"); + return -ENOMEM; + } + + bus->read = greth_mdio_read; + bus->write = greth_mdio_write; + bus->reset = greth_mdio_reset; + sprintf(bus->name, "GRETH%d", 0); + + bus->priv = (void *)greth->regs; + greth->bus = bus; + + return mdio_register(bus); +} + +#else +static inline int greth_mdio_register(greth_priv *greth, bd_t *bis) { return 0; } +#endif /* CONFIG_CMD_MII */ + /* init/start hardware and allocate descriptor buffers for rx side * */ @@ -633,6 +687,9 @@ int greth_initialize(bd_t * bis) sprintf(dev->name, "GRETH_10/100"); }
+ /* Register our device with the MDIO subsystem */ + greth_mdio_register(greth, bis); + /* initiate PHY, select speed/duplex depending on connected PHY */ if (greth_init_phy(greth, bis)) { /* Failed to init PHY (timedout) */ -- 1.9.3
________________________________ Disclaimer and confidentiality note – refer to our website for further details: www.spaceteq.co.za http://www.spaceteq.co.za/home/emaildisclaimer/

Hi Francios,
On Wed, Nov 5, 2014 at 6:30 AM, Francois Retief fgretief@spaceteq.co.za wrote:
Added MDIO support to the Aeroflex Gaisler GRETH driver. The result is that we can now use the CONFIG_CMD_MII commands to access the PHY chip.
Signed-off-by: Francois Retief fgretief@spaceteq.co.za
I noticed this still sitting in patchwork. I attempted to apply it, but it fails checkpatch.pl.
WARNING: please, no spaces at the start of a line #41: FILE: drivers/net/greth.c:57: + struct mii_dev *bus;$
WARNING: line over 80 characters #51: FILE: drivers/net/greth.c:132: +static int greth_mdio_read(struct mii_dev *bus, int port_addr, int dev_addr, int regnum)
WARNING: please, no spaces at the start of a line #53: FILE: drivers/net/greth.c:134: + greth_regs *regs = (greth_regs *)bus->priv;$
WARNING: line over 80 characters #55: FILE: drivers/net/greth.c:136: + debug("GRETH: mdio_read (port_addr=%d, dev_addr=%d, reg=%d)\n", port_addr, dev_addr, regnum);
WARNING: please, no spaces at the start of a line #55: FILE: drivers/net/greth.c:136: + debug("GRETH: mdio_read (port_addr=%d, dev_addr=%d, reg=%d)\n", port_addr, dev_addr, regnum);$
WARNING: please, no spaces at the start of a line #57: FILE: drivers/net/greth.c:138: + return read_mii(port_addr, regnum, regs);$
WARNING: line over 80 characters #60: FILE: drivers/net/greth.c:141: +static int greth_mdio_write(struct mii_dev *bus, int port_addr, int dev_addr, int regnum, u16 value)
WARNING: please, no spaces at the start of a line #62: FILE: drivers/net/greth.c:143: + greth_regs *regs = (greth_regs *)bus->priv;$
WARNING: line over 80 characters #64: FILE: drivers/net/greth.c:145: + debug("GRETH: mdio_write (port_addr=%d, dev_addr=%d, reg=%d, value=%d)\n", port_addr, dev_addr, regnum, value);
WARNING: please, no spaces at the start of a line #64: FILE: drivers/net/greth.c:145: + debug("GRETH: mdio_write (port_addr=%d, dev_addr=%d, reg=%d, value=%d)\n", port_addr, dev_addr, regnum, value);$
WARNING: please, no spaces at the start of a line #66: FILE: drivers/net/greth.c:147: + write_mii(port_addr, regnum, value, regs);$
WARNING: please, no spaces at the start of a line #67: FILE: drivers/net/greth.c:148: + return 0;$
WARNING: please, no spaces at the start of a line #72: FILE: drivers/net/greth.c:153: + puts("GRETH: Reset PHY via MDIO reset\n");$
WARNING: please, no spaces at the start of a line #73: FILE: drivers/net/greth.c:154: + return 0;$
WARNING: please, no spaces at the start of a line #78: FILE: drivers/net/greth.c:159: + struct mii_dev *bus = mdio_alloc();$
WARNING: please, no spaces at the start of a line #80: FILE: drivers/net/greth.c:161: + if (!bus) {$
WARNING: suspect code indent for conditional statements (7, 15) #80: FILE: drivers/net/greth.c:161: + if (!bus) { + printf("GRETH: Failed to allocate MDIO bus\n");
ERROR: code indent should use tabs where possible #81: FILE: drivers/net/greth.c:162: + printf("GRETH: Failed to allocate MDIO bus\n");$
WARNING: please, no spaces at the start of a line #81: FILE: drivers/net/greth.c:162: + printf("GRETH: Failed to allocate MDIO bus\n");$
ERROR: code indent should use tabs where possible #82: FILE: drivers/net/greth.c:163: + return -ENOMEM;$
WARNING: please, no spaces at the start of a line #82: FILE: drivers/net/greth.c:163: + return -ENOMEM;$
WARNING: please, no spaces at the start of a line #83: FILE: drivers/net/greth.c:164: + }$
WARNING: please, no spaces at the start of a line #85: FILE: drivers/net/greth.c:166: + bus->read = greth_mdio_read;$
WARNING: please, no spaces at the start of a line #86: FILE: drivers/net/greth.c:167: + bus->write = greth_mdio_write;$
WARNING: please, no spaces at the start of a line #87: FILE: drivers/net/greth.c:168: + bus->reset = greth_mdio_reset;$
WARNING: please, no spaces at the start of a line #88: FILE: drivers/net/greth.c:169: + sprintf(bus->name, "GRETH%d", 0);$
WARNING: please, no spaces at the start of a line #90: FILE: drivers/net/greth.c:171: + bus->priv = (void *)greth->regs;$
WARNING: please, no spaces at the start of a line #91: FILE: drivers/net/greth.c:172: + greth->bus = bus;$
WARNING: please, no spaces at the start of a line #93: FILE: drivers/net/greth.c:174: + return mdio_register(bus);$
WARNING: line over 80 characters #97: FILE: drivers/net/greth.c:178: +static inline int greth_mdio_register(greth_priv *greth, bd_t *bis) { return 0; }
WARNING: please, no spaces at the start of a line #108: FILE: drivers/net/greth.c:691: + greth_mdio_register(greth, bis);$
total: 2 errors, 29 warnings, 0 checks, 81 lines checked
NOTE: whitespace errors detected, you may wish to use scripts/cleanpatch or scripts/cleanfile
Please clean up and repost.
Thanks, -Joe

Add support of the Aeroflex Gaisler GR712RC-BOARD Development Kit.
Signed-off-by: Francois Retief fgretief@spaceteq.co.za ---
arch/sparc/Kconfig | 8 + board/gaisler/gr712rc_board/Kconfig | 9 + board/gaisler/gr712rc_board/MAINTAINERS | 6 + board/gaisler/gr712rc_board/Makefile | 8 + board/gaisler/gr712rc_board/README | 24 ++ board/gaisler/gr712rc_board/gr712rc_board.c | 68 ++++++ common/cmd_bdinfo.c | 4 + configs/gr712rc_board_defconfig | 3 + include/configs/gr712rc_board.h | 333 ++++++++++++++++++++++++++++ 9 files changed, 463 insertions(+) create mode 100644 board/gaisler/gr712rc_board/Kconfig create mode 100644 board/gaisler/gr712rc_board/MAINTAINERS create mode 100644 board/gaisler/gr712rc_board/Makefile create mode 100644 board/gaisler/gr712rc_board/README create mode 100644 board/gaisler/gr712rc_board/gr712rc_board.c create mode 100644 configs/gr712rc_board_defconfig create mode 100644 include/configs/gr712rc_board.h
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig index 2df09b2..fa0e5bf 100644 --- a/arch/sparc/Kconfig +++ b/arch/sparc/Kconfig @@ -35,6 +35,13 @@ config TARGET_GR_XC3S_1500 bool "Gaisler GR-XC3S-1500 spartan board" select LEON3
+config TARGET_GR712RC_BOARD + bool "Gaisler GR712RC-BOARD Development Kit" + select LEON3 + help + Aeroflex Gaisler's GR712RC development board, based on the Gaisler + GR712RC dual-core 32-bit fault tolerant LEON3FT SPARC v8 processor. + config TARGET_GRSIM bool "GRSIM simulating a LEON3 GR-XC3S-1500 board" select LEON3 @@ -54,6 +61,7 @@ config SYS_VENDOR source "board/gaisler/gr_cpci_ax2000/Kconfig" source "board/gaisler/gr_ep2s60/Kconfig" source "board/gaisler/gr_xc3s_1500/Kconfig" +source "board/gaisler/gr712rc_board/Kconfig" source "board/gaisler/grsim/Kconfig" source "board/gaisler/grsim_leon2/Kconfig"
diff --git a/board/gaisler/gr712rc_board/Kconfig b/board/gaisler/gr712rc_board/Kconfig new file mode 100644 index 0000000..4ef60e2 --- /dev/null +++ b/board/gaisler/gr712rc_board/Kconfig @@ -0,0 +1,9 @@ +if TARGET_GR712RC_BOARD + +config SYS_BOARD + default "gr712rc_board" + +config SYS_CONFIG_NAME + default "gr712rc_board" + +endif diff --git a/board/gaisler/gr712rc_board/MAINTAINERS b/board/gaisler/gr712rc_board/MAINTAINERS new file mode 100644 index 0000000..1a77f89 --- /dev/null +++ b/board/gaisler/gr712rc_board/MAINTAINERS @@ -0,0 +1,6 @@ +GR712RC BOARD +#M: - +S: Maintained +F: board/gaisler/gr712rc_board/ +F: include/configs/gr712rc_board.h +F: configs/gr712rc_board_defconfig diff --git a/board/gaisler/gr712rc_board/Makefile b/board/gaisler/gr712rc_board/Makefile new file mode 100644 index 0000000..11861ef --- /dev/null +++ b/board/gaisler/gr712rc_board/Makefile @@ -0,0 +1,8 @@ +# +# (C) Copyright 2014, Denel Spaceteq +# Francois Retief fgretief@spaceteq.co.za +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y := gr712rc_board.o diff --git a/board/gaisler/gr712rc_board/README b/board/gaisler/gr712rc_board/README new file mode 100644 index 0000000..1f2efab --- /dev/null +++ b/board/gaisler/gr712rc_board/README @@ -0,0 +1,24 @@ +These jumpers need to be correctly set for U-Boot to operate. + +Jumpers for SDRAM: + JP12 = C SDCSN0 + JP13 = C SDCSN1 + JP24 = C SDDQM0 + JP25 = C SDDQM1 + JP48 = C SDCASN + JP49 = C SDRASN + JP52 = C SDWEN + JP53 = C SDDQM2 + JP54 = C SDDQM3 + +Jumpers for Ethernet (RMII): + JP28 = F RMTXD0 + JP29 = F RMTXD1 + JP30 = F RMRXD0 + JP31 = F RMRXD1 + JP32 = F RMTXEN + JP34 = F RMCRSDV + JP35 = F RMMDINT + JP36 = F RMMDIO + JP37 = F RMMDC + JP38 = F RMRFCLK diff --git a/board/gaisler/gr712rc_board/gr712rc_board.c b/board/gaisler/gr712rc_board/gr712rc_board.c new file mode 100644 index 0000000..0b454ba --- /dev/null +++ b/board/gaisler/gr712rc_board/gr712rc_board.c @@ -0,0 +1,68 @@ +/* + * GR712RC-BOARD Developement Kit + * + * (C) Copyright 2014, Denel Spaceteq + * Francois Retief fgretief@spaceteq.co.za + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <common.h> +#include <netdev.h> +#include <asm/io.h> +#include <ambapp.h> + +DECLARE_GLOBAL_DATA_PTR; + +int checkboard(void) +{ + puts("Board: GR712RC-BOARD Development Kit\n"); + return 0; +} + +#ifdef CONFIG_CMD_NET + +#define GAISLER_CLKGATE 0x02C + +#define CLKGATE_GRETH BIT(0) +#define CLKGATE_GRSPW0 BIT(1) +#define CLKGATE_GRSPW1 BIT(2) +#define CLKGATE_GRSPW2 BIT(3) +#define CLKGATE_GRSPW3 BIT(4) +#define CLKGATE_GRSPW4 BIT(5) +#define CLKGATE_GRSPW5 BIT(6) +#define CLKGATE_CANCORE BIT(7) +#define CLKGATE_SATCAN BIT(8) +#define CLKGATE_CCSDS_TLM BIT(9) +#define CLKGATE_CCSDS_TCM BIT(10) +#define CLKGATE_MIL1553 BIT(11) + +#define BIT(x) (1<<(x)) + +typedef struct { + volatile unsigned int unlock; + volatile unsigned int clock_enable; + volatile unsigned int core_reset; +} ambapp_dev_clkgate; + +int board_eth_init(bd_t *bis) +{ + ambapp_apbdev apbdev; + + if (ambapp_apb_first(VENDOR_GAISLER, GAISLER_CLKGATE, &apbdev) != 1) { + puts("Unable to find CLKGATE core. Clock to GRETH not enabled!\n"); + } else { + ambapp_dev_clkgate *clkgate = (ambapp_dev_clkgate *) apbdev.address; + + /* Enable clock for GRETH core */ + clkgate->unlock = CLKGATE_GRETH; + clkgate->core_reset = CLKGATE_GRETH; + clkgate->clock_enable = CLKGATE_GRETH; + clkgate->core_reset = 0; + clkgate->unlock = 0; + } + + return cpu_eth_init(bis); +} + +#endif diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c index 3d37a86..6af5afe 100644 --- a/common/cmd_bdinfo.c +++ b/common/cmd_bdinfo.c @@ -216,10 +216,14 @@ int do_bdinfo(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) print_num("flashstart ", bd->bi_flashstart); print_num("CONFIG_SYS_MONITOR_BASE ", CONFIG_SYS_MONITOR_BASE); print_num("CONFIG_ENV_ADDR ", CONFIG_ENV_ADDR); +#ifdef CONFIG_SYS_RELOC_MONITOR_BASE printf("CONFIG_SYS_RELOC_MONITOR_BASE = 0x%x (%d)\n", CONFIG_SYS_RELOC_MONITOR_BASE, CONFIG_SYS_MONITOR_LEN); +#endif +#ifdef CONFIG_SYS_MALLOC_BASE printf("CONFIG_SYS_MALLOC_BASE = 0x%x (%d)\n", CONFIG_SYS_MALLOC_BASE, CONFIG_SYS_MALLOC_LEN); +#endif printf("CONFIG_SYS_INIT_SP_OFFSET = 0x%x (%d)\n", CONFIG_SYS_INIT_SP_OFFSET, CONFIG_SYS_STACK_SIZE); printf("CONFIG_SYS_PROM_OFFSET = 0x%x (%d)\n", CONFIG_SYS_PROM_OFFSET, diff --git a/configs/gr712rc_board_defconfig b/configs/gr712rc_board_defconfig new file mode 100644 index 0000000..c3c0a93 --- /dev/null +++ b/configs/gr712rc_board_defconfig @@ -0,0 +1,3 @@ +CONFIG_SYS_TEXT_BASE=0x60000000 +CONFIG_SPARC=y +CONFIG_TARGET_GR712RC_BOARD=y diff --git a/include/configs/gr712rc_board.h b/include/configs/gr712rc_board.h new file mode 100644 index 0000000..afccf01 --- /dev/null +++ b/include/configs/gr712rc_board.h @@ -0,0 +1,333 @@ +/* Configuration header file for GR712RC-BOARD Development Kit + * + * (C) Copyright 2007 + * Daniel Hellstrom, Gaisler Research, daniel@gaisler.com. + * + * (C) Copyright 2014 + * Francois Retief, Denel Spaceteq, fgretief@spaceteq.co.za. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#ifndef __CONFIG_H__ +#define __CONFIG_H__ + +#include <linux/sizes.h> + +#define CONFIG_SYS_GENERIC_BOARD 1 + +#define CONFIG_DISPLAY_CPUINFO +#define CONFIG_DISPLAY_BOARDINFO + +/* CPU / AMBA BUS configuration */ +#define CONFIG_SYS_CLK_FREQ 80000000 /* 80MHz (JP84=CLK2, DLLBPN=0) */ + +/* Number of SPARC register windows */ +#define CONFIG_SYS_SPARC_NWINDOWS 8 + +/* GR712RC SoC has two SPARC processors */ +#define CONFIG_SMP + +/* + * Serial console configuration + */ +#define CONFIG_BAUDRATE 115200 /* ... at 115200 bps */ +#define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, 230400 } + +/* Partitions */ +#define CONFIG_DOS_PARTITION +#define CONFIG_ISO_PARTITION + +/* + * Supported commands + */ +#include <config_cmd_default.h> +#define CONFIG_CMD_BDI /* bdinfo */ +#define CONFIG_CMD_BOOTD /* bootd */ +#define CONFIG_CMD_CONSOLE /* coninfo */ +#define CONFIG_CMD_DIAG +#define CONFIG_CMD_ECHO /* echo arguments */ +#define CONFIG_CMD_FLASH /* flinfo, erase, protect */ +#define CONFIG_CMD_IMI /* iminfo */ +#define CONFIG_CMD_IRQ +#define CONFIG_CMD_ITEST /* Integer (and string) test */ +#define CONFIG_CMD_LOADB /* loadb */ +#define CONFIG_CMD_LOADS /* loads */ +#define CONFIG_CMD_MEMINFO /* meminfo */ +#define CONFIG_CMD_MEMORY /* md mm nm mw cp cmp crc base loop */ +#define CONFIG_CMD_MEMTEST /* mtest */ +#define CONFIG_CMD_MII /* MII support */ +#define CONFIG_CMD_MISC /* Misc functions like sleep etc */ +#define CONFIG_CMD_NET /* bootp, tftpboot, rarpboot */ +#define CONFIG_CMD_PING /* ping support */ +#define CONFIG_CMD_REGINFO +#define CONFIG_CMD_RUN /* run command in env variable */ +#define CONFIG_CMD_SETGETDCR /* DCR support on 4xx */ +#define CONFIG_CMD_SOURCE /* "source" command support */ + +/* Autobooting */ +#define CONFIG_BOOTDELAY -1 /* autoboot after 5 seconds */ + +#define CONFIG_PREBOOT "echo;" \ + "echo Type "run flash_nfs" to mount root filesystem over NFS;" \ + "echo" + +#undef CONFIG_BOOTARGS +/*#define CONFIG_SYS_HUSH_PARSER 0*/ + +#define CONFIG_EXTRA_ENV_SETTINGS \ + "netdev=eth0\0" \ + "nfsargs=setenv bootargs root=/dev/nfs rw " \ + "nfsroot=${serverip}:${rootpath},nfsvers=4,tcp\0" \ + "ramargs=setenv bootargs root=/dev/ram rw\0" \ + "addip=setenv bootargs ${bootargs} " \ + "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \ + ":${hostname}:${netdev}:off panic=1\0" \ + "flash_nfs=run nfsargs addip;" \ + "bootm ${kernel_addr}\0" \ + "flash_self=run ramargs addip;" \ + "bootm ${kernel_addr} ${ramdisk_addr}\0" \ + "net_nfs=tftp 40000000 ${bootfile};run nfsargs addip;bootm\0" \ + "scratch=40000000\0" \ + "getkernel=tftpboot $(scratch) $(bootfile)\0" \ + "" +#define CONFIG_IPADDR 10.24.5.199 +#define CONFIG_NETMASK 255.255.0.0 +#define CONFIG_GATEWAYIP 10.24.49.1 +#define CONFIG_SERVERIP 10.24.5.54 +#define CONFIG_ROOTPATH "/srv/nfsroot/gr712rc-board" +#define CONFIG_HOSTNAME gr712rc-board +#define CONFIG_BOOTFILE "/uImage" +#define CONFIG_LOADADDR 0x40000000 +#define CONFIG_ETHADDR 00:00:7a:cc:00:12 + +#define CONFIG_BOOTARGS "console=ttyS0,115200 ip=dhcp root=/dev/nfs rw nfsroot=10.24.5.54:/srv/nfsroot/gr712rc-board,nfsvers=4,tcp" +#define CONFIG_BOOTCOMMAND "tftpboot; bootm" + +/* Memory MAP + * + * Flash: + * |--------------------------------| + * | 0x00000000 Text & Data & BSS | * + * | for Monitor | * + * | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| * + * | UNUSED / Growth | * 256kb + * |--------------------------------| + * | 0x00050000 Base custom area | * + * | kernel / FS | * + * | | * Rest of Flash + * |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| + * | END-0x00008000 Environment | * 32kb + * |--------------------------------| + * + * + * + * Main Memory: + * |--------------------------------| + * | UNUSED / scratch area | + * | | + * | | + * | | + * | | + * |--------------------------------| + * | Monitor .Text / .DATA / .BSS | * 256kb + * | Relocated! | * + * |--------------------------------| + * | Monitor Malloc | * 128kb (contains relocated environment) + * |--------------------------------| + * | Monitor/kernel STACK | * 64kb + * |--------------------------------| + * | Page Table for MMU systems | * 2k + * |--------------------------------| + * | PROM Code accessed from Linux | * 6kb-128b + * |--------------------------------| + * | Global data (avail from kernel)| * 128b + * |--------------------------------| + * + */ + +/* + * Flash configuration + */ +#define CONFIG_SYS_FLASH_CFI +#define CONFIG_FLASH_CFI_DRIVER + +#define CONFIG_SYS_FLASH_BASE 0x00000000 +#define CONFIG_SYS_FLASH_SIZE 0x00800000 /* 8 MiB */ +#define CONFIG_SYS_MAX_FLASH_SECT 64 /* max num of sects on one chip */ +#define CONFIG_SYS_MAX_FLASH_BANKS 1 /* max num of memory banks */ + +#define CONFIG_SYS_FLASH_ERASE_TOUT 240000 /* Flash Erase Timeout (in ms) */ +#define CONFIG_SYS_FLASH_WRITE_TOUT 500 /* Flash Write Timeout (in ms) */ +#define CONFIG_SYS_FLASH_LOCK_TOUT 5 /* Timeout for Flash Set Lock Bit (in ms) */ +#define CONFIG_SYS_FLASH_UNLOCK_TOUT 10000 /* Timeout for Flash Clear Lock Bits (in ms) */ + +#define CONFIG_SYS_FLASH_USE_BUFFER_WRITE +//#define CONFIG_FLASH_SHOW_PROGRESS 45 +#define CONFIG_FLASH_VERIFY + +#undef CONFIG_SYS_NO_FLASH + +/* + * Environment settings + */ +#define CONFIG_CMD_SAVEENV + +#define CONFIG_ENV_IS_IN_FLASH +#define CONFIG_ENV_SECT_SIZE 0x20000 /* 128 KiB */ +#define CONFIG_ENV_SIZE 0x8000 /* 32 KiB */ +#define CONFIG_ENV_ADDR (CONFIG_SYS_FLASH_BASE + CONFIG_SYS_FLASH_SIZE - CONFIG_ENV_SECT_SIZE) + +#define CONFIG_ENV_OVERWRITE /* ethaddr can be reprogrammed */ + +/* #define CONFIG_ENV_IS_NOWHERE 1 */ + +/* + * Memory map + */ +#if 0 /* SRAM and SDRAM */ + +#define CONFIG_SYS_SRAM_BASE 0x40000000 +#define CONFIG_SYS_SRAM_SIZE 0x00800000 /* 8 MiB */ +#define CONFIG_SYS_SRAM_END (CONFIG_SYS_SRAM_BASE + CONFIG_SYS_SRAM_SIZE) + +#define CONFIG_SYS_SDRAM_BASE 0x60000000 +#define CONFIG_SYS_SDRAM_SIZE 0x08000000 /* 128 MiB */ +#define CONFIG_SYS_SDRAM_END (CONFIG_SYS_SDRAM_BASE + CONFIG_SYS_SDRAM_SIZE) + +#define CONFIG_SYS_OCRAM_BASE 0xA0000000 +#define CONFIG_SYS_OCRAM_SIZE 0x00030000 /* 192 KiB */ +#define CONFIG_SYS_OCRAM_END (CONFIG_SYS_OCRAM_BASE + CONFIG_SYS_OCRAM_SIZE) +/* Note: Configuration register at 0x80100000 for OCRAM */ + +/* Always Run U-Boot from SRAM */ +#define CONFIG_SYS_RAM_BASE CONFIG_SYS_SDRAM_BASE +#define CONFIG_SYS_RAM_SIZE CONFIG_SYS_SDRAM_SIZE +#define CONFIG_SYS_RAM_END CONFIG_SYS_SDRAM_END + +#else /* SDRAM only */ + +#undef CONFIG_SYS_SRAM_BASE +#undef CONFIG_SYS_SRAM_SIZE +#undef CONFIG_SYS_SRAM_END + +#define CONFIG_SYS_SDRAM_BASE 0x60000000 +#define CONFIG_SYS_SDRAM_SIZE 0x08000000 /* 128 MiB */ +#define CONFIG_SYS_SDRAM_END (CONFIG_SYS_SDRAM_BASE + CONFIG_SYS_SDRAM_SIZE) + +#define CONFIG_SYS_RAM_BASE CONFIG_SYS_SDRAM_BASE +#define CONFIG_SYS_RAM_SIZE CONFIG_SYS_SDRAM_SIZE +#define CONFIG_SYS_RAM_END CONFIG_SYS_SDRAM_END + +#endif + +/*#define CONFIG_NR_DRAM_BANKS 1 |* we have 1 bank of SDRAM */ +#undef CONFIG_NR_DRAM_BANKS + +#define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_RAM_END - GENERATED_GBL_DATA_SIZE) +/*#define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_SRAM_END - GENERATED_GBL_DATA_SIZE)*/ +/*#define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_OCRAM_END - GENERATED_GBL_DATA_SIZE)*/ +/*#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_GBL_DATA_OFFSET*/ +#define CONFIG_SYS_INIT_SP_OFFSET (0xA0000000 + 0x00030000 - GENERATED_GBL_DATA_SIZE) + +#define CONFIG_SYS_PROM_SIZE (8192-GENERATED_GBL_DATA_SIZE) +#define CONFIG_SYS_PROM_OFFSET (CONFIG_SYS_GBL_DATA_OFFSET-CONFIG_SYS_PROM_SIZE) + +//#define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_PROM_OFFSET-32) +#define CONFIG_SYS_STACK_SIZE (0x10000-32) + +#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE +#if (CONFIG_SYS_MONITOR_BASE < CONFIG_SYS_FLASH_BASE) +# define CONFIG_SYS_RAMBOOT 1 +#endif + +#define CONFIG_SYS_MONITOR_LEN (256 << 10) /* Reserve 256 kB for Monitor */ +#define CONFIG_SYS_MALLOC_LEN (128 << 10) /* Reserve 128 kB for malloc() */ +#define CONFIG_SYS_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */ + +#ifndef CONFIG_SYS_GENERIC_BOARD + +#define CONFIG_SYS_MALLOC_END (CONFIG_SYS_INIT_SP_OFFSET-CONFIG_SYS_STACK_SIZE) +#define CONFIG_SYS_MALLOC_BASE (CONFIG_SYS_MALLOC_END-CONFIG_SYS_MALLOC_LEN) + +/* relocated monitor area */ +#define CONFIG_SYS_RELOC_MONITOR_MAX_END CONFIG_SYS_MALLOC_BASE +#define CONFIG_SYS_RELOC_MONITOR_BASE (CONFIG_SYS_RELOC_MONITOR_MAX_END-CONFIG_SYS_MONITOR_LEN) + +/* make un relocated address from relocated address */ +#define UN_RELOC(address) (address-(CONFIG_SYS_RELOC_MONITOR_BASE-CONFIG_SYS_TEXT_BASE)) + +#endif + +/* + * Ethernet configuration + */ +#define CONFIG_GRETH 1 /* Aeroflex Gaisler GRETH driver */ +#define CONFIG_MII 1 /* MII PHY management */ + +/*#define CONFIG_PHY_NATSEMI |* board has DP83848C chip */ + +/* Default HARDWARE address */ +#define GRETH_HWADDR_0 0x00 +#define GRETH_HWADDR_1 0x00 +#define GRETH_HWADDR_2 0x7A +#define GRETH_HWADDR_3 0xcc +#define GRETH_HWADDR_4 0x00 +#define GRETH_HWADDR_5 0x12 + +/* + * Define CONFIG_GRETH_10MBIT to force GRETH at 10Mb/s + */ +/* #define CONFIG_GRETH_10MBIT 1 */ +#define CONFIG_SYS_GRLIB_GRETH_PHYADDR 0x01 /* DP83848C chip on address 0x01 */ + +/* + * Miscellaneous configurable options + */ +#define CONFIG_SYS_LONGHELP /* undef to save memory */ +#if defined(CONFIG_CMD_KGDB) +#define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */ +#else +#define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */ +#endif +#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16) /* Print Buffer Size */ +#define CONFIG_SYS_MAXARGS 16 /* max number of command args */ +#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE /* Boot Argument Buffer Size */ + +#define CONFIG_SYS_MEMTEST_START CONFIG_SYS_SDRAM_BASE /* memtest works on 64MiB SDRAM */ +#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + 4 * SZ_1M) + +#define CONFIG_SYS_LOAD_ADDR 0x100000 /* default load address */ + +/***** Gaisler GRLIB IP-Cores Config ********/ + +/* Gaisler Fault Tolerant Memory controller */ +#define CONFIG_SYS_GRLIB_FT_MEMCFG1 (0x0803c0ff | (1<<11)) +#define CONFIG_SYS_GRLIB_FT_MEMCFG2 0x9a205465 +#define CONFIG_SYS_GRLIB_FT_MEMCFG3 0x08266010 + +/* System information about memory from GRMON + * + * grmon2> info sys mctrl0 + * mctrl0 Aeroflex Gaisler Memory controller with EDAC + * AHB: 00000000 - 20000000 + * AHB: 20000000 - 40000000 + * AHB: 40000000 - 80000000 + * APB: 80000000 - 80000100 + * 8-bit prom @ 0x00000000 + * 32-bit static ram: 1 * 8192 kbyte @ 0x40000000 + * 32-bit sdram: 2 * 64 Mbyte @ 0x60000000 + * col 9, cas 2, ref 7.8 us + * + * grmon2> mcfg1; mcfg2; mcfg3 + * mcfg1: 0x0803c0ff + * mcfg2: 0x9a205465 + * mcfg3: 0x08266010 + */ + +/* default kernel command line */ +#define CONFIG_DEFAULT_KERNEL_COMMAND_LINE "console=ttyS0,115200\0\0" + +#define CONFIG_IDENT_STRING " Gaisler GR712RC-BOARD" + +#endif /* __CONFIG_H */ -- 1.9.3
________________________________ Disclaimer and confidentiality note – refer to our website for further details: www.spaceteq.co.za http://www.spaceteq.co.za/home/emaildisclaimer/

Hi Francois,
On Wed, 5 Nov 2014 14:30:53 +0200 Francois Retief fgretief@spaceteq.co.za wrote:
diff --git a/board/gaisler/gr712rc_board/MAINTAINERS b/board/gaisler/gr712rc_board/MAINTAINERS new file mode 100644 index 0000000..1a77f89 --- /dev/null +++ b/board/gaisler/gr712rc_board/MAINTAINERS @@ -0,0 +1,6 @@ +GR712RC BOARD +#M: - +S: Maintained +F: board/gaisler/gr712rc_board/ +F: include/configs/gr712rc_board.h +F: configs/gr712rc_board_defconfig
Please fill the M: field with your name and email address. You are the maintainer of this board.
Best Regards Masahiro Yamada
participants (3)
-
Francois Retief
-
Joe Hershberger
-
Masahiro Yamada