Home | History | Annotate | Download | only in fdt
History log of /src/sys/arch/arm/fdt/cpu_fdt.c
RevisionDateAuthorComments
 1.44  10-May-2024  riastradh arm/fdt/cpu_fdt.c: Use `cpu' iattr to attach cpufreq.

Now that cpu has an explicit interface attribute, cpufeaturebus,
_all_ children of cpu must use an explicit interface attribute to
disambiguate. For children that weren't previously attached using an
explicit interface attribute, the name of the parent, `cpu', serves
as the iattr.

XXX I think we should either
(a) not use cpufreqbus, since in the aarch64 case it doesn't seem to
be passing any information through attach args, or
(b) create another iattr like cpufdtbus for use by cpufreq_dt.c,
which does rely on attach args, if it has to attach differently
from the rest of fdtbus.
But for now this should get aarch64 on fdt booting again.
 1.43  09-May-2024  pho kern/58195: arm: Support drvctl -d and -r for cpufeaturebus

This is required for detaching and re-attaching the vmt(4) driver on aarch64.
 1.42  03-Mar-2022  riastradh arm: Use device_set_private for cpuN.

For cpu at fdt, nix the fdt softc -- this was leaked and never used
for anything. The device's private storage is the cpu_info.
 1.41  30-Aug-2021  jmcneill Inspect #address-cells to determine if the cpu-release-addr requires
a 32- or 64-bit write.
 1.40  07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.39  24-Apr-2021  thorpej branches: 1.39.8;
Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.38  03-Dec-2020  skrll branches: 1.38.2;
Provide and use a sev() macro for the sev instruction.

While here use the correct barrier to ensure completion of memory accesses
before a couple of the sev() calls.
 1.37  25-Nov-2020  skrll Fix comment. Spotted by jmcneill@
 1.36  10-Jun-2020  jmcneill branches: 1.36.2;
If enable-method is missing, try psci
 1.35  21-Feb-2020  skrll Improve a comment
 1.34  15-Feb-2020  skrll Various updates and improvements to cpu start up on arm/aarch64

- start sharing more code around the AP startup messaging.
- call arm_cpu_topology_set early so that ci_core_id is available for
drivers, e.g. bcm2835_intr.c
- both arm and aarch64 now have
- a static cpu_info_store array
- the same arm_cpu_{hatched,mbox}
 1.33  27-Jan-2020  jmcneill Match any node with device_type = "cpu"
 1.32  25-Jan-2020  skrll Wrap a long line
 1.31  12-Jan-2020  mrg provide some semblance of valid cpu topology for big.little systems.

while attaching cpus, if the FDT provides "capacity-dmips-mhz" track
the fastest set, and call cpu_topology_set() with slow=true for any
cpus that are not the fastest.

bug fix for cpu_topology_set(): actually set ci_is_slow for slow cpus.

with this change, and -current's recent scheduler changes, this means
that long running processes run on the faster cores. on RK3399 based
systems, i am seeing 20-50% speed ups for many tasks.


XXX: all this can be made common with armv7 big.little.
 1.30  01-Nov-2019  bad branches: 1.30.2;
fix typos in comment in previous.
 1.29  01-Nov-2019  bad re-apply r1.26. but only #if !defined(AARCH64).

not necessary on armv8 and cache ops are not available that early there.
 1.28  19-Oct-2019  jmcneill Increase aarch64 MAXCPUS to 256.
 1.27  17-Oct-2019  bad back out r1.26. it makes the pinebook fail to boot.
 1.26  15-Oct-2019  bad flush the dcache in cpu_enable_psci() before calling psci_cpu_on().

fixes the kernel hanging with multiple "mpstart" on (at least) NanoPi R1.

OK jmcneill@, skrll@

XXX pullup-9
 1.25  13-Apr-2019  jmcneill branches: 1.25.4;
If an enable-method property is present on the cpu node and not supported
by the kernel, try to use the enable-method from the cpus node instead.
 1.24  13-Apr-2019  jmcneill Fix build w/o PSCI
 1.23  13-Apr-2019  jmcneill The spin-table CPU enable method is only valid for 64-bit kernels.
 1.22  31-Jan-2019  skrll Change ap_mpstart to return non-zero value if any/all APs don't start.
 1.21  19-Jan-2019  jmcneill Add support for (FDT-ized) Amlogic Meson8b.
 1.20  03-Jan-2019  jmcneill No need to swap cpu-release-addr twice
 1.19  03-Jan-2019  jmcneill Add a link set for cpu enable methods.
 1.18  03-Jan-2019  skrll Start CPUs more like aarch64 by using a cpu_mpidr array (if populated)
to map MPIDRs to an index for each CPU.

Towards big.LITTLE support.
 1.17  02-Jan-2019  skrll Avoid double negative
 1.16  18-Oct-2018  skrll Provide generic start code that assumes the MMU is off and caches are
disabled as per the linux booting protocol for ARMv6 and ARMv7 boards.
u-boot image type should be changed to 'linux' for correct behaviour.

The new start code builds a minimal "bootstrap" L1PT with cached access
disabled and uses the same table for all processors. AP startup is
performed in less steps and more code is written in C.

The bootstrap tables and stack are placed into an (orphaned) section
"_init_memory" which is given to uvm when it is no longer used.

Various kernels have been converted to use this code and tested. Some
boards were provided by TNF. Thanks!

The GENERIC kernel now boots on boards using the TEGRA, SUNXI and EXYNOS
kernels. The GENERIC kernel will also work on RPI2 using u-boot.

Thanks to martin@ and aymeric@ for testing on parallella and nanosoc
respectively
 1.15  04-Oct-2018  ryo fix to boot APs of RPI3 with GENERIC64.
if no psci, try other methods.
 1.14  13-Sep-2018  jmcneill Wrap arm_fdt_cpu_okay with #ifdef MULTIPROCESSOR
 1.13  10-Sep-2018  jmcneill Re-add support for cpu nodes with status = "disabled", lost in previous commit
 1.12  10-Sep-2018  ryo cleanup aarch64 mpstart and fdt bootstrap
* arm_cpu_hatch_arg is a bad idea. avoid serializing CPU startup, and eliminate arm_cpu_hatch_arg.
in mpstart, resolve own cpu index using array of cpu_mpidr[] (aarch64)
* add support fdt enable-method "spin-table"
* add support fdt enable-method "brcm,bcm2836-smp" (for 32bit RaspberryPi)
* use arm_fdt_cpu_bootstrap() instead of psci_fdt_bootstrap()
* rename "arm/fdt/psci_fdt.h" to "arm/fdt/psci_fdtvar.h" because of conflict of include file for needs-flag
* add devmap for cpu spin-table of raspberrypi3/aarch64
* no need to force hatch APs for raspberrypi3/arm32 ifndef MULTIPROCESSOR.
* fix to work pmap_extract(kerneltext/data/bss) even if before calling pmap_bootstrap

idea to use cpu_mpidr[] by jmcneill@. reviewd by skrll@. thanks.
 1.11  09-Sep-2018  jmcneill Ditch arm,arm-v8 compatible string (everything uses arm,armv8)
 1.10  05-Sep-2018  jmcneill Match non-standard compat string "arm,armv8" (should be "arm,arm-v8")
 1.9  26-Aug-2018  ryo add support multiple cpu clusters.
* pass cpu index as an argument to secondary processors when hatching.
* keep cpu cache confituration per cpu clusters.

Hello big.LITTLE!
 1.8  02-Jul-2018  jmcneill Attach cpufreq scaling provider to ourself, as cpus doesn't do this anymore
 1.7  22-Jun-2018  jmcneill branches: 1.7.2;
Match generic arm,arm-v8 compatible string
 1.6  15-Jun-2018  jakllsch Add "arm,arm-v7" to compatible strings.

(for `qemu-system-arm -M virt`)
 1.5  01-Apr-2018  ryo Add initial support for ARMv8 (AARCH64) (by nisimura@ and ryo@)

- sys/arch/evbarm64 is gone and integrated into sys/arch/evbarm. (by skrll@)
- add support fdt. evbarm/conf/GENERIC64 fdt (bcm2837,sunxi,tegra) based generic 64bit kernel config. (by skrll@, jmcneill@)
 1.4  10-Dec-2017  skrll branches: 1.4.2;
FDTise RapberryPI support. Thanks for jmcneill for a lot of help with this.

The kernel image that the RPI firmware boots is now netbsd.img in the
kernel build directory.

XXX fdtbus_get_reg needs reworking
 1.3  18-Sep-2017  jmcneill branches: 1.3.2;
Add support for arm,arm1176jzf-s
 1.2  18-Jun-2017  jmcneill branches: 1.2.4;
Only try to attach to CPUs with the same cluster ID as the boot processor.
 1.1  28-May-2017  jmcneill branches: 1.1.2;
Enumerate CPUs, GIC, and generic timer using FDT data instead of relying
on hard-coded tables in mainbus.
 1.1.2.1  21-Jun-2017  snj Pull up following revision(s) (requested by jmcneill in ticket #49):
sys/arch/arm/fdt/cpu_fdt.c: revision 1.2
Only try to attach to CPUs with the same cluster ID as the boot processor.
 1.2.4.2  28-Aug-2017  skrll Sync with HEAD
 1.2.4.1  18-Jun-2017  skrll file cpu_fdt.c was added on branch nick-nhusb on 2017-08-28 17:51:30 +0000
 1.3.2.2  03-Dec-2017  jdolecek update from HEAD
 1.3.2.1  18-Sep-2017  jdolecek file cpu_fdt.c was added on branch tls-maxphys on 2017-12-03 11:35:52 +0000
 1.4.2.8  26-Jan-2019  pgoyette Sync with HEAD
 1.4.2.7  18-Jan-2019  pgoyette Synch with HEAD
 1.4.2.6  20-Oct-2018  pgoyette Sync with head
 1.4.2.5  30-Sep-2018  pgoyette Ssync with HEAD
 1.4.2.4  06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.4.2.3  28-Jul-2018  pgoyette Sync with HEAD
 1.4.2.2  25-Jun-2018  pgoyette Sync with HEAD
 1.4.2.1  07-Apr-2018  pgoyette Sync with HEAD. 77 conflicts resolved - all of them $NetBSD$
 1.7.2.3  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.7.2.2  08-Apr-2020  martin Merge changes from current as of 20200406
 1.7.2.1  10-Jun-2019  christos Sync with HEAD
 1.25.4.2  01-Nov-2019  martin Pull up following revision(s) (requested by bad in ticket #342):

sys/arch/arm/fdt/cpu_fdt.c: revision 1.29
sys/arch/arm/fdt/cpu_fdt.c: revision 1.30

re-apply r1.26:
flush the dcache in cpu_enable_psci() before calling psci_cpu_on().
fixes the kernel hanging with multiple "mpstart" on (at least) NanoPi R1.
but only #if !defined(AARCH64).

not necessary on armv8 and cache ops are not available that early there.

fix typos in comment in previous.
 1.25.4.1  23-Oct-2019  martin Pull up following revision(s) (requested by jmcneill in ticket #359):

sys/arch/aarch64/aarch64/locore.S: revision 1.42
sys/arch/aarch64/aarch64/locore.S: revision 1.43
sys/arch/aarch64/aarch64/locore.S: revision 1.44
sys/arch/arm/fdt/cpu_fdt.c: revision 1.28
sys/arch/aarch64/include/cpu.h: revision 1.14
sys/arch/aarch64/include/param.h: revision 1.12
sys/arch/arm/arm32/cpu.c: revision 1.133
sys/arch/arm/arm32/cpu.c: revision 1.134
sys/arch/arm/include/cpu.h: revision 1.101
sys/arch/arm/acpi/cpu_acpi.c: revision 1.7
sys/arch/aarch64/aarch64/cpu.c: revision 1.23
sys/arch/aarch64/aarch64/cpu.c: revision 1.24
sys/arch/aarch64/aarch64/cpu.c: revision 1.25

Increase aarch64 MAXCPUS to 256.

-

Invalidate dcache before polling AP hatched status

-

Avoid overlap between BP and last AP stack. AP stacks are now in order of
increasing address order.

Spotted by and idea from mlelstv.

-

Use separate cacheline aligned arrays for mbox and hatched as before.

-

cpu_hatched_p only for MULTIPROCESSOR
 1.30.2.3  29-Feb-2020  ad Sync with head.
 1.30.2.2  25-Jan-2020  ad Sync with head.
 1.30.2.1  17-Jan-2020  ad Sync with head.
 1.36.2.1  14-Dec-2020  thorpej Sync w/ HEAD.
 1.38.2.1  21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.39.8.1  04-Aug-2021  thorpej Adapt to CFARGS().

RSS XML Feed