From: Simon Glass Date: Sun, 13 Jul 2014 12:27:33 -0600 Subject: [U-Boot] [PATCH v2 0/9] Introduce driver model serial uclass Message-ID: <1405276062-4560-1-git-send-email-sjg@chromium.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de This series adds support for a serial uclass, enabling serial drivers to be converted to use driver model. Unfortunately this is quite a complicated process for a number of reasons: - serial is used before relocation, but driver model does not support this - stdio member functions are not passed a device pointer, but driver model requires this (so does serial, but it uses an ugly work-around) - driver model requires malloc() but this is not available before relocation - for sandbox, if something goes wrong with the console, we still need to get an error message out through the fallback console So this series relies on quite a few patches to address the above, as well as the serial uclass and an implementation for sandbox. If you have limited time, please take a look at least at the uclass patch which is 'dm: Add a uclass for serial devices' (see include/serial.h). Note: this series breaks 4 exynos boards. I will figure out how to get them to build as part of the exynos5-dt common board work. To see the current state of driver model, look at u-boot-dm.git branch 'working'. Changes in v2: - Add exynos serial support - Remove RFC status - Rename struct device to struct udevice - Split out core driver model patches into a separate set Simon Glass (9): serial: Set up the 'priv' pointer when creating a serial device dm: Add a uclass for serial devices Set up stdio earlier when using driver model sandbox: Convert serial driver to use driver model sandbox: serial: Support a coloured console sandbox: dts: Add a serial console node dm: exynos: Mark exynos5 console as pre-reloc dm: exynos: Move serial to driver model dm: Make driver model available before board_init() arch/arm/dts/exynos5.dtsi | 1 + arch/sandbox/dts/sandbox.dts | 10 ++ common/board_r.c | 19 +-- common/stdio.c | 18 ++- drivers/serial/Makefile | 4 + drivers/serial/sandbox.c | 140 +++++++++++++++---- drivers/serial/serial-uclass.c | 197 +++++++++++++++++++++++++++ drivers/serial/serial.c | 1 + drivers/serial/serial_s5p.c | 295 +++++++++++++---------------------------- include/configs/exynos5-dt.h | 1 + include/configs/sandbox.h | 3 + include/dm/uclass-id.h | 1 + include/serial.h | 92 +++++++++++++ include/stdio_dev.h | 24 +++- 14 files changed, 566 insertions(+), 240 deletions(-) create mode 100644 drivers/serial/serial-uclass.c -- 2.0.0.526.g5318336