Skip to content

Instantly share code, notes, and snippets.

@neuschaefer
Created February 7, 2019 22:12
Show Gist options
  • Save neuschaefer/27cacf0acf5411219be9372d728d1163 to your computer and use it in GitHub Desktop.
Save neuschaefer/27cacf0acf5411219be9372d728d1163 to your computer and use it in GitHub Desktop.
Kobo Aura DT
// SPDX-License-Identifier: GPL-2.0+
// Copyright 2019 Jonathan Neuschäfer
//
// The Kobo Aura e-book reader, model N514. The mainboard is marked as E606F0B.
/dts-v1/;
#include "imx50.dtsi"
#include <dt-bindings/input/input.h>
/ {
model = "Kobo Aura (N514)";
compatible = "kobo,aura", "fsl,imx50";
chosen {
stdout-path = "serial1:115200n8";
};
memory@70000000 {
device_type = "memory";
reg = <0x70000000 0x10000000>;
};
gpio-leds {
compatible = "gpio-leds";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_leds>;
on {
label = "kobo_aura:orange:on";
gpios = <&gpio6 24 GPIO_ACTIVE_LOW>;
linux,default-trigger = "heartbeat"; /* TODO: remove */
panic-indicator; /* TODO: test */
};
};
gpio-keys {
compatible = "gpio-keys";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_gpiokeys>;
power {
label = "Power Button";
gpios = <&gpio4 10 GPIO_ACTIVE_LOW>;
linux,code = <KEY_POWER>;
};
hallsensor {
label = "Hallsensor";
gpios = <&gpio5 15 GPIO_ACTIVE_LOW>;
linux,code = <0>;
linux,input-type = <5>;
};
frontlight {
label = "Frontlight";
gpios = <&gpio4 1 GPIO_ACTIVE_LOW>;
linux,code = <KEY_DISPLAYTOGGLE>;
};
};
vmmc: gpio-regulator {
compatible = "regulator-gpio";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_vmmc>;
regulator-name = "vmmc";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
enable-gpio = <&gpio4 13 GPIO_ACTIVE_HIGH>;
startup-delay-us = <100000>;
};
spi {
compatible = "spi-gpio";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_sd1_gpio>;
status = "disabled";
#address-cells = <1>;
#size-cells = <0>;
sck-gpios = <&gpio5 0 GPIO_ACTIVE_HIGH>; /* SD1_CLK */
miso-gpios = <&gpio5 2 GPIO_ACTIVE_HIGH>; /* SD1_D0 */
mosi-gpios = <&gpio5 1 GPIO_ACTIVE_HIGH>; /* SD1_CMD */
cs-gpios = <&gpio5 5 GPIO_ACTIVE_LOW>; /* SD1_D3 */
num-chipselects = <1>;
mmc@0 {
compatible = "mmc-spi-slot";
reg = <0>;
spi-max-frequency = <25000000>;
bus-width = <1>;
voltage-ranges = <3200 3400>;
gpios = <&gpio5 17 GPIO_ACTIVE_LOW>; /* SD2_CD (really) */
};
};
};
&iomuxc {
pinctrl_uart2: uart2 {
fsl,pins = <
MX50_PAD_UART2_TXD__UART2_TXD_MUX 0x1e4
MX50_PAD_UART2_RXD__UART2_RXD_MUX 0x1e4
>;
};
pinctrl_i2c1: i2c1 {
fsl,pins = <
MX50_PAD_I2C1_SCL__I2C1_SCL 0x400001fd
MX50_PAD_I2C1_SDA__I2C1_SDA 0x400001fd
>;
};
pinctrl_i2c3: i2c3 {
fsl,pins = <
MX50_PAD_I2C3_SCL__I2C3_SCL 0x400001fd
MX50_PAD_I2C3_SDA__I2C3_SDA 0x400001fd
>;
};
/* TODO: interrupt line
pinctrl_msp430: msp430 {
fsl,pins = < >;
}; */
pinctrl_leds: leds {
fsl,pins = <
MX50_PAD_PWM1__GPIO6_24 0x0
>;
};
pinctrl_gpiokeys: gpiokeys {
fsl,pins = <
MX50_PAD_CSPI_MISO__GPIO4_10 0x0
MX50_PAD_SD2_D7__GPIO5_15 0x0
MX50_PAD_KEY_ROW0__GPIO4_1 0x0
>;
};
pinctrl_sd1: sd1 {
fsl,pins = <
#if 1
/* From u-boot */
MX50_PAD_SD1_CMD__ESDHC1_CMD 0x1e4
MX50_PAD_SD1_CLK__ESDHC1_CLK 0xd4
MX50_PAD_SD1_D0__ESDHC1_DAT0 0x1d4
MX50_PAD_SD1_D1__ESDHC1_DAT1 0x1d4
MX50_PAD_SD1_D2__ESDHC1_DAT2 0x1d4
MX50_PAD_SD1_D3__ESDHC1_DAT3 0x1d4
#else
/* From kernel */
MX50_PAD_SD1_CMD__ESDHC1_CMD 0x400000d3
MX50_PAD_SD1_CLK__ESDHC1_CLK 0x400000d3
MX50_PAD_SD1_D0__ESDHC1_DAT0 0xd3
MX50_PAD_SD1_D1__ESDHC1_DAT1 0xd3
MX50_PAD_SD1_D2__ESDHC1_DAT2 0xd3
MX50_PAD_SD1_D3__ESDHC1_DAT3 0xd3
#endif
/* Card detect GPIO */
MX50_PAD_SD2_CD__GPIO5_17 0x0
>;
};
pinctrl_sd1_gpio: sd1-gpio {
fsl,pins = <
MX50_PAD_SD1_CMD__GPIO5_1 0x0
MX50_PAD_SD1_CLK__GPIO5_0 0x0
MX50_PAD_SD1_D0__GPIO5_2 0x0
MX50_PAD_SD1_D1__GPIO5_3 0x0
MX50_PAD_SD1_D2__GPIO5_4 0x0
MX50_PAD_SD1_D3__GPIO5_5 0x0
MX50_PAD_SD2_CD__GPIO5_17 0x0
>;
};
pinctrl_vmmc: vmmc {
fsl,pins = <
MX50_PAD_ECSPI1_MOSI__GPIO4_13 0x0
>;
};
pinctrl_sd2: sd2 {
/* TODO: check the mode flags */
fsl,pins = <
MX50_PAD_SD2_CMD__ESDHC2_CMD 0x1e4
MX50_PAD_SD2_CLK__ESDHC2_CLK 0xd4
MX50_PAD_SD2_D0__ESDHC2_DAT0 0x1d4
MX50_PAD_SD2_D1__ESDHC2_DAT1 0x1d4
MX50_PAD_SD2_D2__ESDHC2_DAT2 0x1d4
MX50_PAD_SD2_D3__ESDHC2_DAT3 0x1d4
MX50_PAD_SD2_D4__ESDHC2_DAT4 0x1d4
MX50_PAD_SD2_D5__ESDHC2_DAT5 0x1d4
MX50_PAD_SD2_D6__ESDHC2_DAT6 0x1d4
MX50_PAD_SD2_D7__ESDHC2_DAT7 0x1d4
>;
};
pinctrl_sd3: sd3 {
/* TODO: check the mode flags */
fsl,pins = <
MX50_PAD_SD3_CMD__ESDHC3_CMD 0x1e4
MX50_PAD_SD3_CLK__ESDHC3_CLK 0xd4
MX50_PAD_SD3_D0__ESDHC3_DAT0 0x1d4
MX50_PAD_SD3_D1__ESDHC3_DAT1 0x1d4
MX50_PAD_SD3_D2__ESDHC3_DAT2 0x1d4
MX50_PAD_SD3_D3__ESDHC3_DAT3 0x1d4
MX50_PAD_SD3_D4__ESDHC3_DAT4 0x1d4
MX50_PAD_SD3_D5__ESDHC3_DAT5 0x1d4
MX50_PAD_SD3_D6__ESDHC3_DAT6 0x1d4
MX50_PAD_SD3_D7__ESDHC3_DAT7 0x1d4
>;
};
};
&uart2 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_uart2>;
status = "okay";
};
&i2c1 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_i2c1>;
status = "okay";
/* TODO: ektf2132 touch controller at 0x15 */
};
&i2c3 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_i2c3>;
status = "okay";
embedded-controller@43 {
//pinctrl-names = "default";
//pinctrl-0 = <&pinctrl_msp430>;
compatible = "netronix,msp430-ec";
reg = <0x43>;
system-power-controller;
};
};
&esdhc1 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_sd1>;
max-frequency = <50000000>;
bus-width = <4>;
cd-gpios = <&gpio5 17 GPIO_ACTIVE_LOW>;
disable-wp;
/* External µSD card */
};
&esdhc2 {
//status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_sd2>;
//bus-width = <8>;
bus-width = <4>;
max-frequency = <25000000>;
disable-wp;
/* CyberTan WC121 SDIO WiFi */
// Required function subnode properties:
// - reg: Must contain the SDIO function number of the function this subnode
// describes. A value of 0 denotes the memory SD function, values from
// 1 to 7 denote the SDIO functions. [TODO?]
};
&esdhc3 {
//status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_sd3>;
//bus-width = <8>;
bus-width = <4>;
broken-cd; /* TODO */
max-frequency = <50000000>;
disable-wp;
vmmc-supply = <&vmmc>;
/* Internal eMMC */
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment