Port U-Boot to the Samsung S5L87xx SoC family, which is used by the
Apple iPod nano (2nd to 7th generation), iPod classic (6th generation)
and iPod touch (2nd generation) digital audio players.

As there is no official documentation or datasheets available from the
manufacturer, all peripherals have been reverse-engineered in the span
of more than 18 years, initially by the Linux4Nano project, which was
later renamed to freemyipod.

The current code can be built and booted on the iPod nano series,
from 2nd to 7th generation inclusive, and on the iPod classic (6th
generation). While the iPod touch (2nd generation) uses the same SoC
as the iPod nano (4th generation), support for the former is not
currently included.

On those supported devices, U-Boot's console works over UART, using
either the 30-pin connector's UART pins, or the UART pins on the
Lightning connector for iPod nano (7th generation). USB 2.0 works
in device mode, and U-Boot can successfully enumerate as a DFU device
and launch a firmware image - either another copy of U-Boot, or a
Linux FDT image.

U-Boot can be chain loaded from Apple's bootloader or from Rockbox.
Since Apple's bootloader verifies and decrypts all DFU images, an
additional tool is needed to generate a suitable image from u-boot.bin.

There are a couple issues, still being worked on:
- The timer on iPod nano (2nd generation) is not exact, there's a
  drift of about 5 seconds every 5 minutes.
- The S5L8702 devices (iPod nano 3rd generation and iPod classic
  6th generation) use a different UART baud rate - 57600. In addition,
  the latter's UART interface is not stable when receiving data from
  the computer.
- The iPod classic (6th generation) is currently using a wrong clock
  for keeping time in U-Boot, so the sleep command is slower.
- The iPod nano (5th generation) build does not boot because of wrong
  DTB alignment. The tool which launches U-Boot does not use a 8-byte
  aligned address, which became a requirement since 0535e46d55d7.

This patch is the combined work of several developers:
iPod nano (2nd generation): Franz-Josef Haider <f_haider at gmx.at>
iPod nano (3rd generation): Tucker Osman <osmiumusa at gmail.com>
iPod nano (4th generation): Vencislav Atanasov
                                <user890104 at freemyipod.org>
iPod nano (5th generation): Serge Bazanski <q3k at q3k.org>
iPod nano (6th generation): Vencislav Atanasov
                                <user890104 at freemyipod.org>
iPod nano (7th generation): Martí Guasch <m-gsch at guas.ch>
iPod classic (6th generation): Vencislav Atanasov
                                <user890104 at freemyipod.org>

Links/resources:
- https://freemyipod.org/ - main project wiki
- https://github.com/freemyipod/u-boot - development repository
- https://freemyipod.org/wiki/U-Boot - building/running instructions
- https://freemyipod.org/wiki/Hardware - device and spec list

Signed-off-by: Vencislav Atanasov <[email protected]>
---
Changes in v2:
- Split to separate commits per SoC/board
- Enabled skipping of low level init on ARM1176
- Using separate USB PHY driver for S5L8740
- Cleaned up serial and clk includes
- Regenerated defconfig using savedefconfig
- Removed unused code (BUSCON)
- Fixed tabs/spaces/newlines
- Link to v1: 
https://patch.msgid.link/010701a10b3e4582-979b6c8d-12c9-4819-ad7f-7ce925de5824-000...@eu-central-1.amazonses.com

---
Vencislav Atanasov (14):
      ARM920T: Add support for CONFIG_POSITION_INDEPENDENT
      ARM1176: Add support for CONFIG_POSITION_INDEPENDENT
      ARM1176: Add support for SKIP_LOWLEVEL_INIT/SKIP_LOWLEVEL_INIT_ONLY
      Make CPU_ARM1176 and CPU_ARM920T dependencies of POSITION_INDEPENDENT
      New SoC platform: S5L87xx
      usb: Add DWC2 HS OTG params for S5L87xx
      serial: Add support for S5L87xx to serial_s5p
      Common files for the whole S5L87xx SoC family and the Nxx board series
      New SoC/board: S5L8701/N36
      New SoC/boards: S5L8702/N46 and N25
      New SoC/board: S5L8720/N58s
      New SoC/board: S5L8723/N20
      New SoC/board: S5L8730/N33
      New SoC/board: S5L8740/N31

 MAINTAINERS                                 |  10 ++
 arch/arm/Kconfig                            |  14 ++-
 arch/arm/Makefile                           |   1 +
 arch/arm/cpu/arm1176/start.S                |  46 +++++++++
 arch/arm/cpu/arm920t/start.S                |  43 +++++++++
 arch/arm/dts/s5l8701-n36.dts                |  26 ++++++
 arch/arm/dts/s5l8701.dtsi                   |  62 +++++++++++++
 arch/arm/dts/s5l8702-common.dtsi            |  34 +++++++
 arch/arm/dts/s5l8702-n25.dts                |  26 ++++++
 arch/arm/dts/s5l8702-n46.dts                |  26 ++++++
 arch/arm/dts/s5l8702.dtsi                   |  44 +++++++++
 arch/arm/dts/s5l8720-n58s.dts               |  26 ++++++
 arch/arm/dts/s5l8720.dtsi                   |  42 +++++++++
 arch/arm/dts/s5l8723-n20.dts                |  26 ++++++
 arch/arm/dts/s5l8723.dtsi                   |  40 ++++++++
 arch/arm/dts/s5l8730-n33.dts                |  26 ++++++
 arch/arm/dts/s5l8730.dtsi                   |  42 +++++++++
 arch/arm/dts/s5l8740-n31.dts                |  26 ++++++
 arch/arm/dts/s5l8740.dtsi                   |  43 +++++++++
 arch/arm/dts/s5l87xx-nxx.dtsi               |  22 +++++
 arch/arm/dts/s5l87xx.dtsi                   |  78 ++++++++++++++++
 arch/arm/include/asm/arch-s5l87xx/clk.h     |  19 ++++
 arch/arm/include/asm/arch-s5l87xx/s5l87xx.h |  79 ++++++++++++++++
 arch/arm/include/asm/arch-s5l87xx/uart.h    |  29 ++++++
 arch/arm/mach-s5l87xx/Kconfig               |  67 ++++++++++++++
 arch/arm/mach-s5l87xx/Makefile              |  35 +++++++
 arch/arm/mach-s5l87xx/relocate.S            |  27 ++++++
 arch/arm/mach-s5l87xx/s5l8701-otg-phy.c     |  56 +++++++++++
 arch/arm/mach-s5l87xx/s5l8701-timer.c       | 109 ++++++++++++++++++++++
 arch/arm/mach-s5l87xx/s5l8701.c             |  26 ++++++
 arch/arm/mach-s5l87xx/s5l8701/Kconfig       |  12 +++
 arch/arm/mach-s5l87xx/s5l8702-otg-phy.c     |  72 ++++++++++++++
 arch/arm/mach-s5l87xx/s5l8702.c             |  18 ++++
 arch/arm/mach-s5l87xx/s5l8702/Kconfig       |  26 ++++++
 arch/arm/mach-s5l87xx/s5l8720.c             |  18 ++++
 arch/arm/mach-s5l87xx/s5l8720/Kconfig       |  12 +++
 arch/arm/mach-s5l87xx/s5l8723.c             |  18 ++++
 arch/arm/mach-s5l87xx/s5l8723/Kconfig       |  12 +++
 arch/arm/mach-s5l87xx/s5l8730.c             |  18 ++++
 arch/arm/mach-s5l87xx/s5l8730/Kconfig       |  12 +++
 arch/arm/mach-s5l87xx/s5l8740-otg-phy.c     |  75 +++++++++++++++
 arch/arm/mach-s5l87xx/s5l8740.c             |  25 +++++
 arch/arm/mach-s5l87xx/s5l8740/Kconfig       |  12 +++
 arch/arm/mach-s5l87xx/s5l87xx-clk.c         |  66 +++++++++++++
 arch/arm/mach-s5l87xx/s5l87xx-otg-phy.c     |  55 +++++++++++
 arch/arm/mach-s5l87xx/s5l87xx-timer.c       | 139 ++++++++++++++++++++++++++++
 arch/arm/mach-s5l87xx/s5l87xx.c             |  22 +++++
 board/apple/n20/Kconfig                     |  15 +++
 board/apple/n20/Makefile                    |   7 ++
 board/apple/n20/n20.c                       |  57 ++++++++++++
 board/apple/n25/Kconfig                     |  15 +++
 board/apple/n25/Makefile                    |   7 ++
 board/apple/n25/n25.c                       |  50 ++++++++++
 board/apple/n31/Kconfig                     |  15 +++
 board/apple/n31/Makefile                    |   7 ++
 board/apple/n31/n31.c                       |  96 +++++++++++++++++++
 board/apple/n33/Kconfig                     |  15 +++
 board/apple/n33/Makefile                    |   7 ++
 board/apple/n33/n33.c                       |  57 ++++++++++++
 board/apple/n36/Kconfig                     |  15 +++
 board/apple/n36/Makefile                    |   7 ++
 board/apple/n36/n36.c                       |  19 ++++
 board/apple/n46/Kconfig                     |  15 +++
 board/apple/n46/Makefile                    |   7 ++
 board/apple/n46/n46.c                       |  51 ++++++++++
 board/apple/n58s/Kconfig                    |  15 +++
 board/apple/n58s/Makefile                   |   7 ++
 board/apple/n58s/n58s.c                     |  57 ++++++++++++
 board/apple/nxx-common/nxx.c                |  47 ++++++++++
 configs/apple_n20_defconfig                 |  33 +++++++
 configs/apple_n25_defconfig                 |  37 ++++++++
 configs/apple_n31_defconfig                 |  31 +++++++
 configs/apple_n33_defconfig                 |  33 +++++++
 configs/apple_n36_defconfig                 |  31 +++++++
 configs/apple_n46_defconfig                 |  36 +++++++
 configs/apple_n58s_defconfig                |  33 +++++++
 drivers/serial/Kconfig                      |   4 +-
 drivers/serial/serial_s5p.c                 |  49 ++++++----
 drivers/usb/gadget/dwc2_udc_otg.c           |  29 ++++++
 include/configs/apple_n20.h                 |  15 +++
 include/configs/apple_n25.h                 |  15 +++
 include/configs/apple_n31.h                 |  15 +++
 include/configs/apple_n33.h                 |  16 ++++
 include/configs/apple_n36.h                 |  15 +++
 include/configs/apple_n46.h                 |  15 +++
 include/configs/apple_n58s.h                |  15 +++
 86 files changed, 2753 insertions(+), 19 deletions(-)
---
base-commit: b0da72e3e8e77e36c29a5f3fecc04c47764031bf
change-id: 20261026-s5l87xx-v2-cc5d799fde34

Best regards,
--  
Vencislav Atanasov <[email protected]>

Reply via email to