]> git.sur5r.net Git - u-boot/log
u-boot
7 years agodtoc: Pass include_disabled explicitly
Simon Glass [Mon, 19 Jun 2017 04:09:01 +0000 (22:09 -0600)]
dtoc: Pass include_disabled explicitly

This option is the only one actually used by the dtb_platdata class. Pass
it explicitly to avoid needing to pass the whole option object to the
constructor.

Signed-off-by: Simon Glass <sjg@chromium.org>
7 years agodtoc: Don't handle properties with / in them
Simon Glass [Mon, 19 Jun 2017 04:09:00 +0000 (22:09 -0600)]
dtoc: Don't handle properties with / in them

This conversion appears to not be needed as it does not occur in practice.
Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
7 years agodtoc: Fix pylint warnings
Simon Glass [Mon, 19 Jun 2017 04:08:59 +0000 (22:08 -0600)]
dtoc: Fix pylint warnings

Unfortunately I neglected to run pylint on this tool with its initial
submission. Fix the warnings.

Signed-off-by: Simon Glass <sjg@chromium.org>
7 years agodtoc: Split out the main class into its own file
Simon Glass [Mon, 19 Jun 2017 04:08:58 +0000 (22:08 -0600)]
dtoc: Split out the main class into its own file

To simplify running tests we should move this class into its own file.
This allows the tests to import it without having to import dtoc.py, which
runs the tests.

Signed-off-by: Simon Glass <sjg@chromium.org>
7 years agodtoc: Add a comment at the top
Simon Glass [Mon, 19 Jun 2017 04:08:57 +0000 (22:08 -0600)]
dtoc: Add a comment at the top

Add a description of the dtoc tool at the top of the file.

Signed-off-by: Simon Glass <sjg@chromium.org>
7 years agodtoc: Use self._options instead of the global options
Simon Glass [Mon, 19 Jun 2017 04:08:56 +0000 (22:08 -0600)]
dtoc: Use self._options instead of the global options

This class should use the options object passed to it rather than finding
the global one. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
7 years agomoveconfig: Allow automatic location and adding of 'imply'
Simon Glass [Fri, 16 Jun 2017 03:39:33 +0000 (21:39 -0600)]
moveconfig: Allow automatic location and adding of 'imply'

By using a Kconfig parser we can find the location of each option in the
Kconfig tree. Using the information from the database we can then
automatically add an 'imply' option into the right place if requested by
the user.

Add a -a option to support adding 'imply' options. Display the location of
any existing 'imply' option so that progress can be examined. Add a -A
option to hide any existing 'imply' options so that already-completed
additions need not be considered further.

Also add documentation for this feature.

Signed-off-by: Simon Glass <sjg@chromium.org>
7 years agomoveconfig: Allow control of which implying configs are shown
Simon Glass [Fri, 16 Jun 2017 03:39:32 +0000 (21:39 -0600)]
moveconfig: Allow control of which implying configs are shown

Sometimes it is useful to display CONFIG_TARGET or CONFIG_CMD configs. Add
an option to control this.

Also we generally ignore implying configs which affect fewer than 5
boards. But sometimes it is useful to show those those, so add an option
that reduces the minimum to two.

ERRATUM configs are never useful for implying things, so ignore those.

Signed-off-by: Simon Glass <sjg@chromium.org>
7 years agomoveconfig: Allow piping in 'git show --stat' output
Simon Glass [Fri, 16 Jun 2017 03:39:31 +0000 (21:39 -0600)]
moveconfig: Allow piping in 'git show --stat' output

It is useful to be able to process only a subset of boards to save time.
Often that subset is defined by the defconfig files in a git commit. This
change allows things like:

   # Build the database
   ./tools.moveconfig.py -b

   # Find some implying configs
   ./tools/moveconfig.py -i CONFIG_X

   # Add some 'imply' statements to Kconfig files
   ./tools/moveconfig.py -i CONFIG_X -a CONFIG_A,CONFIG_B

   # Reprocess the defconfig files to see if we can drop some changes
   git show --stat | ./tools/moveconfig.py -s -d -

   # Update the commit, with fewer defconfig changes
   gii commit -au

Where the commit contains defconfig files, this will reprocess them to
take account of the imply statements that you added.

Signed-off-by: Simon Glass <sjg@chromium.org>
7 years agosandbox: Drop special case console code for sandbox
Simon Glass [Fri, 16 Jun 2017 03:37:54 +0000 (21:37 -0600)]
sandbox: Drop special case console code for sandbox

At present sandbox has a special case where it directly calls os_putc()
when it does not have a console yet.

Now that we have the pre-console buffer enabled we can drop this. Any
early characters will be buffered and output later.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
7 years agosandbox: Enable more console options
Simon Glass [Fri, 16 Jun 2017 03:37:53 +0000 (21:37 -0600)]
sandbox: Enable more console options

Enable the pre-console buffer, displaying the model and post-relocation
console announce on sandbox. Also add a model name to the device tree.
This allows testing of these features.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
7 years agoconsole: Use map_sysmem() for the pre-relocation console
Simon Glass [Fri, 16 Jun 2017 03:37:52 +0000 (21:37 -0600)]
console: Use map_sysmem() for the pre-relocation console

At present this feature casts the address to a pointer. Use the
map_sysmem() function so that it will work correctly on sandbox.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
7 years agotest: Add a test for snprintf() and the banner/version
Simon Glass [Fri, 16 Jun 2017 03:37:51 +0000 (21:37 -0600)]
test: Add a test for snprintf() and the banner/version

Add a simple test to make sure that these functions obey the buffer size
passed into them.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
7 years agoAllow displaying the U-Boot banner on a video display
Simon Glass [Fri, 16 Jun 2017 03:37:50 +0000 (21:37 -0600)]
Allow displaying the U-Boot banner on a video display

At present the U-Boot banner is only displayed on the serial console. If
this is not visible to the user, the banner does not show. Some devices
have a video display which can usefully display this information.

Add a banner which is printed after relocation only on non-serial devices
if CONFIG_DISPLAY_BOARDINFO_LATE is defined.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
7 years agodisplay_options: Refactor to allow obtaining the banner
Simon Glass [Fri, 16 Jun 2017 18:51:42 +0000 (12:51 -0600)]
display_options: Refactor to allow obtaining the banner

Move the display options code into a separate function so that the U-Boot
banner can be obtained from other code. Adjust the 'version' command to
use it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
7 years agox86: Move link to use driver model for SCSI
Simon Glass [Thu, 15 Jun 2017 03:28:48 +0000 (21:28 -0600)]
x86: Move link to use driver model for SCSI

As a demonstration of how to use SCSI with driver model, move link over
to use this. This patch needs more work, but illustrates the concept.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
7 years agodm: scsi: Drop scsi_init() when driver model is used
Simon Glass [Thu, 15 Jun 2017 03:28:47 +0000 (21:28 -0600)]
dm: scsi: Drop scsi_init() when driver model is used

This function should not be used with driver model. Update the code to
reflect this.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
7 years agodm: ahci: Add a driver for SCSI on AHCI
Simon Glass [Thu, 15 Jun 2017 03:28:46 +0000 (21:28 -0600)]
dm: ahci: Add a driver for SCSI on AHCI

Some AHCI drivers use SCSI under the hood. Rather than making the AHCI
driver be in the SCSI uclass it makes sense to have the AHCI device create
a SCSI device as a child. That way we can handle any AHCI-specific
operations rather than trying to pretend tha the device is just SCSI.

To handle this we need to provide a way for AHCI drivers to bind a SCSI
device as its child, and probe it. Add functions for this.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
7 years agodm: scsi: Split out the bus scanning code
Simon Glass [Thu, 15 Jun 2017 03:28:45 +0000 (21:28 -0600)]
dm: scsi: Split out the bus scanning code

Split out the code that scans a single SCSI bus into a separate function.
This will allow it to be used from driver model.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
7 years agodm: scsi: Adjust return value of scsi_exec()
Simon Glass [Thu, 15 Jun 2017 03:28:44 +0000 (21:28 -0600)]
dm: scsi: Adjust return value of scsi_exec()

Change this function to return an error number instead of true/false.
This allows us to return a proper error number.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
7 years agodm: scsi: Add operations for SCSI devices
Simon Glass [Thu, 15 Jun 2017 03:28:43 +0000 (21:28 -0600)]
dm: scsi: Add operations for SCSI devices

The SCSI uclass currently has no operations. It just uses the global SCSI
functions. Fix this by adding operations to the only two drivers that use
the uclass, and replacing the global functions with those defined locally
in the SCSI code.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
7 years agodm: ahci: Create a local version of two SCSI functions
Simon Glass [Thu, 15 Jun 2017 03:28:42 +0000 (21:28 -0600)]
dm: ahci: Create a local version of two SCSI functions

With driver model we need to define implementations of exec() and
bus_reset() separately for each SCSI driver. As a first step, create a
local version of each function in the AHCI driver and call each from its
global version.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
7 years agodm: scsi: Document and rename the scsi_scan() parameter
Simon Glass [Thu, 15 Jun 2017 03:28:41 +0000 (21:28 -0600)]
dm: scsi: Document and rename the scsi_scan() parameter

The 'mode' parameter is actually a flag to determine whether to display
a list of devices found during the scan. Rename it to reflect this, add a
function comment and adjust callers to use a boolean.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
7 years agodm: scsi: Add a device pointer to scan_exec(), scsi_bus_reset()
Simon Glass [Thu, 15 Jun 2017 03:28:40 +0000 (21:28 -0600)]
dm: scsi: Add a device pointer to scan_exec(), scsi_bus_reset()

With driver model these functions need a device pointer. Add one even
when CONFIG_DM_SCSI is not defined. This avoids having ugly conditional
function prototypes, When CONFIG_DM_SCSI is not defined we can just ignore
the pointer.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
7 years agodm: scsi: Add operations
Simon Glass [Thu, 15 Jun 2017 03:28:39 +0000 (21:28 -0600)]
dm: scsi: Add operations

Add operations for SCSI. These are not yet implemented, but we have the
struct.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
7 years agodm: ahci: Drop use of probe_ent
Simon Glass [Thu, 15 Jun 2017 03:28:38 +0000 (21:28 -0600)]
dm: ahci: Drop use of probe_ent

With driver model we cannot have static data or assume that there is only
one device of each time. Adjust the code so that 'probe_ent' is not needed
with driver model. Add a new ahci_init_dm() function which can init AHCI
for driver model without re-allocating the uclass data. Move over the only
existing driver to use this new function.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
7 years agodm: ahci: Unwind the confusing init code
Simon Glass [Thu, 15 Jun 2017 03:28:37 +0000 (21:28 -0600)]
dm: ahci: Unwind the confusing init code

Two AHCI drivers use SCSI with CONFIG_DM_SCSI. The SCSI uclass calls
scsi_low_level_init() which is implemented by ahci.c. If
CONFIG_SCSI_AHCI_PLAT is defined it does one thing and if it is not
it does something else.

We don't need to call through scsi_low_level_init() to get the init
completed. Instead, adjust the two drivers to call into AHCI directly.
Drop the post-probe init in the SCSI uclass. This means that driver model
doesn't need to use scsi_low_level_init(). It is a legacy function and
driver model should use a driver's probe() method instead.

While we are here, add a comment to the top of the file explaining what
ahci.c does.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
7 years agodm: ahci: Move common code for starting ports into a function
Simon Glass [Thu, 15 Jun 2017 03:28:36 +0000 (21:28 -0600)]
dm: ahci: Move common code for starting ports into a function

This code is duplicated. Create a ahci_start_ports() function to handle
this and call it from both places.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
7 years agodm: scsi: Indent the confusing #ifdefs
Simon Glass [Thu, 15 Jun 2017 03:28:35 +0000 (21:28 -0600)]
dm: scsi: Indent the confusing #ifdefs

These are very confusing without some sort of indentation. At some point
we will be able to remove them, but for now, indent them.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
7 years agodm: ahci: Refactor to avoid static variables
Simon Glass [Thu, 15 Jun 2017 03:28:34 +0000 (21:28 -0600)]
dm: ahci: Refactor to avoid static variables

With driver model we need each device to have its own state. As a step
towards this, restrict use of the global 'probe_ent' to just a few places
in the file. This will allow us to add driver-model functions which can
pass the correct data around.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
7 years agodm: sata: Move ataid into struct ahci_uc_priv
Simon Glass [Thu, 15 Jun 2017 03:28:33 +0000 (21:28 -0600)]
dm: sata: Move ataid into struct ahci_uc_priv

This array relates to the AHCI controller so should be exist out on its
own in the file. Move it into the structure. Adjust functions that need
access to this to take the structure as a parameter.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
7 years agodm: ahci: Rename struct ahci_probe_ent
Simon Glass [Thu, 15 Jun 2017 03:28:32 +0000 (21:28 -0600)]
dm: ahci: Rename struct ahci_probe_ent

This is not a very useful name since once it is probed it still hangs
around. With driver model we will use uclass data for this, so rename the
struct.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
7 years agodm: scsi: Use the uclass platform data
Simon Glass [Thu, 15 Jun 2017 03:28:31 +0000 (21:28 -0600)]
dm: scsi: Use the uclass platform data

At present the two driver-model SCSI drivers use device platform data to
store information that relates to the uclass. It is better to use uclass
platform data in this situation. Update the code to do this.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
7 years agodm: scsi: Drop the ccb typedef
Simon Glass [Thu, 15 Jun 2017 03:28:30 +0000 (21:28 -0600)]
dm: scsi: Drop the ccb typedef

We should not be using typedefs in U-Boot and 'ccb' is a pretty short
name. It is also used with variables. Drop the typedef and use 'struct'
instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
7 years agodm: scsi: Rename struct SCSI_cmd_block to struct scsi_cmd
Simon Glass [Thu, 15 Jun 2017 03:28:29 +0000 (21:28 -0600)]
dm: scsi: Rename struct SCSI_cmd_block to struct scsi_cmd

This name should be lower case. Also the _block suffix is superfluous.
Rename it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
7 years agodm: scsi: Rearrange header file for driver model
Simon Glass [Thu, 15 Jun 2017 03:28:28 +0000 (21:28 -0600)]
dm: scsi: Rearrange header file for driver model

Put the driver-model declarations first since we are migrating to that.
Also drop scsi_init() when driver model is used.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
7 years agoscsi: Move drivers into new drivers/scsi directory
Simon Glass [Thu, 15 Jun 2017 03:28:27 +0000 (21:28 -0600)]
scsi: Move drivers into new drivers/scsi directory

At present we have the SCSI drivers in the drivers/block and common/
directories. It is better to split them out into their own place. Use
drivers/scsi which is what Linux does.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
7 years agosata: Move drivers into new drivers/ata directory
Simon Glass [Thu, 15 Jun 2017 03:28:26 +0000 (21:28 -0600)]
sata: Move drivers into new drivers/ata directory

At present we have the SATA and PATA drivers mixed up in the drivers/block
directory. It is better to split them out into their own place. Use
drivers/ata which is what Linux does.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
7 years agoKconfig: Add CONFIG_SATA to enable SATA
Simon Glass [Thu, 15 Jun 2017 03:28:25 +0000 (21:28 -0600)]
Kconfig: Add CONFIG_SATA to enable SATA

At present CONFIG_CMD_SATA enables the 'sata' command which also brings
in SATA support. Some boards may wish to enable SATA without the command.
Add a separate CONFIG to permit this.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
7 years agoConvert CONFIG_CMD_SATA to Kconfig
Simon Glass [Thu, 15 Jun 2017 03:28:24 +0000 (21:28 -0600)]
Convert CONFIG_CMD_SATA to Kconfig

This converts the following to Kconfig:
   CONFIG_CMD_SATA

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
7 years agoscsi: Drop scsi_print_error()
Simon Glass [Thu, 15 Jun 2017 03:28:23 +0000 (21:28 -0600)]
scsi: Drop scsi_print_error()

This function is only defined by one driver and is empty. Move it into
the SCSI implementation itself. We could remove it, but it should be
useful for debugging.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
7 years agoscsi: Drop sym53c8xx driver
Simon Glass [Thu, 15 Jun 2017 03:28:22 +0000 (21:28 -0600)]
scsi: Drop sym53c8xx driver

This driver is for a PowerPC board that will likely be removed soon.
Rather than converting it to driver model, drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
7 years agoConvert CONFIG_SCSI to Kconfig
Simon Glass [Thu, 15 Jun 2017 03:28:21 +0000 (21:28 -0600)]
Convert CONFIG_SCSI to Kconfig

This converts the following to Kconfig:
   CONFIG_SCSI

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
7 years agodtoc: Support multiple compatible strings in a node
Simon Glass [Wed, 14 Jun 2017 03:10:06 +0000 (21:10 -0600)]
dtoc: Support multiple compatible strings in a node

Sometimes a node will have multiple compatible strings. Drivers may use
one or the other so the best approach seems to be to #define them to be
equivalent.

Update dtoc to support this.

Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-by: Kever Yang <kever.yang@rock-chips.com>
7 years agocmd gpt: test in sandbox
Alison Chaiken [Sun, 4 Jun 2017 22:11:21 +0000 (15:11 -0700)]
cmd gpt: test in sandbox

Make minor changes to README.gpt and sandbox_defconfig to support
testing of the gpt command's functionality in the sandbox.

Signed-off-by: Alison Chaiken <alison@peloton-tech.com>
7 years agosandbox: README: fix partition command invocation
Alison Chaiken [Sun, 4 Jun 2017 22:11:20 +0000 (15:11 -0700)]
sandbox: README: fix partition command invocation

The instructions for creating a disk image that are presently in
README.sandbox fail because sfdisk doesn't know about GPT.

Signed-off-by: Alison Chaiken <alison@peloton-tech.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
7 years agomoveconfig: Support looking for implied CONFIG options
Simon Glass [Fri, 2 Jun 2017 01:39:03 +0000 (19:39 -0600)]
moveconfig: Support looking for implied CONFIG options

Some CONFIG options can be implied by others and this can help to reduce
the size of the defconfig files. For example, CONFIG_X86 implies
CONFIG_CMD_IRQ, so we can put 'imply CMD_IRQ' under 'config X86' and
all x86 boards will have that option, avoiding adding CONFIG_CMD_IRQ to
each of the x86 defconfig files.

Add a -i option which searches for such options.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
7 years agomoveconfig: Support building a simple config database
Simon Glass [Fri, 2 Jun 2017 01:39:02 +0000 (19:39 -0600)]
moveconfig: Support building a simple config database

Add a -b option which scans all the defconfigs and builds a database of
all the CONFIG options used by each. This is useful for querying later.

At present this only works with the separate -b option, which does not
move any configs. It would be possible to adjust the script to build the
database automatically when moving configs, but this might not be useful
as the database does not change that often.

Signed-off-by: Simon Glass <sjg@chromium.org>
7 years agomoveconfig: Add a constant for auto.conf
Simon Glass [Fri, 2 Jun 2017 01:39:01 +0000 (19:39 -0600)]
moveconfig: Add a constant for auto.conf

This filename is used a few times. Move it to a constant before adding
further uses.

Signed-off-by: Simon Glass <sjg@chromium.org>
7 years agomoveconfig: Tidy up the documentation and add hints
Simon Glass [Fri, 2 Jun 2017 01:39:00 +0000 (19:39 -0600)]
moveconfig: Tidy up the documentation and add hints

The newest clean-up features are not mentioned in the docs. Fix this and
add a few hints for particular workflows that are hopefully helpful.

Signed-off-by: Simon Glass <sjg@chromium.org>
7 years agomoveconfig: Allow reading the defconfig list from stdin
Simon Glass [Fri, 2 Jun 2017 01:38:59 +0000 (19:38 -0600)]
moveconfig: Allow reading the defconfig list from stdin

Support passes in a defconfig filename of '-' to read the list from stdin
instead of from a file.

Signed-off-by: Simon Glass <sjg@chromium.org>
7 years agomoveconfig: Support providing a path to the defconfig files
Simon Glass [Fri, 2 Jun 2017 01:38:58 +0000 (19:38 -0600)]
moveconfig: Support providing a path to the defconfig files

It is convenient to provide the full patch to the defconfig files in some
situations, e.g. when the file was generated by a shell command (e.g.
'ls configs/zynq*').

Add support for this, and move the globbing code into a function with its
own documentation.

Signed-off-by: Simon Glass <sjg@chromium.org>
7 years agorockchip: dts: rk3328: add aliases for mmc controller
Kever Yang [Thu, 18 May 2017 08:05:20 +0000 (16:05 +0800)]
rockchip: dts: rk3328: add aliases for mmc controller

Add aliases for mmc controller to get a fixed order with
emmc at index 0 and sdmmc at index 1.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agodm: core: Add uclass_first/next_device_check()
Simon Glass [Mon, 24 Apr 2017 02:10:45 +0000 (20:10 -0600)]
dm: core: Add uclass_first/next_device_check()

Sometimes it is useful to iterate through all devices in a uclass and
skip over those which do not work correctly (e.g fail to probe). Add two
new functions to provide this feature.

The caller must check the return value each time to make sure that the
device is valid. But the device pointer is always returned.

Signed-off-by: Simon Glass <sjg@chromium.org>
7 years agodm: core: Test uclass_first/next_device() on probe failure
Simon Glass [Mon, 24 Apr 2017 02:10:44 +0000 (20:10 -0600)]
dm: core: Test uclass_first/next_device() on probe failure

Add some tests which check the behaviour of uclass_first_device() and
uclass_next_device() when probing of a device fails.

Signed-off-by: Simon Glass <sjg@chromium.org>
7 years agodm: core: Clarify uclass_first/next_device() comments
Simon Glass [Mon, 24 Apr 2017 02:10:43 +0000 (20:10 -0600)]
dm: core: Clarify uclass_first/next_device() comments

These are not as clear as they could be. Tidy them up a bit. Also fix a
tiny code-style nit.

Signed-off-by: Simon Glass <sjg@chromium.org>
7 years agorockchip: rk3288: Add pinctrl support for the gmac ethernet interface
Sjoerd Simons [Mon, 26 Jun 2017 08:01:46 +0000 (10:01 +0200)]
rockchip: rk3288: Add pinctrl support for the gmac ethernet interface

Add support for the gmac ethernet interface to pinctrl. This hardcodes
the setup to match that of the firefly and Radxa Rock2 boards, using the
RGMII phy mode for gmac interface and GPIO4B0 as the phy reset GPIO.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
Signed-off-by: Romain Perier <romain.perier@collabora.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
7 years agorockchip: evb-rk3328: enable boot on regulator
Kever Yang [Thu, 8 Jun 2017 07:32:05 +0000 (15:32 +0800)]
rockchip: evb-rk3328: enable boot on regulator

Enable all the boot-on regulator in default.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Acked-by: Simon Glass <sjg@chromium.org>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
7 years agorockchip: dts: rk3328-evb: add sdmmc-pwren regulator
Kever Yang [Thu, 8 Jun 2017 07:32:06 +0000 (15:32 +0800)]
rockchip: dts: rk3328-evb: add sdmmc-pwren regulator

Use fixed regulator for sdmmc-pwren for sdmmc power.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Acked-by: Simon Glass <sjg@chromium.org>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
7 years agorockchip: pinctrl: rk3328: use gpio instead of sdmmc-pwren
Kever Yang [Thu, 8 Jun 2017 07:32:04 +0000 (15:32 +0800)]
rockchip: pinctrl: rk3328: use gpio instead of sdmmc-pwren

SDMMC-PWREN is a pin to control voltage for SDMMC IO, it may
be high active or low active, the dwmmc driver always assume
the sdmmc-pwren as high active.

Kernel treat this pin as fixed regulator instead of a pin from
controller, and then it can set in dts file upon board schematic,
that's a good solution, we can also do this in u-boot.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Acked-by: Simon Glass <sjg@chromium.org>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
7 years agodoc: rockchip: Add phyCORE-RK3288 RDK to board list
Wadim Egorov [Mon, 19 Jun 2017 10:36:41 +0000 (12:36 +0200)]
doc: rockchip: Add phyCORE-RK3288 RDK to board list

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Acked-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
7 years agorockchip: Add basic support for phyCORE-RK3288 SoM based carrier board
Wadim Egorov [Mon, 19 Jun 2017 10:36:40 +0000 (12:36 +0200)]
rockchip: Add basic support for phyCORE-RK3288 SoM based carrier board

The phyCORE-RK3288 is a SoM (System on Module) containing a RK3288 SoC.
The module can be connected to different carrier boards.
It can be also equipped with different RAM, SPI flash and eMMC variants.
The Rapid Development Kit option is using the following setup:

  - 1 GB DDR3 RAM (2 Banks)
  - 1x 4 KB EEPROM
  - DP83867 Gigabit Ethernet PHY
  - 16 MB SPI Flash
  - 4 GB eMMC Flash

Add basic support for the PCM-947 carrier board, a RK3288 based development
board made by PHYTEC. This board works in a combination with
the phyCORE-RK3288 System on Module.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
7 years agopower: regulator: rk8xx: Allow input current/charger shutdown configuration
Wadim Egorov [Mon, 19 Jun 2017 10:36:39 +0000 (12:36 +0200)]
power: regulator: rk8xx: Allow input current/charger shutdown configuration

The RK818 PMIC contains a charger. Add very basic charger functionality
to be able to regulate the USB input current and charger shutdown limits.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
7 years agopower: regulator: rk8xx: Build get_ldo_reg only for SPL
Wadim Egorov [Mon, 19 Jun 2017 10:36:38 +0000 (12:36 +0200)]
power: regulator: rk8xx: Build get_ldo_reg only for SPL

Enabling CONFIG_SPL_POWER_SUPPORT will cause a compiler warning:
  ‘get_ldo_reg’ defined but not used [-Wunused-function]

Let's wrap get_ldo_reg(), rk808_ldo and rk818_ldo with ENABLE_DRIVER
which is only set for non SPL builds.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
7 years agorockchip: dts: rk3399: control vbus of typec by fixed regulator
Meng Dongyang [Wed, 28 Jun 2017 11:26:32 +0000 (19:26 +0800)]
rockchip: dts: rk3399: control vbus of typec by fixed regulator

Add fixed regulator for the port of typec0 and typec1 to control vbus
instead of gpio.

Signed-off-by: Meng Dongyang <daniel.meng@rock-chips.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
7 years agorockchip: dts: rk3328: support and enable dwc2
Meng Dongyang [Wed, 28 Jun 2017 11:22:45 +0000 (19:22 +0800)]
rockchip: dts: rk3328: support and enable dwc2

Enable dwc2 controller and add fixed regulator for dwc2 controller to
control vbus.

Signed-off-by: Meng Dongyang <daniel.meng@rock-chips.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
7 years agorockchip: rk3328: board: add support of dwc2 gadget
Meng Dongyang [Wed, 28 Jun 2017 11:22:44 +0000 (19:22 +0800)]
rockchip: rk3328: board: add support of dwc2 gadget

Probe dwc2 udc in the function of board_usb_start to enable
usb gadget function.

Signed-off-by: Meng Dongyang <daniel.meng@rock-chips.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
7 years agousb: dwc2: use dev_read_bool() instead of fdt_getprop()
Meng Dongyang [Wed, 28 Jun 2017 11:22:43 +0000 (19:22 +0800)]
usb: dwc2: use dev_read_bool() instead of fdt_getprop()

Use dev_read_bool() instead of fdt_getprop() to get the property
from DTS. And add a comment for "hnp-srp-disable" property to
fully describe its effect.

Signed-off-by: Meng Dongyang <daniel.meng@rock-chips.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
7 years agorockchip: dts: rk3328: add fixed regulator node for xhci
Meng Dongyang [Wed, 28 Jun 2017 11:22:41 +0000 (19:22 +0800)]
rockchip: dts: rk3328: add fixed regulator node for xhci

The driver changes gpio to fixed regulator to control vbus, so add
fixed regulator node in DTS for xhci driver.

Signed-off-by: Meng Dongyang <daniel.meng@rock-chips.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
7 years agousb: Kconfig: migrate USB_DWC2 to Kconfig
Philipp Tomsich [Mon, 3 Jul 2017 16:30:06 +0000 (18:30 +0200)]
usb: Kconfig: migrate USB_DWC2 to Kconfig

This change migrates the USB_DWC2 configuration item to Kconfig
and runs moveconfig to adjust header files and defconfig.

Signed-off-by: Meng Dongyang <daniel.meng@rock-chips.com>
Split off into a separate patch:
Ran moveconfig to migrate other boards:
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
7 years agorockchip: dts: rk3328: add fixed regulator node for xhci
Meng Dongyang [Wed, 28 Jun 2017 11:22:41 +0000 (19:22 +0800)]
rockchip: dts: rk3328: add fixed regulator node for xhci

The driver changes gpio to fixed regulator to control vbus, so add
fixed regulator node in DTS for xhci driver.

Signed-off-by: Meng Dongyang <daniel.meng@rock-chips.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
7 years agousb: host: xhci-rockchip: use fixed regulator to control vbus
Meng Dongyang [Wed, 28 Jun 2017 11:22:40 +0000 (19:22 +0800)]
usb: host: xhci-rockchip: use fixed regulator to control vbus

Use fixed regulator to control the voltage of vbus. Enable vbus
supply when usb start and disable vbus supply when usb stop.

Signed-off-by: Meng Dongyang <daniel.meng@rock-chips.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
7 years agousb: Kconfig: config USB_XHCI_ROCKCHIP depends on DM_REGULATOR and DM_USB
Meng Dongyang [Wed, 28 Jun 2017 11:22:39 +0000 (19:22 +0800)]
usb: Kconfig: config USB_XHCI_ROCKCHIP depends on DM_REGULATOR and DM_USB

The xhci-rockchip driver depends on DM_REGULATOR and DM_USB.
So add dependent features for xhci-rockchip driver in Kconfig.

Signed-off-by: Meng Dongyang <daniel.meng@rock-chips.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
7 years agorockchip: rk3036: sync os_reg2 define with other soc
Kever Yang [Tue, 13 Jun 2017 08:10:46 +0000 (16:10 +0800)]
rockchip: rk3036: sync os_reg2 define with other soc

Rockchip using the same bit definition for dram info and write
to os_reg, the col and bw info is not correct and let's fix it.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
7 years agorockchip: rk3036 remove CONFIG_RAM from defconfig
Kever Yang [Tue, 13 Jun 2017 08:10:45 +0000 (16:10 +0800)]
rockchip: rk3036 remove CONFIG_RAM from defconfig

rk3036 sdram driver does not use DM, remove CONFIG_RAM first.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
7 years agorockchip: video: mipi: Modify format type for debug message
eric.gao@rock-chips.com [Wed, 21 Jun 2017 03:15:57 +0000 (11:15 +0800)]
rockchip: video: mipi: Modify format type for debug message

Modify format type for debug message.

Signed-off-by: Eric Gao <eric.gao@rock-chips.com>
7 years agorockchip: video: mipi: Modify variable type for arm32 compatibility
eric.gao@rock-chips.com [Wed, 21 Jun 2017 03:12:50 +0000 (11:12 +0800)]
rockchip: video: mipi: Modify variable type for arm32 compatibility

Some address relevant varibable is defined originally as u64. To
compatible with arm32, this patch change them to uintptr_t type.

Signed-off-by: Eric Gao <eric.gao@rock-chips.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agorockchip: pwm: fix the register layout for the PWM controller
eric.gao@rock-chips.com [Mon, 19 Jun 2017 06:45:36 +0000 (14:45 +0800)]
rockchip: pwm: fix the register layout for the PWM controller

According to rk3288 spec, the pwm register order is:
    PWM_PWM0_CNT,
    PWM_PWM0_PERIOD_HPR,
    PWM_PWM0_DUTY_LPR,
    PWM_PWM0_CTRL
but the source code's order is:
  struct rk3288_pwm {
    u32 cnt;
    u32 duty_lpr;
    u32 period_hpr;
    u32 ctrl;
  };

So, correct it here. It is the same as RK3399.

Signed-off-by: Eric Gao <eric.gao@rock-chips.com>
Edited the commit message:
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
7 years agoRevert "mmc: dw_mmc: rockchip: select proper card clock"
Kever Yang [Wed, 14 Jun 2017 08:31:49 +0000 (16:31 +0800)]
Revert "mmc: dw_mmc: rockchip: select proper card clock"

The origin patch get rockchip dwmmc by name 'ciu', which lead
to the SPL not able to remove 'clock-names' node in dts.
I'm not saying this is not correct, but I would prefer to handle
this in dts or clock driver to save memory for SPL.
For example the rk3288 SPL size has out of memory if not enable
BACK_TO_BROM option, there are many other SoCs has less internal
memory than rk3288.

This reverts commit 480a9b834c661fc88217f50bdf780192c3018d66.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
7 years agorockchip: firefly-rk3399: enable dwmmc driver for the board
Kever Yang [Wed, 14 Jun 2017 08:31:48 +0000 (16:31 +0800)]
rockchip: firefly-rk3399: enable dwmmc driver for the board

Enable mmc_dw_rockchip driver, disable CONFIG_SPL_OF_PLATDATA
first for some dependence patches still not merged.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Tested-by: Vagrant Cascadian <vagrant@debian.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agorockchip: firefly-rk3399: dts: enable sdmmc device
Kever Yang [Wed, 14 Jun 2017 08:31:47 +0000 (16:31 +0800)]
rockchip: firefly-rk3399: dts: enable sdmmc device

Enable sdmmc device and add the spl boot device sequence.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
7 years agorockchip: dwmmc: use max-frequency when OF_PLATDATA enabled
Kever Yang [Wed, 14 Jun 2017 08:31:46 +0000 (16:31 +0800)]
rockchip: dwmmc: use max-frequency when OF_PLATDATA enabled

Since the 'clock-freq-min-max' is deprecated, we use max-frequency for
all rockchip SoC dwmmc controller.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
7 years agorockchip: rk3328: dtsi use max-frequency for mmc node
Kever Yang [Wed, 14 Jun 2017 08:31:45 +0000 (16:31 +0800)]
rockchip: rk3328: dtsi use max-frequency for mmc node

Since the 'clock-freq-min-max' is deprecated, we use max-frequency.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
7 years agorockchip: rk3288: dtsi use max-frequency for mmc node
Kever Yang [Wed, 14 Jun 2017 08:31:44 +0000 (16:31 +0800)]
rockchip: rk3288: dtsi use max-frequency for mmc node

Since the 'clock-freq-min-max' is deprecated, we use max-frequency.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
7 years agorockchip: rk3036: dtsi use max-frequency for mmc node
Kever Yang [Wed, 14 Jun 2017 08:31:43 +0000 (16:31 +0800)]
rockchip: rk3036: dtsi use max-frequency for mmc node

Since the 'clock-freq-min-max' is deprecated, we use max-frequency.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
7 years agorockchip: add evb_rk3229 board
Kever Yang [Fri, 23 Jun 2017 09:17:54 +0000 (17:17 +0800)]
rockchip: add evb_rk3229 board

evb_rk3229 is a RK3229 based board, with:
- 8GB eMMC;
- 1GB DDR SDRAM;
- 2 USB2.0 HOST port;
- 1 MAC port;
- 1 HDMI port;
- IR;
- WiFi;

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
7 years agorockchip: rk322x: add sysreset driver
Kever Yang [Fri, 23 Jun 2017 09:17:53 +0000 (17:17 +0800)]
rockchip: rk322x: add sysreset driver

Rockchip rk322x sysreset is much like rk3036 and other Rockchip SoCs,
only difference is that the target register address is different.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
7 years agorockchip: rk322x: add basic soc support
Kever Yang [Fri, 23 Jun 2017 09:17:52 +0000 (17:17 +0800)]
rockchip: rk322x: add basic soc support

Enable soc support for SPL and U-boot skeleton.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
7 years agorockchip: rk322x: add dts file
Kever Yang [Fri, 23 Jun 2017 09:17:51 +0000 (17:17 +0800)]
rockchip: rk322x: add dts file

The dts files are from kernel and with modify to adapt U-Boot.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
7 years agorockchip: rk322x: add pinctrl driver
Kever Yang [Fri, 23 Jun 2017 09:17:50 +0000 (17:17 +0800)]
rockchip: rk322x: add pinctrl driver

Add init pinctrl driver support for:
- i2c;
- spi;
- uart;
- pwm;
- emmc/sdmmc;

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
7 years agorockchip: rk322x: add clock driver
Kever Yang [Fri, 23 Jun 2017 09:17:49 +0000 (17:17 +0800)]
rockchip: rk322x: add clock driver

Add clock driver init support for:
- cpu, bus clock init;
- emmc, sdmmc clock;
- ddr clock;

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Fixed format specified (%x -> %p) in clk_rk322x.c:
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
7 years agorockchip: mkimage: add support for rk322x soc
Kever Yang [Fri, 23 Jun 2017 09:17:48 +0000 (17:17 +0800)]
rockchip: mkimage: add support for rk322x soc

Add support for rk322x package header in mkimage tool.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
7 years agorockchip: rv1108: disable CONFIG_RAM before we have driver
Kever Yang [Fri, 23 Jun 2017 08:11:12 +0000 (16:11 +0800)]
rockchip: rv1108: disable CONFIG_RAM before we have driver

The rv1108 do not have DRAM driver now, so disable it first,
or else it will get conflict with the sdram common code.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
7 years agorockchip: correct the bank0 ram size
Kever Yang [Fri, 23 Jun 2017 08:11:11 +0000 (16:11 +0800)]
rockchip: correct the bank0 ram size

The bank0 ram size should be the DRAM size minus reserved size,
the DRAM size may be 1GB, 2GB, 4GB, we can not hard code it.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Added DECLARE_GLOBAL_DATA_PTR for RK3328, RK3368 and RK3399:
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
7 years agorockchip: dts: rk3368: add dmc node
Kever Yang [Fri, 23 Jun 2017 08:11:10 +0000 (16:11 +0800)]
rockchip: dts: rk3368: add dmc node

Add dmc node to enable sdram driver.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
7 years agorockchip: dts: rk3328: add dmc node
Kever Yang [Fri, 23 Jun 2017 08:11:09 +0000 (16:11 +0800)]
rockchip: dts: rk3328: add dmc node

Add a dmc node for sdram driver.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
7 years agorockchip: rk3368: add sdram driver for U-Boot
Kever Yang [Fri, 23 Jun 2017 08:11:08 +0000 (16:11 +0800)]
rockchip: rk3368: add sdram driver for U-Boot

Add sdram driver in U-Boot for get the correct sdram size from
sys_reg, so that U-Boot can co-work with Rockchip loader or SPL
to get different dram capability and then tell the kernel.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
7 years agorockchip: rk3328: add sdram driver in U-Boot
Kever Yang [Fri, 23 Jun 2017 08:11:07 +0000 (16:11 +0800)]
rockchip: rk3328: add sdram driver in U-Boot

Add sdram driver in U-Boot for get the correct sdram size from
sys_reg, so that U-Boot can co-work with Rockchip loader or SPL
to get different dram capability and then tell the kernel.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
7 years agorockchip: use common sdram function
Kever Yang [Fri, 23 Jun 2017 08:11:06 +0000 (16:11 +0800)]
rockchip: use common sdram function

Replace the sdram_init() in board init and rockchip_sdram_size() in
sdram driver for all the Rockchip SoCs which enable CONFIG_RAM.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Make dram_init() in rk3036-board.c conditional on CONFIG_RAM:
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
7 years agorockchip: add sdram_common for common functions
Kever Yang [Fri, 23 Jun 2017 08:11:05 +0000 (16:11 +0800)]
rockchip: add sdram_common for common functions

There are some functions like sdram_size_mb can be re-used for
different rockchip SoCs, just put them into common file.
Add board_get_usable_ram_top() for ram_top init base on
SDRAM_MAX_SIZE.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Added SDRAM_MAX_SIZE definition for RK3036:
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
fixup: 3036 fix for sdram_common