Skip to contentSkip to conversation

ARM: Add Support for the VInCo platform

PATCH New Gregory CLEMENT 2 participants 3 messages Dec 16, 2015

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: Add Support for the VInCo platform

The Versatile Industrial Communication platform is a community oriented board from Landis + Gyr. It comes with:
- an RS-485 port
- 2 Ethernet ports
- a wireless M-BUS
- a 4G modem
- a 4MB SPI flash
- a 4GB eMMC

---
 arch/arm/mach-at91/Kconfig |   7 ++
 board/l+g/vinco/Kconfig    |  12 +++
 board/l+g/vinco/Makefile   |   2 +
 board/l+g/vinco/vinco.c    | 212 +++++++++++++++++++++++++++++++++++++++++++++
 configs/vinco_defconfig    |  13 +++
 include/configs/vinco.h    | 172 ++++++++++++++++++++++++++++++++++++
 6 files changed, 418 insertions(+)
 create mode 100644 board/l+g/vinco/Kconfig
 create mode 100644 board/l+g/vinco/Makefile
 create mode 100644 board/l+g/vinco/vinco.c
 create mode 100644 configs/vinco_defconfig
 create mode 100644 include/configs/vinco.h
arch/arm/mach-at91/Kconfig +7 -0
index c333647..d7e36cb 100644
@@ -114,6 +114,12 @@ config TARGET_SMARTWEB
 	select CPU_ARM926EJS
 	select SUPPORT_SPL
 
+config TARGET_VINCO
+	bool "Support VINCO"
+	select CPU_V7
+	select SUPPORT_SPL
+
+
 endchoice
 
 config SYS_SOC
@@ -143,5 +149,6 @@ source "board/ronetix/pm9g45/Kconfig"
 source "board/siemens/corvus/Kconfig"
 source "board/siemens/taurus/Kconfig"
 source "board/siemens/smartweb/Kconfig"
+source "board/l+g/vinco/Kconfig"
 
 endif
board/l+g/vinco/Kconfig new file +12 -0
new file mode 100644
index 0000000..229b5ea
@@ -0,0 +1,12 @@
+if TARGET_VINCO
+
+config SYS_BOARD
+	default "vinco"
+
+config SYS_VENDOR
+	default "l+g"
+
+config SYS_CONFIG_NAME
+	default "vinco"
+
+endif
board/l+g/vinco/Makefile new file +2 -0
new file mode 100644
index 0000000..d68b3e4
@@ -0,0 +1,2 @@
+
+obj-y += vinco.o
board/l+g/vinco/vinco.c new file +212 -0

212 lines not on this page · raw message

configs/vinco_defconfig new file +13 -0
new file mode 100644
index 0000000..7cae79b
@@ -0,0 +1,13 @@
+CONFIG_ARM=y
+CONFIG_ARCH_AT91=y
+CONFIG_TARGET_VINCO=y
+CONFIG_SYS_EXTRA_OPTIONS="SAMA5D4,SYS_USE_SERIALFLASH"
+CONFIG_SYS_PROMPT="vinco => "
+# CONFIG_CMD_IMI is not set
+# CONFIG_CMD_IMLS is not set
+# CONFIG_CMD_LOADS is not set
+# CONFIG_CMD_FLASH is not set
+# CONFIG_CMD_FPGA is not set
+CONFIG_SPI_FLASH=y
+CONFIG_NETDEVICES=y
+CONFIG_ETH_DESIGNWARE=y
include/configs/vinco.h new file +172 -0

172 lines not on this page · raw message

Signature · 1 line
2.5.0
#1 lore raw

PATCH 1/1 ARM: Add Support for the VInCo platform

Dear Gregory CLEMENT,

Quoted 5 lines · Gregory CLEMENT
arch/arm/mach-at91/Kconfig +0 -0
index c333647..d7e36cb 100644

arch/arm/mach-at91/Kconfig config TARGET_SMARTWEB · line 122

Quoted 9 lines
arch/arm/mach-at91/Kconfig +6 -0
@@ -114,6 +114,12 @@ config TARGET_SMARTWEB
 	select CPU_ARM926EJS
 	select SUPPORT_SPL
 
+config TARGET_VINCO
+	bool "Support VINCO"
+	select CPU_V7
+	select SUPPORT_SPL
+
+

One too many empty line.

arch/arm/mach-at91/Kconfig source "board/ronetix/pm9g45/Kconfig" · line 152

Quoted 8 lines
arch/arm/mach-at91/Kconfig +1 -0
 endchoice
 
 config SYS_SOC
@@ -143,5 +149,6 @@ source "board/ronetix/pm9g45/Kconfig"
 source "board/siemens/corvus/Kconfig"
 source "board/siemens/taurus/Kconfig"
 source "board/siemens/smartweb/Kconfig"
+source "board/l+g/vinco/Kconfig"

Alphabetic ordering should be respected here.

board/l+g/vinco/Makefile line 1

Quoted 7 lines
board/l+g/vinco/Makefile new file +1 -0
new file mode 100644
index 0000000..d68b3e4
@@ -0,0 +1,2 @@
+

Useless newline.

Quoted 7 lines
board/l+g/vinco/Makefile new file +1 -0
+obj-y += vinco.o
board/l+g/vinco/vinco.c new file +0 -0
new file mode 100644
index 0000000..d9ba987

board/l+g/vinco/vinco.c line 8

Quoted 8 lines
board/l+g/vinco/vinco.c new file +8 -0
@@ -0,0 +1,212 @@
+/*
+ * Board file for the VinCo platform
+ * Based on the the SAMA5-EK board file
+ * Configuration settings for the VinCo platform.
+ * Copyright (C) 2014 Atmel
+ *		      Bo Shen <[email protected]>
+ * Copyright (C) 2015 Free Electrons
+ *		      Gregory CLEMENT gregory.clement at free-electrons.com

E-mail address should be enclosed in <...>.

Quoted 7 lines
board/l+g/vinco/vinco.c new file +7 -0
+#ifdef CONFIG_ATMEL_SPI
+int spi_cs_is_valid(unsigned int bus, unsigned int cs)
+{
+	return bus == 0 && cs == 0;
+}
+
+void spi_cs_activate(struct spi_slave *slave)

board/l+g/vinco/vinco.c line 52

Quoted 10 lines
board/l+g/vinco/vinco.c new file +10 -0
+{
+	at91_set_pio_output(AT91_PIO_PORTC, 3, 0);
+}
+
+void spi_cs_deactivate(struct spi_slave *slave)
+{
+	at91_set_pio_output(AT91_PIO_PORTC, 3, 1);
+}
+
+static void sama5d4ek_spi0_hw_init(void)

A function named sama5d4ek in the support for a board named L+G VInCo ?

Quoted 5 lines
board/l+g/vinco/vinco.c new file +5 -0
+{
+	at91_set_a_periph(AT91_PIO_PORTC, 0, 0);	/* SPI0_MISO */
+	at91_set_a_periph(AT91_PIO_PORTC, 1, 0);	/* SPI0_MOSI */
+	at91_set_a_periph(AT91_PIO_PORTC, 2, 0);	/* SPI0_SPCK */
+

board/l+g/vinco/vinco.c line 67

Quoted 10 lines
board/l+g/vinco/vinco.c new file +10 -0
+	at91_set_pio_output(AT91_PIO_PORTC, 3, 1);	/* SPI0_CS0 */
+
+	/* Enable clock */
+	at91_periph_clk_enable(ATMEL_ID_SPI0);
+}
+#endif /* CONFIG_ATMEL_SPI */
+
+
+#ifdef CONFIG_CMD_USB
+static void sama5d4ek_usb_hw_init(void)

Ditto.

board/l+g/vinco/vinco.c line 77

Quoted 10 lines
board/l+g/vinco/vinco.c new file +10 -0
+{
+	at91_set_pio_output(AT91_PIO_PORTE, 11, 0);
+	at91_set_pio_output(AT91_PIO_PORTE, 12, 0);
+	at91_set_pio_output(AT91_PIO_PORTE, 10, 0);
+}
+#endif
+
+
+#ifdef CONFIG_GENERIC_ATMEL_MCI
+void sama5d4ek_mci0_hw_init(void)

Ditto (and multiple times later).

Quoted 6 lines
include/configs/vinco.h new file +0 -0
new file mode 100644
index 0000000..678b04b

include/configs/vinco.h line 8

Quoted 8 lines
include/configs/vinco.h new file +8 -0
@@ -0,0 +1,172 @@
+/*
+ * Configuration settings for the VInCo platform.
+ *
+ * Based on the settings for the SAMA5-EK board
+ * Copyright (C) 2014 Atmel
+ *		      Bo Shen <[email protected]>
+ * Copyright (C) 2015 Free Electrons
+ *		      Gregory CLEMENT gregory.clement at free-electrons.com

<...> for e-mail address

include/configs/vinco.h line 16

Quoted 8 lines
include/configs/vinco.h new file +8 -0
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+/* No NOR flash, this definition should put before common header */

"should put" ?

include/configs/vinco.h line 21

Quoted 5 lines
include/configs/vinco.h new file +5 -0
+#define CONFIG_SYS_NO_FLASH
+
+#ifdef CONFIG_SYS_TEXT_BASE
+#undef CONFIG_SYS_TEXT_BASE
+#endif

Why here? Nothing has been included so far, I guess this is going to be defined by the next line, no?

include/configs/vinco.h line 28

Quoted 7 lines
include/configs/vinco.h new file +7 -0
+#include "at91-sama5_common.h"
+
+/* The value in the common file is too far away for the VinCo platform */
+#ifdef CONFIG_SYS_TEXT_BASE
+#undef CONFIG_SYS_TEXT_BASE
+#endif
+#define CONFIG_SYS_TEXT_BASE		0x20f00000

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#2 lore raw

PATCH 1/1 ARM: Add Support for the VInCo platform

Hi Thomas,

Quoted 130 lines · Thomas Petazzoni

Dear Gregory CLEMENT,

Quoted 5 lines · Gregory CLEMENT
arch/arm/mach-at91/Kconfig +0 -0
index c333647..d7e36cb 100644

arch/arm/mach-at91/Kconfig config TARGET_SMARTWEB · line 122

Quoted 9 lines
arch/arm/mach-at91/Kconfig +6 -0
@@ -114,6 +114,12 @@ config TARGET_SMARTWEB
 	select CPU_ARM926EJS
 	select SUPPORT_SPL
 
+config TARGET_VINCO
+	bool "Support VINCO"
+	select CPU_V7
+	select SUPPORT_SPL
+
+

One too many empty line.

arch/arm/mach-at91/Kconfig source "board/ronetix/pm9g45/Kconfig" · line 152

Quoted 8 lines
arch/arm/mach-at91/Kconfig +1 -0
 endchoice
 
 config SYS_SOC
@@ -143,5 +149,6 @@ source "board/ronetix/pm9g45/Kconfig"
 source "board/siemens/corvus/Kconfig"
 source "board/siemens/taurus/Kconfig"
 source "board/siemens/smartweb/Kconfig"
+source "board/l+g/vinco/Kconfig"

Alphabetic ordering should be respected here.

board/l+g/vinco/Makefile line 1

Quoted 7 lines
board/l+g/vinco/Makefile new file +1 -0
new file mode 100644
index 0000000..d68b3e4
@@ -0,0 +1,2 @@
+

Useless newline.

Quoted 7 lines
board/l+g/vinco/Makefile new file +1 -0
+obj-y += vinco.o
board/l+g/vinco/vinco.c new file +0 -0
new file mode 100644
index 0000000..d9ba987

board/l+g/vinco/vinco.c line 8

Quoted 8 lines
board/l+g/vinco/vinco.c new file +8 -0
@@ -0,0 +1,212 @@
+/*
+ * Board file for the VinCo platform
+ * Based on the the SAMA5-EK board file
+ * Configuration settings for the VinCo platform.
+ * Copyright (C) 2014 Atmel
+ *		      Bo Shen <[email protected]>
+ * Copyright (C) 2015 Free Electrons
+ *		      Gregory CLEMENT gregory.clement at free-electrons.com

E-mail address should be enclosed in <...>.

Quoted 7 lines
board/l+g/vinco/vinco.c new file +7 -0
+#ifdef CONFIG_ATMEL_SPI
+int spi_cs_is_valid(unsigned int bus, unsigned int cs)
+{
+	return bus == 0 && cs == 0;
+}
+
+void spi_cs_activate(struct spi_slave *slave)

board/l+g/vinco/vinco.c line 52

Quoted 10 lines
board/l+g/vinco/vinco.c new file +10 -0
+{
+	at91_set_pio_output(AT91_PIO_PORTC, 3, 0);
+}
+
+void spi_cs_deactivate(struct spi_slave *slave)
+{
+	at91_set_pio_output(AT91_PIO_PORTC, 3, 1);
+}
+
+static void sama5d4ek_spi0_hw_init(void)

A function named sama5d4ek in the support for a board named L+G VInCo ?

Quoted 5 lines
board/l+g/vinco/vinco.c new file +5 -0
+{
+	at91_set_a_periph(AT91_PIO_PORTC, 0, 0);	/* SPI0_MISO */
+	at91_set_a_periph(AT91_PIO_PORTC, 1, 0);	/* SPI0_MOSI */
+	at91_set_a_periph(AT91_PIO_PORTC, 2, 0);	/* SPI0_SPCK */
+

board/l+g/vinco/vinco.c line 67

Quoted 10 lines
board/l+g/vinco/vinco.c new file +10 -0
+	at91_set_pio_output(AT91_PIO_PORTC, 3, 1);	/* SPI0_CS0 */
+
+	/* Enable clock */
+	at91_periph_clk_enable(ATMEL_ID_SPI0);
+}
+#endif /* CONFIG_ATMEL_SPI */
+
+
+#ifdef CONFIG_CMD_USB
+static void sama5d4ek_usb_hw_init(void)

Ditto.

board/l+g/vinco/vinco.c line 77

Quoted 10 lines
board/l+g/vinco/vinco.c new file +10 -0
+{
+	at91_set_pio_output(AT91_PIO_PORTE, 11, 0);
+	at91_set_pio_output(AT91_PIO_PORTE, 12, 0);
+	at91_set_pio_output(AT91_PIO_PORTE, 10, 0);
+}
+#endif
+
+
+#ifdef CONFIG_GENERIC_ATMEL_MCI
+void sama5d4ek_mci0_hw_init(void)

Ditto (and multiple times later).

Quoted 6 lines
include/configs/vinco.h new file +0 -0
new file mode 100644
index 0000000..678b04b

include/configs/vinco.h line 8

Quoted 8 lines
include/configs/vinco.h new file +8 -0
@@ -0,0 +1,172 @@
+/*
+ * Configuration settings for the VInCo platform.
+ *
+ * Based on the settings for the SAMA5-EK board
+ * Copyright (C) 2014 Atmel
+ *		      Bo Shen <[email protected]>
+ * Copyright (C) 2015 Free Electrons
+ *		      Gregory CLEMENT gregory.clement at free-electrons.com

<...> for e-mail address

Quoted 10 lines

include/configs/vinco.h line 16

Quoted 8 lines
include/configs/vinco.h new file +8 -0
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+/* No NOR flash, this definition should put before common header */

"should put" ?

"should _be_ put" I guess, I dumbly copy and paste this one.

Quoted 10 lines

include/configs/vinco.h line 21

Quoted 6 lines
include/configs/vinco.h new file +5 -0
+#define CONFIG_SYS_NO_FLASH
+
+#ifdef CONFIG_SYS_TEXT_BASE
+#undef CONFIG_SYS_TEXT_BASE
+#endif

Why here? Nothing has been included so far, I guess this is going to be defined by the next line, no?

Quoted 7 lines

include/configs/vinco.h line 28

Quoted 7 lines
include/configs/vinco.h new file +7 -0
+#include "at91-sama5_common.h"
+
+/* The value in the common file is too far away for the VinCo platform */
+#ifdef CONFIG_SYS_TEXT_BASE
+#undef CONFIG_SYS_TEXT_BASE
+#endif
+#define CONFIG_SYS_TEXT_BASE		0x20f00000

Thanks for your review, I agree with all your comment and will send a v2 soon.

Gregory

Quoted 8 lines

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
Signature · 4 lines
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com