Add support for GE/Advantech i.MX6 ELO Platform
cover Add support for GE/Advantech i.MX6 ELO Platform
This series adds support for the Advantech DMS-BA16 i.MX6Q module on the GE ELO baseboard.
The kernel and u-boot are forks of the fslc 3.14-1.1.x and 2015.10+fslc branches, respectively.
conf/machine/imx6q-elo.conf | 23 recipes-bsp/u-boot/u-boot-ge-2015.10/0001-arm-imx-Add-support-for-GE-Bx50v3-boards.patch | 1245 ++++++++++ recipes-bsp/u-boot/u-boot-ge-2015.10/0002-board-ge-bx50v3-Update-display-setup.patch | 293 ++ recipes-bsp/u-boot/u-boot-ge-2015.10/0003-ge_bx50v3-Add-support-for-FSL-Community-Yocto-images.patch | 128 + recipes-bsp/u-boot/u-boot-ge-2015.10/0004-board-ge-bx50v3-Add-support-for-ELO-board.patch | 222 + recipes-bsp/u-boot/u-boot-ge-2015.10/0005-board-ge-bx50v3-Fix-bootargs-for-ELO-board.patch | 37 recipes-bsp/u-boot/u-boot-ge-2015.10/0006-mx6q_ba16-Add-1G-DDR-support.patch | 343 ++ recipes-bsp/u-boot/u-boot-ge-2015.10/0007-board-ge-bx50v3-Add-correct-SATA-settings.patch | 59 recipes-bsp/u-boot/u-boot-ge_2015.10.bb | 22 recipes-kernel/linux/linux-ge-3.14/0001-rtc-rx8010-Add-driver-to-kernel.patch | 1020 ++++++++ recipes-kernel/linux/linux-ge-3.14/0002-mfd-da9063-Add-support-for-production-silicon-varian.patch | 101 recipes-kernel/linux/linux-ge-3.14/0003-mfd-da9063-Upgrade-of-register-definitions-to-suppor.patch | 257 ++ recipes-kernel/linux/linux-ge-3.14/0004-rtc-da9063-RTC-driver.patch | 399 +++ recipes-kernel/linux/linux-ge-3.14/0005-mfd-da9063-Add-support-for-AD-silicon-variant.patch | 582 ++++ recipes-kernel/linux/linux-ge-3.14/0006-mfd-da9063-Get-irq-base-dynamically-before-registeri.patch | 42 recipes-kernel/linux/linux-ge-3.14/0007-mfd-da9063-Add-support-for-OnKey-driver.patch | 114 recipes-kernel/linux/linux-ge-3.14/0008-ahci_imx-Make-receive-DPLL-mode-configurable.patch | 51 recipes-kernel/linux/linux-ge-3.14/0009-PCI-imx6-Add-DT-bindings-to-configure-PHY-Tx-driver-.patch | 112 recipes-kernel/linux/linux-ge-3.14/0010-ARM-dts-imx-Add-support-for-Advantech-GE-ELO.patch | 817 ++++++ recipes-kernel/linux/linux-ge-3.14/defconfig | 453 +++ recipes-kernel/linux/linux-ge_3.14.bb | 25 21 files changed, 6345 insertions(+)
PATCH 1/3 u-boot-ge: Add u-boot recipe for GE i.MX6 boards
This recipe is a fork of the fslc u-boot with patches for supporting the imx6q-elo platform.
This recipe is intended to be a stop-gap until the imx6q-elo board can be rebased and tested with the most recent fslc branch.
--- ...-arm-imx-Add-support-for-GE-Bx50v3-boards.patch | 1245 ++++++++++++++++++++ ...0002-board-ge-bx50v3-Update-display-setup.patch | 293 +++++ ...dd-support-for-FSL-Community-Yocto-images.patch | 128 ++ ...board-ge-bx50v3-Add-support-for-ELO-board.patch | 222 ++++ ...oard-ge-bx50v3-Fix-bootargs-for-ELO-board.patch | 37 + .../0006-mx6q_ba16-Add-1G-DDR-support.patch | 343 ++++++ ...board-ge-bx50v3-Add-correct-SATA-settings.patch | 59 + recipes-bsp/u-boot/u-boot-ge_2015.10.bb | 22 + 8 files changed, 2349 insertions(+) create mode 100644 recipes-bsp/u-boot/u-boot-ge-2015.10/0001-arm-imx-Add-support-for-GE-Bx50v3-boards.patch create mode 100644 recipes-bsp/u-boot/u-boot-ge-2015.10/0002-board-ge-bx50v3-Update-display-setup.patch create mode 100644 recipes-bsp/u-boot/u-boot-ge-2015.10/0003-ge_bx50v3-Add-support-for-FSL-Community-Yocto-images.patch create mode 100644 recipes-bsp/u-boot/u-boot-ge-2015.10/0004-board-ge-bx50v3-Add-support-for-ELO-board.patch create mode 100644 recipes-bsp/u-boot/u-boot-ge-2015.10/0005-board-ge-bx50v3-Fix-bootargs-for-ELO-board.patch create mode 100644 recipes-bsp/u-boot/u-boot-ge-2015.10/0006-mx6q_ba16-Add-1G-DDR-support.patch create mode 100644 recipes-bsp/u-boot/u-boot-ge-2015.10/0007-board-ge-bx50v3-Add-correct-SATA-settings.patch create mode 100644 recipes-bsp/u-boot/u-boot-ge_2015.10.bb
recipes-bsp/u-boot/u-boot-ge-2015.10/0001-arm-imx-Add-support-for-GE-Bx50v3-boards.patch new file +1245 -0
@@ -0,0 +1,1245 @@ +From b887466cde24f9bedd11af567e9dae02112f55ae Mon Sep 17 00:00:00 2001 +From: Akshay Bhat <[email protected]> +Date: Wed, 9 Dec 2015 17:43:17 -0500 +Subject: [PATCH 1/7] arm: imx: Add support for GE Bx50v3 boards + +Add support for GE B450v3, B650v3 and B850v3 boards. The boards +are based on Advantech BA16 module which has a i.MX6D processor. +The boards support: + - FEC Ethernet + - USB Ports + - SDHC and MMC boot + - SPI NOR + - LVDS and HDMI display + +Basic information about the module: + - Module manufacturer: Advantech + - CPU: Freescale ARM Cortex-A9 i.MX6D + - SPECS: + Up to 2GB Onboard DDR3 Memory; + Up to 16GB Onboard eMMC NAND Flash + Supports OpenGL ES 2.0 and OpenVG 1.1 + HDMI, 24-bit LVDS + 1x UART, 2x I2C, 8x GPIO, + 4x Host USB 2.0 port, 1x USB OTG port, + 1x micro SD (SDHC),1x SDIO, 1x SATA II, + 1x 10/100/1000 Mbps Ethernet, 1x PCIe X1 Gen2 + +Signed-off-by: Akshay Bhat <[email protected]> +Series-to: [email protected] +Series-cc: [email protected] +Series-cc: [email protected] +Series-cc: [email protected] +Series-version: 2 +Series-changes: 2 +- Address comments from Peng Fan: +- Use static for iomux definitions and imx6_rgmii_rework() +- Use IS_ENABLED instead of ifdef in detect_baseboard() +- Remove unused BMODE cmd +- Get rid of CONFIG_SYS_EXTRA_OPTIONS and use Kconfig +- Get rid of unused CONFIG_SYS_RECOVERY and CONFIG_ENV_IS_IN_MMC +- Cleanup incorrect comments +- Move gpio and display setup from board_early_init_f to board_init + +Upstream-Status: Submitted [[email protected]] +--- + arch/arm/cpu/armv7/mx6/Kconfig | 13 + + board/ge/bx50v3/Kconfig | 18 ++ + board/ge/bx50v3/MAINTAINERS | 8 + + board/ge/bx50v3/Makefile | 8 + + board/ge/bx50v3/bx50v3.c | 533 +++++++++++++++++++++++++++++++++++++++++ + board/ge/bx50v3/bx50v3.cfg | 151 ++++++++++++ + configs/ge_b450v3_defconfig | 8 + + configs/ge_b650v3_defconfig | 8 + + configs/ge_b850v3_defconfig | 8 + + include/configs/ge_bx50v3.h | 349 +++++++++++++++++++++++++++ + 10 files changed, 1104 insertions(+) + create mode 100644 board/ge/bx50v3/Kconfig + create mode 100644 board/ge/bx50v3/MAINTAINERS + create mode 100644 board/ge/bx50v3/Makefile + create mode 100644 board/ge/bx50v3/bx50v3.c + create mode 100644 board/ge/bx50v3/bx50v3.cfg + create mode 100644 configs/ge_b450v3_defconfig + create mode 100644 configs/ge_b650v3_defconfig + create mode 100644 configs/ge_b850v3_defconfig + create mode 100644 include/configs/ge_bx50v3.h + +diff --git a/arch/arm/cpu/armv7/mx6/Kconfig b/arch/arm/cpu/armv7/mx6/Kconfig +index 8489182..722e0d0 100644 +--- a/arch/arm/cpu/armv7/mx6/Kconfig ++++ b/arch/arm/cpu/armv7/mx6/Kconfig +@@ -60,6 +60,18 @@ config TARGET_CM_FX6 + config TARGET_EMBESTMX6BOARDS + bool "embestmx6boards" + ++config TARGET_GE_B450V3 ++ bool "General Electric B450v3" ++ select MX6Q ++ ++config TARGET_GE_B650V3 ++ bool "General Electric B650v3" ++ select MX6Q ++ ++config TARGET_GE_B850V3 ++ bool "General Electric B850v3" ++ select MX6Q ++ + config TARGET_GW_VENTANA + bool "gw_ventana" + select SUPPORT_SPL +@@ -153,6 +165,7 @@ endchoice + config SYS_SOC + default "mx6" + ++source "board/ge/bx50v3/Kconfig" + source "board/aristainetos/Kconfig" + source "board/bachmann/ot1200/Kconfig" + source "board/barco/platinum/Kconfig" +diff --git a/board/ge/bx50v3/Kconfig b/board/ge/bx50v3/Kconfig +new file mode 100644 +index 0000000..d50dece +--- /dev/null ++++ b/board/ge/bx50v3/Kconfig +@@ -0,0 +1,18 @@ ++if TARGET_GE_B450V3 || TARGET_GE_B650V3 || TARGET_GE_B850V3 ++ ++config IMX_CONFIG ++ default "board/ge/bx50v3/bx50v3.cfg" ++ ++config SYS_BOARD ++ default "bx50v3" ++ ++config SYS_VENDOR ++ default "ge" ++ ++config SYS_SOC ++ default "mx6" ++ ++config SYS_CONFIG_NAME ++ default "ge_bx50v3" ++ ++endif +diff --git a/board/ge/bx50v3/MAINTAINERS b/board/ge/bx50v3/MAINTAINERS +new file mode 100644 +index 0000000..8e60791 +--- /dev/null ++++ b/board/ge/bx50v3/MAINTAINERS +@@ -0,0 +1,8 @@ ++GE_BX50V3 BOARD ++M: Martin Donnelly <[email protected]> ++S: Maintained ++F: board/ge/bx50v3/ ++F: include/configs/ge_bx50v3.h ++F: configs/ge_b450v3_defconfig ++F: configs/ge_b650v3_defconfig ++F: configs/ge_b850v3_defconfig +diff --git a/board/ge/bx50v3/Makefile b/board/ge/bx50v3/Makefile +new file mode 100644 +index 0000000..bcd149f +--- /dev/null ++++ b/board/ge/bx50v3/Makefile +@@ -0,0 +1,8 @@ ++# ++# Copyright 2015 Timesys Corporation ++# Copyright 2015 General Electric Company ++# ++# SPDX-License-Identifier: GPL-2.0+ ++# ++ ++obj-y := bx50v3.o +diff --git a/board/ge/bx50v3/bx50v3.c b/board/ge/bx50v3/bx50v3.c +new file mode 100644 +index 0000000..70c298d +--- /dev/null ++++ b/board/ge/bx50v3/bx50v3.c +@@ -0,0 +1,533 @@ ++/* ++ * Copyright 2015 Timesys Corporation ++ * Copyright 2015 General Electric Company ++ * Copyright 2012 Freescale Semiconductor, Inc. ++ * ++ * SPDX-License-Identifier: GPL-2.0+ ++ */ ++ ++#include <asm/arch/clock.h> ++#include <asm/arch/imx-regs.h> ++#include <asm/arch/iomux.h> ++#include <asm/arch/mx6-pins.h> ++#include <asm/errno.h> ++#include <asm/gpio.h> ++#include <asm/imx-common/mxc_i2c.h> ++#include <asm/imx-common/iomux-v3.h> ++#include <asm/imx-common/boot_mode.h> ++#include <asm/imx-common/video.h> ++#include <mmc.h> ++#include <fsl_esdhc.h> ++#include <miiphy.h> ++#include <netdev.h> ++#include <asm/arch/mxc_hdmi.h> ++#include <asm/arch/crm_regs.h> ++#include <asm/io.h> ++#include <asm/arch/sys_proto.h> ++#include <i2c.h> ++DECLARE_GLOBAL_DATA_PTR; ++ ++#define UART_PAD_CTRL (PAD_CTL_PUS_100K_UP | \ ++ PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | \ ++ PAD_CTL_SRE_FAST | PAD_CTL_HYS) ++ ++#define USDHC_PAD_CTRL (PAD_CTL_PUS_47K_UP | \ ++ PAD_CTL_SPEED_LOW | PAD_CTL_DSE_80ohm | \ ++ PAD_CTL_SRE_FAST | PAD_CTL_HYS) ++ ++#define ENET_PAD_CTRL (PAD_CTL_PUS_100K_UP | PAD_CTL_PUE | \ ++ PAD_CTL_SPEED_HIGH | PAD_CTL_DSE_48ohm | PAD_CTL_SRE_FAST) ++ ++#define ENET_CLK_PAD_CTRL (PAD_CTL_SPEED_MED | \ ++ PAD_CTL_DSE_120ohm | PAD_CTL_SRE_FAST) ++ ++#define ENET_RX_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_PUE | \ ++ PAD_CTL_SPEED_HIGH | PAD_CTL_SRE_FAST) ++ ++#define SPI_PAD_CTRL (PAD_CTL_HYS | PAD_CTL_SPEED_MED | \ ++ PAD_CTL_DSE_40ohm | PAD_CTL_SRE_FAST) ++ ++#define I2C_PAD_CTRL (PAD_CTL_PUS_100K_UP | \ ++ PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | PAD_CTL_HYS | \ ++ PAD_CTL_ODE | PAD_CTL_SRE_FAST) ++ ++#define I2C_PAD MUX_PAD_CTRL(I2C_PAD_CTRL) ++ ++int dram_init(void) ++{ ++ gd->ram_size = get_ram_size((void *)PHYS_SDRAM, PHYS_SDRAM_SIZE); ++ ++ return 0; ++} ++ ++static iomux_v3_cfg_t const uart3_pads[] = { ++ MX6_PAD_EIM_D31__UART3_RTS_B | MUX_PAD_CTRL(UART_PAD_CTRL), ++ MX6_PAD_EIM_D23__UART3_CTS_B | MUX_PAD_CTRL(UART_PAD_CTRL), ++ MX6_PAD_EIM_D24__UART3_TX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL), ++ MX6_PAD_EIM_D25__UART3_RX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL), ++}; ++ ++static iomux_v3_cfg_t const uart4_pads[] = { ++ MX6_PAD_KEY_COL0__UART4_TX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL), ++ MX6_PAD_KEY_ROW0__UART4_RX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL), ++}; ++ ++static iomux_v3_cfg_t const enet_pads[] = { ++ MX6_PAD_ENET_MDIO__ENET_MDIO | MUX_PAD_CTRL(ENET_PAD_CTRL), ++ MX6_PAD_ENET_MDC__ENET_MDC | MUX_PAD_CTRL(ENET_PAD_CTRL), ++ MX6_PAD_RGMII_TXC__RGMII_TXC | MUX_PAD_CTRL(ENET_PAD_CTRL), ++ MX6_PAD_RGMII_TD0__RGMII_TD0 | MUX_PAD_CTRL(ENET_PAD_CTRL), ++ MX6_PAD_RGMII_TD1__RGMII_TD1 | MUX_PAD_CTRL(ENET_PAD_CTRL), ++ MX6_PAD_RGMII_TD2__RGMII_TD2 | MUX_PAD_CTRL(ENET_PAD_CTRL), ++ MX6_PAD_RGMII_TD3__RGMII_TD3 | MUX_PAD_CTRL(ENET_PAD_CTRL), ++ MX6_PAD_RGMII_TX_CTL__RGMII_TX_CTL | MUX_PAD_CTRL(ENET_PAD_CTRL), ++ MX6_PAD_ENET_REF_CLK__ENET_TX_CLK | MUX_PAD_CTRL(ENET_CLK_PAD_CTRL), ++ MX6_PAD_RGMII_RXC__RGMII_RXC | MUX_PAD_CTRL(ENET_RX_PAD_CTRL), ++ MX6_PAD_RGMII_RD0__RGMII_RD0 | MUX_PAD_CTRL(ENET_RX_PAD_CTRL), ++ MX6_PAD_RGMII_RD1__RGMII_RD1 | MUX_PAD_CTRL(ENET_RX_PAD_CTRL), ++ MX6_PAD_RGMII_RD2__RGMII_RD2 | MUX_PAD_CTRL(ENET_RX_PAD_CTRL), ++ MX6_PAD_RGMII_RD3__RGMII_RD3 | MUX_PAD_CTRL(ENET_RX_PAD_CTRL), ++ MX6_PAD_RGMII_RX_CTL__RGMII_RX_CTL | MUX_PAD_CTRL(ENET_RX_PAD_CTRL), ++ /* AR8033 PHY Reset */ ++ MX6_PAD_ENET_TX_EN__GPIO1_IO28 | MUX_PAD_CTRL(NO_PAD_CTRL), ++}; ++ ++static void setup_iomux_enet(void) ++{ ++ imx_iomux_v3_setup_multiple_pads(enet_pads, ARRAY_SIZE(enet_pads)); ++ ++ /* Reset AR8033 PHY */ ++ gpio_direction_output(IMX_GPIO_NR(1, 28), 0); ++ udelay(500); ++ gpio_set_value(IMX_GPIO_NR(1, 28), 1); ++} ++ ++static iomux_v3_cfg_t const usdhc2_pads[] = { ++ MX6_PAD_SD2_CLK__SD2_CLK | MUX_PAD_CTRL(USDHC_PAD_CTRL), ++ MX6_PAD_SD2_CMD__SD2_CMD | MUX_PAD_CTRL(USDHC_PAD_CTRL), ++ MX6_PAD_SD2_DAT0__SD2_DATA0 | MUX_PAD_CTRL(USDHC_PAD_CTRL), ++ MX6_PAD_SD2_DAT1__SD2_DATA1 | MUX_PAD_CTRL(USDHC_PAD_CTRL), ++ MX6_PAD_SD2_DAT2__SD2_DATA2 | MUX_PAD_CTRL(USDHC_PAD_CTRL), ++ MX6_PAD_SD2_DAT3__SD2_DATA3 | MUX_PAD_CTRL(USDHC_PAD_CTRL), ++ MX6_PAD_GPIO_4__GPIO1_IO04 | MUX_PAD_CTRL(NO_PAD_CTRL), ++}; ++ ++static iomux_v3_cfg_t const usdhc3_pads[] = { ++ MX6_PAD_SD3_CLK__SD3_CLK | MUX_PAD_CTRL(USDHC_PAD_CTRL), ++ MX6_PAD_SD3_CMD__SD3_CMD | MUX_PAD_CTRL(USDHC_PAD_CTRL), ++ MX6_PAD_SD3_RST__SD3_RESET | MUX_PAD_CTRL(USDHC_PAD_CTRL), ++ MX6_PAD_SD3_DAT0__SD3_DATA0 | MUX_PAD_CTRL(USDHC_PAD_CTRL), ++ MX6_PAD_SD3_DAT1__SD3_DATA1 | MUX_PAD_CTRL(USDHC_PAD_CTRL), ++ MX6_PAD_SD3_DAT2__SD3_DATA2 | MUX_PAD_CTRL(USDHC_PAD_CTRL), ++ MX6_PAD_SD3_DAT3__SD3_DATA3 | MUX_PAD_CTRL(USDHC_PAD_CTRL), ++ MX6_PAD_SD3_DAT4__SD3_DATA4 | MUX_PAD_CTRL(USDHC_PAD_CTRL), ++ MX6_PAD_SD3_DAT5__SD3_DATA5 | MUX_PAD_CTRL(USDHC_PAD_CTRL), ++ MX6_PAD_SD3_DAT6__SD3_DATA6 | MUX_PAD_CTRL(USDHC_PAD_CTRL), ++ MX6_PAD_SD3_DAT7__SD3_DATA7 | MUX_PAD_CTRL(USDHC_PAD_CTRL), ++}; ++ ++static iomux_v3_cfg_t const usdhc4_pads[] = { ++ MX6_PAD_SD4_CLK__SD4_CLK | MUX_PAD_CTRL(USDHC_PAD_CTRL), ++ MX6_PAD_SD4_CMD__SD4_CMD | MUX_PAD_CTRL(USDHC_PAD_CTRL), ++ MX6_PAD_SD4_DAT0__SD4_DATA0 | MUX_PAD_CTRL(USDHC_PAD_CTRL), ++ MX6_PAD_SD4_DAT1__SD4_DATA1 | MUX_PAD_CTRL(USDHC_PAD_CTRL), ++ MX6_PAD_SD4_DAT2__SD4_DATA2 | MUX_PAD_CTRL(USDHC_PAD_CTRL), ++ MX6_PAD_SD4_DAT3__SD4_DATA3 | MUX_PAD_CTRL(USDHC_PAD_CTRL), ++ MX6_PAD_SD4_DAT4__SD4_DATA4 | MUX_PAD_CTRL(USDHC_PAD_CTRL), ++ MX6_PAD_SD4_DAT5__SD4_DATA5 | MUX_PAD_CTRL(USDHC_PAD_CTRL), ++ MX6_PAD_SD4_DAT6__SD4_DATA6 | MUX_PAD_CTRL(USDHC_PAD_CTRL), ++ MX6_PAD_SD4_DAT7__SD4_DATA7 | MUX_PAD_CTRL(USDHC_PAD_CTRL), ++ MX6_PAD_NANDF_CS0__GPIO6_IO11 | MUX_PAD_CTRL(NO_PAD_CTRL), ++ MX6_PAD_NANDF_CS1__GPIO6_IO14 | MUX_PAD_CTRL(NO_PAD_CTRL), ++}; ++ ++static iomux_v3_cfg_t const ecspi1_pads[] = { ++ MX6_PAD_EIM_D16__ECSPI1_SCLK | MUX_PAD_CTRL(SPI_PAD_CTRL), ++ MX6_PAD_EIM_D17__ECSPI1_MISO | MUX_PAD_CTRL(SPI_PAD_CTRL), ++ MX6_PAD_EIM_D18__ECSPI1_MOSI | MUX_PAD_CTRL(SPI_PAD_CTRL), ++ MX6_PAD_EIM_EB2__GPIO2_IO30 | MUX_PAD_CTRL(NO_PAD_CTRL), ++}; ++ ++static struct i2c_pads_info i2c_pad_info1 = { ++ .scl = { ++ .i2c_mode = MX6_PAD_CSI0_DAT9__I2C1_SCL | I2C_PAD, ++ .gpio_mode = MX6_PAD_CSI0_DAT9__GPIO5_IO27 | I2C_PAD, ++ .gp = IMX_GPIO_NR(5, 27) ++ }, ++ .sda = { ++ .i2c_mode = MX6_PAD_CSI0_DAT8__I2C1_SDA | I2C_PAD, ++ .gpio_mode = MX6_PAD_CSI0_DAT8__GPIO5_IO26 | I2C_PAD, ++ .gp = IMX_GPIO_NR(5, 26) ++ } ++}; ++ ++static struct i2c_pads_info i2c_pad_info2 = { ++ .scl = { ++ .i2c_mode = MX6_PAD_KEY_COL3__I2C2_SCL | I2C_PAD, ++ .gpio_mode = MX6_PAD_KEY_COL3__GPIO4_IO12 | I2C_PAD, ++ .gp = IMX_GPIO_NR(4, 12) ++ }, ++ .sda = { ++ .i2c_mode = MX6_PAD_KEY_ROW3__I2C2_SDA | I2C_PAD, ++ .gpio_mode = MX6_PAD_KEY_ROW3__GPIO4_IO13 | I2C_PAD, ++ .gp = IMX_GPIO_NR(4, 13) ++ } ++}; ++ ++static struct i2c_pads_info i2c_pad_info3 = { ++ .scl = { ++ .i2c_mode = MX6_PAD_GPIO_3__I2C3_SCL | I2C_PAD, ++ .gpio_mode = MX6_PAD_GPIO_3__GPIO1_IO03 | I2C_PAD, ++ .gp = IMX_GPIO_NR(1, 3) ++ }, ++ .sda = { ++ .i2c_mode = MX6_PAD_GPIO_6__I2C3_SDA | I2C_PAD, ++ .gpio_mode = MX6_PAD_GPIO_6__GPIO1_IO06 | I2C_PAD, ++ .gp = IMX_GPIO_NR(1, 6) ++ } ++}; ++ ++#ifdef CONFIG_MXC_SPI ++int board_spi_cs_gpio(unsigned bus, unsigned cs) ++{ ++ return (bus == 0 && cs == 0) ? (IMX_GPIO_NR(2, 30)) : -1; ++} ++ ++static void setup_spi(void) ++{ ++ imx_iomux_v3_setup_multiple_pads(ecspi1_pads, ARRAY_SIZE(ecspi1_pads)); ++} ++#endif ++ ++static iomux_v3_cfg_t const pcie_pads[] = { ++ MX6_PAD_GPIO_5__GPIO1_IO05 | MUX_PAD_CTRL(NO_PAD_CTRL), ++ MX6_PAD_GPIO_17__GPIO7_IO12 | MUX_PAD_CTRL(NO_PAD_CTRL), ++}; ++ ++static void setup_pcie(void) ++{ ++ imx_iomux_v3_setup_multiple_pads(pcie_pads, ARRAY_SIZE(pcie_pads)); ++} ++ ++static void setup_iomux_uart(void) ++{ ++ imx_iomux_v3_setup_multiple_pads(uart3_pads, ARRAY_SIZE(uart3_pads)); ++ imx_iomux_v3_setup_multiple_pads(uart4_pads, ARRAY_SIZE(uart4_pads)); ++} ++ ++#ifdef CONFIG_FSL_ESDHC ++struct fsl_esdhc_cfg usdhc_cfg[3] = { ++ {USDHC2_BASE_ADDR}, ++ {USDHC3_BASE_ADDR}, ++ {USDHC4_BASE_ADDR}, ++}; ++ ++#define USDHC2_CD_GPIO IMX_GPIO_NR(1, 4) ++#define USDHC4_CD_GPIO IMX_GPIO_NR(6, 11) ++ ++int board_mmc_getcd(struct mmc *mmc) ++{ ++ struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv; ++ int ret = 0; ++ ++ switch (cfg->esdhc_base) { ++ case USDHC2_BASE_ADDR: ++ ret = !gpio_get_value(USDHC2_CD_GPIO); ++ break; ++ case USDHC3_BASE_ADDR: ++ ret = 1; /* eMMC is always present */ ++ break; ++ case USDHC4_BASE_ADDR: ++ ret = !gpio_get_value(USDHC4_CD_GPIO); ++ break; ++ } ++ ++ return ret; ++} ++ ++int board_mmc_init(bd_t *bis) ++{ ++ int ret; ++ int i; ++ ++ for (i = 0; i < CONFIG_SYS_FSL_USDHC_NUM; i++) { ++ switch (i) { ++ case 0: ++ imx_iomux_v3_setup_multiple_pads( ++ usdhc2_pads, ARRAY_SIZE(usdhc2_pads)); ++ gpio_direction_input(USDHC2_CD_GPIO); ++ usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC2_CLK); ++ break; ++ case 1: ++ imx_iomux_v3_setup_multiple_pads( ++ usdhc3_pads, ARRAY_SIZE(usdhc3_pads)); ++ usdhc_cfg[1].sdhc_clk = mxc_get_clock(MXC_ESDHC3_CLK); ++ break; ++ case 2: ++ imx_iomux_v3_setup_multiple_pads( ++ usdhc4_pads, ARRAY_SIZE(usdhc4_pads)); ++ gpio_direction_input(USDHC4_CD_GPIO); ++ usdhc_cfg[2].sdhc_clk = mxc_get_clock(MXC_ESDHC4_CLK); ++ break; ++ default: ++ printf("Warning: you configured more USDHC controllers\n" ++ "(%d) then supported by the board (%d)\n", ++ i + 1, CONFIG_SYS_FSL_USDHC_NUM); ++ return -EINVAL; ++ } ++ ++ ret = fsl_esdhc_initialize(bis, &usdhc_cfg[i]); ++ if (ret) ++ return ret; ++ } ++ ++ return 0; ++} ++#endif ++ ++static int mx6_rgmii_rework(struct phy_device *phydev) ++{ ++ /* Configure AR8033 to ouput a 125MHz clk from CLK_25M */ ++ /* set device address 0x7 */ ++ phy_write(phydev, MDIO_DEVAD_NONE, 0xd, 0x7); ++ /* offset 0x8016: CLK_25M Clock Select */ ++ phy_write(phydev, MDIO_DEVAD_NONE, 0xe, 0x8016); ++ /* enable register write, no post increment, address 0x7 */ ++ phy_write(phydev, MDIO_DEVAD_NONE, 0xd, 0x4007); ++ /* set to 125 MHz from local PLL source */ ++ phy_write(phydev, MDIO_DEVAD_NONE, 0xe, 0x18); ++ ++ /* rgmii tx clock delay enable */ ++ /* set debug port address: SerDes Test and System Mode Control */ ++ phy_write(phydev, MDIO_DEVAD_NONE, 0x1d, 0x05); ++ /* enable rgmii tx clock delay */ ++ phy_write(phydev, MDIO_DEVAD_NONE, 0x1e, 0x100); ++ ++ return 0; ++} ++ ++int board_phy_config(struct phy_device *phydev) ++{ ++ mx6_rgmii_rework(phydev); ++ ++ if (phydev->drv->config) ++ phydev->drv->config(phydev); ++ ++ return 0; ++} ++ ++#if defined(CONFIG_VIDEO_IPUV3) ++static iomux_v3_cfg_t const backlight_pads[] = { ++ /* Power for LVDS Display */ ++ MX6_PAD_EIM_D22__GPIO3_IO22 | MUX_PAD_CTRL(NO_PAD_CTRL), ++#define LVDS_POWER_GP IMX_GPIO_NR(3, 22) ++ /* Backlight enable for LVDS display */ ++ MX6_PAD_GPIO_0__GPIO1_IO00 | MUX_PAD_CTRL(NO_PAD_CTRL), ++#define LVDS_BACKLIGHT_GP IMX_GPIO_NR(1, 0) ++}; ++ ++static void do_enable_hdmi(struct display_info_t const *dev) ++{ ++ imx_enable_hdmi_phy(); ++} ++ ++int board_cfb_skip(void) ++{ ++ gpio_direction_output(LVDS_POWER_GP, 1); ++ ++ return 0; ++} ++ ++static int detect_baseboard(struct display_info_t const *dev) ++{ ++ if (IS_ENABLED(CONFIG_TARGET_GE_B450V3) || ++ IS_ENABLED(CONFIG_TARGET_GE_B650V3)) ++ return 1; ++ ++ return 0; ++} ++ ++struct display_info_t const displays[] = {{ ++ .bus = -1, ++ .addr = -1, ++ .pixfmt = IPU_PIX_FMT_RGB24, ++ .detect = detect_baseboard, ++ .enable = NULL, ++ .mode = { ++ .name = "G121X1-L03", ++ .refresh = 60, ++ .xres = 1024, ++ .yres = 768, ++ .pixclock = 15385, ++ .left_margin = 20, ++ .right_margin = 300, ++ .upper_margin = 30, ++ .lower_margin = 8, ++ .hsync_len = 1, ++ .vsync_len = 1, ++ .sync = FB_SYNC_EXT, ++ .vmode = FB_VMODE_NONINTERLACED ++} }, { ++ .bus = -1, ++ .addr = 3, ++ .pixfmt = IPU_PIX_FMT_RGB24, ++ .detect = detect_hdmi, ++ .enable = do_enable_hdmi, ++ .mode = { ++ .name = "HDMI", ++ .refresh = 60, ++ .xres = 1024, ++ .yres = 768, ++ .pixclock = 15385, ++ .left_margin = 220, ++ .right_margin = 40, ++ .upper_margin = 21, ++ .lower_margin = 7, ++ .hsync_len = 60, ++ .vsync_len = 10, ++ .sync = FB_SYNC_EXT, ++ .vmode = FB_VMODE_NONINTERLACED ++} } }; ++size_t display_count = ARRAY_SIZE(displays); ++ ++static void setup_display(void) ++{ ++ struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR; ++ struct iomuxc *iomux = (struct iomuxc *)IOMUXC_BASE_ADDR; ++ int reg; ++ ++ enable_ipu_clock(); ++ imx_setup_hdmi(); ++ ++ reg = readl(&mxc_ccm->CCGR3); ++ reg |= MXC_CCM_CCGR3_LDB_DI0_MASK; ++ writel(reg, &mxc_ccm->CCGR3); ++ ++ reg = readl(&mxc_ccm->cs2cdr); ++ reg &= ~(MXC_CCM_CS2CDR_LDB_DI0_CLK_SEL_MASK | ++ MXC_CCM_CS2CDR_LDB_DI1_CLK_SEL_MASK); ++ reg |= (3 << MXC_CCM_CS2CDR_LDB_DI0_CLK_SEL_OFFSET) | ++ (3 << MXC_CCM_CS2CDR_LDB_DI1_CLK_SEL_OFFSET); ++ writel(reg, &mxc_ccm->cs2cdr); ++ ++ reg = readl(&mxc_ccm->cscmr2); ++ reg |= (MXC_CCM_CSCMR2_LDB_DI0_IPU_DIV); ++ writel(reg, &mxc_ccm->cscmr2); ++ ++ reg = readl(&mxc_ccm->chsccdr); ++ reg |= (CHSCCDR_CLK_SEL_LDB_DI0 ++ << MXC_CCM_CHSCCDR_IPU1_DI0_CLK_SEL_OFFSET); ++ writel(reg, &mxc_ccm->chsccdr); ++ ++ reg = IOMUXC_GPR2_BGREF_RRMODE_EXTERNAL_RES ++ | IOMUXC_GPR2_DI1_VS_POLARITY_ACTIVE_HIGH ++ | IOMUXC_GPR2_DI0_VS_POLARITY_ACTIVE_LOW ++ | IOMUXC_GPR2_BIT_MAPPING_CH1_SPWG ++ | IOMUXC_GPR2_DATA_WIDTH_CH1_24BIT ++ | IOMUXC_GPR2_BIT_MAPPING_CH0_SPWG ++ | IOMUXC_GPR2_DATA_WIDTH_CH0_24BIT ++ | IOMUXC_GPR2_LVDS_CH1_MODE_ENABLED_DI0 ++ | IOMUXC_GPR2_LVDS_CH0_MODE_ENABLED_DI0; ++ writel(reg, &iomux->gpr[2]); ++ ++ reg = readl(&iomux->gpr[3]); ++ reg = (reg & ~(IOMUXC_GPR3_LVDS0_MUX_CTL_MASK | ++ IOMUXC_GPR3_LVDS1_MUX_CTL_MASK | ++ IOMUXC_GPR3_HDMI_MUX_CTL_MASK)) ++ | (IOMUXC_GPR3_MUX_SRC_IPU1_DI0 ++ << IOMUXC_GPR3_LVDS0_MUX_CTL_OFFSET) ++ | (IOMUXC_GPR3_MUX_SRC_IPU1_DI0 ++ << IOMUXC_GPR3_LVDS1_MUX_CTL_OFFSET); ++ writel(reg, &iomux->gpr[3]); ++ ++ /* backlights off until needed */ ++ imx_iomux_v3_setup_multiple_pads(backlight_pads, ++ ARRAY_SIZE(backlight_pads)); ++ gpio_direction_input(LVDS_POWER_GP); ++ gpio_direction_input(LVDS_BACKLIGHT_GP); ++} ++#endif /* CONFIG_VIDEO_IPUV3 */ ++ ++/* ++ * Do not overwrite the console ++ * Use always serial for U-Boot console ++ */ ++int overwrite_console(void) ++{ ++ return 1; ++} ++ ++int board_eth_init(bd_t *bis) ++{ ++ setup_iomux_enet(); ++ setup_pcie(); ++ ++ return cpu_eth_init(bis); ++} ++ ++static iomux_v3_cfg_t const misc_pads[] = { ++ MX6_PAD_KEY_ROW2__GPIO4_IO11 | MUX_PAD_CTRL(NO_PAD_CTRL), ++}; ++#define SUS_S3_OUT IMX_GPIO_NR(4, 11) ++#define WIFI_EN IMX_GPIO_NR(6, 14) ++ ++int board_early_init_f(void) ++{ ++ imx_iomux_v3_setup_multiple_pads(misc_pads, ++ ARRAY_SIZE(misc_pads)); ++ ++ setup_iomux_uart(); ++ ++ ++ return 0; ++} ++ ++int board_init(void) ++{ ++ gpio_direction_output(SUS_S3_OUT, 1); ++ gpio_direction_output(WIFI_EN, 1); ++#if defined(CONFIG_VIDEO_IPUV3) ++ setup_display(); ++#endif ++ /* address of boot parameters */ ++ gd->bd->bi_boot_params = PHYS_SDRAM + 0x100; ++ ++#ifdef CONFIG_MXC_SPI ++ setup_spi(); ++#endif ++ setup_i2c(1, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info1); ++ setup_i2c(2, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info2); ++ setup_i2c(3, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info3); ++ ++ return 0; ++} ++ ++#ifdef CONFIG_CMD_BMODE ++static const struct boot_mode board_boot_modes[] = { ++ /* 4 bit bus width */ ++ {"sd2", MAKE_CFGVAL(0x40, 0x28, 0x00, 0x00)}, ++ {"sd3", MAKE_CFGVAL(0x40, 0x30, 0x00, 0x00)}, ++ {NULL, 0}, ++}; ++#endif ++ ++int board_late_init(void) ++{ ++#ifdef CONFIG_CMD_BMODE ++ add_board_boot_modes(board_boot_modes); ++#endif ++ /* We need at least 200ms between power on and backlight on ++ * as per specifications from CHI MEI */ ++ mdelay(250); ++ ++ /* Backlight Power */ ++ gpio_direction_output(LVDS_BACKLIGHT_GP, 1); ++ ++ return 0; ++} ++ ++int checkboard(void) ++{ ++ printf("BOARD: %s\n", CONFIG_BOARD_NAME); ++ return 0; ++} +diff --git a/board/ge/bx50v3/bx50v3.cfg b/board/ge/bx50v3/bx50v3.cfg +new file mode 100644 +index 0000000..de88769 +--- /dev/null ++++ b/board/ge/bx50v3/bx50v3.cfg +@@ -0,0 +1,151 @@ ++/* ++ * ++ * Copyright 2015 Timesys Corporation. ++ * Copyright 2015 General Electric Company ++ * ++ * SPDX-License-Identifier: GPL-2.0+ ++ * ++ * Refer doc/README.imximage for more details about how-to configure ++ * and create imximage boot image ++ * ++ * The syntax is taken as close as possible with the kwbimage ++ */ ++ ++IMAGE_VERSION 2 ++BOOT_FROM sd ++ ++#define __ASSEMBLY__ ++#include <config.h> ++#include "asm/arch/mx6-ddr.h" ++#include "asm/arch/iomux.h" ++#include "asm/arch/crm_regs.h" ++ ++/* DDR IO */ ++DATA 4, MX6_IOM_GRP_DDR_TYPE, 0x000c0000 ++DATA 4, MX6_IOM_GRP_DDRPKE, 0x00000000 ++DATA 4, MX6_IOM_DRAM_SDCLK_0, 0x00000030 ++DATA 4, MX6_IOM_DRAM_SDCLK_1, 0x00000030 ++DATA 4, MX6_IOM_DRAM_CAS, 0x00000030 ++DATA 4, MX6_IOM_DRAM_RAS, 0x00000030 ++DATA 4, MX6_IOM_GRP_ADDDS, 0x00000030 ++DATA 4, MX6_IOM_DRAM_RESET, 0x00000030 ++DATA 4, MX6_IOM_DRAM_SDBA2, 0x00000000 ++DATA 4, MX6_IOM_DRAM_SDODT0, 0x00000030 ++DATA 4, MX6_IOM_DRAM_SDODT1, 0x00000030 ++DATA 4, MX6_IOM_GRP_CTLDS, 0x00000030 ++DATA 4, MX6_IOM_DDRMODE_CTL, 0x00020000 ++DATA 4, MX6_IOM_DRAM_SDQS0, 0x00000030 ++DATA 4, MX6_IOM_DRAM_SDQS1, 0x00000030 ++DATA 4, MX6_IOM_DRAM_SDQS2, 0x00000030 ++DATA 4, MX6_IOM_DRAM_SDQS3, 0x00000030 ++DATA 4, MX6_IOM_DRAM_SDQS4, 0x00000030 ++DATA 4, MX6_IOM_DRAM_SDQS5, 0x00000030 ++DATA 4, MX6_IOM_DRAM_SDQS6, 0x00000030 ++DATA 4, MX6_IOM_DRAM_SDQS7, 0x00000030 ++DATA 4, MX6_IOM_GRP_DDRMODE, 0x00020000 ++DATA 4, MX6_IOM_GRP_B0DS, 0x00000030 ++DATA 4, MX6_IOM_GRP_B1DS, 0x00000030 ++DATA 4, MX6_IOM_GRP_B2DS, 0x00000030 ++DATA 4, MX6_IOM_GRP_B3DS, 0x00000030 ++DATA 4, MX6_IOM_GRP_B4DS, 0x00000030 ++DATA 4, MX6_IOM_GRP_B5DS, 0x00000030 ++DATA 4, MX6_IOM_GRP_B6DS, 0x00000030 ++DATA 4, MX6_IOM_GRP_B7DS, 0x00000030 ++DATA 4, MX6_IOM_DRAM_DQM0, 0x00000030 ++DATA 4, MX6_IOM_DRAM_DQM1, 0x00000030 ++DATA 4, MX6_IOM_DRAM_DQM2, 0x00000030 ++DATA 4, MX6_IOM_DRAM_DQM3, 0x00000030 ++DATA 4, MX6_IOM_DRAM_DQM4, 0x00000030 ++DATA 4, MX6_IOM_DRAM_DQM5, 0x00000030 ++DATA 4, MX6_IOM_DRAM_DQM6, 0x00000030 ++DATA 4, MX6_IOM_DRAM_DQM7, 0x00000030 ++ ++/* Calibrations */ ++/* ZQ */ ++DATA 4, MX6_MMDC_P0_MPZQHWCTRL, 0xa1390003 ++/* write leveling */ ++DATA 4, MX6_MMDC_P0_MPWLDECTRL0, 0x001F001F ++DATA 4, MX6_MMDC_P0_MPWLDECTRL1, 0x001F001F ++DATA 4, MX6_MMDC_P1_MPWLDECTRL0, 0x001F001F ++DATA 4, MX6_MMDC_P1_MPWLDECTRL1, 0x001F001F ++/* Read DQS Gating calibration */ ++DATA 4, MX6_MMDC_P0_MPDGCTRL0, 0x45380544 ++DATA 4, MX6_MMDC_P0_MPDGCTRL1, 0x05280530 ++DATA 4, MX6_MMDC_P1_MPDGCTRL0, 0x4530053C ++DATA 4, MX6_MMDC_P1_MPDGCTRL1, 0x0530050C ++/* Read calibration */ ++DATA 4, MX6_MMDC_P0_MPRDDLCTL, 0x36303032 ++DATA 4, MX6_MMDC_P1_MPRDDLCTL, 0x38363042 ++/* Write calibration */ ++DATA 4, MX6_MMDC_P0_MPWRDLCTL, 0x3A3A423E ++DATA 4, MX6_MMDC_P1_MPWRDLCTL, 0x4A38483E ++/* read data bit delay */ ++DATA 4, MX6_MMDC_P0_MPRDDQBY0DL, 0x33333333 ++DATA 4, MX6_MMDC_P0_MPRDDQBY1DL, 0x33333333 ++DATA 4, MX6_MMDC_P0_MPRDDQBY2DL, 0x33333333 ++DATA 4, MX6_MMDC_P0_MPRDDQBY3DL, 0x33333333 ++DATA 4, MX6_MMDC_P1_MPRDDQBY0DL, 0x33333333 ++DATA 4, MX6_MMDC_P1_MPRDDQBY1DL, 0x33333333 ++DATA 4, MX6_MMDC_P1_MPRDDQBY2DL, 0x33333333 ++DATA 4, MX6_MMDC_P1_MPRDDQBY3DL, 0x33333333 ++ ++/* Complete calibration by forced measurment */ ++DATA 4, MX6_MMDC_P0_MPMUR0, 0x00000800 ++DATA 4, MX6_MMDC_P1_MPMUR0, 0x00000800 ++ ++/* MMDC init */ ++DATA 4, MX6_MMDC_P0_MDPDC, 0x00020036 ++DATA 4, MX6_MMDC_P0_MDOTC, 0x09444040 ++DATA 4, MX6_MMDC_P0_MDCFG0, 0x8A8F79A4 ++DATA 4, MX6_MMDC_P0_MDCFG1, 0xDB538E64 ++DATA 4, MX6_MMDC_P0_MDCFG2, 0x01ff00db ++DATA 4, MX6_MMDC_P0_MDMISC, 0x00001740 ++DATA 4, MX6_MMDC_P0_MDSCR, 0x00008000 ++DATA 4, MX6_MMDC_P0_MDRWD, 0x000026d2 ++DATA 4, MX6_MMDC_P0_MDOR, 0x008F1023 ++DATA 4, MX6_MMDC_P0_MDASP, 0x00000047 ++DATA 4, MX6_MMDC_P0_MDCTL, 0x841a0000 ++ ++/* Initialize Micron MT41J128M */ ++DATA 4, MX6_MMDC_P0_MDSCR, 0x04088032 ++DATA 4, MX6_MMDC_P0_MDSCR, 0x0408803a ++DATA 4, MX6_MMDC_P0_MDSCR, 0x00008033 ++DATA 4, MX6_MMDC_P0_MDSCR, 0x0000803b ++DATA 4, MX6_MMDC_P0_MDSCR, 0x00408031 ++DATA 4, MX6_MMDC_P0_MDSCR, 0x00408039 ++DATA 4, MX6_MMDC_P0_MDSCR, 0x09408030 ++DATA 4, MX6_MMDC_P0_MDSCR, 0x09408038 ++DATA 4, MX6_MMDC_P0_MDSCR, 0x04008040 ++DATA 4, MX6_MMDC_P0_MDSCR, 0x04008048 ++DATA 4, MX6_MMDC_P0_MDREF, 0x00005800 ++DATA 4, MX6_MMDC_P0_MPODTCTRL, 0x00011117 ++DATA 4, MX6_MMDC_P1_MPODTCTRL, 0x00011117 ++DATA 4, MX6_MMDC_P0_MDPDC, 0x00025576 ++DATA 4, MX6_MMDC_P0_MAPSR, 0x00011006 ++DATA 4, MX6_MMDC_P0_MDSCR, 0x00000000 ++ ++/* set the default clock gate to save power */ ++DATA 4, CCM_CCGR0, 0x00C03F3F ++DATA 4, CCM_CCGR1, 0x0030FC03 ++DATA 4, CCM_CCGR2, 0x0FFFC000 ++DATA 4, CCM_CCGR3, 0x3FF00000 ++DATA 4, CCM_CCGR4, 0x00FFF300 ++DATA 4, CCM_CCGR5, 0x0F0000C3 ++DATA 4, CCM_CCGR6, 0x000003FF ++ ++/* enable AXI cache for VDOA/VPU/IPU */ ++DATA 4, MX6_IOMUXC_GPR4, 0xF00000CF ++/* set IPU AXI-id0 Qos=0xf(bypass) AXI-id1 Qos=0x7 */ ++DATA 4, MX6_IOMUXC_GPR6, 0x007F007F ++DATA 4, MX6_IOMUXC_GPR7, 0x007F007F ++ ++/* ++ * Setup CCM_CCOSR register as follows: ++ * ++ * cko1_en 1 --> CKO1 enabled ++ * cko1_div 111 --> divide by 8 ++ * cko1_sel 1011 --> ahb_clk_root ++ * ++ * This sets CKO1 at ahb_clk_root/8 132/8 16.5 MHz ++ */ ++DATA 4, CCM_CCOSR, 0x000000fb +diff --git a/configs/ge_b450v3_defconfig b/configs/ge_b450v3_defconfig +new file mode 100644 +index 0000000..02873ce +--- /dev/null ++++ b/configs/ge_b450v3_defconfig +@@ -0,0 +1,8 @@ ++CONFIG_ARM=y ++CONFIG_ARCH_MX6=y ++CONFIG_TARGET_GE_B450V3=y ++# CONFIG_CMD_IMLS is not set ++# CONFIG_CMD_FLASH is not set ++CONFIG_CMD_GPIO=y ++CONFIG_SPI_FLASH=y ++CONFIG_SPI_FLASH_STMICRO=y +diff --git a/configs/ge_b650v3_defconfig b/configs/ge_b650v3_defconfig +new file mode 100644 +index 0000000..3d10b35 +--- /dev/null ++++ b/configs/ge_b650v3_defconfig +@@ -0,0 +1,8 @@ ++CONFIG_ARM=y ++CONFIG_ARCH_MX6=y ++CONFIG_TARGET_GE_B650V3=y ++# CONFIG_CMD_IMLS is not set ++# CONFIG_CMD_FLASH is not set ++CONFIG_CMD_GPIO=y ++CONFIG_SPI_FLASH=y ++CONFIG_SPI_FLASH_STMICRO=y +diff --git a/configs/ge_b850v3_defconfig b/configs/ge_b850v3_defconfig +new file mode 100644 +index 0000000..e3f4a0a +--- /dev/null ++++ b/configs/ge_b850v3_defconfig +@@ -0,0 +1,8 @@ ++CONFIG_ARM=y ++CONFIG_ARCH_MX6=y ++CONFIG_TARGET_GE_B850V3=y ++# CONFIG_CMD_IMLS is not set ++# CONFIG_CMD_FLASH is not set ++CONFIG_CMD_GPIO=y ++CONFIG_SPI_FLASH=y ++CONFIG_SPI_FLASH_STMICRO=y +diff --git a/include/configs/ge_bx50v3.h b/include/configs/ge_bx50v3.h +new file mode 100644 +index 0000000..6fa4a9a +--- /dev/null ++++ b/include/configs/ge_bx50v3.h +@@ -0,0 +1,349 @@ ++/* ++ * Copyright (C) 2015 Timesys Corporation ++ * Copyright (C) 2015 General Electric Company ++ * Copyright (C) 2014 Advantech ++ * Copyright (C) 2012 Freescale Semiconductor, Inc. ++ * ++ * Configuration settings for the GE MX6Q Bx50v3 boards. ++ * ++ * SPDX-License-Identifier: GPL-2.0+ ++ */ ++ ++#ifndef __GE_BX50V3_CONFIG_H ++#define __GE_BX50V3_CONFIG_H ++ ++#include <asm/arch/imx-regs.h> ++#include <asm/imx-common/gpio.h> ++ ++#if defined(CONFIG_TARGET_GE_B450V3) ++#define CONFIG_BOARD_NAME "General Electric B450v3" ++#define CONFIG_DEFAULT_FDT_FILE "/boot/imx6q-b450v3.dtb" ++#elif defined(CONFIG_TARGET_GE_B650V3) ++#define CONFIG_BOARD_NAME "General Electric B650v3" ++#define CONFIG_DEFAULT_FDT_FILE "/boot/imx6q-b650v3.dtb" ++#elif defined(CONFIG_TARGET_GE_B850V3) ++#define CONFIG_BOARD_NAME "General Electric B850v3" ++#define CONFIG_DEFAULT_FDT_FILE "/boot/imx6q-b850v3.dtb" ++#else ++#define CONFIG_BOARD_NAME "General Electric BA16 Generic" ++#define CONFIG_DEFAULT_FDT_FILE "/boot/imx6q-ba16.dtb" ++#endif ++ ++#define CONFIG_MXC_UART_BASE UART3_BASE ++#define CONFIG_CONSOLE_DEV "ttymxc2" ++ ++#define PHYS_SDRAM_SIZE (2u * 1024 * 1024 * 1024) ++ ++#define CONFIG_SUPPORT_EMMC_BOOT ++ ++#define CONFIG_BOOTDELAY 1 ++ ++#include "mx6_common.h" ++#include <linux/sizes.h> ++ ++#define CONFIG_DISPLAY_CPUINFO ++#define CONFIG_DISPLAY_BOARDINFO ++ ++#define CONFIG_CMDLINE_TAG ++#define CONFIG_SETUP_MEMORY_TAGS ++#define CONFIG_INITRD_TAG ++#define CONFIG_REVISION_TAG ++#define CONFIG_SYS_MALLOC_LEN (10 * SZ_1M) ++ ++#define CONFIG_BOARD_EARLY_INIT_F ++#define CONFIG_BOARD_LATE_INIT ++ ++#define CONFIG_MXC_GPIO ++#define CONFIG_MXC_UART ++ ++#define CONFIG_CMD_FUSE ++#define CONFIG_MXC_OCOTP ++ ++/* SATA Configs */ ++#define CONFIG_CMD_SATA ++#define CONFIG_DWC_AHSATA ++#define CONFIG_SYS_SATA_MAX_DEVICE 1 ++#define CONFIG_DWC_AHSATA_PORT_ID 0 ++#define CONFIG_DWC_AHSATA_BASE_ADDR SATA_ARB_BASE_ADDR ++#define CONFIG_LBA48 ++#define CONFIG_LIBATA ++ ++/* MMC Configs */ ++#define CONFIG_FSL_ESDHC ++#define CONFIG_FSL_USDHC ++#define CONFIG_SYS_FSL_ESDHC_ADDR 0 ++#define CONFIG_MMC ++#define CONFIG_CMD_MMC ++#define CONFIG_GENERIC_MMC ++#define CONFIG_BOUNCE_BUFFER ++#define CONFIG_CMD_EXT2 ++#define CONFIG_CMD_FAT ++#define CONFIG_DOS_PARTITION ++ ++/* USB Configs */ ++#define CONFIG_CMD_USB ++#define CONFIG_CMD_FAT ++#define CONFIG_USB_EHCI ++#define CONFIG_USB_EHCI_MX6 ++#define CONFIG_USB_STORAGE ++#define CONFIG_USB_MAX_CONTROLLER_COUNT 2 ++#define CONFIG_EHCI_HCD_INIT_AFTER_RESET ++#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW) ++#define CONFIG_MXC_USB_FLAGS 0 ++#define CONFIG_USB_KEYBOARD ++#define CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP ++ ++#define CONFIG_CI_UDC ++#define CONFIG_USBD_HS ++#define CONFIG_USB_GADGET_DUALSPEED ++#define CONFIG_USB_GADGET ++#define CONFIG_USB_GADGET_DOWNLOAD ++#define CONFIG_CMD_USB_MASS_STORAGE ++#define CONFIG_USB_GADGET_MASS_STORAGE ++#define CONFIG_USB_FUNCTION_MASS_STORAGE ++#define CONFIG_USB_GADGET_VBUS_DRAW 2 ++#define CONFIG_G_DNL_VENDOR_NUM 0x0525 ++#define CONFIG_G_DNL_PRODUCT_NUM 0xa4a5 ++#define CONFIG_G_DNL_MANUFACTURER "Advantech" ++ ++/* Networking Configs */ ++#define CONFIG_CMD_PING ++#define CONFIG_CMD_DHCP ++#define CONFIG_CMD_MII ++#define CONFIG_FEC_MXC ++#define CONFIG_MII ++#define IMX_FEC_BASE ENET_BASE_ADDR ++#define CONFIG_FEC_XCV_TYPE RGMII ++#define CONFIG_ETHPRIME "FEC" ++#define CONFIG_FEC_MXC_PHYADDR 4 ++#define CONFIG_PHYLIB ++#define CONFIG_PHY_ATHEROS ++ ++/* Serial Flash */ ++#define CONFIG_CMD_SF ++#ifdef CONFIG_CMD_SF ++#define CONFIG_MXC_SPI ++#define CONFIG_SF_DEFAULT_BUS 0 ++#define CONFIG_SF_DEFAULT_CS 0 ++#define CONFIG_SF_DEFAULT_SPEED 20000000 ++#define CONFIG_SF_DEFAULT_MODE SPI_MODE_0 ++#endif ++ ++/* allow to overwrite serial and ethaddr */ ++#define CONFIG_ENV_OVERWRITE ++#define CONFIG_CONS_INDEX 1 ++#define CONFIG_BAUDRATE 115200 ++ ++/* Command definition */ ++#define CONFIG_CMD_BMODE ++#define CONFIG_CMD_BOOTZ ++#undef CONFIG_CMD_IMLS ++ ++#define CONFIG_LOADADDR 0x12000000 ++#define CONFIG_SYS_TEXT_BASE 0x17800000 ++ ++#define CONFIG_EXTRA_ENV_SETTINGS \ ++ "script=boot.scr\0" \ ++ "image=/boot/uImage\0" \ ++ "uboot=u-boot.imx\0" \ ++ "fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \ ++ "fdt_addr=0x18000000\0" \ ++ "boot_fdt=yes\0" \ ++ "ip_dyn=yes\0" \ ++ "console=" CONFIG_CONSOLE_DEV "\0" \ ++ "fdt_high=0xffffffff\0" \ ++ "initrd_high=0xffffffff\0" \ ++ "sddev=0\0" \ ++ "emmcdev=1\0" \ ++ "partnum=1\0" \ ++ "update_sd_firmware=" \ ++ "if test ${ip_dyn} = yes; then " \ ++ "setenv get_cmd dhcp; " \ ++ "else " \ ++ "setenv get_cmd tftp; " \ ++ "fi; " \ ++ "if mmc dev ${mmcdev}; then " \ ++ "if ${get_cmd} ${update_sd_firmware_filename}; then " \ ++ "setexpr fw_sz ${filesize} / 0x200; " \ ++ "setexpr fw_sz ${fw_sz} + 1; " \ ++ "mmc write ${loadaddr} 0x2 ${fw_sz}; " \ ++ "fi; " \ ++ "fi\0" \ ++ "update_sf_uboot=" \ ++ "if tftp $loadaddr $uboot; then " \ ++ "sf probe; " \ ++ "sf erase 0 0xC0000; " \ ++ "sf write $loadaddr 0x400 $filesize; " \ ++ "echo 'U-Boot upgraded. Please reset'; " \ ++ "fi\0" \ ++ "setargs=setenv bootargs console=${console},${baudrate} " \ ++ "root=/dev/${rootdev} rw rootwait cma=128M\0" \ ++ "loadbootscript=" \ ++ "ext2load ${dev} ${devnum}:${partnum} ${loadaddr} ${script};\0" \ ++ "bootscript=echo Running bootscript from ${dev}:${devnum}:${partnum};" \ ++ " source\0" \ ++ "loadimage=" \ ++ "ext2load ${dev} ${devnum}:${partnum} ${loadaddr} ${image}\0" \ ++ "loadfdt=ext2load ${dev} ${devnum}:${partnum} ${fdt_addr} ${fdt_file}\0" \ ++ "tryboot=" \ ++ "if run loadbootscript; then " \ ++ "run bootscript; " \ ++ "else " \ ++ "if run loadimage; then " \ ++ "run doboot; " \ ++ "fi; " \ ++ "fi;\0" \ ++ "doboot=echo Booting from ${dev}:${devnum}:${partnum} ...; " \ ++ "run setargs; " \ ++ "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \ ++ "if run loadfdt; then " \ ++ "bootm ${loadaddr} - ${fdt_addr}; " \ ++ "else " \ ++ "if test ${boot_fdt} = try; then " \ ++ "bootm; " \ ++ "else " \ ++ "echo WARN: Cannot load the DT; " \ ++ "fi; " \ ++ "fi; " \ ++ "else " \ ++ "bootm; " \ ++ "fi;\0" \ ++ "netargs=setenv bootargs console=${console},${baudrate} " \ ++ "root=/dev/nfs " \ ++ "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \ ++ "netboot=echo Booting from net ...; " \ ++ "run netargs; " \ ++ "if test ${ip_dyn} = yes; then " \ ++ "setenv get_cmd dhcp; " \ ++ "else " \ ++ "setenv get_cmd tftp; " \ ++ "fi; " \ ++ "${get_cmd} ${image}; " \ ++ "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \ ++ "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \ ++ "bootm ${loadaddr} - ${fdt_addr}; " \ ++ "else " \ ++ "if test ${boot_fdt} = try; then " \ ++ "bootm; " \ ++ "else " \ ++ "echo WARN: Cannot load the DT; " \ ++ "fi; " \ ++ "fi; " \ ++ "else " \ ++ "bootm; " \ ++ "fi;\0" \ ++ ++#define CONFIG_BOOTCOMMAND \ ++ "usb start; " \ ++ "setenv dev usb; " \ ++ "setenv devnum 0; " \ ++ "setenv rootdev sda1; " \ ++ "run tryboot; " \ ++ \ ++ "setenv dev mmc; " \ ++ "setenv rootdev mmcblk0p1; " \ ++ \ ++ "setenv devnum ${sddev}; " \ ++ "if mmc dev ${devnum}; then " \ ++ "run tryboot; " \ ++ "setenv rootdev mmcblk1p1; " \ ++ "fi; " \ ++ \ ++ "setenv devnum ${emmcdev}; " \ ++ "if mmc dev ${devnum}; then " \ ++ "run tryboot; " \ ++ "fi; " \ ++ \ ++ "bmode usb; " \ ++ ++#define CONFIG_ARP_TIMEOUT 200UL ++ ++/* Miscellaneous configurable options */ ++#define CONFIG_SYS_LONGHELP ++#define CONFIG_SYS_HUSH_PARSER ++#define CONFIG_SYS_PROMPT_HUSH_PS2 "> " ++#define CONFIG_AUTO_COMPLETE ++ ++/* Print Buffer Size */ ++#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16) ++#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE ++ ++#define CONFIG_SYS_MEMTEST_START 0x10000000 ++#define CONFIG_SYS_MEMTEST_END 0x10010000 ++#define CONFIG_SYS_MEMTEST_SCRATCH 0x10800000 ++ ++#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR ++ ++#define CONFIG_CMDLINE_EDITING ++#define CONFIG_STACKSIZE (128 * 1024) ++ ++/* Physical Memory Map */ ++#define CONFIG_NR_DRAM_BANKS 1 ++#define PHYS_SDRAM MMDC0_ARB_BASE_ADDR ++ ++#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM ++#define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR ++#define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE ++ ++#define CONFIG_SYS_INIT_SP_OFFSET \ ++ (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE) ++#define CONFIG_SYS_INIT_SP_ADDR \ ++ (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET) ++ ++/* FLASH and environment organization */ ++#define CONFIG_SYS_NO_FLASH ++ ++#define CONFIG_ENV_IS_IN_SPI_FLASH ++#define CONFIG_ENV_SIZE (8 * 1024) ++#define CONFIG_ENV_OFFSET (768 * 1024) ++#define CONFIG_ENV_SECT_SIZE (64 * 1024) ++#define CONFIG_ENV_SPI_BUS CONFIG_SF_DEFAULT_BUS ++#define CONFIG_ENV_SPI_CS CONFIG_SF_DEFAULT_CS ++#define CONFIG_ENV_SPI_MODE CONFIG_SF_DEFAULT_MODE ++#define CONFIG_ENV_SPI_MAX_HZ CONFIG_SF_DEFAULT_SPEED ++ ++#define CONFIG_OF_LIBFDT ++ ++#ifndef CONFIG_SYS_DCACHE_OFF ++#define CONFIG_CMD_CACHE ++#endif ++ ++#define CONFIG_SYS_FSL_USDHC_NUM 3 ++ ++/* Framebuffer */ ++#define CONFIG_VIDEO ++#define CONFIG_VIDEO_IPUV3 ++#define CONFIG_CFB_CONSOLE ++#define CONFIG_VGA_AS_SINGLE_DEVICE ++#define CONFIG_SYS_CONSOLE_IS_IN_ENV ++#define CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE ++#define CONFIG_VIDEO_BMP_RLE8 ++#define CONFIG_SPLASH_SCREEN ++#define CONFIG_SPLASH_SCREEN_ALIGN ++#define CONFIG_BMP_16BPP ++#define CONFIG_VIDEO_LOGO ++#define CONFIG_VIDEO_BMP_LOGO ++#define CONFIG_IPUV3_CLK 260000000 ++#define CONFIG_IMX_HDMI ++#define CONFIG_IMX_VIDEO_SKIP ++ ++#undef CONFIG_CMD_PCI ++#ifdef CONFIG_CMD_PCI ++#define CONFIG_PCI ++#define CONFIG_PCI_PNP ++#define CONFIG_PCI_SCAN_SHOW ++#define CONFIG_PCIE_IMX ++#define CONFIG_PCIE_IMX_PERST_GPIO IMX_GPIO_NR(7, 12) ++#define CONFIG_PCIE_IMX_POWER_GPIO IMX_GPIO_NR(1, 5) ++#endif ++ ++/* I2C Configs */ ++#define CONFIG_CMD_I2C ++#define CONFIG_SYS_I2C ++#define CONFIG_SYS_I2C_MXC ++#define CONFIG_SYS_I2C_SPEED 100000 ++#define CONFIG_SYS_I2C_MXC_I2C1 ++#define CONFIG_SYS_I2C_MXC_I2C2 ++#define CONFIG_SYS_I2C_MXC_I2C3 ++ ++#endif /* __GE_BX50V3_CONFIG_H */ +-- +2.5.0 +
recipes-bsp/u-boot/u-boot-ge-2015.10/0002-board-ge-bx50v3-Update-display-setup.patch new file +293 -0
293 lines not on this page · raw message
recipes-bsp/u-boot/u-boot-ge-2015.10/0003-ge_bx50v3-Add-support-for-FSL-Community-Yocto-images.patch new file +128 -0
128 lines not on this page · raw message
recipes-bsp/u-boot/u-boot-ge-2015.10/0004-board-ge-bx50v3-Add-support-for-ELO-board.patch new file +222 -0
222 lines not on this page · raw message
recipes-bsp/u-boot/u-boot-ge-2015.10/0005-board-ge-bx50v3-Fix-bootargs-for-ELO-board.patch new file +37 -0
@@ -0,0 +1,37 @@ +From 17d0da9815466516a8daae8e6d5c6d797caa75fc Mon Sep 17 00:00:00 2001 +From: Justin Waters <[email protected]> +Date: Thu, 10 Mar 2016 15:26:30 -0500 +Subject: [PATCH 5/7] board: ge: bx50v3: Fix bootargs for ELO board + +--- + include/configs/ge_bx50v3.h | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/include/configs/ge_bx50v3.h b/include/configs/ge_bx50v3.h +index 8be4350..5219746 100644 +--- a/include/configs/ge_bx50v3.h ++++ b/include/configs/ge_bx50v3.h +@@ -35,9 +35,11 @@ + #if defined(CONFIG_TARGET_GE_ELO) + #define CONFIG_MXC_UART_BASE UART4_BASE + #define CONFIG_CONSOLE_DEV "ttymxc3" ++#define CONFIG_EXTRA_BOOTARGS "panic=10" + #else + #define CONFIG_MXC_UART_BASE UART3_BASE + #define CONFIG_CONSOLE_DEV "ttymxc2" ++#define CONFIG_EXTRA_BOOTARGS "cma=128M" + #endif + + #ifdef CONFIG_YOCTO_IMAGE +@@ -197,7 +199,7 @@ + "echo 'U-Boot upgraded. Please reset'; " \ + "fi\0" \ + "setargs=setenv bootargs console=${console},${baudrate} " \ +- "root=/dev/${rootdev} rw rootwait cma=128M\0" \ ++ "root=/dev/${rootdev} rw rootwait " CONFIG_EXTRA_BOOTARGS "\0" \ + "loadbootscript=" \ + "${loadcmd} ${dev} ${devnum}:${partnum} ${loadaddr} ${script};\0" \ + "bootscript=echo Running bootscript from ${dev}:${devnum}:${partnum};" \ +-- +2.5.0 +
recipes-bsp/u-boot/u-boot-ge-2015.10/0006-mx6q_ba16-Add-1G-DDR-support.patch new file +343 -0
343 lines not on this page · raw message
recipes-bsp/u-boot/u-boot-ge-2015.10/0007-board-ge-bx50v3-Add-correct-SATA-settings.patch new file +59 -0
59 lines not on this page · raw message
recipes-bsp/u-boot/u-boot-ge_2015.10.bb new file +22 -0
@@ -0,0 +1,22 @@ +require recipes-bsp/u-boot/u-boot.inc + +DESCRIPTION = "U-Boot for GE i.MX6 BA16 based platforms" +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://Licenses/README;md5=0507cd7da8e7ad6d6701926ec9b84c95" +DEPENDS = "u-boot-mkimage-native" + +PROVIDES = "u-boot" + +SRCREV = "1b6aee73e60023ae4ba16b11ce7bc23e0e8552f7" +SRC_URI = "git://github.com/Freescale/u-boot-fslc.git;branch=2015.10+fslc \ + file://0001-arm-imx-Add-support-for-GE-Bx50v3-boards.patch \ + file://0002-board-ge-bx50v3-Update-display-setup.patch \ + file://0003-ge_bx50v3-Add-support-for-FSL-Community-Yocto-images.patch \ + file://0004-board-ge-bx50v3-Add-support-for-ELO-board.patch \ + file://0005-board-ge-bx50v3-Fix-bootargs-for-ELO-board.patch \ + file://0006-mx6q_ba16-Add-1G-DDR-support.patch \ + file://0007-board-ge-bx50v3-Add-correct-SATA-settings.patch \ +" + +PACKAGE_ARCH = "${MACHINE_ARCH}" +COMPATIBLE_MACHINE = "(imx6q-elo)"
Signature · 1 line
2.5.0
Re: [meta-fsl-arm-extra][PATCH 1/3] u-boot-ge: Add u-boot recipe for GE i.MX6 boards
Quoted 7 lines · Justin Waters
This recipe is a fork of the fslc u-boot with patches for supporting the imx6q-elo platform.
This recipe is intended to be a stop-gap until the imx6q-elo board can be rebased and tested with the most recent fslc branch.
Signed-off-by Justin Waters <[email protected]>
The upstream patches has been applied on U-Boot mainline, for upcoming 2016.05 release. Please prepare the backport port of those patches so we can apply them on top of U-Boot FSLC fork and reduce the delta and maintenance burden.
Signature · 3 lines
Otavio Salvador O.S. Systems http://www.ossystems.com.br http://code.ossystems.com.br Mobile: +55 (53) 9981-7854 Mobile: +1 (347) 903-9750
Re: [meta-fsl-arm-extra][PATCH 1/3] u-boot-ge: Add u-boot recipe for GE i.MX6 boards
Otavio,
Quoted 8 lines · Otavio Salvador
Quoted 6 lines · Justin Waters
This recipe is a fork of the fslc u-boot with patches for supporting the imx6q-elo platform.
This recipe is intended to be a stop-gap until the imx6q-elo board can be rebased and tested with the most recent fslc branch.
Quoted 8 lines
Quoted 1 line
Signed-off-by Justin Waters <[email protected]>The upstream patches has been applied on U-Boot mainline, for upcoming 2016.05 release. Please prepare the backport port of those patches so we can apply them on top of U-Boot FSLC fork and reduce the delta and maintenance burden.
To clarify, are you asking me to rebase the tree now, or when we merge the u-boot-ge recipe back in to the u-boot-fslc? We certainly plan to move forward to a newer u-boot for the 4.1 kernel push, and may even push the ELO board support upstream as well. But that's not likely to happen for a few weeks.
-Justin
Re: [meta-fsl-arm-extra][PATCH 1/3] u-boot-ge: Add u-boot recipe for GE i.MX6 boards
Quoted 5 lines · Justin Waters
To clarify, are you asking me to rebase the tree now, or when we merge the u-boot-ge recipe back in to the u-boot-fslc? We certainly plan to move forward to a newer u-boot for the 4.1 kernel push, and may even push the ELO board support upstream as well. But that's not likely to happen for a few weeks.
It would be great if you could do the U-Boot FSLC step soon. We can have it on krogoth and avoid the extra maintenance burden. After we will go to U-Boot 2016.05 and this won't be merged back on krogoth.
Signature · 3 lines
Otavio Salvador O.S. Systems http://www.ossystems.com.br http://code.ossystems.com.br Mobile: +55 (53) 9981-7854 Mobile: +1 (347) 903-9750
PATCH 2/3 linux-ge: Add linux kernel recipe for GE i.MX6 boards
In reply to Justin WatersThis recipe is a fork of the fslc kernel with patches for supporting the imx6q-elo platform.
This recipe is intended to be a stop-gap until the imx6q-elo board can be rebased and tested with the most recent fslc branch.
--- .../0001-rtc-rx8010-Add-driver-to-kernel.patch | 1020 ++++++++++++++++++++ ...Add-support-for-production-silicon-varian.patch | 101 ++ ...Upgrade-of-register-definitions-to-suppor.patch | 257 +++++ .../linux-ge-3.14/0004-rtc-da9063-RTC-driver.patch | 399 ++++++++ ...da9063-Add-support-for-AD-silicon-variant.patch | 582 +++++++++++ ...Get-irq-base-dynamically-before-registeri.patch | 42 + ...7-mfd-da9063-Add-support-for-OnKey-driver.patch | 114 +++ ...i_imx-Make-receive-DPLL-mode-configurable.patch | 51 + ...d-DT-bindings-to-configure-PHY-Tx-driver-.patch | 112 +++ ...-dts-imx-Add-support-for-Advantech-GE-ELO.patch | 817 ++++++++++++++++ recipes-kernel/linux/linux-ge-3.14/defconfig | 453 +++++++++ recipes-kernel/linux/linux-ge_3.14.bb | 25 + 12 files changed, 3973 insertions(+) create mode 100644 recipes-kernel/linux/linux-ge-3.14/0001-rtc-rx8010-Add-driver-to-kernel.patch create mode 100644 recipes-kernel/linux/linux-ge-3.14/0002-mfd-da9063-Add-support-for-production-silicon-varian.patch create mode 100644 recipes-kernel/linux/linux-ge-3.14/0003-mfd-da9063-Upgrade-of-register-definitions-to-suppor.patch create mode 100644 recipes-kernel/linux/linux-ge-3.14/0004-rtc-da9063-RTC-driver.patch create mode 100644 recipes-kernel/linux/linux-ge-3.14/0005-mfd-da9063-Add-support-for-AD-silicon-variant.patch create mode 100644 recipes-kernel/linux/linux-ge-3.14/0006-mfd-da9063-Get-irq-base-dynamically-before-registeri.patch create mode 100644 recipes-kernel/linux/linux-ge-3.14/0007-mfd-da9063-Add-support-for-OnKey-driver.patch create mode 100644 recipes-kernel/linux/linux-ge-3.14/0008-ahci_imx-Make-receive-DPLL-mode-configurable.patch create mode 100644 recipes-kernel/linux/linux-ge-3.14/0009-PCI-imx6-Add-DT-bindings-to-configure-PHY-Tx-driver-.patch create mode 100644 recipes-kernel/linux/linux-ge-3.14/0010-ARM-dts-imx-Add-support-for-Advantech-GE-ELO.patch create mode 100644 recipes-kernel/linux/linux-ge-3.14/defconfig create mode 100644 recipes-kernel/linux/linux-ge_3.14.bb
recipes-kernel/linux/linux-ge-3.14/0001-rtc-rx8010-Add-driver-to-kernel.patch new file +1020 -0
@@ -0,0 +1,1020 @@ +From fc70b949055cfcf19914e9ab1a6ab21d9e7e9634 Mon Sep 17 00:00:00 2001 +From: Justin Waters <[email protected]> +Date: Mon, 22 Dec 2014 11:35:24 -0500 +Subject: [PATCH 01/10] rtc-rx8010: Add driver to kernel + +This is the rx810_k3.8-v1.3 version from the Epson support site: + +http://www5.epsondevice.com/en/quartz/tech/linux_for_rtc/software/rx8010_k3.8-v1.3.zip +--- + drivers/rtc/Kconfig | 8 + + drivers/rtc/Makefile | 1 + + drivers/rtc/rtc-rx8010.c | 965 +++++++++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 974 insertions(+) + create mode 100644 drivers/rtc/rtc-rx8010.c + +diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig +index db933de..87ed3a3 100644 +--- a/drivers/rtc/Kconfig ++++ b/drivers/rtc/Kconfig +@@ -494,6 +494,14 @@ config RTC_DRV_FM3130 + This driver can also be built as a module. If so the module + will be called rtc-fm3130. + ++config RTC_DRV_RX8010 ++ tristate "Epson RX-8010SJ" ++ help ++ If you say yes here you will get support for the Epson RX-8010SJ. ++ ++ This driver can also be built as a module. If so the module ++ will be called rtc-rx8010. ++ + config RTC_DRV_RX8581 + tristate "Epson RX-8581" + help +diff --git a/drivers/rtc/Makefile b/drivers/rtc/Makefile +index b427bf7..1512f48 100644 +--- a/drivers/rtc/Makefile ++++ b/drivers/rtc/Makefile +@@ -106,6 +106,7 @@ obj-$(CONFIG_RTC_DRV_RS5C348) += rtc-rs5c348.o + obj-$(CONFIG_RTC_DRV_RS5C372) += rtc-rs5c372.o + obj-$(CONFIG_RTC_DRV_RV3029C2) += rtc-rv3029c2.o + obj-$(CONFIG_RTC_DRV_RX4581) += rtc-rx4581.o ++obj-$(CONFIG_RTC_DRV_RX8010) += rtc-rx8010.o + obj-$(CONFIG_RTC_DRV_RX8025) += rtc-rx8025.o + obj-$(CONFIG_RTC_DRV_RX8581) += rtc-rx8581.o + obj-$(CONFIG_RTC_DRV_S35390A) += rtc-s35390a.o +diff --git a/drivers/rtc/rtc-rx8010.c b/drivers/rtc/rtc-rx8010.c +new file mode 100644 +index 0000000..80f7506 +--- /dev/null ++++ b/drivers/rtc/rtc-rx8010.c +@@ -0,0 +1,965 @@ ++//====================================================================== ++// Driver for the Epson RTC module RX-8010 SJ ++// ++// Copyright(C) SEIKO EPSON CORPORATION 2013. All rights reserved. ++// ++// Derived from RX-8025 driver: ++// Copyright (C) 2009 Wolfgang Grandegger <[email protected]> ++// ++// Copyright (C) 2005 by Digi International Inc. ++// All rights reserved. ++// ++// Modified by fengjh at rising.com.cn ++// <http://lists.lm-sensors.org/mailman/listinfo/lm-sensors> ++// 2006.11 ++// ++// Code cleanup by Sergei Poselenov, <[email protected]> ++// Converted to new style by Wolfgang Grandegger <[email protected]> ++// Alarm and periodic interrupt added by Dmitry Rakhchev <[email protected]> ++// ++// ++// This driver software is distributed as is, without any warranty of any kind, ++// either express or implied as further specified in the GNU Public License. This ++// software may be used and distributed according to the terms of the GNU Public ++// License, version 2 as published by the Free Software Foundation. ++// See the file COPYING in the main directory of this archive for more details. ++// ++// You should have received a copy of the GNU General Public License along with ++// this program. If not, see <http://www.gnu.org/licenses/>. ++//====================================================================== ++ ++#if 0 ++#define DEBUG ++#include <linux/device.h> ++#undef DEBUG ++#endif ++ ++#include <linux/kernel.h> ++#include <linux/module.h> ++#include <linux/slab.h> ++#include <linux/init.h> ++#include <linux/bcd.h> ++#include <linux/i2c.h> ++#include <linux/list.h> ++#include <linux/rtc.h> ++#include <linux/of_gpio.h> ++ ++#include <linux/of.h> ++#include <linux/of_device.h> ++#include <linux/of_irq.h> ++#include <linux/interrupt.h> ++#include <linux/input.h> ++ ++ ++// RX-8010 Register definitions ++#define RX8010_REG_SEC 0x10 ++#define RX8010_REG_MIN 0x11 ++#define RX8010_REG_HOUR 0x12 ++#define RX8010_REG_WDAY 0x13 ++#define RX8010_REG_MDAY 0x14 ++#define RX8010_REG_MONTH 0x15 ++#define RX8010_REG_YEAR 0x16 ++// 0x17 is reserved ++#define RX8010_REG_ALMIN 0x18 ++#define RX8010_REG_ALHOUR 0x19 ++#define RX8010_REG_ALWDAY 0x1A ++#define RX8010_REG_TCOUNT0 0x1B ++#define RX8010_REG_TCOUNT1 0x1C ++#define RX8010_REG_EXT 0x1D ++#define RX8010_REG_FLAG 0x1E ++#define RX8010_REG_CTRL 0x1F ++#define RX8010_REG_USER0 0x20 ++#define RX8010_REG_USER1 0x21 ++#define RX8010_REG_USER2 0x22 ++#define RX8010_REG_USER3 0x23 ++#define RX8010_REG_USER4 0x24 ++#define RX8010_REG_USER5 0x25 ++#define RX8010_REG_USER6 0x26 ++#define RX8010_REG_USER7 0x27 ++#define RX8010_REG_USER8 0x28 ++#define RX8010_REG_USER9 0x29 ++#define RX8010_REG_USERA 0x2A ++#define RX8010_REG_USERB 0x2B ++#define RX8010_REG_USERC 0x2C ++#define RX8010_REG_USERD 0x2D ++#define RX8010_REG_USERE 0x2E ++#define RX8010_REG_USERF 0x2F ++// 0x30 is reserved ++// 0x31 is reserved ++#define RX8010_REG_IRQ 0x32 ++ ++// Extension Register (1Dh) bit positions ++#define RX8010_BIT_EXT_TSEL (7 << 0) ++#define RX8010_BIT_EXT_WADA (1 << 3) ++#define RX8010_BIT_EXT_TE (1 << 4) ++#define RX8010_BIT_EXT_USEL (1 << 5) ++#define RX8010_BIT_EXT_FSEL (3 << 6) ++ ++// Flag Register (1Eh) bit positions ++#define RX8010_BIT_FLAG_VLF (1 << 1) ++#define RX8010_BIT_FLAG_AF (1 << 3) ++#define RX8010_BIT_FLAG_TF (1 << 4) ++#define RX8010_BIT_FLAG_UF (1 << 5) ++ ++// Control Register (1Fh) bit positions ++#define RX8010_BIT_CTRL_TSTP (1 << 2) ++#define RX8010_BIT_CTRL_AIE (1 << 3) ++#define RX8010_BIT_CTRL_TIE (1 << 4) ++#define RX8010_BIT_CTRL_UIE (1 << 5) ++#define RX8010_BIT_CTRL_STOP (1 << 6) ++#define RX8010_BIT_CTRL_TEST (1 << 7) ++ ++ ++static const struct i2c_device_id rx8010_id[] = { ++ { "rx8010", 0 }, ++ { } ++}; ++MODULE_DEVICE_TABLE(i2c, rx8010_id); ++ ++struct rx8010_data { ++ struct i2c_client *client; ++ struct rtc_device *rtc; ++ struct work_struct work_1; ++ struct work_struct work_2; ++ u8 ctrlreg; ++ int irq_1; ++ int irq_2; ++ unsigned exiting:1; ++}; ++ ++typedef struct { ++ u8 number; ++ u8 value; ++}reg_data; ++ ++#define SE_RTC_REG_READ _IOWR('p', 0x20, reg_data) ++#define SE_RTC_REG_WRITE _IOW('p', 0x21, reg_data) ++ ++//---------------------------------------------------------------------- ++// rx8010_read_reg() ++// reads a rx8010 register (see Register defines) ++// See also rx8010_read_regs() to read multiple registers. ++// ++//---------------------------------------------------------------------- ++static int rx8010_read_reg(struct i2c_client *client, int number, u8 *value) ++{ ++ int ret = i2c_smbus_read_byte_data(client, number) ; ++ ++ //check for error ++ if (ret < 0) { ++ dev_err(&client->dev, "Unable to read register #%d\n", number); ++ return ret; ++ } ++ ++ *value = ret; ++ return 0; ++} ++ ++//---------------------------------------------------------------------- ++// rx8010_read_regs() ++// reads a specified number of rx8010 registers (see Register defines) ++// See also rx8010_read_reg() to read single register. ++// ++//---------------------------------------------------------------------- ++static int rx8010_read_regs(struct i2c_client *client, int number, u8 length, u8 *values) ++{ ++ int ret = i2c_smbus_read_i2c_block_data(client, number, length, values); ++ ++ //check for length error ++ if (ret != length) { ++ dev_err(&client->dev, "Unable to read registers #%d..#%d\n", number, number + length - 1); ++ return ret < 0 ? ret : -EIO; ++ } ++ ++ return 0; ++} ++ ++//---------------------------------------------------------------------- ++// rx8010_write_reg() ++// writes a rx8010 register (see Register defines) ++// See also rx8010_write_regs() to write multiple registers. ++// ++//---------------------------------------------------------------------- ++static int rx8010_write_reg(struct i2c_client *client, int number, u8 value) ++{ ++ int ret = i2c_smbus_write_byte_data(client, number, value); ++ ++ //check for error ++ if (ret) ++ dev_err(&client->dev, "Unable to write register #%d\n", number); ++ ++ return ret; ++} ++ ++//---------------------------------------------------------------------- ++// rx8010_write_regs() ++// writes a specified number of rx8010 registers (see Register defines) ++// See also rx8010_write_reg() to write a single register. ++// ++//---------------------------------------------------------------------- ++static int rx8010_write_regs(struct i2c_client *client, int number, u8 length, u8 *values) ++{ ++ int ret = i2c_smbus_write_i2c_block_data(client, number, length, values); ++ ++ //check for error ++ if (ret) ++ dev_err(&client->dev, "Unable to write registers #%d..#%d\n", number, number + length - 1); ++ ++ return ret; ++} ++ ++//---------------------------------------------------------------------- ++// rx8010_irq_1() ++// irq handler ++// ++//---------------------------------------------------------------------- ++static irqreturn_t rx8010_irq_1(int irq, void *dev_id) ++{ ++ struct i2c_client *client = dev_id; ++ struct rx8010_data *rx8010 = i2c_get_clientdata(client); ++ ++ disable_irq_nosync(irq); ++ schedule_work(&rx8010->work_1); ++ ++ ++ return IRQ_HANDLED; ++} ++ ++//---------------------------------------------------------------------- ++// rx8010_work_1() ++// ++//---------------------------------------------------------------------- ++static void rx8010_work_1(struct work_struct *work) ++{ ++ struct rx8010_data *rx8010 = container_of(work, struct rx8010_data, work_1); ++ struct i2c_client *client = rx8010->client; ++ struct mutex *lock = &rx8010->rtc->ops_lock; ++ u8 status; ++ ++ mutex_lock(lock); ++ ++ if (rx8010_read_reg(client, RX8010_REG_FLAG, &status)) ++ goto out; ++ ++ // check VLF ++ if ((status & RX8010_BIT_FLAG_VLF)) ++ dev_warn(&client->dev, "Frequency stop was detected, probably due to a supply voltage drop\n"); ++ ++ dev_dbg(&client->dev, "%s: RX8010_REG_FLAG: %xh\n", __func__, status); ++ ++ // periodic "fixed-cycle" timer ++ if (status & RX8010_BIT_FLAG_TF) { ++ status &= ~RX8010_BIT_FLAG_TF; ++ local_irq_disable(); ++ rtc_update_irq(rx8010->rtc, 1, RTC_PF | RTC_IRQF); ++ local_irq_enable(); ++ } ++ ++ // alarm function ++ if (status & RX8010_BIT_FLAG_AF) { ++ status &= ~RX8010_BIT_FLAG_AF; ++ local_irq_disable(); ++ rtc_update_irq(rx8010->rtc, 1, RTC_AF | RTC_IRQF); ++ local_irq_enable(); ++ } ++ ++ // time update function ++ if (status & RX8010_BIT_FLAG_UF) { ++ status &= ~RX8010_BIT_FLAG_UF; ++ local_irq_disable(); ++ rtc_update_irq(rx8010->rtc, 1, RTC_UF | RTC_IRQF); ++ local_irq_enable(); ++ } ++ ++ // acknowledge IRQ (clear flags) ++ rx8010_write_reg(client, RX8010_REG_FLAG, status); ++ ++out: ++ if (!rx8010->exiting) ++ { ++ if (rx8010->irq_1 > 0) ++ enable_irq(rx8010->irq_1); ++ else ++ enable_irq(client->irq); ++ } ++ ++ mutex_unlock(lock); ++} ++ ++//---------------------------------------------------------------------- ++// rx8010_irq_2() ++// irq handler ++// ++//---------------------------------------------------------------------- ++static irqreturn_t rx8010_irq_2(int irq, void *dev_id) ++{ ++ struct i2c_client *client = dev_id; ++ struct rx8010_data *rx8010 = i2c_get_clientdata(client); ++ ++ disable_irq_nosync(irq); ++ schedule_work(&rx8010->work_2); ++ ++ ++ return IRQ_HANDLED; ++} ++ ++//---------------------------------------------------------------------- ++// rx8010_work_2() ++// ++//---------------------------------------------------------------------- ++static void rx8010_work_2(struct work_struct *work) ++{ ++ struct rx8010_data *rx8010 = container_of(work, struct rx8010_data, work_2); ++ struct i2c_client *client = rx8010->client; ++ struct mutex *lock = &rx8010->rtc->ops_lock; ++ u8 status; ++ ++ mutex_lock(lock); ++ ++ if (rx8010_read_reg(client, RX8010_REG_FLAG, &status)) ++ goto out; ++ ++ // check VLF ++ if ((status & RX8010_BIT_FLAG_VLF)) ++ dev_warn(&client->dev, "Frequency stop was detected, \ ++ probably due to a supply voltage drop\n"); ++ ++ dev_dbg(&client->dev, "%s: RX8010_REG_FLAG: %xh\n", __func__, status); ++ ++ // periodic "fixed-cycle" timer ++ if (status & RX8010_BIT_FLAG_TF) { ++ status &= ~RX8010_BIT_FLAG_TF; ++ local_irq_disable(); ++ rtc_update_irq(rx8010->rtc, 1, RTC_PF | RTC_IRQF); ++ local_irq_enable(); ++ } ++ ++ // acknowledge IRQ (clear flags) ++ rx8010_write_reg(client, RX8010_REG_FLAG, status); ++ ++out: ++ if (!rx8010->exiting) ++ { ++ if (rx8010->irq_2 > 0) ++ enable_irq(rx8010->irq_2); ++ else ++ enable_irq(client->irq); ++ } ++ ++ mutex_unlock(lock); ++} ++ ++//---------------------------------------------------------------------- ++// rx8010_get_time() ++// gets the current time from the rx8010 registers ++// ++//---------------------------------------------------------------------- ++static int rx8010_get_time(struct device *dev, struct rtc_time *dt) ++{ ++ struct rx8010_data *rx8010 = dev_get_drvdata(dev); ++ u8 date[7]; ++ int err; ++ ++ err = rx8010_read_regs(rx8010->client, RX8010_REG_SEC, 7, date); ++ if (err) ++ return err; ++ ++ dev_dbg(dev, "%s: read 0x%02x 0x%02x " ++ "0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n", __func__, ++ date[0], date[1], date[2], date[3], date[4], date[5], date[6]); ++ ++ //Note: need to subtract 0x10 for index as register offset starts at 0x10 ++ dt->tm_sec = bcd2bin(date[RX8010_REG_SEC-0x10] & 0x7f); ++ dt->tm_min = bcd2bin(date[RX8010_REG_MIN-0x10] & 0x7f); ++ dt->tm_hour = bcd2bin(date[RX8010_REG_HOUR-0x10] & 0x3f); //only 24-hour clock ++ dt->tm_mday = bcd2bin(date[RX8010_REG_MDAY-0x10] & 0x3f); ++ dt->tm_mon = bcd2bin(date[RX8010_REG_MONTH-0x10] & 0x1f) - 1; ++ dt->tm_year = bcd2bin(date[RX8010_REG_YEAR-0x10]); ++ dt->tm_wday = bcd2bin(date[RX8010_REG_WDAY-0x10] & 0x7f); ++ ++ if (dt->tm_year < 70) ++ dt->tm_year += 100; ++ ++ dev_dbg(dev, "%s: date %ds %dm %dh %dmd %dm %dy\n", __func__, ++ dt->tm_sec, dt->tm_min, dt->tm_hour, ++ dt->tm_mday, dt->tm_mon, dt->tm_year); ++ ++ return rtc_valid_tm(dt); ++} ++ ++//---------------------------------------------------------------------- ++// rx8010_set_time() ++// Sets the current time in the rx8010 registers ++// ++// BUG: The HW assumes every year that is a multiple of 4 to be a leap ++// year. Next time this is wrong is 2100, which will not be a leap year ++// ++// Note: If STOP is not set/cleared, the clock will start when the seconds ++// register is written ++// ++//---------------------------------------------------------------------- ++static int rx8010_set_time(struct device *dev, struct rtc_time *dt) ++{ ++ struct rx8010_data *rx8010 = dev_get_drvdata(dev); ++ u8 date[7]; ++ u8 ctrl; ++ int ret; ++ ++ //set STOP bit before changing clock/calendar ++ rx8010_read_reg(rx8010->client, RX8010_REG_CTRL, &ctrl); ++ rx8010->ctrlreg = ctrl | RX8010_BIT_CTRL_STOP; ++ rx8010_write_reg(rx8010->client, RX8010_REG_CTRL, rx8010->ctrlreg); ++ ++ //Note: need to subtract 0x10 for index as register offset starts at 0x10 ++ date[RX8010_REG_SEC-0x10] = bin2bcd(dt->tm_sec); ++ date[RX8010_REG_MIN-0x10] = bin2bcd(dt->tm_min); ++ date[RX8010_REG_HOUR-0x10] = bin2bcd(dt->tm_hour); //only 24hr time ++ ++ date[RX8010_REG_MDAY-0x10] = bin2bcd(dt->tm_mday); ++ date[RX8010_REG_MONTH-0x10] = bin2bcd(dt->tm_mon + 1); ++ date[RX8010_REG_YEAR-0x10] = bin2bcd(dt->tm_year % 100); ++ date[RX8010_REG_WDAY-0x10] = bin2bcd(dt->tm_wday); ++ ++ dev_dbg(dev, "%s: write 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n", ++ __func__, date[0], date[1], date[2], date[3], date[4], date[5], date[6]); ++ ++ ret = rx8010_write_regs(rx8010->client, RX8010_REG_SEC, 7, date); ++ ++ //clear STOP bit after changing clock/calendar ++ rx8010_read_reg(rx8010->client, RX8010_REG_CTRL, &ctrl); ++ rx8010->ctrlreg = ctrl & ~RX8010_BIT_CTRL_STOP; ++ rx8010_write_reg(rx8010->client, RX8010_REG_CTRL, rx8010->ctrlreg); ++ ++ return ret; ++} ++ ++//---------------------------------------------------------------------- ++// rx8010_init_client() ++// initializes the rx8010 ++// ++//---------------------------------------------------------------------- ++static int rx8010_init_client(struct i2c_client *client, int *need_reset) ++{ ++ struct rx8010_data *rx8010 = i2c_get_clientdata(client); ++ u8 ctrl[3]; ++ int need_clear = 0; ++ int err; ++ ++ //set reserved register 0x17 with specified value of 0xD8 ++ err = rx8010_write_reg(client, 0x17, 0xD8); ++ if (err) ++ goto out; ++ ++ //set reserved register 0x30 with specified value of 0x00 ++ err = rx8010_write_reg(client, 0x30, 0x00); ++ if (err) ++ goto out; ++ ++ //set reserved register 0x31 with specified value of 0x08 ++ err = rx8010_write_reg(client, 0x31, 0x08); ++ if (err) ++ goto out; ++ ++ //set reserved register 0x32 with default value ++ err = rx8010_write_reg(client, RX8010_REG_IRQ, 0x00); ++ if (err) ++ goto out; ++ ++ ++ //get current extension, flag, control register values ++ err = rx8010_read_regs(rx8010->client, RX8010_REG_EXT, 3, ctrl); ++ if (err) ++ goto out; ++ ++ //check for VLF Flag (set at power-on) ++ if ((ctrl[1] & RX8010_BIT_FLAG_VLF)) { ++ dev_warn(&client->dev, "Frequency stop was detected, probably due to a supply voltage drop\n"); ++ *need_reset = 1; ++ } ++ ++ //check for Alarm Flag ++ if (ctrl[1] & RX8010_BIT_FLAG_AF) { ++ dev_warn(&client->dev, "Alarm was detected\n"); ++ need_clear = 1; ++ } ++ ++ //check for Periodic Timer Flag ++ if (ctrl[1] & RX8010_BIT_FLAG_TF) { ++ dev_warn(&client->dev, "Periodic timer was detected\n"); ++ need_clear = 1; ++ } ++ ++ //check for Update Timer Flag ++ if (ctrl[1] & RX8010_BIT_FLAG_UF) { ++ dev_warn(&client->dev, "Update timer was detected\n"); ++ need_clear = 1; ++ } ++ ++ //reset or clear needed? ++ if (*need_reset) { ++ //clear 1d, 1e, 1f registers ++ ctrl[0] = ctrl[1] = ctrl[2] = 0; ++ err = rx8010_write_regs(client, RX8010_REG_EXT, 3, ctrl); ++ if (err) ++ goto out; ++ } ++ else if(need_clear){ ++ //clear flag register ++ err = rx8010_write_reg(client, RX8010_REG_FLAG, 0x00); ++ if (err) ++ goto out; ++ } ++ ++ //set "test bit" and reserved bits of control register zero ++ rx8010->ctrlreg = (ctrl[2] & ~RX8010_BIT_CTRL_TEST); ++out: ++ return err; ++} ++ ++//---------------------------------------------------------------------- ++// rx8010_read_alarm() ++// reads current Alarm ++// ++// Notes: - currently filters the AE bits (bit 7) ++// - assumes WADA setting is week (week/day) ++//---------------------------------------------------------------------- ++static int rx8010_read_alarm(struct device *dev, struct rtc_wkalrm *t) ++{ ++ struct rx8010_data *rx8010 = dev_get_drvdata(dev); ++ struct i2c_client *client = rx8010->client; ++ u8 alarmvals[3]; //minute, hour, week/day values ++ u8 ctrl[3]; //extension, flag, control values ++ int err; ++ ++ if (client->irq <= 0) ++ return -EINVAL; ++ ++ //get current minute, hour, week/day alarm values ++ err = rx8010_read_regs(client, RX8010_REG_ALMIN, 3, alarmvals); ++ if (err) ++ return err; ++ dev_dbg(dev, "%s: minutes:0x%02x hours:0x%02x week/day:0x%02x\n", ++ __func__, alarmvals[0], alarmvals[1], alarmvals[2]); ++ ++ ++ //get current extension, flag, control register values ++ err = rx8010_read_regs(client, RX8010_REG_EXT, 3, ctrl); ++ if (err) ++ return err; ++ dev_dbg(dev, "%s: extension:0x%02x flag:0x%02x control:0x%02x \n", ++ __func__, ctrl[0], ctrl[1], ctrl[2]); ++ ++ // Hardware alarm precision is 1 minute ++ t->time.tm_sec = 0; ++ t->time.tm_min = bcd2bin(alarmvals[0] & 0x7f); //0x7f filters AE bit currently ++ t->time.tm_hour = bcd2bin(alarmvals[1] & 0x3f); //0x3f filters AE bit currently, also 24hr only ++ ++ t->time.tm_wday = -1; ++ t->time.tm_mday = -1; ++ t->time.tm_mon = -1; ++ t->time.tm_year = -1; ++ ++ dev_dbg(dev, "%s: date: %ds %dm %dh %dmd %dm %dy\n", ++ __func__, ++ t->time.tm_sec, t->time.tm_min, t->time.tm_hour, ++ t->time.tm_mday, t->time.tm_mon, t->time.tm_year); ++ ++ t->enabled = !!(rx8010->ctrlreg & RX8010_BIT_CTRL_AIE); //check if interrupt is enabled ++ t->pending = (ctrl[1] & RX8010_BIT_FLAG_AF) && t->enabled; //check if flag is triggered ++ ++ return err; ++} ++ ++//---------------------------------------------------------------------- ++// rx8010_set_alarm() ++// sets Alarm ++// ++// Notes: - currently filters the AE bits (bit 7) ++// - assumes WADA setting is week (week/day) ++//---------------------------------------------------------------------- ++static int rx8010_set_alarm(struct device *dev, struct rtc_wkalrm *t) ++{ ++ struct i2c_client *client = to_i2c_client(dev); ++ struct rx8010_data *rx8010 = dev_get_drvdata(dev); ++ u8 alarmvals[3]; //minute, hour, day ++ u8 extreg; //extension register ++ u8 flagreg; //flag register ++ int err; ++ ++ if (client->irq <= 0) ++ return -EINVAL; ++ ++ //get current extension register ++ err = rx8010_read_reg(client, RX8010_REG_EXT, &extreg); ++ if (err <0) ++ return err; ++ ++ //get current flag register ++ err = rx8010_read_reg(client, RX8010_REG_FLAG, &flagreg); ++ if (err <0) ++ return err; ++ ++ // Hardware alarm precision is 1 minute ++ alarmvals[0] = bin2bcd(t->time.tm_min); ++ alarmvals[1] = bin2bcd(t->time.tm_hour); ++ alarmvals[2] = bin2bcd(t->time.tm_mday); ++ dev_dbg(dev, "%s: write 0x%02x 0x%02x 0x%02x\n", __func__, alarmvals[0], alarmvals[1], alarmvals[2]); ++ ++ //check interrupt enable and disable ++ if (rx8010->ctrlreg & RX8010_BIT_CTRL_AIE) { ++ rx8010->ctrlreg &= ~RX8010_BIT_CTRL_AIE; ++ err = rx8010_write_reg(rx8010->client, RX8010_REG_CTRL, rx8010->ctrlreg); ++ if (err) ++ return err; ++ } ++ ++ //write the new minute and hour values ++ //Note:assume minute and hour values will be enabled. Bit 7 of each of the ++ // minute, hour, week/day register can be set which will "disable" the ++ // register from triggering an alarm. See the RX8010 spec for more information ++ err = rx8010_write_regs(rx8010->client, RX8010_REG_ALMIN, 2, alarmvals); ++ if (err) ++ return err; ++ ++ //set Week/Day bit ++ // Week setting is typically not used, so we will assume "day" setting ++ extreg |= RX8010_BIT_EXT_WADA; //set to "day of month" ++ err = rx8010_write_reg(rx8010->client, RX8010_REG_EXT, extreg); ++ if (err) ++ return err; ++ ++ //set Day of Month register ++ if (alarmvals[2] == 0) { ++ alarmvals[2] |= 0x80; //turn on AE bit to ignore day of month (no zero day) ++ err = rx8010_write_reg(rx8010->client, RX8010_REG_ALWDAY, alarmvals[2]); ++ } ++ else { ++ err = rx8010_write_reg(rx8010->client, RX8010_REG_ALWDAY, alarmvals[2]); ++ } ++ if (err) ++ return err; ++ ++ //clear Alarm Flag ++ flagreg &= ~RX8010_BIT_FLAG_AF; ++ err = rx8010_write_reg(rx8010->client, RX8010_REG_FLAG, flagreg); ++ if (err) ++ return err; ++ ++ //re-enable interrupt if required ++ if (t->enabled) { ++ ++ if ( rx8010->rtc->uie_rtctimer.enabled ) ++ rx8010->ctrlreg |= RX8010_BIT_CTRL_UIE; //set update interrupt enable ++ if ( rx8010->rtc->aie_timer.enabled ) ++ rx8010->ctrlreg |= (RX8010_BIT_CTRL_AIE | RX8010_BIT_CTRL_UIE); //set alarm interrupt enable ++ ++ err = rx8010_write_reg(rx8010->client, RX8010_REG_CTRL, rx8010->ctrlreg); ++ if (err) ++ return err; ++ } ++ ++ return 0; ++} ++ ++//---------------------------------------------------------------------- ++// rx8010_alarm_irq_enable() ++// sets enables Alarm IRQ ++// ++// Todo: - ++// ++//---------------------------------------------------------------------- ++static int rx8010_alarm_irq_enable(struct device *dev, unsigned int enabled) ++{ ++ struct i2c_client *client = to_i2c_client(dev); ++ struct rx8010_data *rx8010 = dev_get_drvdata(dev); ++ u8 flagreg; ++ u8 ctrl; ++ int err; ++ ++ //get the current ctrl settings ++ ctrl = rx8010->ctrlreg; ++ ++ if (enabled) ++ { ++ if ( rx8010->rtc->uie_rtctimer.enabled ) ++ ctrl |= RX8010_BIT_CTRL_UIE; //set update interrupt enable ++ if ( rx8010->rtc->aie_timer.enabled ) ++ ctrl |= (RX8010_BIT_CTRL_AIE | RX8010_BIT_CTRL_UIE); //set alarm interrupt enable ++ } ++ else ++ { ++ if ( ! rx8010->rtc->uie_rtctimer.enabled ) ++ ctrl &= ~RX8010_BIT_CTRL_UIE; //clear update interrupt enable ++ if ( ! rx8010->rtc->aie_timer.enabled ) ++ { ++ if ( rx8010->rtc->uie_rtctimer.enabled ) ++ ctrl &= ~RX8010_BIT_CTRL_AIE; ++ else ++ ctrl &= ~(RX8010_BIT_CTRL_AIE | RX8010_BIT_CTRL_UIE); //clear alarm interrupt enable ++ } ++ } ++ ++ //clear alarm flag ++ err = rx8010_read_reg(client, RX8010_REG_FLAG, &flagreg); ++ if (err <0) ++ return err; ++ flagreg &= ~RX8010_BIT_FLAG_AF; ++ err = rx8010_write_reg(rx8010->client, RX8010_REG_FLAG, flagreg); ++ if (err) ++ return err; ++ ++ //update the Control register if the setting changed ++ if (ctrl != rx8010->ctrlreg) { ++ rx8010->ctrlreg = ctrl; ++ err = rx8010_write_reg(rx8010->client, RX8010_REG_CTRL, rx8010->ctrlreg); ++ if (err) ++ return err; ++ } ++ ++ return 0; ++} ++ ++//--------------------------------------------------------------------------- ++// rx8010_ioctl() ++// ++//--------------------------------------------------------------------------- ++static int rx8010_ioctl(struct device *dev, unsigned int cmd, unsigned long arg) ++{ ++ struct i2c_client *client = to_i2c_client(dev); ++ //struct rx8010_data *rx8010 = dev_get_drvdata(dev); ++ //struct mutex *lock = &rx8010->rtc->ops_lock; ++ int ret = 0; ++ int tmp; ++ void __user *argp = (void __user *)arg; ++ reg_data reg; ++ ++ dev_dbg(dev, "%s: cmd=%x\n", __func__, cmd); ++ ++ switch (cmd) { ++ case SE_RTC_REG_READ: ++ if (copy_from_user(®, argp, sizeof(reg))) ++ return -EFAULT; ++ if ( reg.number < RX8010_REG_SEC || reg.number > RX8010_REG_IRQ ) ++ return -EFAULT; ++ //mutex_lock(lock); ++ ret = rx8010_read_reg(client, reg.number, ®.value); ++ //mutex_unlock(lock); ++ if (! ret ) ++ return copy_to_user(argp, ®, sizeof(reg)) ? -EFAULT : 0; ++ break; ++ ++ case SE_RTC_REG_WRITE: ++ if (copy_from_user(®, argp, sizeof(reg))) ++ return -EFAULT; ++ if ( reg.number < RX8010_REG_SEC || reg.number > RX8010_REG_IRQ ) ++ return -EFAULT; ++ //mutex_lock(lock); ++ ret = rx8010_write_reg(client, reg.number, reg.value); ++ //mutex_unlock(lock); ++ break; ++ ++ case RTC_VL_READ: ++ //mutex_lock(lock); ++ ret = rx8010_read_reg(client, RX8010_REG_FLAG, ®.value); ++ //mutex_unlock(lock); ++ if (! ret) ++ { ++ tmp = !!(reg.value & RX8010_BIT_FLAG_VLF); ++ return copy_to_user(argp, &tmp, sizeof(tmp)) ? -EFAULT : 0; ++ } ++ break; ++ ++ case RTC_VL_CLR: ++ //mutex_lock(lock); ++ ret = rx8010_read_reg(client, RX8010_REG_FLAG, ®.value); ++ if (! ret) ++ { ++ reg.value &= ~RX8010_BIT_FLAG_VLF; ++ ret = rx8010_write_reg(client, RX8010_REG_FLAG, reg.value); ++ } ++ //mutex_unlock(lock); ++ break; ++ ++ default: ++ return -ENOIOCTLCMD; ++ } ++ ++ return ret; ++} ++ ++static struct rtc_class_ops rx8010_rtc_ops = { ++ .read_time = rx8010_get_time, ++ .set_time = rx8010_set_time, ++ .read_alarm = rx8010_read_alarm, ++ .set_alarm = rx8010_set_alarm, ++ .alarm_irq_enable = rx8010_alarm_irq_enable, ++ .ioctl = rx8010_ioctl, ++}; ++ ++//---------------------------------------------------------------------- ++// rx8010_probe() ++// probe routine for the rx8010 driver ++// ++//---------------------------------------------------------------------- ++static int rx8010_probe(struct i2c_client *client, const struct i2c_device_id *id) ++{ ++ struct device_node *np = client->dev.of_node; ++ struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); ++ struct rx8010_data *rx8010; ++ int err, gpio, i, irqs_success = 0, need_reset = 0; ++ const char * irq_name[2] = {"rx8010-irq_1", "rx8010-irq_2"}; ++ ++ if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_I2C_BLOCK)) { ++ dev_err(&adapter->dev, "doesn't support required functionality\n"); ++ err = -EIO; ++ goto errout; ++ } ++ ++ rx8010 = devm_kzalloc(&client->dev, sizeof(struct rx8010_data), GFP_KERNEL); ++ if (!rx8010) { ++ dev_err(&adapter->dev, "failed to alloc memory\n"); ++ err = -ENOMEM; ++ goto errout; ++ } ++ ++ rx8010->client = client; ++ i2c_set_clientdata(client, rx8010); ++ ++ err = rx8010_init_client(client, &need_reset); ++ if (err) ++ goto errout; ++ ++ ++ if (need_reset) { ++ struct rtc_time tm; ++ rtc_time_to_tm(0, &tm); // set to 1970/1/1 ++ rx8010_set_time(&client->dev, &tm); ++ dev_warn(&client->dev, " - time reset to 1970/1/1\n"); ++ } ++ ++ rx8010->rtc = rtc_device_register(client->name, &client->dev, &rx8010_rtc_ops, THIS_MODULE); ++ ++ if (IS_ERR(rx8010->rtc)) { ++ err = PTR_ERR(rx8010->rtc); ++ dev_err(&client->dev, "unable to register the class device\n"); ++ goto errout; ++ } ++ ++ // get interrupts ++ rx8010->irq_1 = rx8010->irq_2 = -1; ++ for ( i=0; i < 2; i++ ) ++ { ++ gpio = of_get_named_gpio(np, irq_name[i], 0); ++ if (gpio_is_valid(gpio)) { ++ int irq; ++ err = devm_gpio_request_one(&client->dev, gpio, GPIOF_DIR_IN, ++ irq_name[i]); ++ if (err) { ++ dev_err(&client->dev, "cannot request %s\n", irq_name[i]); ++ goto errout_reg; ++ } ++ irq = gpio_to_irq(gpio); ++ dev_dbg(&client->dev, "%s %d\n", irq_name[i], irq); ++ if (irq <= 0) { ++ dev_warn(&client->dev, "Failed to " ++ "convert gpio #%d to %s\n", ++ gpio, irq_name[i]); ++ goto errout_reg; ++ } ++ err = devm_request_threaded_irq(&client->dev,irq, NULL, ++ i==0 ? rx8010_irq_1 : rx8010_irq_2, ++ IRQF_TRIGGER_LOW | IRQF_ONESHOT, ++ irq_name[i], ++ client); ++ if (err) { ++ dev_err(&client->dev, "unable to request %s\n", irq_name[i]); ++ goto errout_reg; ++ } ++ if (i == 0) ++ { ++ rx8010->irq_1 = irq; ++ INIT_WORK(&rx8010->work_1, rx8010_work_1); ++ } ++ else ++ { ++ rx8010->irq_2 = irq; ++ INIT_WORK(&rx8010->work_2, rx8010_work_2); ++ } ++ irqs_success++; ++ } else { ++ dev_warn(&client->dev, "%s missing or invalid\n", ++ irq_name[i]); ++ } ++ } ++ ++ // another irq request try if one failed above ++ if ( ! irqs_success && client->irq > 0 ){ ++ dev_info(&client->dev, "IRQ %d supplied\n", client->irq); ++ err = devm_request_threaded_irq(&client->dev,client->irq, NULL, ++ rx8010_irq_1, ++ IRQF_TRIGGER_LOW | IRQF_ONESHOT, ++ "rx8010", client); ++ ++ if (err) { ++ dev_err(&client->dev, "unable to request IRQ\n"); ++ goto errout_reg; ++ } ++ INIT_WORK(&rx8010->work_1, rx8010_work_1); ++ } ++ ++ ++ rx8010->rtc->irq_freq = 1; ++ rx8010->rtc->max_user_freq = 1; ++ ++ return 0; ++ ++errout_reg: ++ rtc_device_unregister(rx8010->rtc); ++ ++errout: ++ dev_err(&adapter->dev, "probing for rx8010 failed\n"); ++ return err; ++} ++ ++//---------------------------------------------------------------------- ++// rx8010_remove() ++// remove routine for the rx8010 driver ++// ++//---------------------------------------------------------------------- ++static int rx8010_remove(struct i2c_client *client) ++{ ++ struct rx8010_data *rx8010 = i2c_get_clientdata(client); ++ struct mutex *lock = &rx8010->rtc->ops_lock; ++ ++ if (client->irq > 0 || rx8010->irq_1 > 0 || rx8010->irq_2 > 0) { ++ mutex_lock(lock); ++ rx8010->exiting = 1; ++ mutex_unlock(lock); ++ ++ //cancel_work ++ if (rx8010->irq_1 > 0 || client->irq > 0) ++ cancel_work_sync(&rx8010->work_1); ++ if (rx8010->irq_2 > 0) ++ cancel_work_sync(&rx8010->work_2); ++ } ++ ++ rtc_device_unregister(rx8010->rtc); ++ ++ return 0; ++} ++ ++static struct i2c_driver rx8010_driver = { ++ .driver = { ++ .name = "rtc-rx8010", ++ .owner = THIS_MODULE, ++ }, ++ .probe = rx8010_probe, ++ .remove = rx8010_remove, ++ .id_table = rx8010_id, ++}; ++ ++module_i2c_driver(rx8010_driver); ++ ++MODULE_AUTHOR("Dennis Henderson <[email protected]>"); ++MODULE_DESCRIPTION("RX-8010 SJ RTC driver"); ++MODULE_LICENSE("GPL"); +-- +2.5.0 +
recipes-kernel/linux/linux-ge-3.14/0002-mfd-da9063-Add-support-for-production-silicon-varian.patch new file +101 -0
101 lines not on this page · raw message
recipes-kernel/linux/linux-ge-3.14/0003-mfd-da9063-Upgrade-of-register-definitions-to-suppor.patch new file +257 -0
257 lines not on this page · raw message
recipes-kernel/linux/linux-ge-3.14/0004-rtc-da9063-RTC-driver.patch new file +399 -0
399 lines not on this page · raw message
recipes-kernel/linux/linux-ge-3.14/0005-mfd-da9063-Add-support-for-AD-silicon-variant.patch new file +582 -0
582 lines not on this page · raw message
recipes-kernel/linux/linux-ge-3.14/0006-mfd-da9063-Get-irq-base-dynamically-before-registeri.patch new file +42 -0
42 lines not on this page · raw message
recipes-kernel/linux/linux-ge-3.14/0007-mfd-da9063-Add-support-for-OnKey-driver.patch new file +114 -0
114 lines not on this page · raw message
recipes-kernel/linux/linux-ge-3.14/0008-ahci_imx-Make-receive-DPLL-mode-configurable.patch new file +51 -0
51 lines not on this page · raw message
recipes-kernel/linux/linux-ge-3.14/0009-PCI-imx6-Add-DT-bindings-to-configure-PHY-Tx-driver-.patch new file +112 -0
112 lines not on this page · raw message
recipes-kernel/linux/linux-ge-3.14/0010-ARM-dts-imx-Add-support-for-Advantech-GE-ELO.patch new file +817 -0
322 lines not on this page · raw message
recipes-kernel/linux/linux-ge-3.14/defconfig new file +453 -0
453 lines not on this page · raw message
recipes-kernel/linux/linux-ge_3.14.bb new file +25 -0
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.5.0
Part of the diff is not shown here. View the raw message.
PATCH 3/3 imx6q-elo: Add machine configuration
In reply to Justin WatersThis commit adds support for the Advantech/General Electric ELO board, which is based on the DMS-BA16 Qseven module from Advantech.
The DMS-BA16 module supports:
- Freescale ARM Cortex-A9 i.MX6 Dual/Quad Core 1 GHz high performance processor
- Up to 2GB Onboard DDR3 Memory; Up to 32GB Onboard eMMC NAND Flash
- Supports OpenGL ES 2.0 and OpenVG 1.1
- HDMI, 24-bit LVDS
- 1x UART
- 2x I2C
- 8x GPIO
- 4x Host USB 2.0 port
- 1x USB OTG port
- 1x micro SD (SDHC)
- 1x SDIO
- 1x SATA II
- 1x 10/100/1000 Mbps Ethernet
- 1x PCIe X1 Gen1
For more information about this product, please visit:
http://www.advantech.com/products/medical_computing_system/dms-ba16/mod_64aa1566-169c-483d-97c8-c2c22c163fc3
--- conf/machine/imx6q-elo.conf | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 conf/machine/imx6q-elo.conf
conf/machine/imx6q-elo.conf new file +23 -0
@@ -0,0 +1,23 @@ +#@TYPE: Machine +#@NAME: General Electric ELO +#@SOC: i.MX6Q +#@DESCRIPTION: Machine configuration for Advantech/GE ELO system +#@MAINTAINER: Justin Waters <[email protected]> + +include conf/machine/include/imx-base.inc +include conf/machine/include/tune-cortexa9.inc + +SOC_FAMILY = "mx6:mx6q" + +PREFERRED_PROVIDER_virtual/bootloader = "u-boot-ge" +PREFERRED_PROVIDER_u-boot = "u-boot-ge" +UBOOT_MACHINE = "ge_elo_yocto_defconfig" + +PREFERRED_PROVIDER_virtual/kernel = "linux-ge" +PREFERRED_PROVIDER_kernel = "linux-ge" +KERNEL_DEVICETREE = "imx6q-elo.dtb" +KERNEL_IMAGETYPE = "uImage" + +MACHINE_FEATURES += "pci" + +SERIAL_CONSOLE = "115200 ttymxc3"
Signature · 1 line
2.5.0
Quoted 3 lines · Justin Waters
This series adds support for the Advantech DMS-BA16 i.MX6Q module on the GE ELO baseboard.
The kernel and u-boot are forks of the fslc 3.14-1.1.x and 2015.10+fslc branches, respectively.
As said in the patches, I am awaiting the update to the current releases :-)
Signature · 3 lines
Otavio Salvador O.S. Systems http://www.ossystems.com.br http://code.ossystems.com.br Mobile: +55 (53) 9981-7854 Mobile: +1 (347) 903-9750