#
eb0b02b2 |
|
10-Dec-2019 |
Simon Shields <simon.shields@data61.csiro.au> |
elfloader: use driver model for SMP on ARM Previously, each platform had its own implementation of init_cpus(). This is particularly cumbersome in the case of aarch64, where all platforms which support SMP use PSCI to do so. This patch moves SMP on ARM to be implemented using the driver model. It introduces a new driver type, DRIVER_SMP. This driver has a single method, `cpu_on`, which, when given an `elfloader_cpu` struct, turns on the CPU corresponding to that struct, launching it at the given entry point with the provided stack. This patch also makes the aarch64 and aarch32 CPU bringup logic much more similar. Both architectures now wait for CPUs to come up before starting the next. Note that the i.MX7 is left as-is, using the old mechanism, due to a lack of hardware to test on.
|
#
6e8ec638 |
|
21-Oct-2019 |
Simon Shields <simon.shields@data61.csiro.au> |
elfloader: pick serial driver at runtime On ARM, each serial driver now has an ELFLOADER_DRIVER(...), which contains information about the compatible strings the driver matches, the driver type and an "init" function for the driver to do setup. hardware_gen is now used by the ELF loader to generate a list of interesting devices at compile-time, which go in a header file "devices_gen.h". The ELFLOADER_DRIVERs are put into a special "_driver_list" section by the linker, and accessed as an array via the special __start__driver_list and __stop__driver_list linker symbols. At boot, the ELF loader calls initialise_devices(), which does the following: for each device in devices_gen.h for each driver in elfloader_drivers array if (device compat matches driver compat) call driver->init(device, driver) end if end for end for For serial drivers, the serial driver calls uart_set_out with the elfloader_device that should be the output for the elfloader from the driver->init function. There is a 'common' plat_console_putchar implementation which uses the dynamically picked uart output. This eliminates the need for a lot of the platform-specific code we have. This implementation could one day be replaced with a in-ELF loader device tree. This could also (possibly) be used to handle dynamically picking SMP core bringup mechanisms. As all RISC-V platforms use SBI to provide a serial port, RISCV is only modified to register the SBI putc implementation as the fputc implementatin.
|