We use part_get_info_by_name to get partition, this will read MBR, GPT
header and GPT entry every time, optimize to read only once.
Change-Id: I4d6c508311f7cc661aa991b3c61460a2b8d63fac
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
The pwm of rk3328 is almost the same as rk3288, except
the lock feature, would implement in feature.
Change-Id: I22650128c456f25aa9815718386c50142cac404a
Signed-off-by: David Wu <david.wu@rock-chips.com>
The set_parent implementations do not make sense when OF_PLATDATA is
enabled. We guard these against OF_PLATDATA and don't populate the
set_parent-op when this is the case.
Change-Id: I37c384bf6851666550b8b3902d79b9278cff5074
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Signed-off-by: David Wu <david.wu@rock-chips.com>
Implement the setting parent for gmac clock, and add internal
pll div set for mac clk.
Change-Id: I4f75d0c1e35bbe7ff0af07d05dbb42f4732d5eb7
Signed-off-by: David Wu <david.wu@rock-chips.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
The RK3288 CRU-node assigns rates to a number of clocks that are not
implemented in the RK3288 clock-driver (but which have been
sufficiently initialised from rkclk_init()): for these clocks, we
implement the gmac clock set parent, but simply ignore the
others' set_rate() operation and return 0 to signal success.
Change-Id: Ic1a41634aba674001beb0e7e5ca3f7f2fa008e51
Signed-off-by: David Wu <david.wu@rock-chips.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
The LCDC assigned rate is 0, it will make boot error,
error log:"pll_para_config: the frequency can not be
0 Hz". Remove them, and the lcdc driver will do the
correct clock rate setting.
Change-Id: Ic189f6747e36a2f4083f81d9db899a9f44fe0936
Signed-off-by: David Wu <david.wu@rock-chips.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Add gmac config support for rk3229 evb.
Change-Id: I11514c969b35c7418aae6c0c66fe7003d3aa3b5c
Signed-off-by: David Wu <david.wu@rock-chips.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
The GMAC in the RK3228 once again is identical to the incarnation in
the RK3288 and the RK3399, except for where some of the configuration
and control registers are located in the GRF.
This adds the RK3368-specific logic necessary to reuse this driver.
Change-Id: Iba16013ad469196e0d0674fa62d1dcecf6749968
Signed-off-by: David Wu <david.wu@rock-chips.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Assuming mac_clk is fed by an external clock, set clk_rmii_src
clock select control register from IO for rgmii interface.
Change-Id: I6405c3b2ead429084118c544bcc461e0b301d77a
Signed-off-by: David Wu <david.wu@rock-chips.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Clean the iomux definitions at grf_rk322x.h, and move them into
pinctrl-driver for resolving the compiling error of redefinition.
After that, define the uart2 iomux at rk322x-board file.
Change-Id: If409e90706650de9fbe75b5c5fa47498cbbc79fe
Signed-off-by: David Wu <david.wu@rock-chips.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Enable GMAC configs for evb-rk3328
Change-Id: I85d61ae4fedc3b6e9533b4913fa9666670f79356
Signed-off-by: David Wu <david.wu@rock-chips.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
The GMAC2IO in the RK3328 once again is identical to the incarnation in
the RK3288 and the RK3399, except for where some of the configuration
and control registers are located in the GRF.
This adds the RK3328-specific logic necessary to reuse this driver.
Change-Id: If00fc0dc957cf3e29faa1d1d0611a6e6edd29ced
Signed-off-by: David Wu <david.wu@rock-chips.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
The rk3328 soc has two gmac controllers, one is gmac2io,
the other is gmac2phy. We use the gmac2io rgmii interface
for 1000M phy here.
Change-Id: I4963f03f6aea2c7196f33dae0bca38a432c80690
Signed-off-by: David Wu <david.wu@rock-chips.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Clean the iomux definitions at grf_rk3328.h, and move them into
pinctrl-driver for resolving the compiling error of redefinition.
Change-Id: I6297fa72bff03a0d0620982b2f8745cd1dbe2e8e
Signed-off-by: David Wu <david.wu@rock-chips.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
The rv1108 GMAC only support rmii interface, so need to add the
set_rmii() ops. Use the phy current interface to set rmii or
rgmii ops. At the same time, need to set the mac clock rate of
rmii with 50M, the clock rate of rgmii with 125M.
Change-Id: Ie669aefd1af254f4f7c71ac82decc01bd61e9e5b
Signed-off-by: David Wu <david.wu@rock-chips.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
If we include both the rk3288_grf.h and rv1108_grf.h, it will cause the
conflicts of redefinition. Clean the iomux definitions at grf_rv1108.h,
and move them into pinctrl-driver.
Change-Id: Ie47ccd77963de909acf3494ad7e3ce20b3c560a6
Signed-off-by: David Wu <david.wu@rock-chips.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
The last 4 grf registers offset of rv1108 are wrong, fix them
for correct usage.
Change-Id: I4bbc7e8fcd04321d5ebcfb2c1a288ea49c0eddfc
Signed-off-by: David Wu <david.wu@rock-chips.com>
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>
If the Ethernet address is not set, the network can't work,
enable the random address config for default use.
Change-Id: If639e0bc19f3b9dc749cbedc436a2d661f42d724
Signed-off-by: David Wu <david.wu@rock-chips.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Give the mac controller the correct tx-delay and rx-delay value
for the rgmii mode transmission. If they are not matched, there
would be Ethernet packets lost, the net feature may not work.
Change-Id: I4ff6bd47fe75ff6b480de45df2e0e4e611e3950d
Signed-off-by: David Wu <david.wu@rock-chips.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
The RK3399 CRU-node assigns rates to a number of clocks that are not
implemented in the RK3399 clock-driver (but which have been
sufficiently initialised from rkclk_init()): for these clocks, we
simply ignore the set_rate() operation and return 0 to signal success.
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Tested-by: David Wu <david.wu@rock-chips.com>
Series-changes: 2
- Fixed David's email address.
(cherry picked from commit d2f1f1abafbedd3580334f2564bfea918e49522d)
Change-Id: Ic19614e75b76d8159cf03ac4adb180ca5a8688fd
Signed-off-by: David Wu <david.wu@rock-chips.com>
Linux uses the properties 'assigned-clocks', 'assigned-clock-parents'
and 'assigned-clock-rates' to configure the clock subsystem for use
with various peripheral nodes.
This implements clk_set_defaults() and hooks it up with the general
device probibin in drivers/core/device.c: when a new device is probed,
clk_set_defaults() will be called for it and will process the
properties mentioned above.
Note that this functionality is designed to fail gracefully (i.e. if a
clock-driver does not implement set_parent(), we simply accept this
and ignore the error) as not to break existing board-support.
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Tested-by: David Wu <david.wu@rock-chips.com>
Series-changes: 2
- Fixed David's email address.
Series-version: 2
Cover-letter:
clk: support assigned-clock, assigned-clock-parents, assigned-clock-rates
For various peripherals on Rockchip SoCs (e.g. for the Ethernet GMAC),
the parent-clock needs to be set via the DTS. This adds the required
plumbing and implements the GMAC case for the RK3399.
END
(cherry picked from commit f4fcba5c5baaaa9d477d753f97124efdb8e45893)
Change-Id: I549891987c5a3e8546b96f1f54ad575950f92b12
Signed-off-by: David Wu <david.wu@rock-chips.com>
This implements the (newly added) set_parent() operation for the
RK3399 with a focus on allowing the RGMII clock parent to be
configured via the assigned-clock-parents property of the GMAC node.
This implementation supports only the GMAC (in fact only the RGMII
clock parent) and allows to set this clock's parent either to the
internal SCLK_GMAC or to an external clock input (identifiable by it
providing a 'clock-output-name' of "gmac_clkin").
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Tested-by: David Wu <david.wu@rock-chips.com>
Series-changes: 2
- Fixed David's email address.
(cherry picked from commit a45f17e8b9f91628936349ef40a06d10dc9c08ae)
Change-Id: I64910d7fa0b520194a5bd2b82e2bb5fbd5b6637c
Signed-off-by: David Wu <david.wu@rock-chips.com>
The logic in clk_get_by_index() may be useful for other properties
than 'clocks': e.g. 'assigned-clocks' and 'assigned-clock-parents'
follows the same model.
This commit refactors clk_get_by_index() by introducing an internal
function clk_get_by_indexed_prop() that allows to specify the name
of the property to process. The original clk_get_by_index() call
is simply directed through this helper function with the property
name fixed to "clocks".
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Tested-by: David Wu <david.wu@rock-chips.com>
Series-changes: 2
- Fixed David's email address.
(cherry picked from commit 95f9a7e5957093612b1e8447ac5460a6adcea3ba)
Change-Id: I898e38a99e63c851a0c8285670a4c86a711a6972
Signed-off-by: David Wu <david.wu@rock-chips.com>
Clocks may support multiple parents: this change introduces an
optional operation on the clk-uclass to set a clock's parent.
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Tested-by: David Wu <david.wu@rock-chips.com>
Series-changes: 2
- Fixed David's email address.
(cherry picked from commit f7d1046da18fd03a047b5f4d290a8ab8550ebf73)
Change-Id: I92065a132988a66b7d86a936766429ea024f4d1e
Signed-off-by: David Wu <david.wu@rock-chips.com>
The clk uclass was converted to support a live device tree recently,
hence the global data pointer declarations are no longer needed.
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Mario Six <mario.six@gdsys.cc>
(cherry picked from commit 7fe1b063d8eef2549bd53d618dcecb6723e1354c)
Change-Id: If3dbb3dfc7b2ab5a94846c0e11635cc1c2af563c
Signed-off-by: David Wu <david.wu@rock-chips.com>
checkpatch.pl complains that the clk_ops structures used in clk-uclass.c
ought to be const, so we mark them as const.
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Mario Six <mario.six@gdsys.cc>
(cherry picked from commit 268453be7c8f9fb93e1c40b9ce5f7382335ebeb4)
Change-Id: I4939e3354672f1200a8bcee9f747df5ccca1214d
Signed-off-by: David Wu <david.wu@rock-chips.com>
default use current directory as output dir, you can also
assign output dir by command "O=[directory]".
Example:
./make.sh evb-px30 O=rockdev
Change-Id: I1a7efb7a273d147d81b7fa9bb0bbbe00a8f5d12e
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
These interfaces are moved from kernel 4.4:
./drivers/firmware/rockchip_sip.c
Only those maybe used in U-Boot are moved.
Change-Id: I5896606c992056199f116692cca3c6d9530fd2f9
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
We may read the dtb file before bootrkp command, we can use it directly.
Change-Id: Iff6dcd037d9d3637f1be81f458140189c13b1977
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Enable and update the rockchip_display_fixup() so that we can update the
logo reserve memory node for kernel dts.
Change-Id: I34e3812689052a63ed58c61a41bca53798ffd666
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Add API for rockchip pass uboot logo memory info to kernel.
Change-Id: Ib3bfadc381efae21359a43654493e8e0f4e67dd0
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
The kernel image follows the header(default 0x800) in boot.img, we need to fix
the load address for boot.img so that kernel image can align to 0x80000 as
required by ARM64 kernel booting.
Change-Id: I526ff38bfce2d8fd1571aff817ade11086f196e3
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
in some case, we need persistent file system in NOR or NAND,
such as squashfs, we need to boot system in flash.
Change-Id: I46e4ae3e43f96f77f1ca6b4df8424fce19866226
Signed-off-by: Yu YongZhen <yuyz@rock-chips.com>
Enable warning treat as error cflags to avoid further compile warning.
Change-Id: Ibfd959b4afa4724c4d6920985f21e55b959a0ed0
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Each uclass has a driver name which we can use to look up the uclass. This
is useful for logging, where the uclass ID is used as the category.
Add a function to handle this, as well as a test.
Change-Id: Id221809d6f9f818b52a5bf88f4e12d409a070f05
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 6e43d1b19982b1756b7c607569d1778e556d6577)
Judging from its name and parameters, device_is_compatible looks like it
is compatible with a live device tree, but it actually isn't.
Make it compatible with a live device tree.
Reviewed-by: Simon Glass <sjg@chromium.org>
Change-Id: I892142d611ab5068d4ec6bdb51666a673b679794
Signed-off-by: Mario Six <mario.six@gdsys.cc>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 29d11b8838bb2aa324b8873159cbd7088870a75b)