The limit needs to be raised as soon as possible to prevent boot loops
on empty or removed battery. The default 450mA limit is crossed when
eMMC or SD card starts seeing reads in SPL after DRAM was already
enabled in TPL.
But this fix is good enough to prevent boot loops when the phone can still
get ~100mA from the battery to cover the difference between 450 mA current
limit and ~550 mA needed to load main U-Boot from eMMC while the DRAM
is already initialized by TPL.
Detect low battery voltage and prevent boot, set current limit to
something even USB 3.0 port can handle, and charge the battery
until at least 3.5V is reached. Typically the charging power will
be ~2W in this mode, which will reach the target voltage within 15
minutes or so and the phone will then boot.
If the USB power is not available, just blink the red led quickly
and power off. If USB power is available, indicate progress of charging:
- dead battery: 100ms green LED flash each second
- trickle charging: 200ms green LED flash each second
- cc-cv: duty cycle indicates charging current (5-95% of 2A)
with period of 2s
- various failures while USB power is connected, blink red LED
5 times quickly, wait 1s, and repeat until the failure clears
TODO:
- allow volume key input (raise / lower input current limit)
- power button, skip the algorithm and continue boot at user's
own risk
Signed-off-by: Ondrej Jirman <megi@xff.cz>
Per dw_mmc databook, it's recommended to reset the host controller if
some data-related error occurred.
Implement a reset mechanism.
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
Co-developed-by: Jason Zhu <jason.zhu@rock-chips.com>
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
[eugen.hristev@collabora.com: modified a bit the variables initialization]
Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Shows a menu of items that can be controlled using touch panel.
This is useful for touch based devices like tablets to select
alternative boot options (multi-boot).
Signed-off-by: Ondrej Jirman <megous@megous.com>
Touchapnel devices are useful in u-boot for implementation of boot
menu user interfaces on tablets and other touch based devices.
This uclass implements start, stop and get_touches interface methods.
Signed-off-by: Ondrej Jirman <megous@megous.com>
This is used for video output using video bridge implementation of
MIPI-DSI, like with the recently added dw_mipi_dsi_rockchip.c
driver.
The original code path when the UCLASS_DISPLAY device is found is
untouched. The video bridge branch is taken only when the
UCLASS_VIDEO_BRIDGE device is found at the remote endpoint's parent.
This was tested to work on Pinephone Pro.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Cc: Philipp Tomsich <philipp.tomsich@vrull.eu>
Cc: Kever Yang <kever.yang@rock-chips.com>
Cc: Chris Morgan <macromorgan@hotmail.com>
cpll in U-Boot runs at 384 MHz, set various VOP related clocks to produce
roughly 400 and 100 MHz just like in Linux.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
Boards like Radxa ROCK 5 Model B and NanoPi R5C require PCI to be
initialized in order to discover their onboard network controllers.
During standard boot, PCI gets initialized after faster boot media have
been evaluated. However when an EFI bootflow is run from a fast boot
media, PCI initialization may not have happended and as a result no
network device is exposed to EFI.
Fix this by initializing PCI during EFI bootflow when no ethernet device
can be found.
This allows chainloading e.g. iPXE on ROCK 5B and NanoPi R5C without
having to enable PCI_INIT_R. Enabling of PCI_INIT_R has the side affect
of slowing down booting from faster boot media, by adding ~1 second off
boot delay for each unocupied M.2 slot.
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>