summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeLines
* rockchip: pinctrl: Update the rk3288 driver to support of-platdataSimon Glass2016-07-14-1/+7
| | | | | | | | Add support for of-platdata with rk3288. This requires disabling access to the device tree and renaming the driver to match the string that of-platdata will search for. Signed-off-by: Simon Glass <sjg@chromium.org>
* rockchip: clk: Update the rk3288 driver to support of-platdataSimon Glass2016-07-14-2/+18
| | | | | | | | Add support for of-platdata with rk3288. This requires decoding the of-platdata struct and setting up the devices from that. Also the driver needs to be renamed to match the string that of-platdata will search for. Signed-off-by: Simon Glass <sjg@chromium.org>
* rockchip: clk: Move all DT decoding to ofdata_to_platdata()Simon Glass2016-07-14-1/+12
| | | | | | | | It is more correct to avoid touching the device tree in the probe() method. Update the driver to work this way. Also add an error check on grf since if that fails then we should not use it. Signed-off-by: Simon Glass <sjg@chromium.org>
* rockchip: mmc: Update the driver to support of-platdataSimon Glass2016-07-14-3/+26
| | | | | | | | Add support for of-platdata with rk3288. This requires decoding the of-platdata struct and setting up the device from that. Also the driver needs to be renamed to match the string that of-platdata will search for. Signed-off-by: Simon Glass <sjg@chromium.org>
* rockchip: mmc: Move all DT decoding to ofdata_to_platdata()Simon Glass2016-07-14-15/+17
| | | | | | | It is more correct to avoid touching the device tree in the probe() method. Update the driver to work this way. Signed-off-by: Simon Glass <sjg@chromium.org>
* rockchip: Update the sdram-channel property to support of-platdataSimon Glass2016-07-14-1/+8
| | | | | | | Add an extra byte so that this data is not byteswapped. Add a comment to the code to explain the purpose. Signed-off-by: Simon Glass <sjg@chromium.org>
* rockchip: serial: Add an of-platdata driver for rockchipSimon Glass2016-07-14-0/+55
| | | | | | | Add a driver that works with of-platdata. It sets up the platform data and calls the standard ns16550 driver. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: serial: ns16550: Update to support of-platdataSimon Glass2016-07-14-1/+3
| | | | | | | | | With of-platdata this driver cannot know the format of the of-platdata struct, so we cannot use generic code for accessing the of-platdata. Each SoC that uses this driver will need to set up ns16550's platdata for it. So don't compile in the generic code. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: core: Add an implementation of regmap_init_mem_platdata()Simon Glass2016-07-14-3/+30
| | | | | | | | Add an implementation of this function which mirrors the functions of the automatic device-tree implementation. This can be used with of-platdata to create regmaps. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: core: Move regmap allocation into a separate functionSimon Glass2016-07-14-12/+22
| | | | | | | We plan to add a new way of creating a regmap for of-platdata. Move the allocation code into a separate function so that it can be shared. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: sandbox: Enable of-platdata for sandbox_splSimon Glass2016-07-14-0/+1
| | | | | | Enable this feature so that we can use it for testing in sandbox_spl. Signed-off-by: Simon Glass <sjg@chromium.org>
* sandbox: Don't bring in the eeprom emulator in SPLSimon Glass2016-07-14-0/+2
| | | | | | | This driver should not be used in SPL since we do not have I2C support enabled in SPL on sandbox. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: core: Expand platdata for of-platdata devicesSimon Glass2016-07-14-11/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Devices which use of-platdata have their own platdata. However, in many cases the driver will have its own auto-alloced platdata, for use with the device tree. The ofdata_to_platdata() method converts the device tree settings to platdata. With of-platdata we would not normally allocate the platdata since it is provided by the U_BOOT_DEVICE() declaration. However this is inconvenient since the of-platdata struct is closely tied to the device tree properties. It is unlikely to exactly match the platdata needed by the driver. In fact a useful approach is to declare platdata in the driver like this: struct r3288_mmc_platdata { struct dtd_rockchip_rk3288_dw_mshc of_platdata; /* the 'normal' fields go here */ }; In this case we have dt_platadata available, but the normal fields are not present, since ofdata_to_platdata() is never called. In fact driver model doesn't allocate any space for the 'normal' fields, since it sees that there is already platform data attached to the device. To make this easier, adjust driver model to allocate the full size of the struct (i.e. platdata_auto_alloc_size from the driver) and copy in the of-platdata. This means that when the driver's bind() method is called, the of-platdata will be present, followed by zero bytes for the empty 'normal field' portion. A new DM_FLAG_OF_PLATDATA flag is available that indicates that the platdata came from of-platdata. When the allocation/copy happens, the DM_FLAG_ALLOC_PDATA flag will be set as well. The dtoc tool is updated to output the platdata_size field, since U-Boot has no other way of knowing the size of the of-platdata struct. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: Don't attach the device tree to SPL with of-platdataSimon Glass2016-07-14-1/+1
| | | | | | | | When of-platdata is used in SPL we don't use the device tree. So there is no point in attaching it. Adjust the Makefile to skip attaching the device tree when of-platdata is enabled. Signed-off-by: Simon Glass <sjg@chromium.org>
* dtoc: Ignore the u-boot, dm-pre-reloc propertySimon Glass2016-07-14-0/+1
| | | | | | This property is not useful for of-platdata, so omit it. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: core: Rename DM_NAME_ALLOCED to DM_FLAG_NAME_ALLOCEDSimon Glass2016-07-14-4/+4
| | | | | | This is a flag. Adjust the name to be consistent with the other flags. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: spl: Bind in all devices in SPL with of-platdataSimon Glass2016-07-14-1/+2
| | | | | | | | | | | | | | When CONFIG_OF_PLATDATA is enabled, we cannot use the u-boot,dm-pre-reloc device tree property since the device tree is not available. However, dt-platdata.c only includes devices which would have been present in the device tree, and we can assume that all such devices are needed for SPL. If they were not needed, they would have been omitted to save space. So in this case, bind all devices regardless of the u-boot,dm-pre-reloc setting. This avoids needing to add a DM_FLAG_PRE_RELOC to every driver, thus affecting U-Boot proper also. Signed-off-by: Simon Glass <sjg@chromium.org>
* tiny-printf: Support assert()Simon Glass2016-07-14-0/+9
| | | | | | | | | | At present assert() is not supported with tiny-printf, so when DEBUG is enabled a build error is generated for each assert(). Add an __assert_fail() function to correct this. It prints a message and then hangs. Signed-off-by: Simon Glass <sjg@chromium.org>
* Only build the libfdt python module if 'swig' is availableSimon Glass2016-07-14-1/+4
| | | | | | | When swig is not available, we can still build correctly. So make this optional. Add a comment about how to enable this build. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: Add a more efficient libfdt librarySimon Glass2016-07-14-2/+339
| | | | | | | | Add a Python version of the libfdt library which contains enough features to support the dtoc tool. This is only a very bare-bones implementation. It requires the 'swig' to build. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: Makefile: Build of-platdata files when the feature is enabledSimon Glass2016-07-14-3/+36
| | | | | | | Update the Makefile to call dtoc to create the C header and source files, then build these into the image. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: Add a tool to generate C code from a device treeSimon Glass2016-07-14-0/+392
| | | | | | | This tool can produce C struct definitions and C platform data tables. This is used to support the of-platdata feature. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: Add a library to provide simple device-tree accessSimon Glass2016-07-14-0/+294
| | | | | | | This Python library provides a way to access the contents of the device tree. It uses fdtget, so is inefficient for larger device tree files. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: Add a README for of-platdataSimon Glass2016-07-14-0/+268
| | | | | | Add documentation on how this works, including the benefits and drawbacks. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: Add an option to enable the of-platdata featureSimon Glass2016-07-14-0/+21
| | | | | | Add a Kconfig option to enable this feature. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: Don't include fdtdec functions when of-platdata is enabledSimon Glass2016-07-14-3/+2
| | | | | | | We cannot access the device tree in this case, so avoid compiling in the various device-tree helper functions. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: serial: Add support for of-platdataSimon Glass2016-07-14-1/+7
| | | | | | | When this feature is enabled, we cannot access the device tree to find out which serial device to use. Just use the first serial driver we find. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: clk: Add support for of-platdataSimon Glass2016-07-14-2/+26
| | | | | | Add support for this feature in the core clock code. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: Add a header that provides access to the of-platdata structsSimon Glass2016-07-14-0/+19
| | | | | | | | This header can be included from anywhere, but will only pull in the of-platdata struct definitions when this feature is enabled (and only in SPL). Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: sandbox: Add a simple driver to test of-platdataSimon Glass2016-07-14-0/+58
| | | | | | | | Add a driver which uses of-platdata to obtain its platform data. This can be used to test the feature in sandbox. It displays the contents of its platform data. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: syscon: Add support for of-platdataSimon Glass2016-07-14-0/+24
| | | | | | | Provide a new function which can cope with obtaining information from of-platdata instead of the device tree. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: regmap: Add a dummy implementation for of-platdataSimon Glass2016-07-14-0/+12
| | | | | | | Add a placeholder for now so that this code will compile. It currently does nothing. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: core: Don't use device tree with of-platdataSimon Glass2016-07-14-4/+4
| | | | | | | When CONFIG_SPL_OF_PLATDATA is enabled we should not access the device tree. Remove all references to this in the core driver-model code. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: Makefile: Build of-platdata before SPLSimon Glass2016-07-14-1/+2
| | | | | | | Since SPL needs the of-platdata structures, build these before starting to build any SPL components. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: spl: Don't set up device tree with of-platdataSimon Glass2016-07-14-1/+1
| | | | | | When this feature is enabled, we should not access the device tree. Signed-off-by: Simon Glass <sjg@chromium.org>
* sandbox: Add a test device that uses of-platdataSimon Glass2016-07-14-0/+50
| | | | | | | | | | Start up the test devices. These print out of-platdata contents, providing a check that the of-platdata feature is working correctly. The device-tree changes are made to sandbox.dts rather than test.dts. since the former controls the of-platdata generation. Signed-off-by: Simon Glass <sjg@chromium.org>
* sandbox: Add a new sandbox_spl boardSimon Glass2016-07-14-1/+237
| | | | | | | | | | | | It is useful to be able to build SPL for sandbox. It provides additional build coverage and allows SPL features to be tested in sandbox. However it does not need worthwhile to always create an SPL build. It nearly doubles the build time and the feature is (so far) seldom used. So for now, create a separate build target for sandbox SPL. This allows experimentation with this new feature without impacting existing workflows. Signed-off-by: Simon Glass <sjg@chromium.org>
* sandbox: serial: Don't sync video in SPLSimon Glass2016-07-14-0/+2
| | | | | | | SPL does not support an LCD display so there is no need to sync the video when there is serial output. Signed-off-by: Simon Glass <sjg@chromium.org>
* sandbox: Don't use IDE and iotrace in SPLSimon Glass2016-07-14-0/+4
| | | | | | These functions are not supported in SPL, so drop them. Signed-off-by: Simon Glass <sjg@chromium.org>
* sandbox: Add basic SPL implementationSimon Glass2016-07-14-0/+75
| | | | | | | Add an sandbox implementation for the generic SPL framework. This supports locating and running U-Boot proper. Signed-off-by: Simon Glass <sjg@chromium.org>
* sandbox: Don't include the main loop in SPLSimon Glass2016-07-14-0/+2
| | | | | | | SPL does not have a command interface so we should not include the main loop code. Signed-off-by: Simon Glass <sjg@chromium.org>
* sandbox: Don't use PCI in SPLSimon Glass2016-07-14-1/+3
| | | | | | PCI is not supported in SPL for sandbox, so avoid using it. Signed-off-by: Simon Glass <sjg@chromium.org>
* sandbox: Add some missing headers in cpu.cSimon Glass2016-07-14-0/+2
| | | | | | These headers are needed in case they are not transitively included. Signed-off-by: Simon Glass <sjg@chromium.org>
* sandbox: Correct header file order in cpu.cSimon Glass2016-07-14-1/+1
| | | | | | The dm/ file should go at the end. Move it. Signed-off-by: Simon Glass <sjg@chromium.org>
* sandbox: Support building an SPL imageSimon Glass2016-07-14-0/+5
| | | | | | | When building an SPL image, override the link flags so that it uses the system libraries. This is similar to the way the non-SPL image is built. Signed-off-by: Simon Glass <sjg@chromium.org>
* sandbox: Allow chaining from SPL to U-Boot properSimon Glass2016-07-14-0/+76
| | | | | | | | SPL is expected to load and run U-Boot. This needs to work with sandbox also. Provide a function to locate the U-Boot image, and another to start it. This allows SPL to function on sandbox as it does on other archs. Signed-off-by: Simon Glass <sjg@chromium.org>
* Makefile: Allow the SPL final link rule to be overriddenSimon Glass2016-07-14-2/+4
| | | | | | | | | | Overriding the final link rule is possible with U-Boot proper. It us used to create a sandbox image links with host libraries. To build a sandbox SPL image we need the same feature for SPL. To support this, update the SPL link rule so sandbox can override it. Signed-off-by: Simon Glass <sjg@chromium.org>
* spl: Drop include of i2c.hSimon Glass2016-07-14-1/+0
| | | | | | This file does not appear to use I2C, so drop this include. Signed-off-by: Simon Glass <sjg@chromium.org>
* README: Remove CONFIG_SYS_MALLOC_F_LEN commentSimon Glass2016-07-14-3/+0
| | | | | | | This option is now widely available, so remove the comment that it is only available on ARM and sandbox. Signed-off-by: Simon Glass <sjg@chromium.org>
* sandbox: Don't print a warning for CONFIG_I2C_COMPATSimon Glass2016-07-14-1/+1
| | | | | | | | | | | Sandbox includes this code to provide build coverage. While we retain this feature we should have sandbox build it. Sandbox does not in fact use the I2C compatibility mode. Showing a warning for sandbox is just confusing, since no conversion is expected. Drop the warning for sandbox. Signed-off-by: Simon Glass <sjg@chromium.org>