]> git.baikalelectronics.ru Git - uboot.git/commit
sunxi: H3: Rework MBUS priority setup
authorPhilipp Tomsich <philipp.tomsich@theobroma-systems.com>
Mon, 2 Jan 2017 11:48:38 +0000 (11:48 +0000)
committerJagan Teki <jagan@openedev.com>
Wed, 4 Jan 2017 15:37:42 +0000 (16:37 +0100)
commit76c54428159ddfa9e0b2fef2a15fa231b5651e28
treed2b7f3babc4a904b141a98b7cb477cb58c6dfff0
parentb6059b18e4511ce6c77fe88856ad63ebe569c907
sunxi: H3: Rework MBUS priority setup

So far the MBUS priority setup was done by writing "magic" values taken
from a DRAM controller register dump after a boot0 run.
By peeking at the Linux (sic!) MBUS driver [1] from the Allwinner BSP
kernel, we learned more about the actual meaning of those bits.
Add macros and refactor the setup function to make the MBUS setup much
more readable and meaningful.
The actual values used now are a transformation of the values used
before, which are assembled by the new code to result in the same register
writes. So this rework does not change any settings, also the code size
stays the same.

The respective source files in the BSP kernel had a proper GPL header,
so lifting this code and information into U-Boot is legal.

[Andre: provide a convenience macro to fit definitions on one line]

[1] https://github.com/longsleep/linux-pine64/blob/lichee-dev-v3.10.65/drivers/bus/sunxi_mbus.c

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
arch/arm/mach-sunxi/dram_sun8i_h3.c