public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH RESEND 0/9] sunxi: chip: Enable the DIP auto-detection
@ 2016-11-08 10:19 Maxime Ripard
  2016-11-08 10:19 ` [U-Boot] [PATCH RESEND 1/9] fdtdec: Fix alias retrieval Maxime Ripard
                   ` (10 more replies)
  0 siblings, 11 replies; 34+ messages in thread
From: Maxime Ripard @ 2016-11-08 10:19 UTC (permalink / raw)
  To: u-boot

The NextThing's C.H.I.P. can have expansion boards called DIPs. Those DIPs
are connected through the external headers, and comes with an
identification mechanism based on 1-Wire EEPROMs.

That auto-detection works great, because 1-Wire allows the enumeration, and
the EEPROMs are guaranteed to have different addresses, which allows us to
stack as many DIPs as possible, without any constraints.

Since those DIPs can be close to anything, ranging from a simple PWM-based
buzzer to a full featured device such as the PocketCHIP (which comes with a
touchscreen, a keyboard, a battery, etc), some adjustments might be needed
in U-Boot to be able to present something that just works to the user.

In particular, we need to:
  - Apply an overlay if the device is something that should be dealt with
    early in the boot process (display, storage device)
  - Adjust the U-Boot environment if the DIP has a display to change the
    default video output
  - Adjust the kernel command line in previous case for Linux to have the
    same default

In order to achieve that, we introduced some logic optionally hooked into
the sunxi board, two new uclasses for 1-Wire and EEPROMs, and a bunch of
new environment variables:
  - dip-auto-video to control the automatic video set up (default to yes)
  - dip_overlay_cmd that is a script to load the overlay $dip_overlay_name
    to $dip_addr_r, from whatever place it was stored in, and later apply
    it.
  - kernelarg_video to host the default kernel output in the kernel
    command line

I think the biggest drawback at the moment is that we maintain a list of
DIPs and the actions needed directly into the C code, which will make it
quite hard to customise for end users and tedious to maintain in the long
term. I couldn't really get my head around a better solution, so feel free
to suggest alternative approaches.

Let me know what you think,
Maxime

Maxime Ripard (9):
  fdtdec: Fix alias retrieval
  sunxi: chip: Add 1-wire node
  w1: Add 1-Wire uclass
  w1: Add 1-Wire gpio driver
  EEPROM: Add an EEPROM uclass
  eeprom: Add DS2431 support
  video: Allow board hook before video init
  sunxi: Add CHIP's DIP support
  config: chip: Enable DIP support

 arch/arm/dts/sun5i-r8-chip.dts |  15 ++-
 board/sunxi/Kconfig            |   9 +-
 board/sunxi/Makefile           |   1 +-
 board/sunxi/board.c            |   6 +-
 board/sunxi/dip.c              | 227 ++++++++++++++++++++++++++++++-
 configs/CHIP_defconfig         |   5 +-
 drivers/Kconfig                |   4 +-
 drivers/Makefile               |   2 +-
 drivers/eeprom/Kconfig         |  23 +++-
 drivers/eeprom/Makefile        |   3 +-
 drivers/eeprom/ds2431.c        |  38 +++++-
 drivers/eeprom/eeprom-uclass.c |  57 +++++++-
 drivers/video/cfb_console.c    |   9 +-
 drivers/w1/Kconfig             |  23 +++-
 drivers/w1/Makefile            |   3 +-
 drivers/w1/w1-gpio.c           | 160 +++++++++++++++++++++-
 drivers/w1/w1-uclass.c         | 259 ++++++++++++++++++++++++++++++++++-
 include/dm/uclass-id.h         |   2 +-
 include/eeprom.h               |  21 +++-
 include/w1.h                   |  47 ++++++-
 lib/fdtdec.c                   |   3 +-
 21 files changed, 916 insertions(+), 1 deletion(-)
 create mode 100644 board/sunxi/dip.c
 create mode 100644 drivers/eeprom/Kconfig
 create mode 100644 drivers/eeprom/Makefile
 create mode 100644 drivers/eeprom/ds2431.c
 create mode 100644 drivers/eeprom/eeprom-uclass.c
 create mode 100644 drivers/w1/Kconfig
 create mode 100644 drivers/w1/Makefile
 create mode 100644 drivers/w1/w1-gpio.c
 create mode 100644 drivers/w1/w1-uclass.c
 create mode 100644 include/eeprom.h
 create mode 100644 include/w1.h

base-commit: d8bdfc80da39211d95f10d24e79f2e867305f71b
-- 
git-series 0.8.11

^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2016-12-08 22:22 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-08 10:19 [U-Boot] [PATCH RESEND 0/9] sunxi: chip: Enable the DIP auto-detection Maxime Ripard
2016-11-08 10:19 ` [U-Boot] [PATCH RESEND 1/9] fdtdec: Fix alias retrieval Maxime Ripard
2016-11-08 10:19 ` [U-Boot] [PATCH RESEND 2/9] sunxi: chip: Add 1-wire node Maxime Ripard
2016-11-08 10:19 ` [U-Boot] [PATCH RESEND 3/9] w1: Add 1-Wire uclass Maxime Ripard
2016-11-08 10:19 ` [U-Boot] [PATCH RESEND 4/9] w1: Add 1-Wire gpio driver Maxime Ripard
2016-11-10 13:35   ` Michal Simek
2016-11-11 20:53     ` Maxime Ripard
2016-11-08 10:19 ` [U-Boot] [PATCH RESEND 5/9] EEPROM: Add an EEPROM uclass Maxime Ripard
2016-11-11 16:17   ` Simon Glass
2016-11-11 19:13     ` Moritz Fischer
2016-11-14 13:39       ` Maxime Ripard
2016-11-08 10:19 ` [U-Boot] [PATCH RESEND 6/9] eeprom: Add DS2431 support Maxime Ripard
2016-11-11 19:16   ` Moritz Fischer
2016-11-14 13:42     ` Maxime Ripard
2016-11-14 15:14       ` Tom Rini
2016-11-14 20:12         ` Maxime Ripard
2016-11-14 20:44           ` Simon Glass
2016-11-14 21:09             ` Maxime Ripard
2016-11-14 21:17               ` Simon Glass
2016-11-14 20:44       ` Simon Glass
2016-11-08 10:19 ` [U-Boot] [PATCH RESEND 7/9] video: Allow board hook before video init Maxime Ripard
2016-11-11 16:17   ` Simon Glass
2016-11-14 20:24     ` Maxime Ripard
2016-11-14 20:44       ` Simon Glass
2016-11-22 12:41         ` Maxime Ripard
2016-11-24  2:21           ` Simon Glass
2016-12-06 17:39             ` Maxime Ripard
2016-12-08 22:22               ` Simon Glass
2016-11-08 10:19 ` [U-Boot] [PATCH RESEND 8/9] sunxi: Add CHIP's DIP support Maxime Ripard
2016-11-08 10:19 ` [U-Boot] [PATCH RESEND 9/9] config: chip: Enable " Maxime Ripard
2016-11-09  3:44 ` [U-Boot] [PATCH RESEND 0/9] sunxi: chip: Enable the DIP auto-detection Tom Rini
2016-11-09 14:10   ` Maxime Ripard
2016-11-11 16:33     ` Tom Rini
2016-11-14 11:14 ` Hans de Goede

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox