Skip to contentSkip to conversation

ARM: mx6: Add support for Kosagi Novena

PATCH Superseded Marek Vasut 2 participants 4 messages Oct 9, 2014 – Oct 11, 2014

Subsystems (2)

v6 of 8 Superseded Latest is v8 →

lore
Share & tools
lore
#0 lore raw

PATCH v6 1/1 ARM: mx6: Add support for Kosagi Novena

Add support for the Kosagi Novena board. Currently supported are:
- I2C busses
- FEC Ethernet
- MMC0, MMC1, Booting from MMC
- SATA
- USB ports
- USB Ethernet

Cc Stefano Babic <[email protected]>
Cc Sean Cross <[email protected]>
Cc Nikolay Dimitrov <[email protected]>
---
 arch/arm/Kconfig                 |   4 +
 board/kosagi/novena/Kconfig      |  18 ++
 board/kosagi/novena/Makefile     |  11 +
 board/kosagi/novena/novena.c     | 339 +++++++++++++++++++++++
 board/kosagi/novena/novena_spl.c | 580 +++++++++++++++++++++++++++++++++++++++
 board/kosagi/novena/setup.cfg    |  47 ++++
 configs/novena_defconfig         |   4 +
 include/configs/imx6_spl.h       |   2 +-
 include/configs/novena.h         | 302 ++++++++++++++++++++
 9 files changed, 1306 insertions(+), 1 deletion(-)
 create mode 100644 board/kosagi/novena/Kconfig
 create mode 100644 board/kosagi/novena/Makefile
 create mode 100644 board/kosagi/novena/novena.c
 create mode 100644 board/kosagi/novena/novena_spl.c
 create mode 100644 board/kosagi/novena/setup.cfg
 create mode 100644 configs/novena_defconfig
 create mode 100644 include/configs/novena.h

V2: - Drop the tegra_keyboard_init() comment altogether
- Immediatelly return from the SD controller probe function on failure
- Rename PFUZE100_PMIC to just PFUZE100
- Fix the IMX OTP support with CMD_FUSE
- Enabling LVDS clock is still in place, since this is coming soon.
V3: - Zap rootpath builtin env
V4: - Zap the checkpatch issues
- Update comments
V5: - Don't configure VGEN1
- Set FPGA into reset in SPL
- Drop ECSPI1 and add ECSPI3 mux
- Drop UART1 and add UART3, UART4 muxes
- Add separate mux option for the RGMII pins which doesn't set SPEED field
- Move the configuration of RGMII after they were configured in GPIO mode
V6: - Drop 'string' prop from Kconfig
- Zap uSD card detect
- Add bigSD write-protect detection
- Zap USB hub reset GPIO
- Remove unnecessary zeroing of GD in SPL

arch/arm/Kconfig +4 -0
index 106aed9..4da1923 100644
@@ -411,6 +411,9 @@ config TARGET_GW_VENTANA
 config TARGET_HUMMINGBOARD
 	bool "Support hummingboard"
 
+config TARGET_KOSAGI_NOVENA
+	bool "Support Kosagi Novena"
+
 config TARGET_TQMA6
 	bool "TQ Systems TQMa6 board"
 
@@ -637,6 +640,7 @@ source "board/imx31_phycore/Kconfig"
 source "board/isee/igep0033/Kconfig"
 source "board/jornada/Kconfig"
 source "board/karo/tx25/Kconfig"
+source "board/kosagi/novena/Kconfig"
 source "board/logicpd/imx27lite/Kconfig"
 source "board/logicpd/imx31_litekit/Kconfig"
 source "board/mpl/vcma9/Kconfig"
board/kosagi/novena/Kconfig new file +18 -0
new file mode 100644
index 0000000..4ba6399
@@ -0,0 +1,18 @@
+if TARGET_KOSAGI_NOVENA
+
+config SYS_CPU
+	default "armv7"
+
+config SYS_BOARD
+	default "novena"
+
+config SYS_VENDOR
+	default "kosagi"
+
+config SYS_SOC
+	default "mx6"
+
+config SYS_CONFIG_NAME
+	default "novena"
+
+endif
board/kosagi/novena/Makefile new file +11 -0
new file mode 100644
index 0000000..6fba177
@@ -0,0 +1,11 @@
+#
+# Copyright (C) 2014 Marek Vasut <[email protected]>
+#
+# SPDX-License-Identifier:	GPL-2.0+
+#
+
+ifdef CONFIG_SPL_BUILD
+obj-y	:= novena_spl.o
+else
+obj-y	:= novena.o
+endif
board/kosagi/novena/novena.c new file +339 -0

339 lines not on this page · raw message

board/kosagi/novena/novena_spl.c new file +580 -0

580 lines not on this page · raw message

board/kosagi/novena/setup.cfg new file +47 -0

47 lines not on this page · raw message

configs/novena_defconfig new file +4 -0
new file mode 100644
index 0000000..a560afb
@@ -0,0 +1,4 @@
+CONFIG_SPL=y
+CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/kosagi/novena/setup.cfg,MX6Q,SPL"
++S:CONFIG_ARM=y
++S:CONFIG_TARGET_KOSAGI_NOVENA=y
include/configs/imx6_spl.h +1 -1
index 970460d..52fe9cf 100644
@@ -27,7 +27,7 @@
 #define CONFIG_SYS_THUMB_BUILD
 #define CONFIG_SPL_LDSCRIPT	"arch/arm/cpu/armv7/omap-common/u-boot-spl.lds"
 #define CONFIG_SPL_TEXT_BASE		0x00908000
-#define CONFIG_SPL_MAX_SIZE		(64 * 1024)
+#define CONFIG_SPL_MAX_SIZE		0x10000
 #define CONFIG_SPL_START_S_PATH		"arch/arm/cpu/armv7"
 #define CONFIG_SPL_STACK		0x0091FFB8
 #define CONFIG_SPL_LIBCOMMON_SUPPORT
include/configs/novena.h new file +302 -0

302 lines not on this page · raw message

Signature · 1 line
2.0.0
#1 lore raw

PATCH v6 1/1 ARM: mx6: Add support for Kosagi Novena

Hi Marek,

The usual stuff follows :D.

board/kosagi/novena/novena.c line 43

Quoted 3 lines · Marek Vasut
board/kosagi/novena/novena.c new file +3 -0
+#define NOVENA_BUTTON_GPIO	IMX_GPIO_NR(4, 14)
+#define NOVENA_SD_WP		IMX_GPIO_NR(1, 2)
+#define NOVENA_SD_CD		IMX_GPIO_NR(1, 4)

NOVENA_BUTTON_GPIO is initialized as input in this source file, but the NOVENA_SD_WP and NOVENA_SD_CD are not. They're initialized only in novena_spl.c, and if you change the SPL configuration, they won't be explicitly initialized.

While by pure luck the iomuxc reset values are those of the GPIO pins, I would vote for explicit initialization of WP & CD.

And btw, it's cool that you added the WP pin, I totally missed this out last time I was staring at the schematic.

Quoted 5 lines
board/kosagi/novena/novena_spl.c new file +5 -0
+/*
+ * USB
+ */
+#ifdef CONFIG_USB_EHCI_MX6
+static iomux_v3_cfg_t usb_pads[] = {

board/kosagi/novena/novena_spl.c line 373

Quoted 10 lines
board/kosagi/novena/novena_spl.c new file +10 -0
+	MX6_PAD_GPIO_17__GPIO7_IO12 | MUX_PAD_CTRL(NO_PAD_CTRL),
+};
+
+static void novena_spl_setup_iomux_usb(void)
+{
+	imx_iomux_v3_setup_multiple_pads(usb_pads, ARRAY_SIZE(usb_pads));
+}
+#else
+static void novena_spl_setup_iomux_usb(void) {}
+#endif

The patch comments are saying this is gone :).

board/kosagi/novena/novena_spl.c line 536

Quoted 13 lines
board/kosagi/novena/novena_spl.c new file +13 -0
+/*
+ * called from C runtime startup code (arch/arm/lib/crt0.S:_main)
+ * - we have a stack and a place to store GD, both in SRAM
+ * - no variable global data is available
+ */
+void board_init_f(ulong dummy)
+{
+	/*
+	 * Zero out global data:
+	 *  - this should be done by crt0.S
+	 *  - failure to zero it will cause i2c_setup to fail
+	 */
+	memset((void *)gd, 0, sizeof(struct global_data));

Same here.

include/configs/novena.h line 85

Quoted 10 lines
include/configs/novena.h new file +10 -0
+/*
+ * Environment is on MMC, starting at offset 64KiB from start of the card.
+ * Please place first partition at offset 1MiB from the start of the card
+ * as recommended by GNU/fdisk. See below for details:
+ * http://homepage.ntlworld.com./jonathan.deboynepollard/FGA/disc-partition-alignment.html
+ */
+#ifdef CONFIG_CMD_MMC
+#define CONFIG_ENV_IS_IN_MMC
+#define CONFIG_SYS_MMC_ENV_DEV		0
+#define CONFIG_ENV_OFFSET		(512 * 1024)

Please fix either the comment saying offset is 64KiB from start, or fix the CONFIG_ENV_OFFSET.

Marek, would you agree that after finishing this patch which enables the initial Novena support, to handle all other fixes by separate independent patches, which are easier to review, resubmit, test, etc?

Kind regards,
Nikolay

#2 lore raw

PATCH v6 1/1 ARM: mx6: Add support for Kosagi Novena

Quoted 14 lines · Nikolay Dimitrov

Hi Marek,

The usual stuff follows :D.

board/kosagi/novena/novena.c line 43

Quoted 3 lines · Marek Vasut
board/kosagi/novena/novena.c new file +3 -0
+#define NOVENA_BUTTON_GPIO	IMX_GPIO_NR(4, 14)
+#define NOVENA_SD_WP		IMX_GPIO_NR(1, 2)
+#define NOVENA_SD_CD		IMX_GPIO_NR(1, 4)

NOVENA_BUTTON_GPIO is initialized as input in this source file, but the NOVENA_SD_WP and NOVENA_SD_CD are not. They're initialized only in novena_spl.c, and if you change the SPL configuration, they won't be explicitly initialized.

Quoted 5 lines

While by pure luck the iomuxc reset values are those of the GPIO pins, I would vote for explicit initialization of WP & CD.

And btw, it's cool that you added the WP pin, I totally missed this out last time I was staring at the schematic.

I disagree that doing the initialization of pinmux twice is necessary, the SPL will always run before the rest of the software, so it will do the pinmux init. If you mean GPIO direction, then that's done in V7.

Quoted 9 lines
Quoted 9 lines
board/kosagi/novena/novena_spl.c new file +9 -0
+/*
+ * USB
+ */
+#ifdef CONFIG_USB_EHCI_MX6
+static iomux_v3_cfg_t usb_pads[] = {
+	MX6_PAD_GPIO_17__GPIO7_IO12 | MUX_PAD_CTRL(NO_PAD_CTRL),
+};
+
+static void novena_spl_setup_iomux_usb(void)
Quoted 8 lines

board/kosagi/novena/novena_spl.c line 373

Quoted 6 lines
board/kosagi/novena/novena_spl.c new file +6 -0
+{
+	imx_iomux_v3_setup_multiple_pads(usb_pads, ARRAY_SIZE(usb_pads));
+}
+#else
+static void novena_spl_setup_iomux_usb(void) {}
+#endif

The patch comments are saying this is gone :).

Only part of it then, thanks. The rest should be fixed.

btw. just curious, you're one of the novena backers ?

[...]

Best regards,
Marek Vasut

#3 lore raw

PATCH v6 1/1 ARM: mx6: Add support for Kosagi Novena

Hi Marek,

Quoted 18 lines · Marek Vasut
Quoted 17 lines · Nikolay Dimitrov

Hi Marek,

The usual stuff follows :D.

board/kosagi/novena/novena.c line 43

Quoted 3 lines · Marek Vasut
board/kosagi/novena/novena.c new file +3 -0
+#define NOVENA_BUTTON_GPIO	IMX_GPIO_NR(4, 14)
+#define NOVENA_SD_WP		IMX_GPIO_NR(1, 2)
+#define NOVENA_SD_CD		IMX_GPIO_NR(1, 4)

NOVENA_BUTTON_GPIO is initialized as input in this source file, but the NOVENA_SD_WP and NOVENA_SD_CD are not. They're initialized only in novena_spl.c, and if you change the SPL configuration, they won't be explicitly initialized.

While by pure luck the iomuxc reset values are those of the GPIO pins, I would vote for explicit initialization of WP & CD.

Quoted 6 lines
Quoted 2 lines

And btw, it's cool that you added the WP pin, I totally missed this out last time I was staring at the schematic.

I disagree that doing the initialization of pinmux twice is necessary, the SPL will always run before the rest of the software, so it will do the pinmux init. If you mean GPIO direction, then that's done in V7.

I also agree that there's no need to pinmux twice. And yes, what I meant was to set the WP/CD GPIOs pin directions, so thanks for fixing that.

Regards,
Nikolay