Skip to contentSkip to conversation

Add Kindle generation 6/7 support

PATCH Superseded Alexander Kurz 2 participants 4 messages Nov 17, 2025

Subsystems (5)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover Add Kindle generation 6/7 support

Changes in v2:
- Link to v1: https://lore.barebox.org/barebox/[email protected]/
- Remove explicit RAM size settings from lowlevel.c and dts since this can be autodetected. As consequence, both DP75SDI variants (Paperwhite 2 and 3) now share the same dts.
- Rebase to current
- Attempts to use barebox,deep-probe did unfortunately not work yet. Brief description of the problem:
Device specific data is stored in /dev/mmc1.boot0.userdata, this data is read by barebox and passed as ATAGs to the vendor kernel, without this data, the device won't work properly.
An attempt has been made to use barebox,deep-probe (see patch below), however, mmc1 will not be available later, resulting e.g. in an error

Quoted 1 line

Could not read board info from /dev/mmc1.boot0.userdata

during startup.
Example patch:

# diff --git a/arch/arm/boards/kindle-mx6sl/board.c b/arch/arm/boards/kindle-mx6sl/board.c
index ff8083a756..5c18e074c9 100644
--- a/arch/arm/boards/kindle-mx6sl/board.c
+++ b/arch/arm/boards/kindle-mx6sl/board.c
@@ -194,15 +194,10 @@ late_initcall(kindle_mx6sl_late_init);

static int kindle6_device_init(void)
{
- struct device *dev;
-

        if (!is_mx6sl_kindle())
                return 0;
-       /* Probe the eMMC to allow reading the board serial and revision */
-       dev = get_device_by_name("mmc1");
-       if (dev)

- dev_set_param(dev, "probe", "1");
+ of_device_ensure_probed_by_alias("mmc1");

        defaultenv_append_directory(defaultenv_kindle_mx6sl);
# diff --git a/arch/arm/dts/imx6sl-kindle-dp75sdi.dts b/arch/arm/dts/imx6sl-kindle-dp75sdi.dts
index 9dc4a0c867..05fdd77a47 100644
--- a/arch/arm/dts/imx6sl-kindle-dp75sdi.dts
+++ b/arch/arm/dts/imx6sl-kindle-dp75sdi.dts
@@ -12,7 +12,7 @@
 / {
        model = "kindle-dp75sdi";
        compatible = "amazon,imx6sl-kindle-dp75sdi",  "fsl,imx6sl";
-       barebox,disable-deep-probe;
+       barebox,deep-probe;
 };

&iomuxc {

Alexander Kurz (1):
ARM i.MX6SL: Add Kindle generation 6/7 support

 .../boards/imx/amazon-kindle-6-7.rst          |  94 ++++++++
 arch/arm/boards/Makefile                      |   1 +
 arch/arm/boards/kindle-mx6sl/Makefile         |   5 +
 arch/arm/boards/kindle-mx6sl/board.c          | 212 ++++++++++++++++++
 .../defaultenv-kindle-mx6sl/boot/mmc_kernel   |  11 +
 .../defaultenv-kindle-mx6sl/init/pmic         |  32 +++
 .../defaultenv-kindle-mx6sl/init/usbserial    |   4 +
 .../nv/autoboot_timeout                       |   1 +
 .../defaultenv-kindle-mx6sl/nv/boot.default   |   1 +
 .../nv/linux.bootargs.base                    |   1 +
 .../nv/linux.bootargs.console                 |   1 +
 .../nv/linux.bootargs.video                   |   1 +
 .../flash-header-kindle-mx6sl-256m.imxcfg     | 126 +++++++++++
 .../flash-header-kindle-mx6sl-512m.imxcfg     | 126 +++++++++++
 arch/arm/boards/kindle-mx6sl/lowlevel.c       |  84 +++++++
 arch/arm/configs/kindle-gen-6-7_defconfig     |  89 ++++++++
 arch/arm/dts/Makefile                         |   3 +
 arch/arm/dts/imx6sl-kindle-common.dtsi        | 167 ++++++++++++++
 arch/arm/dts/imx6sl-kindle-dp75sdi.dts        |  51 +++++
 arch/arm/dts/imx6sl-kindle-nm460gz.dts        |  65 ++++++
 arch/arm/dts/imx6sl-kindle-wp63gw.dts         |  40 ++++
 arch/arm/mach-imx/Kconfig                     |  17 ++
 images/Makefile.imx                           |  21 ++
 23 files changed, 1153 insertions(+)
 create mode 100644 Documentation/boards/imx/amazon-kindle-6-7.rst
 create mode 100644 arch/arm/boards/kindle-mx6sl/Makefile
 create mode 100644 arch/arm/boards/kindle-mx6sl/board.c
 create mode 100644 arch/arm/boards/kindle-mx6sl/defaultenv-kindle-mx6sl/boot/mmc_kernel
 create mode 100644 arch/arm/boards/kindle-mx6sl/defaultenv-kindle-mx6sl/init/pmic
 create mode 100644 arch/arm/boards/kindle-mx6sl/defaultenv-kindle-mx6sl/init/usbserial
 create mode 100644 arch/arm/boards/kindle-mx6sl/defaultenv-kindle-mx6sl/nv/autoboot_timeout
 create mode 100644 arch/arm/boards/kindle-mx6sl/defaultenv-kindle-mx6sl/nv/boot.default
 create mode 100644 arch/arm/boards/kindle-mx6sl/defaultenv-kindle-mx6sl/nv/linux.bootargs.base
 create mode 100644 arch/arm/boards/kindle-mx6sl/defaultenv-kindle-mx6sl/nv/linux.bootargs.console
 create mode 100644 arch/arm/boards/kindle-mx6sl/defaultenv-kindle-mx6sl/nv/linux.bootargs.video
 create mode 100644 arch/arm/boards/kindle-mx6sl/flash-header-kindle-mx6sl-256m.imxcfg
 create mode 100644 arch/arm/boards/kindle-mx6sl/flash-header-kindle-mx6sl-512m.imxcfg
 create mode 100644 arch/arm/boards/kindle-mx6sl/lowlevel.c
 create mode 100644 arch/arm/configs/kindle-gen-6-7_defconfig
 create mode 100644 arch/arm/dts/imx6sl-kindle-common.dtsi
 create mode 100644 arch/arm/dts/imx6sl-kindle-dp75sdi.dts
 create mode 100644 arch/arm/dts/imx6sl-kindle-nm460gz.dts
 create mode 100644 arch/arm/dts/imx6sl-kindle-wp63gw.dts
Signature · 1 line
2.39.5
#1 lore raw

PATCH v2 1/1 ARM i.MX6SL: Add Kindle generation 6/7 support

Four Amazon Kindle 6th and 7th generation e-book readers were considered for this patch, referred by their models
* DP75SDI "PINOT_WFO" (256MB) "Kindle Paperwhite 2" 6th gen
* DP75SDI "Muscat WFO" (512MB) "Kindle Paperwhite 3" 7th gen
* WP63GW "Kindle" 7th gen (512MB)
* NM460GZ "Voyage" 7th gen (512MB)
Kindle e-book readers from generation 6 and 7 use the i.MX6SL and an are shipped with a factory-adapted u-boot image. Vendor software image updates for these models stopped around 2021 to 2023.

Add experimental support for the kindle gen 6/7 models and make barebox an optional drop-in replacement for the original bootloader. Required PMIC settings are implemented as script.

Notable features tested on all models:
- Support for eMMC, USB, UART, I2C and SPI.
- LPDDR2 setup is done via DCD, the same imximage may be used for USB-startup and for installation.
- Support for vendor specific ATAGs that are required by the Kindle-System.
- usbserial barebox console access for 10 seconds after startup.

Known issues:
- Reset on models kindle6-dp75sdi and nm460gz does not work and triggers microcode USB download boot.
- No recovery (without soldering) like USB boot known after e.g. a failed flashing attempt.

---
 .../boards/imx/amazon-kindle-6-7.rst          |  94 ++++++++
 arch/arm/boards/Makefile                      |   1 +
 arch/arm/boards/kindle-mx6sl/Makefile         |   5 +
 arch/arm/boards/kindle-mx6sl/board.c          | 212 ++++++++++++++++++
 .../defaultenv-kindle-mx6sl/boot/mmc_kernel   |  11 +
 .../defaultenv-kindle-mx6sl/init/pmic         |  32 +++
 .../defaultenv-kindle-mx6sl/init/usbserial    |   4 +
 .../nv/autoboot_timeout                       |   1 +
 .../defaultenv-kindle-mx6sl/nv/boot.default   |   1 +
 .../nv/linux.bootargs.base                    |   1 +
 .../nv/linux.bootargs.console                 |   1 +
 .../nv/linux.bootargs.video                   |   1 +
 .../flash-header-kindle-mx6sl-256m.imxcfg     | 126 +++++++++++
 .../flash-header-kindle-mx6sl-512m.imxcfg     | 126 +++++++++++
 arch/arm/boards/kindle-mx6sl/lowlevel.c       |  84 +++++++
 arch/arm/configs/kindle-gen-6-7_defconfig     |  89 ++++++++
 arch/arm/dts/Makefile                         |   3 +
 arch/arm/dts/imx6sl-kindle-common.dtsi        | 167 ++++++++++++++
 arch/arm/dts/imx6sl-kindle-dp75sdi.dts        |  51 +++++
 arch/arm/dts/imx6sl-kindle-nm460gz.dts        |  65 ++++++
 arch/arm/dts/imx6sl-kindle-wp63gw.dts         |  40 ++++
 arch/arm/mach-imx/Kconfig                     |  17 ++
 images/Makefile.imx                           |  21 ++
 23 files changed, 1153 insertions(+)
 create mode 100644 Documentation/boards/imx/amazon-kindle-6-7.rst
 create mode 100644 arch/arm/boards/kindle-mx6sl/Makefile
 create mode 100644 arch/arm/boards/kindle-mx6sl/board.c
 create mode 100644 arch/arm/boards/kindle-mx6sl/defaultenv-kindle-mx6sl/boot/mmc_kernel
 create mode 100644 arch/arm/boards/kindle-mx6sl/defaultenv-kindle-mx6sl/init/pmic
 create mode 100644 arch/arm/boards/kindle-mx6sl/defaultenv-kindle-mx6sl/init/usbserial
 create mode 100644 arch/arm/boards/kindle-mx6sl/defaultenv-kindle-mx6sl/nv/autoboot_timeout
 create mode 100644 arch/arm/boards/kindle-mx6sl/defaultenv-kindle-mx6sl/nv/boot.default
 create mode 100644 arch/arm/boards/kindle-mx6sl/defaultenv-kindle-mx6sl/nv/linux.bootargs.base
 create mode 100644 arch/arm/boards/kindle-mx6sl/defaultenv-kindle-mx6sl/nv/linux.bootargs.console
 create mode 100644 arch/arm/boards/kindle-mx6sl/defaultenv-kindle-mx6sl/nv/linux.bootargs.video
 create mode 100644 arch/arm/boards/kindle-mx6sl/flash-header-kindle-mx6sl-256m.imxcfg
 create mode 100644 arch/arm/boards/kindle-mx6sl/flash-header-kindle-mx6sl-512m.imxcfg
 create mode 100644 arch/arm/boards/kindle-mx6sl/lowlevel.c
 create mode 100644 arch/arm/configs/kindle-gen-6-7_defconfig
 create mode 100644 arch/arm/dts/imx6sl-kindle-common.dtsi
 create mode 100644 arch/arm/dts/imx6sl-kindle-dp75sdi.dts
 create mode 100644 arch/arm/dts/imx6sl-kindle-nm460gz.dts
 create mode 100644 arch/arm/dts/imx6sl-kindle-wp63gw.dts
Documentation/boards/imx/amazon-kindle-6-7.rst new file +94 -0
new file mode 100644
index 0000000000..c57d27afe4
@@ -0,0 +1,94 @@
+Amazon Kindle 6/7 (Paperwhite 2/3, Kindle 7th gen and Voyage)
+=============================================================
+
+Four models of the Amazon Kindle e-Book readers are considered as members
+of the 6th and 7th generation:
+
+* DP75SDI "PINOT_WFO" (256MB) "Kindle Paperwhite 2" 6th gen
+* DP75SDI "Muscat WFO" (512MB) "Kindle Paperwhite 3" 7th gen
+* WP63GW (512MB) "Kindle" 7th gen
+* NM460GZ (512MB) "Voyage" 7th gen
+
+Those e-book readers share a common set of hardware:
+
+* Freescale i.MX6SL SOC
+* 256MB or 512MB of LPDDR2
+* eMMC storage
+* MAX77696A PMIC
+
+The devices boot up in internal boot mode from eMMC boot partition 1
+and are shipped with a vendor modified u-boot imximage based on u-boot
+v2009.08.
+
+According to the availability of source code tarballs on the amazon website
+"Source Code Notice for Kindle E-Readers and Fire Tablets", factory image
+updates seem to have been terminated between 2021 and 2023.
+
+This device is battery-powered and there is no way to switch the device off.
+When the device is inactive, the Kindle software will first reduce the
+power consumption to a few milliamps of battery power, after some minutes
+the power consumption is further reduced to sub-milliamp level. Keeping
+iomux pullups switched on at standby may significantly drain your battery.
+
+Building barebox
+----------------
+
+``make kindle-gen-6-7_defconfig`` should get you a working config.
+
+Uploading barebox
+-----------------
+
+Similar to the 4/5 gen devices, console access to gen 6/7 kindles is
+available via the Micro-USB connector when a 30k Ohm resistor to GND
+is used on the sense pin: USB D- will become TXD, D+ RXD.
+
+From the uboot shell, the barebox image may be chainloaded e.g. like
+
+   .. code-block:: console
+
+        $ bist
+        $ loady 0x80000000
+        $ go 0x80001000
+
+Booting the devices from USB is more demanding and will likely require
+opening of the device and desoldering of a metal shield.
+All devices feature just a single power button which may be used to reset
+the device. Unlike the models of the 4th generation where a separate
+button is available to boot from USB, such buttons do not exist here.
+Button pads on the PCB are not populated and USB boot mode by
+pin-strapping seems to be disabled by fuse settings. To put the device
+into USB boot mode, the eMMC may be disabled temporarily.
+
+1. Connect the Kindle to your host computer with a USB cable.
+2. Disable the eMMC
+   * for the DP75SDI pull the left resistor left of TP806/TP807 (below
+     TP914) facing the eMMC to zero.
+2. Power down the device by holding the power button until the power LED goes
+   dark (about 12-15 seconds).
+3. Release the power button.
+4. Free the eMMC pin.
+5. After 10-20 seconds, a new USB device named ``SE Blank MEGREZ`` should
+   appear on your host computer.
+6. Use imx-usb-loader to boot from USB.
+
+   .. code-block:: console
+
+        $ scripts/imx/imx-usb-loader images/barebox-kindle6-dp75sdi.img
+
+A USB serial ACM console will be launched by a barebox init script
+for 10 seconds after boot.
+
+Installing barebox
+------------------
+
+Barebox may be used as drop-in replacement for the shipped bootloader, when
+the imximg fits into 384000 bytes, compression like IMAGE_COMPRESSION_XZKERN
+might be required for this. When installing the barebox imximg on
+the eMMC, take care not to overwrite the vendor supplied serial numbers and
+other data stored on the eMMC. All 6th and 7th gen devices seem to share the
+same disk layout. E.g. just write the imx-header and the application section:
+
+.. code-block:: console
+
+        $ loady -t usbserial
+        $ memcpy -s barebox-kindle6-dp75sdi.img -d /dev/mmc1.boot0 0x400 0x400 0x5dc00
arch/arm/boards/Makefile +1 -0
index f73285ede9..cc32dff2a5 100644
@@ -141,6 +141,7 @@ obj-$(CONFIG_MACH_TNY_A9260)			+= tny-a926x/
 obj-$(CONFIG_MACH_TNY_A9263)			+= tny-a926x/
 obj-$(CONFIG_MACH_TNY_A9G20)			+= tny-a926x/
 obj-$(CONFIG_MACH_KINDLE_MX50)			+= kindle-mx50/
+obj-$(CONFIG_MACH_KINDLE_6_7)			+= kindle-mx6sl/
 obj-$(CONFIG_MACH_TORADEX_COLIBRI_T20)		+= toradex-colibri-t20/
 obj-$(CONFIG_MACH_TOSHIBA_AC100)		+= toshiba-ac100/
 obj-$(CONFIG_MACH_TQMA53)			+= tqma53/
arch/arm/boards/kindle-mx6sl/Makefile new file +5 -0
new file mode 100644
index 0000000000..bb9aca5b96
@@ -0,0 +1,5 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+obj-y += board.o
+lwl-y += lowlevel.o
+bbenv-y += defaultenv-kindle-mx6sl
arch/arm/boards/kindle-mx6sl/board.c new file +212 -0

212 lines not on this page · raw message

arch/arm/boards/kindle-mx6sl/defaultenv-kindle-mx6sl/boot/mmc_kernel new file +11 -0
new file mode 100644
index 0000000000..518110b8fd
@@ -0,0 +1,11 @@
+#!/bin/sh
+# Boot the Amazon factory-shipped kernel uimage stored on
+# the eMMC at CONFIG_MMC_BOOTFLASH_ADDR 0x41000
+
+# Force ATAG boot
+global.bootm.boot_atag=true
+
+global linux.bootargs.dyn.log="log_pos_goal=0x8fff0000"
+global linux.bootargs.dyn.root="rootwait root=/dev/mmcblk0p1 ro"
+
+bootm -c /dev/mmc1.kernel
arch/arm/boards/kindle-mx6sl/defaultenv-kindle-mx6sl/init/pmic new file +32 -0
new file mode 100644
index 0000000000..efa02843e6
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+# MAX77696 PMIC setup.
+#
+# Common settings for gen 6/7 kindles
+# LDO_L07_CNFG1_REG
+i2c_write -b 0 -a 0x3c -r 0x4f 0x70
+# LDO_L10_CNFG1_REG
+i2c_write -b 0 -a 0x3c -r 0x55 0xf4
+
+i2c_write -b 0 -a 0x3c -r 0x2 0x36
+# BUCK_VOUT1_REG
+i2c_write -b 0 -a 0x3c -r 0x31 0x34
+# BUCK_VOUTCNFG1_REG
+i2c_write -b 0 -a 0x3c -r 0x39 0xd0
+# BUCK_VOUTCNFG2_REG
+i2c_write -b 0 -a 0x3c -r 0x3a 0xd0
+# BUCK_VOUTCNFG3_REG
+i2c_write -b 0 -a 0x3c -r 0x3b 0x40
+# BUCK_VOUTCNFG6_REG
+i2c_write -b 0 -a 0x3c -r 0x3e 0x70
+i2c_write -b 0 -a 0x3c -r 0x5e 0x04
+# VREG_EPDCNFG_REG
+i2c_write -b 0 -a 0x3c -r 0x60 0x00
+# VREG_EPDSEQ_REG / VDDQ_SET_REG
+i2c_write -b 0 -a 0x3c -r 0x69 0x18
+
+if [ "$global.model" = "kindle6-dp75sdi" -o "$global.model" = "kindle7-dp75sdi" ]; then
+	# Backlight not available on WP63GW.
+	i2c_write -b 0 -a 0x3c -r 0x6c 0x80
+	i2c_write -b 0 -a 0x3c -r 0x6d 0x20
+fi
arch/arm/boards/kindle-mx6sl/defaultenv-kindle-mx6sl/init/usbserial new file +4 -0
new file mode 100644
index 0000000000..c181c06da9
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+usbserial
+global.autoboot_timeout=10
arch/arm/boards/kindle-mx6sl/defaultenv-kindle-mx6sl/nv/autoboot_timeout new file +1 -0
new file mode 100644
index 0000000000..64bb6b746d
@@ -0,0 +1 @@
+30
arch/arm/boards/kindle-mx6sl/defaultenv-kindle-mx6sl/nv/boot.default new file +1 -0
new file mode 100644
index 0000000000..3118b7af45
@@ -0,0 +1 @@
+mmc_kernel
arch/arm/boards/kindle-mx6sl/defaultenv-kindle-mx6sl/nv/linux.bootargs.base new file +1 -0
new file mode 100644
index 0000000000..64d790aa7f
@@ -0,0 +1 @@
+ip=off
arch/arm/boards/kindle-mx6sl/defaultenv-kindle-mx6sl/nv/linux.bootargs.console new file +1 -0
new file mode 100644
index 0000000000..d775310b40
@@ -0,0 +1 @@
+console=ttymxc0,115200
arch/arm/boards/kindle-mx6sl/defaultenv-kindle-mx6sl/nv/linux.bootargs.video new file +1 -0
new file mode 100644
index 0000000000..9b4e01473b
@@ -0,0 +1 @@
+video=mxcepdcfb:E60,bpp=8,x_mem=3M
arch/arm/boards/kindle-mx6sl/flash-header-kindle-mx6sl-256m.imxcfg new file +126 -0

126 lines not on this page · raw message

arch/arm/boards/kindle-mx6sl/flash-header-kindle-mx6sl-512m.imxcfg new file +126 -0

126 lines not on this page · raw message

arch/arm/boards/kindle-mx6sl/lowlevel.c new file +84 -0

84 lines not on this page · raw message

arch/arm/configs/kindle-gen-6-7_defconfig new file +89 -0

89 lines not on this page · raw message

arch/arm/dts/Makefile +3 -0
index e78722a9a7..1f17859c57 100644
@@ -17,6 +17,9 @@ lwl-$(CONFIG_MACH_EXYNOS) += exynos8895-dreamlte.dtb.o \
 			exynos990-x1s.dtb.o
 lwl-$(CONFIG_MACH_DUCKBILL) += imx28-duckbill.dtb.o
 lwl-$(CONFIG_MACH_KINDLE_MX50) += imx50-kindle-d01100.dtb.o imx50-kindle-d01200.dtb.o imx50-kindle-ey21.dtb.o
+lwl-$(CONFIG_MACH_KINDLE_6_7) += imx6sl-kindle-wp63gw.dtb.o \
+		imx6sl-kindle-dp75sdi.dtb.o \
+		imx6sl-kindle-nm460gz.dtb.o
 lwl-$(CONFIG_MACH_EFIKA_MX_SMARTBOOK) += imx51-genesi-efika-sb.dtb.o
 lwl-$(CONFIG_MACH_ELTEC_HIPERCAM) += imx6dl-eltec-hipercam.dtb.o
 lwl-$(CONFIG_MACH_EMBEST_MARSBOARD) += imx6q-marsboard.dtb.o
arch/arm/dts/imx6sl-kindle-common.dtsi new file +167 -0

167 lines not on this page · raw message

arch/arm/dts/imx6sl-kindle-dp75sdi.dts new file +51 -0

51 lines not on this page · raw message

arch/arm/dts/imx6sl-kindle-nm460gz.dts new file +65 -0

65 lines not on this page · raw message

arch/arm/dts/imx6sl-kindle-wp63gw.dts new file +40 -0
new file mode 100644
index 0000000000..2d2e020a1f
@@ -0,0 +1,40 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (C) 2025 Alexander Kurz <[email protected]>
+ */
+
+/dts-v1/;
+#include "imx6sl-kindle-common.dtsi"
+#include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+	model = "kindle-wp63gw";
+	compatible = "amazon,imx6sl-kindle-wp63gw",  "fsl,imx6sl";
+	barebox,disable-deep-probe;
+};
+
+&iomuxc {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_hog>;
+
+	imx6sl-kindle-wp63gw {
+		pinctrl_hog: hoggrp {
+			fsl,pins = <
+				/* Hall sensor */
+				MX6SL_PAD_KEY_ROW7__GPIO4_IO07	0x17059
+				/* zForce touch */
+				MX6SL_PAD_I2C2_SCL__GPIO3_IO14	0x17059
+				MX6SL_PAD_I2C2_SDA__GPIO3_IO15	0x17059
+				MX6SL_PAD_KEY_ROW5__GPIO4_IO03	0x17059
+				MX6SL_PAD_KEY_ROW6__GPIO4_IO05	0x17059
+				/* EMMC_3v2_EN, EMMC_1v8_EN */
+				MX6SL_PAD_FEC_RXD0__GPIO4_IO17	0x17059
+				MX6SL_PAD_FEC_MDC__GPIO4_IO23	0x17059
+				/* WLAN pwd */
+				MX6SL_PAD_KEY_ROW2__GPIO3_IO29	0x17059
+			>;
+		};
+	};
+};
arch/arm/mach-imx/Kconfig +17 -0
index 5f50d1a823..eb947e67fb 100644
@@ -353,6 +353,23 @@ config MACH_ADVANTECH_ROM_742X
 	bool "Advantech ROM 742X"
 	select ARCH_IMX6
 
+config MACH_KINDLE_6_7
+	bool "i.MX6SL based Amazon Kindle generation 6 and 7"
+	select ARCH_IMX6SL
+	select SPI
+	select DRIVER_SPI_IMX
+	select I2C
+	select I2C_IMX
+	select GPIO_IMX
+	select ARM_BOARD_APPEND_ATAG
+	select ARM_LINUX
+	select OFTREE
+	select PINCTRL
+	help
+	  Say Y here if you are using the sixth or seventh generation Amazon
+	  Kindle Model No. DP75SDI (Paperwhite 2 or 3), WP63GW (Kindle 7) or
+	  NM460GZ (Kindle Voyage) based on the i.MX6SL SoC and MAX77696 PMIC.
+
 config MACH_NITROGEN6
 	bool "BoundaryDevices Nitrogen6 boards"
 	select ARCH_IMX6
images/Makefile.imx +21 -0
index 5ae14a5988..f66c0af6a4 100644
@@ -374,6 +374,27 @@ $(call build_imx_habv4img, CONFIG_MACH_ADVANTECH_ROM_742X, start_advantech_imx6d
 
 $(call build_imx_habv4img, CONFIG_MACH_ZII_RDU2, start_imx6_zii_rdu2, zii-imx6q-rdu2/flash-header-rdu2, zii-imx6-rdu2)
 
+# ----------------------- i.MX6sl based boards --------------
+pblb-$(CONFIG_MACH_KINDLE_6_7) += start_imx6sl_kindle_wp63gw
+CFG_start_imx6sl_kindle_wp63gw.pblb.imximg = $(board)/kindle-mx6sl/flash-header-kindle-mx6sl-256m.imxcfg
+FILE_barebox-kindle-wp63gw.img = start_imx6sl_kindle_wp63gw.pblb.imximg
+image-$(CONFIG_MACH_KINDLE_6_7) += barebox-kindle-wp63gw.img
+
+pblb-$(CONFIG_MACH_KINDLE_6_7) += start_imx6sl_kindle6_dp75sdi
+CFG_start_imx6sl_kindle6_dp75sdi.pblb.imximg = $(board)/kindle-mx6sl/flash-header-kindle-mx6sl-256m.imxcfg
+FILE_barebox-kindle6-dp75sdi.img = start_imx6sl_kindle6_dp75sdi.pblb.imximg
+image-$(CONFIG_MACH_KINDLE_6_7) += barebox-kindle6-dp75sdi.img
+
+pblb-$(CONFIG_MACH_KINDLE_6_7) += start_imx6sl_kindle7_dp75sdi
+CFG_start_imx6sl_kindle7_dp75sdi.pblb.imximg = $(board)/kindle-mx6sl/flash-header-kindle-mx6sl-512m.imxcfg
+FILE_barebox-kindle7-dp75sdi.img = start_imx6sl_kindle7_dp75sdi.pblb.imximg
+image-$(CONFIG_MACH_KINDLE_6_7) += barebox-kindle7-dp75sdi.img
+
+pblb-$(CONFIG_MACH_KINDLE_6_7) += start_imx6sl_kindle_nm460gz
+CFG_start_imx6sl_kindle_nm460gz.pblb.imximg = $(board)/kindle-mx6sl/flash-header-kindle-mx6sl-512m.imxcfg
+FILE_barebox-kindle-nm460gz.img = start_imx6sl_kindle_nm460gz.pblb.imximg
+image-$(CONFIG_MACH_KINDLE_6_7) += barebox-kindle-nm460gz.img
+
 # ----------------------- i.MX6ul / i.MX6ull based boards --------------
 $(call build_imx_habv4img, CONFIG_MACH_GRINN_LITEBOARD, start_imx6ul_liteboard_256mb, grinn-liteboard/flash-header-liteboard-256mb, grinn-liteboard-256mb)
 
Signature · 1 line
2.39.5
maintainer
#2 lore raw
In reply to Alexander Kurz
Quoted 24 lines · Alexander Kurz

Changes in v2:
- Link to v1: https://lore.barebox.org/barebox/[email protected]/
- Remove explicit RAM size settings from lowlevel.c and dts since this can be autodetected. As consequence, both DP75SDI variants (Paperwhite 2 and 3) now share the same dts.
- Rebase to current
- Attempts to use barebox,deep-probe did unfortunately not work yet. Brief description of the problem:
Device specific data is stored in /dev/mmc1.boot0.userdata, this data is read by barebox and passed as ATAGs to the vendor kernel, without this data, the device won't work properly.
An attempt has been made to use barebox,deep-probe (see patch below), however, mmc1 will not be available later, resulting e.g. in an error

Quoted 1 line

Could not read board info from /dev/mmc1.boot0.userdata

during startup.
Example patch:

# diff --git a/arch/arm/boards/kindle-mx6sl/board.c b/arch/arm/boards/kindle-mx6sl/board.c
index ff8083a756..5c18e074c9 100644
arch/arm/boards/kindle-mx6sl/board.c +0 -0
@@ -194,15 +194,10 @@ late_initcall(kindle_mx6sl_late_init);
 
 static int kindle6_device_init(void)
 {

arch/arm/boards/kindle-mx6sl/board.c late_initcall(kindle_mx6sl_late_init); · line 200

Quoted 10 lines
arch/arm/boards/kindle-mx6sl/board.c +1 -6
-       struct device *dev;
-
        if (!is_mx6sl_kindle())
                return 0;
 
-       /* Probe the eMMC to allow reading the board serial and revision */
-       dev = get_device_by_name("mmc1");
-       if (dev)
-               dev_set_param(dev, "probe", "1");
+       of_device_ensure_probed_by_alias("mmc1");

On return of this function the MMC host is probed, but the card is not yet detected. You can do that by adding a:

	device_detect_by_name("mmc1");

Does it work with this line added?

Sascha

Quoted 69 lines
arch/arm/boards/kindle-mx6sl/board.c +0 -0
        defaultenv_append_directory(defaultenv_kindle_mx6sl);
 
 # diff --git a/arch/arm/dts/imx6sl-kindle-dp75sdi.dts b/arch/arm/dts/imx6sl-kindle-dp75sdi.dts

index 9dc4a0c867..05fdd77a47 100644

arch/arm/dts/imx6sl-kindle-dp75sdi.dts +1 -1
@@ -12,7 +12,7 @@
 / {
        model = "kindle-dp75sdi";
        compatible = "amazon,imx6sl-kindle-dp75sdi",  "fsl,imx6sl";
-       barebox,disable-deep-probe;
+       barebox,deep-probe;
 };
 
 &iomuxc {

Alexander Kurz (1):
ARM i.MX6SL: Add Kindle generation 6/7 support

 .../boards/imx/amazon-kindle-6-7.rst          |  94 ++++++++
 arch/arm/boards/Makefile                      |   1 +
 arch/arm/boards/kindle-mx6sl/Makefile         |   5 +
 arch/arm/boards/kindle-mx6sl/board.c          | 212 ++++++++++++++++++
 .../defaultenv-kindle-mx6sl/boot/mmc_kernel   |  11 +
 .../defaultenv-kindle-mx6sl/init/pmic         |  32 +++
 .../defaultenv-kindle-mx6sl/init/usbserial    |   4 +
 .../nv/autoboot_timeout                       |   1 +
 .../defaultenv-kindle-mx6sl/nv/boot.default   |   1 +
 .../nv/linux.bootargs.base                    |   1 +
 .../nv/linux.bootargs.console                 |   1 +
 .../nv/linux.bootargs.video                   |   1 +
 .../flash-header-kindle-mx6sl-256m.imxcfg     | 126 +++++++++++
 .../flash-header-kindle-mx6sl-512m.imxcfg     | 126 +++++++++++
 arch/arm/boards/kindle-mx6sl/lowlevel.c       |  84 +++++++
 arch/arm/configs/kindle-gen-6-7_defconfig     |  89 ++++++++
 arch/arm/dts/Makefile                         |   3 +
 arch/arm/dts/imx6sl-kindle-common.dtsi        | 167 ++++++++++++++
 arch/arm/dts/imx6sl-kindle-dp75sdi.dts        |  51 +++++
 arch/arm/dts/imx6sl-kindle-nm460gz.dts        |  65 ++++++
 arch/arm/dts/imx6sl-kindle-wp63gw.dts         |  40 ++++
 arch/arm/mach-imx/Kconfig                     |  17 ++
 images/Makefile.imx                           |  21 ++
 23 files changed, 1153 insertions(+)
 create mode 100644 Documentation/boards/imx/amazon-kindle-6-7.rst
 create mode 100644 arch/arm/boards/kindle-mx6sl/Makefile
 create mode 100644 arch/arm/boards/kindle-mx6sl/board.c
 create mode 100644 arch/arm/boards/kindle-mx6sl/defaultenv-kindle-mx6sl/boot/mmc_kernel
 create mode 100644 arch/arm/boards/kindle-mx6sl/defaultenv-kindle-mx6sl/init/pmic
 create mode 100644 arch/arm/boards/kindle-mx6sl/defaultenv-kindle-mx6sl/init/usbserial
 create mode 100644 arch/arm/boards/kindle-mx6sl/defaultenv-kindle-mx6sl/nv/autoboot_timeout
 create mode 100644 arch/arm/boards/kindle-mx6sl/defaultenv-kindle-mx6sl/nv/boot.default
 create mode 100644 arch/arm/boards/kindle-mx6sl/defaultenv-kindle-mx6sl/nv/linux.bootargs.base
 create mode 100644 arch/arm/boards/kindle-mx6sl/defaultenv-kindle-mx6sl/nv/linux.bootargs.console
 create mode 100644 arch/arm/boards/kindle-mx6sl/defaultenv-kindle-mx6sl/nv/linux.bootargs.video
 create mode 100644 arch/arm/boards/kindle-mx6sl/flash-header-kindle-mx6sl-256m.imxcfg
 create mode 100644 arch/arm/boards/kindle-mx6sl/flash-header-kindle-mx6sl-512m.imxcfg
 create mode 100644 arch/arm/boards/kindle-mx6sl/lowlevel.c
 create mode 100644 arch/arm/configs/kindle-gen-6-7_defconfig
 create mode 100644 arch/arm/dts/imx6sl-kindle-common.dtsi
 create mode 100644 arch/arm/dts/imx6sl-kindle-dp75sdi.dts
 create mode 100644 arch/arm/dts/imx6sl-kindle-nm460gz.dts
 create mode 100644 arch/arm/dts/imx6sl-kindle-wp63gw.dts
Signature · 1 line
2.39.5
Signature · 4 lines
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#3 lore raw
Quoted 39 lines · Sascha Hauer
Quoted 24 lines · Alexander Kurz

Changes in v2:
- Link to v1: https://lore.barebox.org/barebox/[email protected]/
- Remove explicit RAM size settings from lowlevel.c and dts since this can be autodetected. As consequence, both DP75SDI variants (Paperwhite 2 and 3) now share the same dts.
- Rebase to current
- Attempts to use barebox,deep-probe did unfortunately not work yet. Brief description of the problem:
Device specific data is stored in /dev/mmc1.boot0.userdata, this data is read by barebox and passed as ATAGs to the vendor kernel, without this data, the device won't work properly.
An attempt has been made to use barebox,deep-probe (see patch below), however, mmc1 will not be available later, resulting e.g. in an error

Quoted 1 line

Could not read board info from /dev/mmc1.boot0.userdata

during startup.
Example patch:

# diff --git a/arch/arm/boards/kindle-mx6sl/board.c b/arch/arm/boards/kindle-mx6sl/board.c
index ff8083a756..5c18e074c9 100644
arch/arm/boards/kindle-mx6sl/board.c +0 -0
@@ -194,15 +194,10 @@ late_initcall(kindle_mx6sl_late_init);
 
 static int kindle6_device_init(void)
 {

arch/arm/boards/kindle-mx6sl/board.c late_initcall(kindle_mx6sl_late_init); · line 200

Quoted 10 lines
arch/arm/boards/kindle-mx6sl/board.c +1 -6
-       struct device *dev;
-
        if (!is_mx6sl_kindle())
                return 0;
 
-       /* Probe the eMMC to allow reading the board serial and revision */
-       dev = get_device_by_name("mmc1");
-       if (dev)
-               dev_set_param(dev, "probe", "1");
+       of_device_ensure_probed_by_alias("mmc1");

On return of this function the MMC host is probed, but the card is not yet detected. You can do that by adding a:

Quoted 3 lines
	device_detect_by_name("mmc1");

Does it work with this line added?

Thanks, with this change, the this works now with barebox,deep-probe.

Quoted 2 lines

Sascha

Thanks, Alexander

Quoted 19 lines
Quoted 19 lines
arch/arm/boards/kindle-mx6sl/board.c +0 -0
        defaultenv_append_directory(defaultenv_kindle_mx6sl);
 
 # diff --git a/arch/arm/dts/imx6sl-kindle-dp75sdi.dts b/arch/arm/dts/imx6sl-kindle-dp75sdi.dts

index 9dc4a0c867..05fdd77a47 100644

arch/arm/dts/imx6sl-kindle-dp75sdi.dts +1 -1
@@ -12,7 +12,7 @@
 / {
        model = "kindle-dp75sdi";
        compatible = "amazon,imx6sl-kindle-dp75sdi",  "fsl,imx6sl";
-       barebox,disable-deep-probe;
+       barebox,deep-probe;
 };
 
 &iomuxc {