Pull request for efi-2022-01-rc4-3

Documentation:
 
 * add Calxeda Highbank/Midway board documentation
 
 Bug fixes:
 
 * call part_init() in blk_get_device_by_str() only for MMC
 * fix an 'undefined' error in some driver model macros
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEbcT5xx8ppvoGt20zxIHbvCwFGsQFAmG+M5IACgkQxIHbvCwF
 GsQhbw/+LyvTg6c1mmo7icwRI/h6rpfX9mrVMXfdyGiP8A9OyzZ2lCFV1duCKP7B
 e5+0VZ/Heu2vCkWw/7PT67uKbjyq+DzVWytujAAebxsSPj4aRS+KtUiqtQChkSTw
 i2nYJb0HW8UwP+oprdpvE8Sia4o2wM2E7jJI3103Vr9lIbkY+nML7BL9VH7J+pNx
 ZEbtkXTaJqwdF+z8+XXiYBYpQrb/2DneV346tttyj43up7BD2fZC/P93n8pTd4/i
 3mTcSlvRNfXwxba9PPslzLiaxEwqpxAusmIwL7Kbaruo1gNXEolSYO5VCSX3/xlJ
 DDYxAJAeM9qnXcbhun+MFZsnkhT1M/qPxiJNox7BThK/XDGEdvV6HKmiAY53DnQ0
 /f4OLoHfxLXJmGVzmpoDo3R5nfhdT1SRKyrKx3r+9IeyipF6122nW3eEfLomMaka
 5VsM2i0/aCNJFWWWTTLnY9LEi66zdHqOpQLfUKR3yr8Rp5NY2XG9rRpPQ1hHyImp
 YCVeeN0RiHr0/5QaNgoWAOViBrN9PrxN6lHHWekV7swNohQIMrT0+bgGUR9JJBNQ
 ylRvzhdK/yhMsvR+Gbo/sBa+U1GTV/HDlFeNinB41Gi1FAX9ubNpD40BuvRWYdSx
 oSq5iQk56dWk12mYCg3IY09gx1tnzrGELrSs6CNPE1GaOMAUbs8=
 =Hs83
 -----END PGP SIGNATURE-----

Merge tag 'efi-2022-01-rc4-3' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request for efi-2022-01-rc4-3

Documentation:

* add Calxeda Highbank/Midway board documentation

Bug fixes:

* call part_init() in blk_get_device_by_str() only for MMC
* fix an 'undefined' error in some driver model macros
This commit is contained in:
Tom Rini 2021-12-18 14:39:21 -05:00
commit d3213c26b5
7 changed files with 119 additions and 5 deletions

View file

@ -430,7 +430,8 @@ int blk_get_device_by_str(const char *ifname, const char *dev_hwpart_str,
* Always should be done, otherwise hw partition 0 will return stale
* data after displaying a non-zero hw partition.
*/
part_init(*dev_desc);
if ((*dev_desc)->if_type == IF_TYPE_MMC)
part_init(*dev_desc);
#endif
cleanup:

View file

@ -0,0 +1,78 @@
Calxeda Highbank/Midway board support
=====================================
The Calxeda ECX-1000 ("Highbank") and ECX-2000 ("Midway") were ARM based
servers, providing high-density cluster systems. A single motherboard could
host between 12 and 48 nodes, each with their own quad-core ARMv7
processor, private DRAM and peripherals, connected through a high-bandwith
and low-latency "fabric" network. Multiple motherboards could be connected
together, to extend this fabric.
For the purpose of U-Boot we just care about a single node, this can be
used as a single system, just using the fabric to connect to some Ethernet
network. Each node boots on its own, either from a local hard disk, or
via the network.
The earlier ECX-1000 nodes ("Highbank") contain four ARM Cortex-A9 cores,
a Cortex-M3 system controller, three 10GBit/s MACs and five SATA
controllers. The DRAM is limited to 4GB.
The later ECX-2000 nodes ("Midway") use four Cortex-A15 cores, alongside
two Cortex-A7 management cores, and support up to 32GB of DRAM, while
keeping the other peripherals.
For the purpose of U-Boot those two SoCs are very similar, so we offer
one build target. The subtle differences are handled at runtime.
Calxeda as a company is long defunct, and the remaining systems are
considered legacy at this point.
Bgilding U-Boot
---------------
There is only one defconfig to cover both systems::
$ make highbank_defconfig
$ make
This will create ``u-boot.bin``, which could become part of the firmware update
package, or could be chainloaded by the existing U-Boot, see below for more
details.
Boot process
------------
Upon powering up a node (which would be controlled by some BMC style
management controller on the motherboard), the system controller ("ECME")
would start and do some system initialisation (fabric registration,
DRAM init, clock setup). It would load the device tree binary, some secure
monitor code (``a9boot``/``a15boot``) and a U-Boot binary from SPI flash
into DRAM, then power up the actual application cores (ARM Cortex-A9/A15).
They would start executing ``a9boot``/``a15boot``, registering the PSCI SMC
handlers, then dropping into U-Boot, but in non-secure state (HYP mode on
the A15s).
U-Boot would act as a mere loader, trying to find some ``boot.scr`` file on
the local hard disks, or reverting to PXE boot.
Updating U-Boot
---------------
The U-Boot binary is loaded from SPI flash, which is controlled exclusively
by the ECME. This can be reached via IPMI using the LANplus transport protocol.
Updating the SPI flash content requires vendor specific additions to the
IPMI protocol, support for which was never upstreamed to ipmitool or
FreeIPMI. Some older repositories for `ipmitool`_, the `pyipmi`_ library and
a Python `management script`_ to update the SPI flash can be found on Github.
A simpler and safer way to get an up-to-date U-Boot running, is chainloading
it via the legacy U-Boot::
$ mkimage -A arm -O u-boot -T standalone -C none -a 0x8000 -e 0x8000 \
-n U-Boot -d u-boot.bin u-boot-highbank.img
Then load this image file, either from hard disk, or via TFTP, from the
existing U-Boot, and execute it with bootm::
=> tftpboot 0x8000 u-boot-highbank.img
=> bootm
.. _`ipmitool`: https://github.com/Cynerva/ipmitool
.. _`pyipmi`: https://pypi.org/project/pyipmi/
.. _`management script`: https://github.com/Cynerva/cxmanage

View file

@ -0,0 +1,9 @@
.. SPDX-License-Identifier: GPL-2.0+
Highbank
========
.. toctree::
:maxdepth: 2
highbank

View file

@ -16,6 +16,7 @@ Board-specific doc
coreboot/index
emulation/index
google/index
highbank/index
intel/index
kontron/index
microchip/index

View file

@ -672,6 +672,19 @@ int blk_create_devicef(struct udevice *parent, const char *drv_name,
return 0;
}
int blk_probe_or_unbind(struct udevice *dev)
{
int ret;
ret = device_probe(dev);
if (ret) {
log_debug("probing %s failed\n", dev->name);
device_unbind(dev);
}
return ret;
}
int blk_unbind_all(int if_type)
{
struct uclass *uc;

View file

@ -370,6 +370,18 @@ int blk_create_devicef(struct udevice *parent, const char *drv_name,
const char *name, int if_type, int devnum, int blksz,
lbaint_t lba, struct udevice **devp);
/**
* blk_probe_or_unbind() - Try to probe
*
* Try to probe the device, primarily for enumerating partitions.
* If it fails, the device itself is unbound since it means that it won't
* work any more.
*
* @dev: The device to probe
* Return: 0 if OK, -ve on error
*/
int blk_probe_or_unbind(struct udevice *dev);
/**
* blk_unbind_all() - Unbind all device of the given interface type
*

View file

@ -959,8 +959,8 @@ static inline bool device_is_on_pci_bus(const struct udevice *dev)
* @parent: parent device to scan
*/
#define device_foreach_child_of_to_plat(pos, parent) \
for (int _ret = device_first_child_ofdata_err(parent, &dev); !_ret; \
_ret = device_next_child_ofdata_err(&dev))
for (int _ret = device_first_child_ofdata_err(parent, &pos); !_ret; \
_ret = device_next_child_ofdata_err(&pos))
/**
* device_foreach_child_probe() - iterate through children, probing them
@ -976,8 +976,8 @@ static inline bool device_is_on_pci_bus(const struct udevice *dev)
* @parent: parent device to scan
*/
#define device_foreach_child_probe(pos, parent) \
for (int _ret = device_first_child_err(parent, &dev); !_ret; \
_ret = device_next_child_err(&dev))
for (int _ret = device_first_child_err(parent, &pos); !_ret; \
_ret = device_next_child_err(&pos))
/**
* dm_scan_fdt_dev() - Bind child device in the device tree