From patchwork Mon Mar 4 18:53:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tomasz Maciej Nowak X-Patchwork-Id: 1051301 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=o2.pl Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="h9HBXX67"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44Cq146w7Mz9s3q for ; Tue, 5 Mar 2019 05:53:28 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=zGMmxkWmgfwvfz889N/rEmPN350+Rdl5HiMIm0ejtwg=; b=h9HBXX67HsODk8ISIJM1sXzuRT 0F4Zny6rmqwa1BY9/zR8QW+it0lmhyzJfiG8aO70bXhfhR/TRHy7llQp3IPqHvtLRHhbwE7w+ZJLK GbOAoFdl3X4VngCzpSfx+rDAc80HZpm5W1EoeTrPjArNSpaoP5sH4LNBNbOCZCThTyypbFPR52IAg XHaX5tUSaAYNlyXFz0NmukxaFBNMVM2E1RVCelNMbRkIsTr83jrgUK1ZIuasy1fMoJKWNc8A6WMI5 YhfeQ2bUmQE904BjsaXN6uM6XpnNMxl+P1WRTWoXkMqOsJfVrC5Y4Gt6xEpYl/jFvxgwz38tgeCgI 67tGU3UQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h0siH-00068I-SN; Mon, 04 Mar 2019 18:53:21 +0000 Received: from mx-out.tlen.pl ([193.222.135.158]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h0sh7-0004DL-3E for openwrt-devel@lists.openwrt.org; Mon, 04 Mar 2019 18:52:19 +0000 Received: (wp-smtpd smtp.tlen.pl 1308 invoked from network); 4 Mar 2019 19:52:07 +0100 Received: from pub-59.183.29.194.multiplay.pl (HELO localhost.localdomain) (tomek_n@o2.pl@[194.29.183.59]) (envelope-sender ) by smtp.tlen.pl (WP-SMTPD) with ECDHE-RSA-AES256-GCM-SHA384 encrypted SMTP for ; 4 Mar 2019 19:52:07 +0100 From: Tomasz Maciej Nowak To: openwrt-devel@lists.openwrt.org Date: Mon, 4 Mar 2019 19:53:25 +0100 Message-Id: <20190304185326.9234-7-tomek_n@o2.pl> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190304185326.9234-1-tomek_n@o2.pl> References: <20190304185326.9234-1-tomek_n@o2.pl> MIME-Version: 1.0 X-WP-MailID: a6eb48400cdb7695a053ce811b9dc113 X-WP-AV: skaner antywirusowy Poczty o2 X-WP-SPAM: NO 000000A [QbN0] X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190304_105209_709061_2BD068EE X-CRM114-Status: GOOD ( 10.80 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (tomek_n[at]o2.pl) -0.0 SPF_PASS SPF: sender matches SPF record Subject: [OpenWrt-Devel] [PATCH 6/7] tegra: add support for CompuLab TrimSlice X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org It is 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 --- package/kernel/linux/modules/sound.mk | 21 ++++++++- target/linux/tegra/image/Makefile | 10 ++++ ...enable-front-panel-leds-in-TrimSlice.patch | 46 +++++++++++++++++++ 3 files changed, 76 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/package/kernel/linux/modules/sound.mk b/package/kernel/linux/modules/sound.mk index 0c20cc6c9d..446f5d9c91 100644 --- a/package/kernel/linux/modules/sound.mk +++ b/package/kernel/linux/modules/sound.mk @@ -283,7 +283,6 @@ define KernelPackage/sound-soc-tegra20 CONFIG_SND_HDA_TEGRA=n \ CONFIG_SND_SOC_TEGRA30_AHUB=n \ CONFIG_SND_SOC_TEGRA30_I2S=n \ - CONFIG_SND_SOC_TEGRA_TRIMSLICE=n \ CONFIG_SND_SOC_TEGRA_ALC5632=n \ CONFIG_SND_SOC_TEGRA_MAX98090=n \ CONFIG_SND_SOC_TEGRA_RT5640=n \ @@ -325,6 +324,26 @@ endef $(eval $(call KernelPackage,sound-soc-tegra20-spdif)) +define KernelPackage/sound-soc-tegra-trimslice + TITLE:=TrimSlice sound support + KCONFIG:= \ + CONFIG_SND_SOC_TEGRA_TRIMSLICE=y + FILES:= \ + $(LINUX_DIR)/sound/soc/tegra/snd-soc-tegra-trimslice.ko \ + $(LINUX_DIR)/sound/soc/codecs/snd-soc-tlv320aic23.ko \ + $(LINUX_DIR)/sound/soc/codecs/snd-soc-tlv320aic23-i2c.ko + AUTOLOAD:=$(call AutoProbe,snd-soc-tegra-trimslice snd-soc-tlv320aic23 snd-soc-tlv320aic23-i2c) + DEPENDS:= @TARGET_tegra +kmod-sound-soc-tegra20 + $(call AddDepends/sound) +endef + +define KernelPackage/sound-soc-tegra-trimslice/description + CompuLab TrimSlice built-in audio support +endef + +$(eval $(call KernelPackage,sound-soc-tegra-trimslice)) + + define KernelPackage/pcspkr DEPENDS:=@TARGET_x86 +kmod-input-core TITLE:=PC speaker support diff --git a/target/linux/tegra/image/Makefile b/target/linux/tegra/image/Makefile index 5e3427ad27..2b1380bec7 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-rtc-em3027 kmod-rt2800-usb \ + 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>;