Skip to contentSkip to conversation

add support for new arch stv0991

PATCH Superseded Vikas Manocha 2 participants 7 messages Sep 2, 2014 – Nov 18, 2014

Subsystems (2)

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v3 cover add support for new arch stv0991

This patchset add support for new arch stv0991.

Changes in v3:
- removed period from commit messages

Changes in v2:
- corrected files license to GPL-2.0+
- replaced printf() usage with puts() for string print
- sorted sourcing of board Kconfig

Vikas Manocha (3):
stv0991: Add basic stv0991 architecture support
stv0991: enable ethernet support
stv0991: default + misc command configs enabled

 arch/arm/Kconfig                                   |    4 +
 arch/arm/cpu/armv7/stv0991/Makefile                |    9 ++
 arch/arm/cpu/armv7/stv0991/clock.c                 |   41 +++++++
 arch/arm/cpu/armv7/stv0991/lowlevel.S              |   12 ++
 arch/arm/cpu/armv7/stv0991/pinmux.c                |   62 +++++++++++
 arch/arm/cpu/armv7/stv0991/reset.c                 |   26 +++++
 arch/arm/cpu/armv7/stv0991/timer.c                 |  114 +++++++++++++++++++
 arch/arm/include/asm/arch-stv0991/gpio.h           |   22 ++++
 arch/arm/include/asm/arch-stv0991/hardware.h       |   73 ++++++++++++
 arch/arm/include/asm/arch-stv0991/stv0991_cgu.h    |  116 ++++++++++++++++++++
 arch/arm/include/asm/arch-stv0991/stv0991_creg.h   |   95 ++++++++++++++++
 arch/arm/include/asm/arch-stv0991/stv0991_defs.h   |   16 +++
 arch/arm/include/asm/arch-stv0991/stv0991_gpt.h    |   43 ++++++++
 arch/arm/include/asm/arch-stv0991/stv0991_periph.h |   44 ++++++++
 arch/arm/include/asm/arch-stv0991/stv0991_wdru.h   |   28 +++++
 board/st/stv0991/Kconfig                           |   23 ++++
 board/st/stv0991/Makefile                          |    8 ++
 board/st/stv0991/stv0991.c                         |   91 +++++++++++++++
 configs/stv0991_defconfig                          |    3 +
 include/configs/stv0991.h                          |   88 +++++++++++++++
 20 files changed, 918 insertions(+)
 create mode 100644 arch/arm/cpu/armv7/stv0991/Makefile
 create mode 100644 arch/arm/cpu/armv7/stv0991/clock.c
 create mode 100644 arch/arm/cpu/armv7/stv0991/lowlevel.S
 create mode 100644 arch/arm/cpu/armv7/stv0991/pinmux.c
 create mode 100644 arch/arm/cpu/armv7/stv0991/reset.c
 create mode 100644 arch/arm/cpu/armv7/stv0991/timer.c
 create mode 100644 arch/arm/include/asm/arch-stv0991/gpio.h
 create mode 100644 arch/arm/include/asm/arch-stv0991/hardware.h
 create mode 100644 arch/arm/include/asm/arch-stv0991/stv0991_cgu.h
 create mode 100644 arch/arm/include/asm/arch-stv0991/stv0991_creg.h
 create mode 100644 arch/arm/include/asm/arch-stv0991/stv0991_defs.h
 create mode 100644 arch/arm/include/asm/arch-stv0991/stv0991_gpt.h
 create mode 100644 arch/arm/include/asm/arch-stv0991/stv0991_periph.h
 create mode 100644 arch/arm/include/asm/arch-stv0991/stv0991_wdru.h
 create mode 100644 board/st/stv0991/Kconfig
 create mode 100644 board/st/stv0991/Makefile
 create mode 100644 board/st/stv0991/stv0991.c
 create mode 100644 configs/stv0991_defconfig
 create mode 100644 include/configs/stv0991.h
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH v3 1/3 stv0991: Add basic stv0991 architecture support

stv0991 architecture support added. It contains the support for following blocks
- Timer
- uart

---

Changes in v3:
- removed period from commit message

Changes in v2:
- corrected files license to GPL-2.0+
- replaced printf() usage with puts() for string print
- sorted sourcing of board Kconfig

 arch/arm/Kconfig                                   |    4 +
 arch/arm/cpu/armv7/stv0991/Makefile                |    9 ++
 arch/arm/cpu/armv7/stv0991/clock.c                 |   27 +++++
 arch/arm/cpu/armv7/stv0991/lowlevel.S              |   12 +++
 arch/arm/cpu/armv7/stv0991/pinmux.c                |   48 +++++++++
 arch/arm/cpu/armv7/stv0991/reset.c                 |   26 +++++
 arch/arm/cpu/armv7/stv0991/timer.c                 |  114 ++++++++++++++++++++
 arch/arm/include/asm/arch-stv0991/hardware.h       |   73 +++++++++++++
 arch/arm/include/asm/arch-stv0991/stv0991_cgu.h    |   80 ++++++++++++++
 arch/arm/include/asm/arch-stv0991/stv0991_creg.h   |   82 ++++++++++++++
 arch/arm/include/asm/arch-stv0991/stv0991_defs.h   |   16 +++
 arch/arm/include/asm/arch-stv0991/stv0991_gpt.h    |   43 ++++++++
 arch/arm/include/asm/arch-stv0991/stv0991_periph.h |   43 ++++++++
 arch/arm/include/asm/arch-stv0991/stv0991_wdru.h   |   28 +++++
 board/st/stv0991/Kconfig                           |   23 ++++
 board/st/stv0991/Makefile                          |    8 ++
 board/st/stv0991/stv0991.c                         |   54 ++++++++++
 configs/stv0991_defconfig                          |    3 +
 include/configs/stv0991.h                          |   58 ++++++++++
 19 files changed, 751 insertions(+)
 create mode 100644 arch/arm/cpu/armv7/stv0991/Makefile
 create mode 100644 arch/arm/cpu/armv7/stv0991/clock.c
 create mode 100644 arch/arm/cpu/armv7/stv0991/lowlevel.S
 create mode 100644 arch/arm/cpu/armv7/stv0991/pinmux.c
 create mode 100644 arch/arm/cpu/armv7/stv0991/reset.c
 create mode 100644 arch/arm/cpu/armv7/stv0991/timer.c
 create mode 100644 arch/arm/include/asm/arch-stv0991/hardware.h
 create mode 100644 arch/arm/include/asm/arch-stv0991/stv0991_cgu.h
 create mode 100644 arch/arm/include/asm/arch-stv0991/stv0991_creg.h
 create mode 100644 arch/arm/include/asm/arch-stv0991/stv0991_defs.h
 create mode 100644 arch/arm/include/asm/arch-stv0991/stv0991_gpt.h
 create mode 100644 arch/arm/include/asm/arch-stv0991/stv0991_periph.h
 create mode 100644 arch/arm/include/asm/arch-stv0991/stv0991_wdru.h
 create mode 100644 board/st/stv0991/Kconfig
 create mode 100644 board/st/stv0991/Makefile
 create mode 100644 board/st/stv0991/stv0991.c
 create mode 100644 configs/stv0991_defconfig
 create mode 100644 include/configs/stv0991.h
arch/arm/Kconfig +4 -0
index e385eda..81656c3 100644
@@ -305,6 +305,9 @@ config TARGET_SPEAR310
 config TARGET_SPEAR320
 	bool "Support spear320"
 
+config TARGET_STV0991
+	bool "Support stv0991"
+
 config TARGET_SPEAR600
 	bool "Support spear600"
 
@@ -963,6 +966,7 @@ source "board/spear/x600/Kconfig"
 source "board/st-ericsson/snowball/Kconfig"
 source "board/st-ericsson/u8500/Kconfig"
 source "board/st/nhk8815/Kconfig"
+source "board/st/stv0991/Kconfig"
 source "board/sunxi/Kconfig"
 source "board/syteco/jadecpu/Kconfig"
 source "board/syteco/zmx25/Kconfig"
arch/arm/cpu/armv7/stv0991/Makefile new file +9 -0
new file mode 100644
index 0000000..95641d3
@@ -0,0 +1,9 @@
+#
+# (C) Copyright 2014
+# Vikas Manocha, ST Microelectronics, vikas.manocha at stcom
+#
+# SPDX-License-Identifier:	GPL-2.0+
+#
+
+obj-y	:= timer.o clock.o pinmux.o reset.o
+obj-y	+= lowlevel.o
arch/arm/cpu/armv7/stv0991/clock.c new file +27 -0
new file mode 100644
index 0000000..aca6aba
@@ -0,0 +1,27 @@
+/*
+ * (C) Copyright 2014
+ * Vikas Manocha, ST Micoelectronics, vikas.manocha at st.com.
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <asm/io.h>
+#include <asm/arch/hardware.h>
+#include <asm/arch/stv0991_cgu.h>
+#include<asm/arch/stv0991_periph.h>
+
+static struct stv0991_cgu_regs *const stv0991_cgu_regs = \
+				(struct stv0991_cgu_regs *) (CGU_BASE_ADDR);
+
+void clock_setup(int peripheral)
+{
+	switch (peripheral) {
+	case UART_CLOCK_CFG:
+		writel(UART_CLK_CFG, &stv0991_cgu_regs->uart_freq);
+		break;
+	case ETH_CLOCK_CFG:
+		break;
+	default:
+		break;
+	}
+}
arch/arm/cpu/armv7/stv0991/lowlevel.S new file +12 -0
new file mode 100644
index 0000000..6dafba3
@@ -0,0 +1,12 @@
+/*
+ * (C) Copyright 2014 stmicroelectronics
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <config.h>
+#include <linux/linkage.h>
+
+ENTRY(lowlevel_init)
+	mov	pc, lr
+ENDPROC(lowlevel_init)
arch/arm/cpu/armv7/stv0991/pinmux.c new file +48 -0

48 lines not on this page · raw message

arch/arm/cpu/armv7/stv0991/reset.c new file +26 -0
new file mode 100644
index 0000000..3384b32
@@ -0,0 +1,26 @@
+/*
+ * (C) Copyright 2014
+ * Vikas Manocha, ST Micoelectronics, vikas.manocha at st.com.
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <asm/arch/stv0991_wdru.h>
+void reset_cpu(ulong ignored)
+{
+	puts("System is going to reboot ...\n");
+	/*
+	 * This 1 second delay will allow the above message
+	 * to be printed before reset
+	 */
+	udelay((1000 * 1000));
+
+	/* Setting bit 1 of the WDRU unit will reset the SoC */
+	writel(WDRU_RST_SYS, &stv0991_wd_ru_ptr->wdru_ctrl1);
+
+	/* system will restart */
+	while (1)
+		;
+}
arch/arm/cpu/armv7/stv0991/timer.c new file +114 -0

114 lines not on this page · raw message

arch/arm/include/asm/arch-stv0991/hardware.h new file +73 -0

73 lines not on this page · raw message

arch/arm/include/asm/arch-stv0991/stv0991_cgu.h new file +80 -0

80 lines not on this page · raw message

arch/arm/include/asm/arch-stv0991/stv0991_creg.h new file +82 -0

82 lines not on this page · raw message

arch/arm/include/asm/arch-stv0991/stv0991_defs.h new file +16 -0
new file mode 100644
index 0000000..1151378
@@ -0,0 +1,16 @@
+/*
+ * (C) Copyright 2014
+ * Vikas Manocha, ST Micoelectronics, [email protected].
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#ifndef __STV0991_DEFS_H__
+#define __STV0991_DEFS_H__
+#include <asm/arch/stv0991_periph.h>
+
+extern int stv0991_pinmux_config(enum periph_id);
+extern int clock_setup(enum periph_clock);
+
+#endif
+
arch/arm/include/asm/arch-stv0991/stv0991_gpt.h new file +43 -0

43 lines not on this page · raw message

arch/arm/include/asm/arch-stv0991/stv0991_periph.h new file +43 -0

43 lines not on this page · raw message

arch/arm/include/asm/arch-stv0991/stv0991_wdru.h new file +28 -0
new file mode 100644
index 0000000..7e555a2
@@ -0,0 +1,28 @@
+/*
+ * (C) Copyright 2014
+ * Vikas Manocha, ST Micoelectronics, [email protected]
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#ifndef _STV0991_WD_RST_H
+#define _STV0991_WD_RST_H
+#include <asm/arch-stv0991/hardware.h>
+
+struct stv0991_wd_ru {
+	u32 wdru_config;
+	u32 wdru_ctrl1;
+	u32 wdru_ctrl2;
+	u32 wdru_tim;
+	u32 wdru_count;
+	u32 wdru_stat;
+	u32 wdru_wrlock;
+};
+
+struct stv0991_wd_ru *const stv0991_wd_ru_ptr = \
+		(struct stv0991_wd_ru *)WDRU_BASE_ADDR;
+
+/* Watchdog control register */
+#define WDRU_RST_SYS		0x1
+
+#endif
board/st/stv0991/Kconfig new file +23 -0
new file mode 100644
index 0000000..8bda349
@@ -0,0 +1,23 @@
+if TARGET_STV0991
+
+config SYS_CPU
+	string
+	default "armv7"
+
+config SYS_BOARD
+	string
+	default "stv0991"
+
+config SYS_VENDOR
+	string
+	default "st"
+
+config SYS_SOC
+	string
+	default "stv0991"
+
+config SYS_CONFIG_NAME
+	string
+	default "stv0991"
+
+endif
board/st/stv0991/Makefile new file +8 -0
new file mode 100644
index 0000000..fb5169a
@@ -0,0 +1,8 @@
+#
+# (C) Copyright 2014
+# Vikas Manocha, ST Microelectronics, vikas.manocha at stcom
+#
+# SPDX-License-Identifier:	GPL-2.0+
+#
+
+obj-y	:= stv0991.o
board/st/stv0991/stv0991.c new file +54 -0

54 lines not on this page · raw message

configs/stv0991_defconfig new file +3 -0
new file mode 100644
index 0000000..a05e991
@@ -0,0 +1,3 @@
+CONFIG_SYS_EXTRA_OPTIONS="stv0991"
+CONFIG_ARM=y
+CONFIG_TARGET_STV0991=y
include/configs/stv0991.h new file +58 -0

58 lines not on this page · raw message

Signature · 1 line
1.7.9.5
#2 lore raw

PATCH v3 1/3 stv0991: Add basic stv0991 architecture support

Hello Vikas,

Quoted 7 lines · Vikas Manocha

stv0991 architecture support added. It contains the support for following blocks
- Timer
- uart

---

Please add MAINTAINER information and rebase series above current u-boot/master.

Amicalement,

Signature · 1 line
Albert.
#3 lore raw

PATCH v3 1/3 stv0991: Add basic stv0991 architecture support

Thanks Albert,

I rebased the patchset on current master today & submitted the v4.

Rgds,
Vikas

Quoted 25 lines

-----Original Message-----
From: Albert ARIBAUD [mailto:albert.u.boot at aribaud.net]
Sent: Wednesday, November 12, 2014 1:08 AM
To: Vikas MANOCHA
Cc: u-boot at lists.denx.de; vk.vipin at gmail.com
Subject: Re: [PATCH v3 1/3] stv0991: Add basic stv0991 architecture support

Hello Vikas,

Quoted 7 lines · Vikas Manocha

stv0991 architecture support added. It contains the support for following blocks
- Timer
- uart

---

Please add MAINTAINER information and rebase series above current u- boot/master.

Amicalement,
--
Albert.

#4 lore raw

PATCH v3 2/3 stv0991: enable ethernet support

In reply to Vikas Manocha

---

Changes in v3:
- removed period from commit message

Changes in v2: None

 arch/arm/cpu/armv7/stv0991/clock.c                 |   14 ++++++++
 arch/arm/cpu/armv7/stv0991/pinmux.c                |   14 ++++++++
 arch/arm/include/asm/arch-stv0991/gpio.h           |   22 ++++++++++++
 arch/arm/include/asm/arch-stv0991/stv0991_cgu.h    |   36 +++++++++++++++++++
 arch/arm/include/asm/arch-stv0991/stv0991_creg.h   |   13 +++++++
 arch/arm/include/asm/arch-stv0991/stv0991_periph.h |    1 +
 board/st/stv0991/stv0991.c                         |   37 ++++++++++++++++++++
 include/configs/stv0991.h                          |   15 +++++++-
 8 files changed, 151 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/include/asm/arch-stv0991/gpio.h
arch/arm/cpu/armv7/stv0991/clock.c +14 -0
index aca6aba..70b8a8d 100644
@@ -13,6 +13,13 @@
 static struct stv0991_cgu_regs *const stv0991_cgu_regs = \
 				(struct stv0991_cgu_regs *) (CGU_BASE_ADDR);
 
+void enable_pll1(void)
+{
+	/* pll1 already configured for 1000Mhz, just need to enable it */
+	writel(readl(&stv0991_cgu_regs->pll1_ctrl) & ~(0x01),
+			&stv0991_cgu_regs->pll1_ctrl);
+}
+
 void clock_setup(int peripheral)
 {
 	switch (peripheral) {
@@ -20,6 +27,13 @@ void clock_setup(int peripheral)
 		writel(UART_CLK_CFG, &stv0991_cgu_regs->uart_freq);
 		break;
 	case ETH_CLOCK_CFG:
+		enable_pll1();
+		writel(ETH_CLK_CFG, &stv0991_cgu_regs->eth_freq);
+
+		/* Clock selection for ethernet tx_clk & rx_clk*/
+		writel((readl(&stv0991_cgu_regs->eth_ctrl) & ETH_CLK_MASK)
+				| ETH_CLK_CTRL, &stv0991_cgu_regs->eth_ctrl);
+
 		break;
 	default:
 		break;
arch/arm/cpu/armv7/stv0991/pinmux.c +14 -0
index 6d4414a..1d086a2 100644
@@ -41,6 +41,20 @@ int stv0991_pinmux_config(int peripheral)
 				CFG_GPIOB_16_UART_TX,
 				&stv0991_creg->mux7);
 		break;
+	case ETH_GPIOB_10_31_C_0_4:
+		writel(readl(&stv0991_creg->mux6) & 0x000000FF,
+				&stv0991_creg->mux6);
+		writel(0x00000000, &stv0991_creg->mux7);
+		writel(0x00000000, &stv0991_creg->mux8);
+		writel(readl(&stv0991_creg->mux9) & 0xFFF00000,
+				&stv0991_creg->mux9);
+		/* Ethernet Voltage configuration to 1.8V*/
+		writel((readl(&stv0991_creg->vdd_pad1) & VDD_ETH_PS_MASK) |
+				ETH_VDD_CFG, &stv0991_creg->vdd_pad1);
+		writel((readl(&stv0991_creg->vdd_pad1) & VDD_ETH_PS_MASK) |
+				ETH_M_VDD_CFG, &stv0991_creg->vdd_pad1);
+
+		break;
 	default:
 		break;
 	}
arch/arm/include/asm/arch-stv0991/gpio.h new file +22 -0
new file mode 100644
index 0000000..9131ded
@@ -0,0 +1,22 @@
+/*
+ * (C) Copyright 2014
+ * Vikas Manocha, ST Micoelectronics, vikas.manocha at st.com
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#ifndef __ASM_ARCH_STV0991_GPIO_H
+#define __ASM_ARCH_STV0991_GPIO_H
+
+enum gpio_direction {
+	GPIO_DIRECTION_IN,
+	GPIO_DIRECTION_OUT,
+};
+
+struct gpio_regs {
+	u32 data;		/* offset 0x0 */
+	u32 reserved[0xff];	/* 0x4--0x3fc */
+	u32 dir;		/* offset 0x400 */
+};
+
+#endif	/* __ASM_ARCH_STV0991_GPIO_H */
arch/arm/include/asm/arch-stv0991/stv0991_cgu.h +36 -0
index 4926395..ddcbb57 100644
@@ -77,4 +77,40 @@ struct stv0991_cgu_regs {
 #define UART_CLK_CFG			(4 << DIV_SHIFT_UART \
 					| 1 << MDIV_SHIFT_UART | CLK_UART_MCLK)
 
+/* CGU Ethernet clock config */
+#define CLK_ETH_MCLK			0
+#define CLK_ETH_PLL1			1
+#define CLK_ETH_PLL2			2
+
+#define MDIV_SHIFT_ETH			3
+#define DIV_SHIFT_ETH			6
+#define DIV_ETH_125			9
+#define DIV_ETH_50			12
+#define DIV_ETH_P2P			15
+
+#define ETH_CLK_CFG			(4 << DIV_ETH_P2P | 4 << DIV_ETH_50 \
+					| 1 << DIV_ETH_125 \
+					| 0 << DIV_SHIFT_ETH \
+					| 3 << MDIV_SHIFT_ETH | CLK_ETH_PLL1)
+ /* CGU Ethernet control */
+
+#define ETH_CLK_TX_EXT_PHY		0
+#define ETH_CLK_TX_125M			1
+#define ETH_CLK_TX_25M			2
+#define ETH_CLK_TX_2M5			3
+#define ETH_CLK_TX_DIS			7
+
+#define ETH_CLK_RX_EXT_PHY		0
+#define ETH_CLK_RX_25M			1
+#define ETH_CLK_RX_2M5			2
+#define ETH_CLK_RX_DIS			3
+#define RX_CLK_SHIFT			3
+#define ETH_CLK_MASK			~(0x1F)
+
+#define ETH_PHY_MODE_GMII		0
+#define ETH_PHY_MODE_RMII		1
+#define ETH_PHY_CLK_DIS			1
+
+#define ETH_CLK_CTRL			(ETH_CLK_RX_EXT_PHY << RX_CLK_SHIFT \
+					| ETH_CLK_TX_EXT_PHY)
 #endif
arch/arm/include/asm/arch-stv0991/stv0991_creg.h +13 -0
index 045dbfe..c804eb5 100644
@@ -79,4 +79,17 @@ struct stv0991_creg {
 #define CFG_GPIOC_30_MODE_LOW	(0 << GPIOC_30_MODE_SHIFT)
 #define CFG_GPIOC_30_MODE_HIGH	(1 << GPIOC_30_MODE_SHIFT)
 
+/* CREG Ethernet pad config */
+
+#define VDD_ETH_PS_1V8		0
+#define VDD_ETH_PS_2V5		2
+#define VDD_ETH_PS_3V3		3
+#define VDD_ETH_PS_MASK		0x3
+
+#define VDD_ETH_PS_SHIFT	12
+#define ETH_VDD_CFG		(VDD_ETH_PS_1V8 << VDD_ETH_PS_SHIFT)
+
+#define VDD_ETH_M_PS_SHIFT	28
+#define ETH_M_VDD_CFG		(VDD_ETH_PS_1V8 << VDD_ETH_M_PS_SHIFT)
+
 #endif
arch/arm/include/asm/arch-stv0991/stv0991_periph.h +1 -0
index f723771..f728c83 100644
@@ -17,6 +17,7 @@
 enum periph_id {
 	UART_GPIOC_30_31 = 0,
 	UART_GPIOB_16_17,
+	ETH_GPIOB_10_31_C_0_4,
 	PERIPH_ID_I2C0,
 	PERIPH_ID_I2C1,
 	PERIPH_ID_I2C2,
board/st/stv0991/stv0991.c +37 -0
index bdeb53c..989fb5e 100644
@@ -9,9 +9,16 @@
 #include <miiphy.h>
 #include <asm/arch/stv0991_periph.h>
 #include <asm/arch/stv0991_defs.h>
+#include <asm/arch/hardware.h>
+#include <asm/arch/gpio.h>
+#include <netdev.h>
+#include <asm/io.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
+struct gpio_regs *const gpioa_regs =
+		(struct gpio_regs *) GPIOA_BASE_ADDR;
+
 #ifdef CONFIG_SHOW_BOOT_PROGRESS
 void show_boot_progress(int progress)
 {
@@ -19,11 +26,26 @@ void show_boot_progress(int progress)
 }
 #endif
 
+void enable_eth_phy(void)
+{
+	/* Set GPIOA_06 pad HIGH (Appli board)*/
+	writel(readl(&gpioa_regs->dir) | 0x40, &gpioa_regs->dir);
+	writel(readl(&gpioa_regs->data) | 0x40, &gpioa_regs->data);
+}
+int board_eth_enable(void)
+{
+	stv0991_pinmux_config(ETH_GPIOB_10_31_C_0_4);
+	clock_setup(ETH_CLOCK_CFG);
+	enable_eth_phy();
+	return 0;
+}
+
 /*
  * Miscellaneous platform dependent initialisations
  */
 int board_init(void)
 {
+	board_eth_enable();
 	return 0;
 }
 
@@ -33,6 +55,7 @@ int board_uart_init(void)
 	clock_setup(UART_CLOCK_CFG);
 	return 0;
 }
+
 #ifdef CONFIG_BOARD_EARLY_INIT_F
 int board_early_init_f(void)
 {
@@ -52,3 +75,17 @@ void dram_init_banksize(void)
 	gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
 	gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
 }
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+	int ret = 0;
+
+#if defined(CONFIG_DESIGNWARE_ETH)
+	u32 interface = PHY_INTERFACE_MODE_MII;
+	if (designware_initialize(GMAC_BASE_ADDR, interface) >= 0)
+		ret++;
+#endif
+	return ret;
+}
+#endif
include/configs/stv0991.h +14 -1
index 37cfa7a..a7181b1 100644
@@ -7,11 +7,11 @@
 
 #ifndef __CONFIG_STV0991_H
 #define __CONFIG_STV0991_H
-
 #define CONFIG_SYS_DCACHE_OFF
 #define CONFIG_SYS_ICACHE_OFF
 #define CONFIG_SYS_EXCEPTION_VECTORS_HIGH
 #define CONFIG_BOARD_EARLY_INIT_F
+
 #define CONFIG_SYS_CORTEX_R4
 
 #define CONFIG_SYS_GENERIC_BOARD
@@ -55,4 +55,17 @@
 #define CONFIG_SYS_INIT_SP_ADDR			\
 	(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
 
+/* GMAC related configs */
+
+#define CONFIG_MII
+#define CONFIG_PHYLIB
+#define CONFIG_CMD_NET
+#define CONFIG_DESIGNWARE_ETH
+#define CONFIG_DW_ALTDESCRIPTOR
+#define CONFIG_PHY_MICREL
+
+/* Command support defines */
+#define CONFIG_CMD_PING
+#define CONFIG_PHY_RESET_DELAY			10000		/* in usec */
+
 #endif /* __CONFIG_H */
Signature · 1 line
1.7.9.5
#5 lore raw

PATCH v3 3/3 stv0991: default + misc command configs enabled

In reply to Vikas Manocha

---

Changes in v3:
- removed period from commit message

Changes in v2: None

 include/configs/stv0991.h |   21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)
include/configs/stv0991.h +19 -2
index a7181b1..d6ff243 100644
@@ -8,7 +8,6 @@
 #ifndef __CONFIG_STV0991_H
 #define __CONFIG_STV0991_H
 #define CONFIG_SYS_DCACHE_OFF
-#define CONFIG_SYS_ICACHE_OFF
 #define CONFIG_SYS_EXCEPTION_VECTORS_HIGH
 #define CONFIG_BOARD_EARLY_INIT_F
 
@@ -40,7 +39,7 @@
 
 /* user interface */
 #define CONFIG_SYS_PROMPT			"STV0991> "
-#define CONFIG_SYS_CBSIZE			256/* Console I/O Buffer Size */
+#define CONFIG_SYS_CBSIZE			1024
 #define CONFIG_SYS_PBSIZE			(CONFIG_SYS_CBSIZE \
 						+sizeof(CONFIG_SYS_PROMPT) + 16)
 
@@ -68,4 +67,22 @@
 #define CONFIG_CMD_PING
 #define CONFIG_PHY_RESET_DELAY			10000		/* in usec */
 
+#include "config_cmd_default.h"
+#undef CONFIG_CMD_SAVEENV
+
+#define CONFIG_SYS_MEMTEST_START               0x0000
+#define CONFIG_SYS_MEMTEST_END                 1024*1024
+#define CONFIG_CMD_MEMTEST
+
+/* Misc configuration */
+#define CONFIG_SYS_LONGHELP
+#define CONFIG_CMDLINE_EDITING
+
+#define CONFIG_BOOTDELAY                       3
+#define CONFIG_BOOTCOMMAND                     "go 0x40040000"
+#define CONFIG_AUTOBOOT_KEYED
+#define CONFIG_AUTOBOOT_STOP_STR               " "
+#define CONFIG_AUTOBOOT_PROMPT                 \
+	"Hit SPACE in %d seconds to stop autoboot.\n", bootdelay
+
 #endif /* __CONFIG_H */
Signature · 1 line
1.7.9.5
author
#6 lore raw

v3 cover add support for new arch stv0991

In reply to Vikas Manocha

Hello Masahiro/Nobuhiro,

As per your comments , the changes are done in V3 patchset. Please provide your acceptance for reviewed-by or acked-by tag ?

Rgds,
Vikas

Quoted 57 lines · Vikas MANOCHA

This patchset add support for new arch stv0991.

Changes in v3:
- removed period from commit messages

Changes in v2:
- corrected files license to GPL-2.0+
- replaced printf() usage with puts() for string print
- sorted sourcing of board Kconfig

Vikas Manocha (3):
stv0991: Add basic stv0991 architecture support
stv0991: enable ethernet support
stv0991: default + misc command configs enabled

  arch/arm/Kconfig                                   |    4 +
  arch/arm/cpu/armv7/stv0991/Makefile                |    9 ++
  arch/arm/cpu/armv7/stv0991/clock.c                 |   41 +++++++
  arch/arm/cpu/armv7/stv0991/lowlevel.S              |   12 ++
  arch/arm/cpu/armv7/stv0991/pinmux.c                |   62 +++++++++++
  arch/arm/cpu/armv7/stv0991/reset.c                 |   26 +++++
  arch/arm/cpu/armv7/stv0991/timer.c                 |  114 +++++++++++++++++++
  arch/arm/include/asm/arch-stv0991/gpio.h           |   22 ++++
  arch/arm/include/asm/arch-stv0991/hardware.h       |   73 ++++++++++++
  arch/arm/include/asm/arch-stv0991/stv0991_cgu.h    |  116 ++++++++++++++++++++
  arch/arm/include/asm/arch-stv0991/stv0991_creg.h   |   95 ++++++++++++++++
  arch/arm/include/asm/arch-stv0991/stv0991_defs.h   |   16 +++
  arch/arm/include/asm/arch-stv0991/stv0991_gpt.h    |   43 ++++++++
  arch/arm/include/asm/arch-stv0991/stv0991_periph.h |   44 ++++++++
  arch/arm/include/asm/arch-stv0991/stv0991_wdru.h   |   28 +++++
  board/st/stv0991/Kconfig                           |   23 ++++
  board/st/stv0991/Makefile                          |    8 ++
  board/st/stv0991/stv0991.c                         |   91 +++++++++++++++
  configs/stv0991_defconfig                          |    3 +
  include/configs/stv0991.h                          |   88 +++++++++++++++
  20 files changed, 918 insertions(+)

create mode 100644 arch/arm/cpu/armv7/stv0991/Makefile create mode 100644 arch/arm/cpu/armv7/stv0991/clock.c create mode 100644 arch/arm/cpu/armv7/stv0991/lowlevel.S create mode 100644 arch/arm/cpu/armv7/stv0991/pinmux.c create mode 100644 arch/arm/cpu/armv7/stv0991/reset.c create mode 100644 arch/arm/cpu/armv7/stv0991/timer.c create mode 100644 arch/arm/include/asm/arch-stv0991/gpio.h create mode 100644 arch/arm/include/asm/arch-stv0991/hardware.h create mode 100644 arch/arm/include/asm/arch-stv0991/stv0991_cgu.h create mode 100644 arch/arm/include/asm/arch-stv0991/stv0991_creg.h create mode 100644 arch/arm/include/asm/arch-stv0991/stv0991_defs.h create mode 100644 arch/arm/include/asm/arch-stv0991/stv0991_gpt.h create mode 100644 arch/arm/include/asm/arch-stv0991/stv0991_periph.h create mode 100644 arch/arm/include/asm/arch-stv0991/stv0991_wdru.h create mode 100644 board/st/stv0991/Kconfig
create mode 100644 board/st/stv0991/Makefile
create mode 100644 board/st/stv0991/stv0991.c
create mode 100644 configs/stv0991_defconfig
create mode 100644 include/configs/stv0991.h