lauv-aux: added new system type for LAUV's auxiliary and storage CPU.

This commit is contained in:
Ricardo Martins 2015-02-08 18:42:48 +00:00
parent 2cba596d8d
commit adda9f7614
8 changed files with 3066 additions and 0 deletions

File diff suppressed because it is too large Load Diff

17
systems/lauv-aux/config Normal file
View File

@ -0,0 +1,17 @@
cfg_architecture='cortex-a8-hardfp'
cfg_storage='data0:ext4:/opt'
cfg_modules=''
cfg_services0='network dropbear storage upgrade syslog ptpd'
cfg_services2='dune'
cfg_packages='u-boot dropbear rsync busybox e2fsprogs ptpd am33xx-cm3/host linux'
cfg_target_linux_kernel='arch/arm/boot/zImage'
cfg_target_linux_dtb='arch/arm/boot/dts/am335x-lauv-aux.dtb'
cfg_target_uboot_config='am335x_bbb'
cfg_ptpd_interface='eth0'
cfg_terminal='ttyO0'
cfg_partitions=\
(
x-boot boot0 512B 32MiB
root root0 32MiB 544MiB
data data0 544MiB -1
)

View File

@ -0,0 +1,23 @@
#!/bin/sh
export PATH=/bin
mount -t proc proc /proc
mount -t sysfs sysfs /sys
mount -t devtmpfs devtmpfs /dev
while [ 1 ]; do
dev="$(ls /sys/class/mmc_host/mmc?/mmc?:0001/block)"
if [ -n "$dev" ]; then
mount -o ro "/dev/${dev}p2" /mnt && break
fi
usleep 100000
done
umount /sys /proc /dev
exec switch_root /mnt /sbin/init
echo "ERROR: failed to switch root"
exec /bin/sh

View File

@ -0,0 +1,6 @@
ttyO0 root:root 660 >terminal
ttyO1 root:root 660 >uart/1
ttyO2 root:root 660 >uart/2
ttyO4 root:root 660 >uart/4
ttyO5 root:root 660 >uart/5
ttyUSB[0-9]* root:root 660 */sbin/mdev-ttyusb

View File

@ -0,0 +1,5 @@
cfg_hostname='lauv-aux-testbed'
cfg_eth_ext_ip='10.0.200.22'
cfg_eth_ext_mk='255.255.0.0'
cfg_eth_ext_gw='10.0.0.1'
cfg_ptpd_interface='eth0'

View File

@ -0,0 +1,92 @@
diff -Nru linux-3.13.1/arch/arm/boot/dts/Makefile linux-3.13.1.rasm/arch/arm/boot/dts/Makefile
--- linux-3.13.1/arch/arm/boot/dts/Makefile 2014-01-29 13:06:37.000000000 +0000
+++ linux-3.13.1.rasm/arch/arm/boot/dts/Makefile 2014-02-01 06:53:43.968486026 +0000
@@ -198,6 +198,7 @@
am335x-evmsk.dtb \
am335x-bone.dtb \
am335x-boneblack.dtb \
+ am335x-lauv-aux.dtb \
am335x-nano.dtb \
am335x-base0033.dtb \
am3517-evm.dtb \
diff -Nru linux-3.13.1/arch/arm/boot/dts/am335x-lauv-aux.dts linux-3.13.1.rasm/arch/arm/boot/dts/am335x-lauv-aux.dts
--- linux-3.13.1/arch/arm/boot/dts/am335x-lauv-aux.dts 1970-01-01 01:00:00.000000000 +0100
+++ linux-3.13.1.rasm/arch/arm/boot/dts/am335x-lauv-aux.dts 2014-02-01 06:51:48.273816483 +0000
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 2014 Universidade do Porto - Faculdade de Engenharia
+ *
+ * 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 "am335x-boneblack.dts"
+
+/ {
+ /* No need for HDMI. */
+ hdmi {
+ status = "disabled";
+ };
+
+ /* PPS. */
+ pps {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pps_pins>;
+ compatible = "pps-gpio";
+ status = "okay";
+ gpios = <&gpio2 13 0>;
+ assert-rising-edge;
+ };
+};
+
+&am33xx_pinmux {
+ pinctrl-names = "default";
+ pinctrl-0 = <&board_pins>;
+
+ /* User space. */
+ board_pins: pinmux_board_pins {
+ /* lcd_data6 / gpio2_12 / GPIO 76 */
+ pinctrl-single,pins = <0xb8 (PIN_OUTPUT_PULLDOWN | MUX_MODE7)>;
+ };
+
+ /* PPS. */
+ pps_pins: pinmux_pps_pins {
+ /* lcd_data7 / gpio2_13 */
+ pinctrl-single,pins = <0xbc (PIN_INPUT_PULLDOWN | MUX_MODE7)>;
+ };
+
+ /* UART1. */
+ uart1_pins: pinmux_uart1_pins {
+ pinctrl-single,pins = <
+ /* uart1_rxd */
+ 0x180 (PIN_INPUT_PULLUP | MUX_MODE0)
+ /* uart1_txd */
+ 0x184 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)
+ >;
+ };
+
+ /* UART2. */
+ uart2_pins: pinmux_uart2_pins {
+ pinctrl-single,pins = <
+ /* uart2_rxd */
+ 0x150 (PIN_INPUT_PULLUP | MUX_MODE1)
+ /* uart2_txd */
+ 0x154 (PIN_OUTPUT_PULLDOWN | MUX_MODE1)
+ >;
+ };
+};
+
+/* Enable UART1. */
+&uart1 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart1_pins>;
+ status = "okay";
+};
+
+/* Enable UART2 (actual UART3). */
+&uart2 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart2_pins>;
+ status = "okay";
+};

View File

@ -0,0 +1,136 @@
From 83ad4305da1128111b2f063e41a740d1e19836c8 Mon Sep 17 00:00:00 2001
From: Jay at Control Module Industries <cmidroid@gmail.com>
Date: Tue, 1 Jul 2014 14:49:52 -0500
Subject: [PATCH 7/7] cpsw: search for phy
I have encountered the same issue(s) on A6A boards.
I couldn't find a patch, so I wrote this patch to update the device tree
in the davinci_mdio driver in the 3.15.1 tree, it seems to correct it. I
would welcome any input on a different approach.
https://groups.google.com/d/msg/beagleboard/9mctrG26Mc8/SRlnumt0LoMJ
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
---
drivers/net/ethernet/ti/davinci_mdio.c | 83 ++++++++++++++++++++++++++++++++++
1 file changed, 83 insertions(+)
diff --git a/drivers/net/ethernet/ti/davinci_mdio.c b/drivers/net/ethernet/ti/davinci_mdio.c
index 0cca9de..0197edd 100644
--- a/drivers/net/ethernet/ti/davinci_mdio.c
+++ b/drivers/net/ethernet/ti/davinci_mdio.c
@@ -39,6 +39,7 @@
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/pinctrl/consumer.h>
+#include <linux/phy.h>
/*
* This timeout definition is a worst-case ultra defensive measure against
@@ -97,6 +98,10 @@ struct davinci_mdio_data {
unsigned long access_time; /* jiffies */
};
+#if IS_ENABLED(CONFIG_OF)
+static void davinci_mdio_update_dt_from_phymask(u32 phy_mask);
+#endif
+
static void __davinci_mdio_reset(struct davinci_mdio_data *data)
{
u32 mdio_in, div, mdio_out_khz, access_time;
@@ -150,6 +155,11 @@ static int davinci_mdio_reset(struct mii_bus *bus)
/* restrict mdio bus to live phys only */
dev_info(data->dev, "detected phy mask %x\n", ~phy_mask);
phy_mask = ~phy_mask;
+
+ #if IS_ENABLED(CONFIG_OF)
+ davinci_mdio_update_dt_from_phymask(phy_mask);
+ #endif
+
} else {
/* desperately scan all phys */
dev_warn(data->dev, "no live phy, scanning all\n");
@@ -312,6 +322,79 @@ static int davinci_mdio_probe_dt(struct mdio_platform_data *data,
}
#endif
+#if IS_ENABLED(CONFIG_OF)
+static void davinci_mdio_update_dt_from_phymask(u32 phy_mask)
+{
+ int i, len;
+ u32 addr;
+ __be32 *old_phy_p, *phy_id_p;
+ struct property *phy_id_property = NULL;
+ struct device_node *node_p, *slave_p;
+
+ addr = 0;
+
+ for (i = 0; i < PHY_MAX_ADDR; i++) {
+ if ((phy_mask & (1 << i)) == 0) {
+ addr = (u32) i;
+ break;
+ }
+ }
+
+ for_each_compatible_node(node_p, NULL, "ti,cpsw") {
+ for_each_node_by_name(slave_p, "slave") {
+
+ old_phy_p = (__be32 *) of_get_property(slave_p, "phy_id", &len);
+
+ if (len != (sizeof(__be32 *) * 2))
+ goto err_out;
+
+ if (old_phy_p) {
+
+ phy_id_property = kzalloc(sizeof(*phy_id_property), GFP_KERNEL);
+
+ if (! phy_id_property)
+ goto err_out;
+
+ phy_id_property->length = len;
+ phy_id_property->name = kstrdup("phy_id", GFP_KERNEL);
+ phy_id_property->value = kzalloc(len, GFP_KERNEL);
+
+ if (! phy_id_property->name)
+ goto err_out;
+
+ if (! phy_id_property->value)
+ goto err_out;
+
+ memcpy(phy_id_property->value, old_phy_p, len);
+
+ phy_id_p = (__be32 *) phy_id_property->value + 1;
+
+ *phy_id_p = cpu_to_be32(addr);
+
+ of_update_property(slave_p, phy_id_property);
+
+ ++addr;
+ }
+ }
+ }
+
+ return;
+
+err_out:
+
+ if (phy_id_property) {
+ if (phy_id_property->name)
+ kfree(phy_id_property->name);
+
+ if (phy_id_property->value)
+ kfree(phy_id_property->value);
+
+ if (phy_id_property)
+ kfree(phy_id_property);
+ }
+}
+#endif
+
static int davinci_mdio_probe(struct platform_device *pdev)
{
struct mdio_platform_data *pdata = dev_get_platdata(&pdev->dev);
--
2.0.0

View File

@ -0,0 +1,151 @@
diff --git a/boards.cfg b/boards.cfg
index 1ba2081..08dc221 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -1218,3 +1218,4 @@ Orphan powerpc ppc4xx - sandburst metrobox
# The following were move to "Orphan" in September, 2013
Orphan arm arm1136 mx31 - imx31_phycore imx31_phycore_eet imx31_phycore:IMX31_PHYCORE_EET (resigned) Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Orphan arm arm1136 mx31 freescale mx31ads mx31ads - (resigned) Guennadi Liakhovetski <g.liakhovetski@gmx.de>
+Active arm armv7 am33xx ti am335x am335x_bbb am335x_bbb:SERIAL1,CONS_INDEX=1 Ricardo Martins <rasm@fe.up.pt>
diff --git a/include/configs/am335x_bbb.h b/include/configs/am335x_bbb.h
new file mode 100644
index 0000000..9e00817
--- /dev/null
+++ b/include/configs/am335x_bbb.h
@@ -0,0 +1,136 @@
+/*
+ * am335x_evm.h
+ *
+ * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation version 2.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __CONFIG_AM335X_EVM_H
+#define __CONFIG_AM335X_EVM_H
+
+#include <configs/ti_am335x_common.h>
+
+#ifdef CONFIG_BOOTDELAY
+# undef CONFIG_BOOTLDELAY
+#endif
+#define CONFIG_BOOTDELAY 2
+#define CONFIG_AUTOBOOT_KEYED 1
+#define CONFIG_AUTOBOOT_DELAY_STR "uboot"
+#define CONFIG_AUTOBOOT_PROMPT \
+ "autoboot in %d seconds\n",bootdelay
+
+#undef CONFIG_BOOTM_NETBSD
+#undef CONFIG_BOOTM_PLAN9
+#undef CONFIG_BOOTM_RTEMS
+#undef CONFIG_BOOTM_VXWORKS
+#undef CONFIG_BOOTP_DNS
+#undef CONFIG_BOOTP_DNS2
+#undef CONFIG_BOOTP_SEND_HOSTNAME
+#undef CONFIG_CMD_ASKENV
+#undef CONFIG_CMD_BDI
+#undef CONFIG_CMD_BOOTD
+#undef CONFIG_CMD_CRC32
+#undef CONFIG_CMD_DFU
+#undef CONFIG_CMD_DHCP
+#undef CONFIG_CMD_EDITENV
+#undef CONFIG_CMD_EDITENV
+#undef CONFIG_CMD_EXPORTENV
+#undef CONFIG_CMD_FPGA
+#undef CONFIG_CMD_ITEST
+#undef CONFIG_CMD_LOADB
+#undef CONFIG_CMD_LOADS
+#undef CONFIG_CMD_MEMORY
+#undef CONFIG_CMD_MISC
+#undef CONFIG_CMD_NET
+#undef CONFIG_CMD_NFS
+#undef CONFIG_CMD_PING
+#undef CONFIG_CMD_SETGETDCR
+#undef CONFIG_CMD_SPI
+#undef CONFIG_DRIVER_TI_CPSW
+#undef CONFIG_MII
+#undef CONFIG_MUSB_GADGET
+#undef CONFIG_MUSB_HOST
+#undef CONFIG_NAND
+#undef CONFIG_OMAP3_SPI
+#undef CONFIG_SPI
+#undef CONFIG_SPI_BOOT
+#undef CONFIG_SPL_ETH_SUPPORT
+#undef CONFIG_SPL_NAND_LOAD
+#undef CONFIG_SPL_NAND_SUPPORT
+#undef CONFIG_SPL_SPI_FLASH_SUPPORT
+#undef CONFIG_SPL_SPI_LOAD
+#undef CONFIG_SPL_SPI_SUPPORT
+#undef CONFIG_SPL_YMODEM_SUPPORT
+#undef CONFIG_SYS_LONGHELP
+
+#define MACH_TYPE_TIAM335EVM 3589 /* Until the next sync */
+#define CONFIG_MACH_TYPE MACH_TYPE_TIAM335EVM
+
+/* Clock Defines */
+#define V_OSCK 24000000 /* Clock output from T2 */
+#define V_SCLK (V_OSCK)
+
+/* Custom script for NOR */
+#define CONFIG_SYS_LDSCRIPT "board/ti/am335x/u-boot.lds"
+
+/* Always 128 KiB env size */
+#define CONFIG_ENV_SIZE (128 << 10)
+
+#define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
+
+#ifndef CONFIG_SPL_BUILD
+#define CONFIG_EXTRA_ENV_SETTINGS \
+ "loadaddr=0x80200000\0" \
+ "fdtaddr=0x80F80000\0" \
+ "console=ttyO0,115200n8 ro quiet\0"
+
+#define CONFIG_BOOTCOMMAND \
+ "setenv bootargs \"console=${console} ro\";" \
+ "mmc dev 1; " \
+ "ext4load mmc 1:2 ${loadaddr} /boot/kernel; " \
+ "ext4load mmc 1:2 ${fdtaddr} /boot/board.dtb; " \
+ "bootz ${loadaddr} - ${fdtaddr}; "
+
+#endif
+
+/* NS16550 Configuration */
+#define CONFIG_SYS_NS16550_COM1 0x44e09000 /* Base EVM has UART0 */
+#define CONFIG_SYS_NS16550_COM2 0x48022000 /* UART1 */
+#define CONFIG_SYS_NS16550_COM3 0x48024000 /* UART2 */
+#define CONFIG_SYS_NS16550_COM4 0x481a6000 /* UART3 */
+#define CONFIG_SYS_NS16550_COM5 0x481a8000 /* UART4 */
+#define CONFIG_SYS_NS16550_COM6 0x481aa000 /* UART5 */
+#define CONFIG_BAUDRATE 115200
+
+#define CONFIG_CMD_EEPROM
+#define CONFIG_ENV_EEPROM_IS_ON_I2C
+#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* Main EEPROM */
+#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
+#define CONFIG_SYS_I2C_MULTI_EEPROMS
+
+/* PMIC support */
+#define CONFIG_POWER_TPS65217
+#define CONFIG_POWER_TPS65910
+
+/* SPL */
+#define CONFIG_SPL_POWER_SUPPORT
+
+
+/* Bootcount using the RTC block */
+#define CONFIG_BOOTCOUNT_LIMIT
+#define CONFIG_BOOTCOUNT_AM33XX
+
+/* SPI flash. */
+#define CONFIG_SPL_LDSCRIPT "$(CPUDIR)/am33xx/u-boot-spl.lds"
+
+#define CONFIG_ENV_IS_NOWHERE
+
+#endif /* ! __CONFIG_AM335X_EVM_H */