
On 22 September 2014 17:30, Simon Glass sjg@chromium.org wrote:
Adjust the driver so that leaf functions take a pointer to the serial port register base. Put all the global configuration in the init function, and use the same settings from then on.
This makes it much easier to move to driver model without duplicating the code, since with driver model we use platform data rather than global settings.
The driver is compiled with either the CONFIG_PL010_SERIAL or CONFIG_PL011_SERIAL option and this determines the uart type. With driver model this needs to come in from platform data, so create a new CONFIG_PL01X_SERIAL config which brings in the driver, and adjust the driver to support both peripheral variants.
Signed-off-by: Simon Glass sjg@chromium.org
drivers/serial/Makefile | 5 +- drivers/serial/serial_pl01x.c | 300 +++++++++++---------- .../{serial_pl01x.h => serial_pl01x_internal.h} | 0 include/serial_pl01x.h | 27 ++ 4 files changed, 192 insertions(+), 140 deletions(-) rename drivers/serial/{serial_pl01x.h => serial_pl01x_internal.h} (100%) create mode 100644 include/serial_pl01x.h
Applied to u-boot-dm/master.