From bba0c012b824c8281b16e120126e3d6f8c09b01f Mon Sep 17 00:00:00 2001 From: Tomasz Maciej Nowak Date: Mon, 1 Apr 2019 19:25:43 +0200 Subject: [PATCH] tegra: add support for CompuLab TrimSlice MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It is a small form factor computer with rich amount of expansion ports. Some hardware specs and supported features in this commit: CPU: NVIDIA Tegra 2 @ 1GHz RAM: 1GB DDR2-667 Storage: SDHC card slot µSDHC card slot USB to SATA bridge (depends on model) 1MB SPI NOR flash for bootloader (single partition) LAN: RTL8111DL GbE WIFI: RT3070 b/g/n with external antenna (depends on model) RTC: EM3027 (mapped as rtc0; with battery backup) Tegra 2 built-in (mapped as rtc1) Sound: Analog/Digital (TLV320AIC23b; S/PDIF not tested) Connectors: 4x USB 2.0 RS232 (mini serial) HDMI DVI-D (depends on model, not supported atm) Extension connector (24 pin ZIF, 0.5mm pitch): 2X UART SPI JTAG (1.8V) Other: power button with green led (not functional for early revisions without programmed PMIC) 2x GPIO configurable green led TrimSlice uses U-Boot placed in NOR flash. Boots Linux from any media connected to USB, SATA or SD card inserted in slot. Can also boot from TFTP. To run OpenWrt one needs to update U-Boot to fairly recent version (the versions, pre-dts/dts provided by CompuLab won't suffice): 1. Boot TrimSlice into Your current linux distro, 2. Download trimslice-spi.img from u-boot-trimslice subdir, 3. Install mtd-utils, 4. Run following commands: flash_erase /dev/mtd0 0 256 nandwrite /dev/mtd0 trimslice-spi.img 5. Poweroff, insert SD card with OpenWrt, boot and enjoy. If by some obstacle You can't follow those instructions, it is possible to flash U-Boot using serial console. 1. Insert FAT or EXT2/EXT3 formatted SD card with trimslice-spi.img, 2. Interrupt boot process to enter U-Boot command line, 3. Run following commands: ${fs}load mmc 0 0x04080000 trimslice-spi.img sf probe 0 sf erase 0 0x100000 sf write 0x04080000 0x0 ${filesize} reset 4. Poweroff, insert SD card with OpenWrt, boot and enjoy. If something went wrong with one of above steps, there is simple recovery option: 1. Open the µSD slot security door to access the recovery-boot button, 2. Insert SD card with OpenWrt to the front slot while unpowered, 3. Power on the TrimSlice while pressing the recovery-boot button, 4. With this it should boot straigth to OpenWrt, from there download trimslice-spi.img and execute following commands: mtd erase /dev/mtd0 mtd write trimslice-spi.img /dev/mtd0 5. Reboot, now it should boot straigth to OpenWrt, without pressing the recovery-boot button, with proper U-Boot flashed. Signed-off-by: Tomasz Maciej Nowak --- target/linux/tegra/config-4.14 | 4 +- target/linux/tegra/image/Makefile | 10 ++++ ...enable-front-panel-leds-in-TrimSlice.patch | 46 +++++++++++++++++++ 3 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 target/linux/tegra/patches-4.14/101-ARM-dtc-tegra-enable-front-panel-leds-in-TrimSlice.patch diff --git a/target/linux/tegra/config-4.14 b/target/linux/tegra/config-4.14 index 3df360d1fc..42547da301 100644 --- a/target/linux/tegra/config-4.14 +++ b/target/linux/tegra/config-4.14 @@ -482,10 +482,12 @@ CONFIG_SND_SOC_TEGRA20_SPDIF=y # CONFIG_SND_SOC_TEGRA_RT5640 is not set # CONFIG_SND_SOC_TEGRA_RT5677 is not set # CONFIG_SND_SOC_TEGRA_SGTL5000 is not set -# CONFIG_SND_SOC_TEGRA_TRIMSLICE is not set +CONFIG_SND_SOC_TEGRA_TRIMSLICE=y # CONFIG_SND_SOC_TEGRA_WM8753 is not set # CONFIG_SND_SOC_TEGRA_WM8903 is not set # CONFIG_SND_SOC_TEGRA_WM9712 is not set +CONFIG_SND_SOC_TLV320AIC23=y +CONFIG_SND_SOC_TLV320AIC23_I2C=y # CONFIG_SND_USB is not set CONFIG_SOC_BUS=y CONFIG_SOC_TEGRA_FLOWCTRL=y diff --git a/target/linux/tegra/image/Makefile b/target/linux/tegra/image/Makefile index 5e3427ad27..706cc65d92 100644 --- a/target/linux/tegra/image/Makefile +++ b/target/linux/tegra/image/Makefile @@ -46,4 +46,14 @@ define Device/Default PROFILES := Default endef +define Device/trimslice + DEVICE_TITLE := CompuLab TrimSlice + DEVICE_DTS := tegra20-trimslice + DEVICE_PACKAGES := kmod-r8169 kmod-rt2800-usb kmod-rtc-em3027 \ + kmod-usb-storage wpad-mini + SUPPORTED_DEVICES := compulab,trimslice + UBOOT := trimslice-mmc +endef +TARGET_DEVICES += trimslice + $(eval $(call BuildImage)) diff --git a/target/linux/tegra/patches-4.14/101-ARM-dtc-tegra-enable-front-panel-leds-in-TrimSlice.patch b/target/linux/tegra/patches-4.14/101-ARM-dtc-tegra-enable-front-panel-leds-in-TrimSlice.patch new file mode 100644 index 0000000000..ae48e8d862 --- /dev/null +++ b/target/linux/tegra/patches-4.14/101-ARM-dtc-tegra-enable-front-panel-leds-in-TrimSlice.patch @@ -0,0 +1,46 @@ +--- a/arch/arm/boot/dts/tegra20-trimslice.dts ++++ b/arch/arm/boot/dts/tegra20-trimslice.dts +@@ -200,16 +200,17 @@ + conf_ata { + nvidia,pins = "ata", "atc", "atd", "ate", + "crtp", "dap2", "dap3", "dap4", "dta", +- "dtb", "dtc", "dtd", "dte", "gmb", +- "gme", "i2cp", "pta", "slxc", "slxd", +- "spdi", "spdo", "uda"; ++ "dtb", "dtc", "dtd", "gmb", "gme", ++ "i2cp", "pta", "slxc", "slxd", "spdi", ++ "spdo", "uda"; + nvidia,pull = ; + nvidia,tristate = ; + }; + conf_atb { + nvidia,pins = "atb", "cdev1", "cdev2", "dap1", +- "gma", "gmc", "gmd", "gpu", "gpu7", +- "gpv", "sdio1", "slxa", "slxk", "uac"; ++ "dte", "gma", "gmc", "gmd", "gpu", ++ "gpu7", "gpv", "sdio1", "slxa", "slxk", ++ "uac"; + nvidia,pull = ; + nvidia,tristate = ; + }; +@@ -402,6 +403,20 @@ + }; + }; + ++ gpio-leds { ++ compatible = "gpio-leds"; ++ ++ ds2 { ++ label = "trimslice:green:right"; ++ gpios = <&gpio TEGRA_GPIO(D, 2) GPIO_ACTIVE_LOW>; ++ }; ++ ++ ds3 { ++ label = "trimslice:green:left"; ++ gpios = <&gpio TEGRA_GPIO(BB, 5) GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ + poweroff { + compatible = "gpio-poweroff"; + gpios = <&gpio TEGRA_GPIO(X, 7) GPIO_ACTIVE_LOW>;