History log of /netbsd-current/sys/arch/arm/arm32/cpu.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.154 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.


Revision tags: netbsd-10-0-RELEASE netbsd-10-0-RC6 netbsd-10-0-RC5 netbsd-10-0-RC4 netbsd-10-0-RC3 netbsd-10-0-RC2 thorpej-ifq-base thorpej-altq-separation-base netbsd-10-0-RC1 netbsd-10-base bouyer-sunxi-drm-base
# 1.153 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.152 31-Oct-2021 skrll

Rework Arm (32bit and 64bit) AP startup so that cpu_hatch doesn't sleep.

The AP initialisation code in cpu_init_secondary_processor will read and
initialise the required system registers and state for the BP to attach
and report.

Rework the interrupt handler code for this new sequence. Thankfully,
this removes a bunch of code for bcm2836mp.

The VFP detection handler on <= armv7 relies on the global undefined
handler being in place until the BP attaches vfp. That is, after the
APs have been spun up.

gicv3_its.c has a serialisation issue which is protected against in
the gicv3_its_cpu_init, which is called from cpu_hatch, with a spin
lock. The serialisation issue needs addressing more completely.

Tested on RPI3, Apple M1, QEMU, and lx2k

Fixes PR port-arm/56264:
diagnostic assertion "l->l_stat == LSONPROC" failed on RPI3


# 1.151 11-Oct-2021 rin

For some classic CPUs, info->[id]cache_sets are not initialized.
Calculate and print numbers of sets in this case.


# 1.150 11-Oct-2021 rin

pN steppings are used for ARM926EJ-S, although only r0 seems to be available.


# 1.149 23-Sep-2021 skrll

Print the cache information in similar formats and arm and aarch64, e.g.

arm before
[ 1.0000000] cpu0: 32KB/64B 2-way L1 PIPT Instruction cache
[ 1.0000000] cpu0: 32KB/64B 2-way write-back-locking-C L1 PIPT Data cache
[ 1.0000000] cpu0: 2304KB/64B 16-way write-through L2 PIPT Unified cache

arm after
[ 1.0000000] cpu0: L1 32KB/64B 2-way (256 set) PIPT Instruction cache
[ 1.0000000] cpu0: L1 32KB/64B 2-way (256 set) write-back-locking-C PIPT Data cache
[ 1.0000000] cpu0: L2 2304KB/64B 16-way (2304 set) write-through PIPT Unified cache

aarch64 before
[ 1.0000030] cpu1: L1 48KB/64B*256L*3W PIPT Instruction cache
[ 1.0000030] cpu1: L1 32KB/64B*256L*2W PIPT Data cache
[ 1.0000030] cpu1: L2 2048KB/64B*2048L*16W PIPT Unified cache

aarch64 after
[ 1.0000030] cpu1: L1 48KB/64B 3-way (256 set) PIPT Instruction cache
[ 1.0000030] cpu1: L1 32KB/64B 2-way (256 set) PIPT Data cache
[ 1.0000030] cpu1: L2 2048KB/64B 16-way (2048 set) PIPT Unified cache


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base thorpej-i2c-spi-conf-base
# 1.148 06-Jul-2021 skrll

Assume all ARM11[37]6 r0 variants are missing ISAR and friends. This is
certainly the case for r0 variants I could find TRMs for.

PR/50596 CPU_ID_ARM1136JS r0p4 does not support feature registers


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-cfargs-base thorpej-futex-base
# 1.147 02-Jul-2020 martin

branches: 1.147.6;
Initialize ci_kfpu_spl earlier for secondary CPUs. From riastradh


# 1.146 29-Jun-2020 riastradh

Implement fpu_kern_enter/leave for arm32.


# 1.145 20-Jun-2020 skrll

KNF #includes

Remove some unnecessary ones while I'm here.


Revision tags: bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3
# 1.144 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}


Revision tags: ad-namecache-base2
# 1.143 22-Jan-2020 skrll

#ifdef whack-a-mole for the pmap_maxproc_set functionality


# 1.142 20-Jan-2020 skrll

s/_ARM_ARCH_6/ARM_MMU_EXTENDED/ in the #ifdef for the recent 4k pages
change


# 1.141 18-Jan-2020 skrll

Use 4K pages on ARM_MMU_EXTENDED platforms (all armv[67] except RPI) by
creating a new pool l1ttpl for the userland L1 translation table which
needs to be 8KB and 8KB aligned.

Limit the pool to maxproc and add hooks to allow the sysctl changing of
maxproc to adjust the pool.

This comes at a 5% performance penalty for build.sh -j8 kernel on a
Tegra TK1.


Revision tags: ad-namecache-base1
# 1.140 15-Jan-2020 mrg

port the arm64 cpu topology setup for big.little to arm.

rename arm64 cpu_do_topology() to arm_cpu_do_topology() and
call it from both arm cpu_attach().

replace both aarch64_set_topology() inline code in arm
cpu_attach() with new arm_cpu_do_topology(), which is called
by the arm64 locore as well (possibly not needed, which would
allow it to become static.)

not yet tested on a real big.little armv7 system. tested
on rockpro64 and pinebook pro.


# 1.139 09-Jan-2020 ad

- Many small tweaks to the SMT awareness in the scheduler. It does a much
better job now at keeping all physical CPUs busy, while using the extra
threads to help out. In particular, during preempt() if we're using SMT,
try to find a better CPU to run on and teleport curlwp there.

- Change the CPU topology stuff so it can work on asymmetric systems. This
mainly entails rearranging one of the CPU lists so it makes sense in all
configurations.

- Add a parameter to cpu_topology_set() to note that a CPU is "slow", for
where there are fast CPUs and slow CPUs, like with the Rockwell RK3399.
Extend the SMT awareness to try and handle that situation too (keep fast
CPUs busy, use slow CPUs as helpers).


# 1.138 09-Jan-2020 martin

When attaching the first fdtbus, use the root "comptabile" (or failing that:
"model") property to set the cpu model (in userland aka sysctl hw.model).
When attaching the first cpu, do not overwrite a cpu model if it already
had been set.


# 1.137 08-Jan-2020 jmcneill

cpu_hatch is too late to report AP topology, do it at attach time instead


Revision tags: ad-namecache-base
# 1.136 20-Dec-2019 ad

branches: 1.136.2;
Some more CPU topology stuff:

- Use cegger@'s ACPI SRAT parsing code to figure out NUMA node ID for each
CPU as it is attached.

- For scheduler experiments with SMT, flag CPUs with the lowest numbered SMT
IDs as "primaries", link back to the primaries from secondaries, and build
a circular list of CPUs in each package with identical SMT IDs.

- No need for package/core/smt/numa IDs to be anything other than a u_int.


# 1.135 02-Dec-2019 ad

Take the basic CPU topology information we already collect, and use it
to make circular lists of CPU siblings in the same core, and in the
same package. Nothing fancy, just enough to have a bit of fun in the
scheduler trying out different tactics.


Revision tags: phil-wifi-20191119
# 1.134 20-Oct-2019 jmcneill

cpu_hatched_p only for MULTIPROCESSOR


# 1.133 19-Oct-2019 jmcneill

Increase aarch64 MAXCPUS to 256.


# 1.132 29-Sep-2019 skrll

aprint_debug_dev output alignment


# 1.131 08-Sep-2019 tnn

report A12 as A17 to the user. A12 is retcon'ed by ARM.


# 1.130 07-Sep-2019 tnn

Cortex A12 is marketed as A17 but has a distinct part number

observed on Rockchip RK3288


Revision tags: netbsd-9-base phil-wifi-20190609 isaki-audio2-base
# 1.129 17-Mar-2019 skrll

branches: 1.129.4;
Wrap arm_cpu_marker if #ifdef MPDEBUG.

One day a9_mpsubr.S will die


# 1.128 27-Jan-2019 pgoyette

Merge the [pgoyette-compat] branch


Revision tags: pgoyette-compat-20190127
# 1.127 25-Jan-2019 skrll

Make sure ci_{smt,core,package}_id are all filled in appropriately.

Previously the BP was missed and __SHIFTOUT wasn't used.


Revision tags: pgoyette-compat-20190118
# 1.126 03-Jan-2019 jmcneill

Read mpidr and cpuid from the secondary processor itself instead of the
boot processor. While here, add Cortex-A15 r4p0 to supported list.


# 1.125 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.124 02-Jan-2019 skrll

Don't overwrite the setting of cpu_core_id from mpidr


Revision tags: pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020
# 1.123 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.122 08-Oct-2018 skrll

Trialing whitespace


# 1.121 06-Oct-2018 skrll

Use __BIT. NFC.


Revision tags: pgoyette-compat-0930 pgoyette-compat-0906
# 1.120 15-Aug-2018 skrll

KNF


# 1.119 15-Aug-2018 skrll

Fix includes (sys/cdefs.h then sys/param.h)


# 1.118 15-Aug-2018 skrll

Sprinkle #include "opt_cputypes.h"


# 1.117 10-Aug-2018 maxv

Retire CPU_ARM2, CPU_ARM250 and CPU_ARM3, they are all leftovers of
acorn26.

ok jmcneill@ skrll@


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202
# 1.116 16-Sep-2017 matt

branches: 1.116.2; 1.116.4;
Add Cortex-A35 CPU ID.


Revision tags: netbsd-8-3-RELEASE netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base
# 1.115 01-Jun-2017 chs

branches: 1.115.6;
remove checks for failure after memory allocation calls that cannot fail:

kmem_alloc() with KM_SLEEP
kmem_zalloc() with KM_SLEEP
percpu_alloc()
pserialize_create()
psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.114 11-Jul-2016 kiyohara

Add Cortex-A9 r1.


Revision tags: nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.113 03-Mar-2016 skrll

Get the RPI3 working (in aarch32 mode) by recognising Cortex A53 CPUs.
While I'm here add some A57/A72 info as well.

My RPI3 works with FB console - the uart needs some help with its clocks.


# 1.112 23-Jan-2016 christos

Rename the cpu_id() define to cpu_idnum() so that it does not conflict with
dtrace and friends.


Revision tags: nick-nhusb-base-20151226
# 1.111 12-Nov-2015 jmcneill

change some register dumps from aprint_verbose to aprint_debug


Revision tags: nick-nhusb-base-20150921
# 1.110 08-Jul-2015 skrll

aprint_verbose [sa]ctlr


Revision tags: nick-nhusb-base-20150606
# 1.109 05-Jun-2015 skrll

Print the Revision ID regster (verbose)


# 1.108 17-May-2015 matt

Print out mpidr on MP systems (verbose print)


Revision tags: nick-nhusb-base-20150406
# 1.107 03-Mar-2015 jmcneill

cache type 12 is "write-back", from matt


Revision tags: nick-nhusb-base
# 1.106 27-Nov-2014 matt

branches: 1.106.2;
Add entry for Cortex-A17 r1


# 1.105 01-Sep-2014 reinoud

Increase the `freqbuf' buffer that holds the result of humanize_number(). Now
it prints 1600 Mhz instead of 1 Ghz.
Pitty enough humanize_number(9) doesn't do 1.6 Ghz type output.


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.104 28-Mar-2014 matt

branches: 1.104.4;
Various MP changes.


# 1.103 24-Mar-2014 christos

use cpu_{g,s}etmodel


# 1.102 20-Mar-2014 matt

Define cache type 13


Revision tags: riastradh-drm2-base3
# 1.101 03-Mar-2014 matt

Add most of the cpu_* variables to <arm/locore.h>
Add and initialize cpu_synchprim_present


# 1.100 20-Feb-2014 matt

Keep track of what each cache is (VIVT/VIPT/PIPT).

cpu0: 32KB/32B 2-way L1 VIPT Instruction cache
cpu0: 32KB/64B 4-way write-back-locking-C L1 PIPT Data cache
cpu0: 256KB/64B 8-way write-through L2 PIPT Unified cache


# 1.99 07-Sep-2013 matt

Add a machdep.hwdiv_present sysctl (cortex A7 and A15 have hwdiv instructions)


# 1.98 07-Sep-2013 matt

Add CPU_ID_CORTEXA7R0 entry


# 1.97 18-Aug-2013 matt

Move parts of cpu.h that are not needed by MI code in <arm/locore.h>
Don't include <machine/cpu.h> or <machine/frame.h>, use <arm/locore.h>
Use <arm/asm.h> instead of <machine/arm.h>


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.96 12-Jun-2013 matt

branches: 1.96.2;
Nuke cpu_pfr, just use the armreg_pfr?_read inlines


# 1.95 12-Jun-2013 matt

Use the armreg_pfr?_read inlines.


# 1.94 19-May-2013 rkujawa

Plug support for PJ4B into our ARM CPU infrastructure.

Obtained from Marvell, Semihalf.


Revision tags: agc-symver-base
# 1.93 03-Feb-2013 matt

Add a machdep.cpu_arch sysctl


# 1.92 31-Jan-2013 matt

Add simple sysctls for cpu_id, fpu_id, neon_present, simd_present,
simdex_present.
Add struct sysctls to return the isar, mmfr, pfr, and mvfr sets.


Revision tags: yamt-pagecache-base8 yamt-pagecache-base7
# 1.91 05-Dec-2012 matt

ARMFPE hasn't compiled since NetBSD 4. Remove it.
Complete support for FPU_VFP.
fpregs now contains vfpreg.
XXX vfpreg only has space for 16 64-bit FP registers though VFPv3 and later
have 32 64-bit FP registers.


# 1.90 30-Nov-2012 msaitoh

Use snprintf() instead of sprintf().


# 1.89 30-Nov-2012 msaitoh

s/,/;/


# 1.88 12-Nov-2012 skrll

C99 types


Revision tags: yamt-pagecache-base6
# 1.87 22-Sep-2012 matt

Don't use an asm in pmap_activate to update the TTBR, use cpu_setttb instead
but add a second argument to it to indicate whether the TLB/caches need to be
flushed. Default cortex to pmap_needs_fixup = 1. But check the MMFR3 field
to see if the fixed can be skipped.
Use a cf_flag bit 0 to indicate whether the A9 L2 cache should disable (bit 0 = 1)
or enabeld (bit = 0).

With these changes, the A9 MMU can use traverse caches to do MMU tablewalks
Also, make sure all memory has the shareable bit for the A9.


# 1.86 07-Sep-2012 matt

branches: 1.86.2;
Switch cortex_a9 back to need_ptesync = 1
Add code to disable the L2 cache on cortex-a9 (for now).
Add evcnt for all the fault types.
Move cache info in a structure and have one for the pcache and one for scache.
Probe L1/L2 caches properly for ARMv7


# 1.85 29-Aug-2012 matt

Use new armv7 CP15 register to print out cache types.
If the cpu_cc_freq is set, report it.
Add macros to make inlines for reading/writing co-processor registers.


# 1.84 14-Aug-2012 matt

Use device_t


# 1.83 12-Aug-2012 matt

Rework VFP support to use PCU.
Add emulation of instruction which save/restore the VFP FPSCR.
Add a sysarch hook to VFP FPSCR manipulation.

[The emulation will be used by libc to store/fetch exception modes and
rounding mode on a per-thread basis.]


# 1.82 14-Jul-2012 matt

Refresh cortex cpus


Revision tags: jmcneill-usbmp-base10 yamt-pagecache-base5
# 1.81 20-May-2012 skrll

Remove the ARM1156T2 bloat - it only has an MPU. Prompted by matt@


# 1.80 20-May-2012 skrll

Add the ARM1156T2-S


# 1.79 20-May-2012 skrll

Add the 'Z' to the 1176 cpu product name.

ok matt@


Revision tags: jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base jym-xensuspend-nbase rmind-uvmplock-base jym-xensuspend-base
# 1.78 10-Mar-2011 bsh

branches: 1.78.4; 1.78.8; 1.78.10;
add MPCore to CPU-ID table
add branch predict bit to arm11_options


Revision tags: uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11
# 1.77 02-Oct-2010 kiyohara

branches: 1.77.2;
Add support Marvell Sheeva Core and SoC. (Orion/Kirkwood)
Discovery Innovation not yet.


Revision tags: uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.76 19-Jun-2010 matt

Fix cache probing on Cortex. Add missing CORTEX dependency in cpu.c


# 1.75 19-Jun-2010 matt

Fix c&p error.


# 1.74 19-Jun-2010 matt

Cleanup the armv7 changes. Add ARM_ARCH_7. Use CPU_CORTEX instead of
CPU_CORTEXA8 everywhere since there more types of Cortex than just the A8.
CPU_CORTEXA8 still exists but causes CPU_CORTEX to be defined.
Add CPU_CORTEXA9 as well. Use .arch armv7a to get us the isb/dsb
instructions.

Test booted to root device prompt on a Beagleboard.
All ARM kernels successfully test built.


# 1.73 16-Jun-2010 jmcneill

PR port-arm/43299: Support added for igepv2/cortexa8/omap3530

Apply patch from PR, with build fixes. ok skrll, matt


Revision tags: uebayasi-xip-base1 yamt-nfs-mp-base9 uebayasi-xip-base
# 1.72 23-Jan-2010 mrg

branches: 1.72.2; 1.72.4;
rename a local cpu_name structure member to avoid potential conflict
with <sys/cpu.h>'s.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-premerge-20091211 yamt-nfs-mp-base8 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 yamt-nfs-mp-base7 netbsd-5-0-1-RELEASE jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base nick-hppapmap-base haad-dm-base mjf-devfs2-base
# 1.71 25-Oct-2008 matt

branches: 1.71.4; 1.71.12;
Fix some missing things for CPU_ID_FA526.


Revision tags: matt-mips64-base2
# 1.70 24-Oct-2008 matt

Add entry for FA526.


# 1.69 21-Oct-2008 matt

Add Cortex cpus


Revision tags: haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base
# 1.68 27-Apr-2008 matt

branches: 1.68.6;
Merge kernel changes in matt-armv6 to HEAD.


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 chris-arm-intr-rework-base7 keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.67 15-Mar-2008 rearnsha

branches: 1.67.2; 1.67.4;
VFP support.


Revision tags: nick-net80211-sync-base chris-arm-intr-rework-base6 chris-arm-intr-rework-base5 chris-arm-intr-rework-base4 bouyer-xeni386-merge1 chris-arm-intr-rework-base3 vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 jmcneill-base mjf-devfs-base bouyer-xenamd64-base2 vmlocking-nbase yamt-x86pmap-base4 bouyer-xenamd64-base matt-armv6-base jmcneill-pm-base hpcarm-cleanup-base reinoud-bufcleanup-base
# 1.66 17-Oct-2007 garbled

branches: 1.66.12; 1.66.16;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base chris-arm-intr-rework-base2 chris-arm-intr-rework-base nick-csl-alignment-base matt-mips64-base ppcoea-renovation-base mjf-ufs-trans-base vmlocking-base
# 1.65 17-May-2007 yamt

branches: 1.65.10; 1.65.12;
merge yamt-idlelwp branch. asked by core@. some ports still needs work.

from doc/BRANCHES:

idle lwp, and some changes depending on it.

1. separate context switching and thread scheduling.
(cf. gmcgarry_ctxsw)
2. implement idle lwp.
3. clean up related MD/MI interfaces.
4. make scheduler(s) modular.


Revision tags: yamt-idlelwp-base8 thorpej-atomic-base ad-audiomp-base post-newlock2-merge newlock2-nbase newlock2-base
# 1.64 06-Jan-2007 christos

branches: 1.64.2; 1.64.6; 1.64.8; 1.64.14;
Scott Allan in http://mail-index.netbsd.org/port-arm/2006/07/31/0000.html
Patch to add support for ARM9E


# 1.63 06-Jan-2007 christos

From Scott Alan in http://mail-index.netbsd.org/port-arm/2006/07/26/0000.html
identify_arm_cpu() prints out a helpful message when it detects that you're
trying to run on a CPU that you didn't configure for. Unfortunately, the
check for class_option being NULL is backward, so it either won't print the
class_option, or it will try to dereference a NULL. The patch just flips the
!= NULL to be == NULL.


Revision tags: yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 abandoned-netbsd-4-base yamt-splraiseipl-base2 yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 netbsd-4-base yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base elad-kernelauth-base simonb-timecounters-base rpaulo-netinet-merge-pcb-base
# 1.62 15-Mar-2006 drochner

branches: 1.62.10; 1.62.14;
use km_alloc to get wired kernel memory for kernel stacks
of idle processes for secondary CPUs
(affects the MULTIPROCESSOR case only - does this exist?)
(untested)


Revision tags: yamt-pdpolicy-base2 yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.61 11-Dec-2005 christos

branches: 1.61.4; 1.61.6; 1.61.8; 1.61.10;
merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.60 20-Jul-2005 nonaka

Added i80219.


# 1.59 04-Jul-2005 bsh

branches: 1.59.2;
The first step to support Intel PXA270.

kernel config option CPU_XSCALE_PXA2X0 is now obsoleted by
CPU_XSCALE_PXA250 and CPU_XSCALE_PXA270. If both of them are defined,
CPU is determined run-time.


# 1.58 03-Jun-2005 rearnsha

Very basic support for the ARM1136.

This code takes no advantage of any 'new' features provided by
architecture 6 devices (such as physically tagged caches or new
MMU features), and basically runs the chip in a 'legacy v5' mode.


# 1.57 10-May-2005 rearnsha

Add support for arm1026ej-s.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 yamt-km-base4 yamt-km-base3 netbsd-3-base yamt-km-base2 yamt-km-base kent-audio2-base kent-audio1-beforemerge kent-audio1-base
# 1.56 14-Apr-2004 bsh

distinguish PXA255/26x from PXA2[15]0 in CPU attach message


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.55 13-Feb-2004 wiz

Uppercase CPU, plural is CPUs.


# 1.54 26-Oct-2003 chris

Fix up some unitialised variables.


# 1.53 06-Sep-2003 rearnsha

Support for ARM10E class devices.


# 1.52 03-Sep-2003 mycroft

Recognize some TI processors -- not that you'd want to use them.


# 1.51 23-Jun-2003 martin

branches: 1.51.2;
Make sure to include opt_foo.h if a defflag option FOO is used.


# 1.50 23-May-2003 ichiro

support IXP425 Intel Network Processor
running on BigEndian


# 1.49 29-Apr-2003 thorpej

Use aprint*().


# 1.48 14-Feb-2003 rjs

Add CPU IDs for PXA B2 and C0 steppings.


Revision tags: nathanw_sa_before_merge nathanw_sa_base
# 1.47 06-Jan-2003 wiz

specified, not specifed.


Revision tags: fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base
# 1.46 17-Nov-2002 chs

change uvm_uarea_alloc() to indicate whether the returned uarea is already
backed by physical pages (ie. because it reused a previously-freed one),
so that we can skip a bunch of useless work in that case.
this fixes the underlying problem behind PR 18543, and also speeds up fork()
quite a bit (eg. 7% on my pc, 1% on my ultra2) when we get a cache hit.


Revision tags: kqueue-aftermerge kqueue-beforemerge bjh21-hydra-base
# 1.45 13-Oct-2002 chris

branches: 1.45.2;
Fix arm kernel build breaks for non multiprocessor systems.


# 1.44 13-Oct-2002 bjh21

It appears that MI code requires ci_cpuid to be the CPU number of the CPU
in question, whereas the ARM code was using it to hold the model
identification. To fix this, rename:

ci_cpuid -> ci_arm_cpuid
ci_cputype -> ci_arm_cputype (for consistency)
ci_cpurev -> ci_arm_cpurev (ditto)
ci_cpunum -> ci_cpuid

This makes top(1) give correct CPU numbers in its "STATE" column (all 0 for
now).


# 1.43 12-Oct-2002 bjh21

Remember the location of each CPU's idle PCB in struct cpu_info.
Move allocation of the idle PCB from hydra.c to cpu.c and add some
extra initialisation from cpu_fork().


Revision tags: kqueue-base
# 1.42 01-Oct-2002 bjh21

constify various string tables.


# 1.41 06-Sep-2002 gehenna

Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.


Revision tags: gehenna-devsw-base
# 1.40 22-Jul-2002 briggs

Handle i80200 step D0 and i80321 step B0


# 1.39 10-Jul-2002 ichiro

add cpu id for "PXA250/210 3rd version CPUcore".

for using many PDA/xscale-core.


# 1.38 07-Jun-2002 thorpej

Add the CPU ID for the 600MHz i80321 part.


Revision tags: netbsd-1-6-base
# 1.37 12-May-2002 ichiro

branches: 1.37.2; 1.37.4;
change ICP12x0 steppings.
define CPU_IXP12X0


# 1.36 10-May-2002 thorpej

Add IXP1200 steppings.


# 1.35 03-May-2002 thorpej

Add support for the Intel PXA210 and PXA250. From Hiroyuki Bessho, PR 16617.


# 1.34 02-May-2002 rjs

Enable CPU_CLASS_SA1 for SA1100 and SA1110.


# 1.33 12-Apr-2002 thorpej

Centralize ARM CPU configuration information by adding a new header
file, <arm/cpuconf.h>, which pulls in "opt_cputypes.h" and then defines
the following:
* CPU_NTYPES -- now many CPU types are configured into the kernel. What
you really want to know is "== 1" or "> 1".
* Defines ARM_ARCH_2, ARM_ARCH_3, ARM_ARCH_4, ARM_ARCH_5, depending
on which ARM architecture versions are configured (based on CPU_*
options). Also defines ARM_NARCH to determins how many architecture
versions are configured.
* Defines ARM_MMU_MEMC, ARM_MMU_GENERIC, ARM_MMU_XSCALE depending on
which classes of ARM MMUs are configured into the kernel, and ARM_NMMUS
to determine how many MMU classes are configured.

Remove the needless inclusion of "opt_cputypes.h" in several places.
Convert remaining users to <arm/cpuconf.h>.


# 1.32 27-Mar-2002 thorpej

The 80321 manual lies; it does have a CPU ID distinct from the 80200.
Add that CPU ID, and add a case for it.


# 1.31 26-Mar-2002 thorpej

Restructure a few things in order to support other XScale core
I/O processors:
* The i80200 and the i80321 have the same CPU ID, so split the
CPU_XSCALE option into CPU_XSCALE_80200 and CPU_XSCALE_80321
options, and don't let them both be defined at the same time.
XXX May want to revisit this in the future.
* Split some registers common between the i80200 and i80321 into
<arm/xscale/xscalereg.h>.
* Rename a few existing functions.


# 1.30 24-Mar-2002 thorpej

Cache the cpu type and cpu revision in cpu_info.


Revision tags: eeh-devprop-base
# 1.29 16-Mar-2002 bjh21

Only put the CPU type into cpu_model, not the state of the control register.
Instead, print the control register state on the next line at startup.


# 1.28 16-Mar-2002 bjh21

Add CPU ID for the ARM1022ES.
Also add a CPU class for ARM10E processors in general.


# 1.27 11-Mar-2002 reinoud

When ARMFPE wasn't enabled the `usearmfpe' flag was statically initialised
but not used resulting in a compiler error. By splitting the declaration
and the initialisation this is solved.

Better would be to not even declare the flag when ARMFPE isnt enabled but
that would just add to the #ifdef jungle.


# 1.26 10-Mar-2002 bjh21

__RCSID -> __KERNEL_RCSID


# 1.25 10-Mar-2002 bjh21

Re-work the way that FPAs are handled. If ARMFPE isn't configured, don't
even bother probing for an FPA. If ARMFPE is configured, always use it,
even if there's an FPA (since it provides the FPA support code). Move all
printfs about FPAs into armfpe_init.c.

This means I can delete the last two elements from struct _cpu, so that the
structure, and the whole of <arm/cpus.h> is redundant and can be deleted.


# 1.24 10-Mar-2002 bjh21

Remove fpu_model from struct _cpu. Instead, have initialise_arm_fpe()
printf() the FPE version number itself.


# 1.23 10-Mar-2002 bjh21

Add a ci_dev element to struct cpu_info, pointing to the device that
corresponds to the CPU.


Revision tags: newlock-base
# 1.22 10-Mar-2002 bjh21

Kill the fpu_flags element from struct _cpu. It was only ever set to 0
anyway.


# 1.21 10-Mar-2002 bjh21

Clean up inline assembler. Rather than saving R0, copying FPSR to R0,
copying it to the output register and then restoring R0, just copy the
FPSR straight to the output.


# 1.20 09-Mar-2002 bjh21

Remove the cpu_model member from struct _cpu, and just use the cpu_model
variable directly. While we're at it, make cpu_model rather larger.


# 1.19 09-Mar-2002 bjh21

Remove the cpu_class element from struct _cpu, and make it a local variable
in identify_arm_cpu(), since it's almost unused elsewhere.

Change the detection of bugged StrongARMs to use the cpu ID rather than the
class. This turns "almost" into "entirely".


# 1.18 09-Mar-2002 bjh21

Replace cpu_id and cpu_ctrl in struct _cpu with ci_cpuid and ci_ctrl in
struct cpu_info. Also kill the cpuctrl global while we're here, and make
identify_arm_cpu() take a struct cpu_info * as an argument alongside the CPU
number.


# 1.17 09-Mar-2002 bjh21

Move arm700bugcount into stuct cpu_info, and attach it in
identify_master_cpu().


Revision tags: ifpoll-base
# 1.16 17-Feb-2002 bjh21

Our assembler handles FPA instructions fine, so don't use .word for them.


# 1.15 17-Feb-2002 bjh21

ANSIfy, and othe KNF cleanup.


# 1.14 27-Jan-2002 bjh21

Add revision->stepping maps for the SA-110, SA-1100 and SA-1110.
Those for the SA-1100 and SA-1110 are from Intel's documentation.
The mapping for the SA-110 is from various sources on the net, since Intel
don't seem to document it.

Also, change the layout of the maps to have four steppings per line,
so they aren't quite so unwieldy.


# 1.13 24-Jan-2002 thorpej

Use a table to look up stepping names. Add a generic stepping
table ("rev 0", "rev 1", etc.) and an i80200 stepping table that
has the stepping names that appear in the i80200 manuals/errata..


# 1.12 29-Nov-2001 thorpej

Fetch cache info from the Cache Type register on ARM7TDMI and "greater"
processors. Report this when the processor is attached.


# 1.11 24-Nov-2001 thorpej

Move the ARM, Ltd. floating point emulator to arch/arm.


# 1.10 23-Nov-2001 thorpej

Use <arm/undefined.h> instead of <machine/undefined.h>.


Revision tags: thorpej-mips-cache-base
# 1.9 06-Nov-2001 thorpej

branches: 1.9.2;
Const poisoning of cpu/class names.


# 1.8 06-Nov-2001 thorpej

"i80200", not "80200".


# 1.7 06-Nov-2001 thorpej

"XScale", not "Xscale".


# 1.6 18-Oct-2001 rearnsha

branches: 1.6.2;
Support for ARM9.


Revision tags: thorpej-devvp-base3 thorpej-devvp-base2
# 1.5 28-Sep-2001 chris

Add extra arg to fpa_test as it should have 4 args. Also add prototypes for fpa_test and fpa_handler.


Revision tags: post-chs-ubcperf pre-chs-ubcperf thorpej-devvp-base
# 1.4 05-Sep-2001 matt

branches: 1.4.2;
Flesh XSCALE support.


# 1.3 03-Jun-2001 chris

branches: 1.3.2; 1.3.4;
Add support for ARM7TDMI, as provided in a patch from John Fremlin to port-arm32.

Shouldn't effect any currently in tree ports.


# 1.2 13-May-2001 bjh21

Use get_bootconf_option() to find boot options, rather than home-grown
strstr()-based hacks.


Revision tags: thorpej_scsipi_beforemerge thorpej_scsipi_base thorpej_scsipi_nbase
# 1.1 20-Apr-2001 matt

branches: 1.1.2;
Split cpu from mainbus so that cpu can attached to other buses (like ofbus).


# 1.153 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.152 31-Oct-2021 skrll

Rework Arm (32bit and 64bit) AP startup so that cpu_hatch doesn't sleep.

The AP initialisation code in cpu_init_secondary_processor will read and
initialise the required system registers and state for the BP to attach
and report.

Rework the interrupt handler code for this new sequence. Thankfully,
this removes a bunch of code for bcm2836mp.

The VFP detection handler on <= armv7 relies on the global undefined
handler being in place until the BP attaches vfp. That is, after the
APs have been spun up.

gicv3_its.c has a serialisation issue which is protected against in
the gicv3_its_cpu_init, which is called from cpu_hatch, with a spin
lock. The serialisation issue needs addressing more completely.

Tested on RPI3, Apple M1, QEMU, and lx2k

Fixes PR port-arm/56264:
diagnostic assertion "l->l_stat == LSONPROC" failed on RPI3


# 1.151 11-Oct-2021 rin

For some classic CPUs, info->[id]cache_sets are not initialized.
Calculate and print numbers of sets in this case.


# 1.150 11-Oct-2021 rin

pN steppings are used for ARM926EJ-S, although only r0 seems to be available.


# 1.149 23-Sep-2021 skrll

Print the cache information in similar formats and arm and aarch64, e.g.

arm before
[ 1.0000000] cpu0: 32KB/64B 2-way L1 PIPT Instruction cache
[ 1.0000000] cpu0: 32KB/64B 2-way write-back-locking-C L1 PIPT Data cache
[ 1.0000000] cpu0: 2304KB/64B 16-way write-through L2 PIPT Unified cache

arm after
[ 1.0000000] cpu0: L1 32KB/64B 2-way (256 set) PIPT Instruction cache
[ 1.0000000] cpu0: L1 32KB/64B 2-way (256 set) write-back-locking-C PIPT Data cache
[ 1.0000000] cpu0: L2 2304KB/64B 16-way (2304 set) write-through PIPT Unified cache

aarch64 before
[ 1.0000030] cpu1: L1 48KB/64B*256L*3W PIPT Instruction cache
[ 1.0000030] cpu1: L1 32KB/64B*256L*2W PIPT Data cache
[ 1.0000030] cpu1: L2 2048KB/64B*2048L*16W PIPT Unified cache

aarch64 after
[ 1.0000030] cpu1: L1 48KB/64B 3-way (256 set) PIPT Instruction cache
[ 1.0000030] cpu1: L1 32KB/64B 2-way (256 set) PIPT Data cache
[ 1.0000030] cpu1: L2 2048KB/64B 16-way (2048 set) PIPT Unified cache


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base thorpej-i2c-spi-conf-base
# 1.148 06-Jul-2021 skrll

Assume all ARM11[37]6 r0 variants are missing ISAR and friends. This is
certainly the case for r0 variants I could find TRMs for.

PR/50596 CPU_ID_ARM1136JS r0p4 does not support feature registers


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-cfargs-base thorpej-futex-base
# 1.147 02-Jul-2020 martin

branches: 1.147.6;
Initialize ci_kfpu_spl earlier for secondary CPUs. From riastradh


# 1.146 29-Jun-2020 riastradh

Implement fpu_kern_enter/leave for arm32.


# 1.145 20-Jun-2020 skrll

KNF #includes

Remove some unnecessary ones while I'm here.


Revision tags: bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3
# 1.144 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}


Revision tags: ad-namecache-base2
# 1.143 22-Jan-2020 skrll

#ifdef whack-a-mole for the pmap_maxproc_set functionality


# 1.142 20-Jan-2020 skrll

s/_ARM_ARCH_6/ARM_MMU_EXTENDED/ in the #ifdef for the recent 4k pages
change


# 1.141 18-Jan-2020 skrll

Use 4K pages on ARM_MMU_EXTENDED platforms (all armv[67] except RPI) by
creating a new pool l1ttpl for the userland L1 translation table which
needs to be 8KB and 8KB aligned.

Limit the pool to maxproc and add hooks to allow the sysctl changing of
maxproc to adjust the pool.

This comes at a 5% performance penalty for build.sh -j8 kernel on a
Tegra TK1.


Revision tags: ad-namecache-base1
# 1.140 15-Jan-2020 mrg

port the arm64 cpu topology setup for big.little to arm.

rename arm64 cpu_do_topology() to arm_cpu_do_topology() and
call it from both arm cpu_attach().

replace both aarch64_set_topology() inline code in arm
cpu_attach() with new arm_cpu_do_topology(), which is called
by the arm64 locore as well (possibly not needed, which would
allow it to become static.)

not yet tested on a real big.little armv7 system. tested
on rockpro64 and pinebook pro.


# 1.139 09-Jan-2020 ad

- Many small tweaks to the SMT awareness in the scheduler. It does a much
better job now at keeping all physical CPUs busy, while using the extra
threads to help out. In particular, during preempt() if we're using SMT,
try to find a better CPU to run on and teleport curlwp there.

- Change the CPU topology stuff so it can work on asymmetric systems. This
mainly entails rearranging one of the CPU lists so it makes sense in all
configurations.

- Add a parameter to cpu_topology_set() to note that a CPU is "slow", for
where there are fast CPUs and slow CPUs, like with the Rockwell RK3399.
Extend the SMT awareness to try and handle that situation too (keep fast
CPUs busy, use slow CPUs as helpers).


# 1.138 09-Jan-2020 martin

When attaching the first fdtbus, use the root "comptabile" (or failing that:
"model") property to set the cpu model (in userland aka sysctl hw.model).
When attaching the first cpu, do not overwrite a cpu model if it already
had been set.


# 1.137 08-Jan-2020 jmcneill

cpu_hatch is too late to report AP topology, do it at attach time instead


Revision tags: ad-namecache-base
# 1.136 20-Dec-2019 ad

branches: 1.136.2;
Some more CPU topology stuff:

- Use cegger@'s ACPI SRAT parsing code to figure out NUMA node ID for each
CPU as it is attached.

- For scheduler experiments with SMT, flag CPUs with the lowest numbered SMT
IDs as "primaries", link back to the primaries from secondaries, and build
a circular list of CPUs in each package with identical SMT IDs.

- No need for package/core/smt/numa IDs to be anything other than a u_int.


# 1.135 02-Dec-2019 ad

Take the basic CPU topology information we already collect, and use it
to make circular lists of CPU siblings in the same core, and in the
same package. Nothing fancy, just enough to have a bit of fun in the
scheduler trying out different tactics.


Revision tags: phil-wifi-20191119
# 1.134 20-Oct-2019 jmcneill

cpu_hatched_p only for MULTIPROCESSOR


# 1.133 19-Oct-2019 jmcneill

Increase aarch64 MAXCPUS to 256.


# 1.132 29-Sep-2019 skrll

aprint_debug_dev output alignment


# 1.131 08-Sep-2019 tnn

report A12 as A17 to the user. A12 is retcon'ed by ARM.


# 1.130 07-Sep-2019 tnn

Cortex A12 is marketed as A17 but has a distinct part number

observed on Rockchip RK3288


Revision tags: netbsd-9-base phil-wifi-20190609 isaki-audio2-base
# 1.129 17-Mar-2019 skrll

branches: 1.129.4;
Wrap arm_cpu_marker if #ifdef MPDEBUG.

One day a9_mpsubr.S will die


# 1.128 27-Jan-2019 pgoyette

Merge the [pgoyette-compat] branch


Revision tags: pgoyette-compat-20190127
# 1.127 25-Jan-2019 skrll

Make sure ci_{smt,core,package}_id are all filled in appropriately.

Previously the BP was missed and __SHIFTOUT wasn't used.


Revision tags: pgoyette-compat-20190118
# 1.126 03-Jan-2019 jmcneill

Read mpidr and cpuid from the secondary processor itself instead of the
boot processor. While here, add Cortex-A15 r4p0 to supported list.


# 1.125 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.124 02-Jan-2019 skrll

Don't overwrite the setting of cpu_core_id from mpidr


Revision tags: pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020
# 1.123 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.122 08-Oct-2018 skrll

Trialing whitespace


# 1.121 06-Oct-2018 skrll

Use __BIT. NFC.


Revision tags: pgoyette-compat-0930 pgoyette-compat-0906
# 1.120 15-Aug-2018 skrll

KNF


# 1.119 15-Aug-2018 skrll

Fix includes (sys/cdefs.h then sys/param.h)


# 1.118 15-Aug-2018 skrll

Sprinkle #include "opt_cputypes.h"


# 1.117 10-Aug-2018 maxv

Retire CPU_ARM2, CPU_ARM250 and CPU_ARM3, they are all leftovers of
acorn26.

ok jmcneill@ skrll@


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202
# 1.116 16-Sep-2017 matt

branches: 1.116.2; 1.116.4;
Add Cortex-A35 CPU ID.


Revision tags: netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base
# 1.115 01-Jun-2017 chs

branches: 1.115.6;
remove checks for failure after memory allocation calls that cannot fail:

kmem_alloc() with KM_SLEEP
kmem_zalloc() with KM_SLEEP
percpu_alloc()
pserialize_create()
psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.114 11-Jul-2016 kiyohara

Add Cortex-A9 r1.


Revision tags: nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.113 03-Mar-2016 skrll

Get the RPI3 working (in aarch32 mode) by recognising Cortex A53 CPUs.
While I'm here add some A57/A72 info as well.

My RPI3 works with FB console - the uart needs some help with its clocks.


# 1.112 23-Jan-2016 christos

Rename the cpu_id() define to cpu_idnum() so that it does not conflict with
dtrace and friends.


Revision tags: nick-nhusb-base-20151226
# 1.111 12-Nov-2015 jmcneill

change some register dumps from aprint_verbose to aprint_debug


Revision tags: nick-nhusb-base-20150921
# 1.110 08-Jul-2015 skrll

aprint_verbose [sa]ctlr


Revision tags: nick-nhusb-base-20150606
# 1.109 05-Jun-2015 skrll

Print the Revision ID regster (verbose)


# 1.108 17-May-2015 matt

Print out mpidr on MP systems (verbose print)


Revision tags: nick-nhusb-base-20150406
# 1.107 03-Mar-2015 jmcneill

cache type 12 is "write-back", from matt


Revision tags: nick-nhusb-base
# 1.106 27-Nov-2014 matt

branches: 1.106.2;
Add entry for Cortex-A17 r1


# 1.105 01-Sep-2014 reinoud

Increase the `freqbuf' buffer that holds the result of humanize_number(). Now
it prints 1600 Mhz instead of 1 Ghz.
Pitty enough humanize_number(9) doesn't do 1.6 Ghz type output.


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.104 28-Mar-2014 matt

branches: 1.104.4;
Various MP changes.


# 1.103 24-Mar-2014 christos

use cpu_{g,s}etmodel


# 1.102 20-Mar-2014 matt

Define cache type 13


Revision tags: riastradh-drm2-base3
# 1.101 03-Mar-2014 matt

Add most of the cpu_* variables to <arm/locore.h>
Add and initialize cpu_synchprim_present


# 1.100 20-Feb-2014 matt

Keep track of what each cache is (VIVT/VIPT/PIPT).

cpu0: 32KB/32B 2-way L1 VIPT Instruction cache
cpu0: 32KB/64B 4-way write-back-locking-C L1 PIPT Data cache
cpu0: 256KB/64B 8-way write-through L2 PIPT Unified cache


# 1.99 07-Sep-2013 matt

Add a machdep.hwdiv_present sysctl (cortex A7 and A15 have hwdiv instructions)


# 1.98 07-Sep-2013 matt

Add CPU_ID_CORTEXA7R0 entry


# 1.97 18-Aug-2013 matt

Move parts of cpu.h that are not needed by MI code in <arm/locore.h>
Don't include <machine/cpu.h> or <machine/frame.h>, use <arm/locore.h>
Use <arm/asm.h> instead of <machine/arm.h>


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.96 12-Jun-2013 matt

branches: 1.96.2;
Nuke cpu_pfr, just use the armreg_pfr?_read inlines


# 1.95 12-Jun-2013 matt

Use the armreg_pfr?_read inlines.


# 1.94 19-May-2013 rkujawa

Plug support for PJ4B into our ARM CPU infrastructure.

Obtained from Marvell, Semihalf.


Revision tags: agc-symver-base
# 1.93 03-Feb-2013 matt

Add a machdep.cpu_arch sysctl


# 1.92 31-Jan-2013 matt

Add simple sysctls for cpu_id, fpu_id, neon_present, simd_present,
simdex_present.
Add struct sysctls to return the isar, mmfr, pfr, and mvfr sets.


Revision tags: yamt-pagecache-base8 yamt-pagecache-base7
# 1.91 05-Dec-2012 matt

ARMFPE hasn't compiled since NetBSD 4. Remove it.
Complete support for FPU_VFP.
fpregs now contains vfpreg.
XXX vfpreg only has space for 16 64-bit FP registers though VFPv3 and later
have 32 64-bit FP registers.


# 1.90 30-Nov-2012 msaitoh

Use snprintf() instead of sprintf().


# 1.89 30-Nov-2012 msaitoh

s/,/;/


# 1.88 12-Nov-2012 skrll

C99 types


Revision tags: yamt-pagecache-base6
# 1.87 22-Sep-2012 matt

Don't use an asm in pmap_activate to update the TTBR, use cpu_setttb instead
but add a second argument to it to indicate whether the TLB/caches need to be
flushed. Default cortex to pmap_needs_fixup = 1. But check the MMFR3 field
to see if the fixed can be skipped.
Use a cf_flag bit 0 to indicate whether the A9 L2 cache should disable (bit 0 = 1)
or enabeld (bit = 0).

With these changes, the A9 MMU can use traverse caches to do MMU tablewalks
Also, make sure all memory has the shareable bit for the A9.


# 1.86 07-Sep-2012 matt

branches: 1.86.2;
Switch cortex_a9 back to need_ptesync = 1
Add code to disable the L2 cache on cortex-a9 (for now).
Add evcnt for all the fault types.
Move cache info in a structure and have one for the pcache and one for scache.
Probe L1/L2 caches properly for ARMv7


# 1.85 29-Aug-2012 matt

Use new armv7 CP15 register to print out cache types.
If the cpu_cc_freq is set, report it.
Add macros to make inlines for reading/writing co-processor registers.


# 1.84 14-Aug-2012 matt

Use device_t


# 1.83 12-Aug-2012 matt

Rework VFP support to use PCU.
Add emulation of instruction which save/restore the VFP FPSCR.
Add a sysarch hook to VFP FPSCR manipulation.

[The emulation will be used by libc to store/fetch exception modes and
rounding mode on a per-thread basis.]


# 1.82 14-Jul-2012 matt

Refresh cortex cpus


Revision tags: jmcneill-usbmp-base10 yamt-pagecache-base5
# 1.81 20-May-2012 skrll

Remove the ARM1156T2 bloat - it only has an MPU. Prompted by matt@


# 1.80 20-May-2012 skrll

Add the ARM1156T2-S


# 1.79 20-May-2012 skrll

Add the 'Z' to the 1176 cpu product name.

ok matt@


Revision tags: jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base jym-xensuspend-nbase rmind-uvmplock-base jym-xensuspend-base
# 1.78 10-Mar-2011 bsh

branches: 1.78.4; 1.78.8; 1.78.10;
add MPCore to CPU-ID table
add branch predict bit to arm11_options


Revision tags: uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11
# 1.77 02-Oct-2010 kiyohara

branches: 1.77.2;
Add support Marvell Sheeva Core and SoC. (Orion/Kirkwood)
Discovery Innovation not yet.


Revision tags: uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.76 19-Jun-2010 matt

Fix cache probing on Cortex. Add missing CORTEX dependency in cpu.c


# 1.75 19-Jun-2010 matt

Fix c&p error.


# 1.74 19-Jun-2010 matt

Cleanup the armv7 changes. Add ARM_ARCH_7. Use CPU_CORTEX instead of
CPU_CORTEXA8 everywhere since there more types of Cortex than just the A8.
CPU_CORTEXA8 still exists but causes CPU_CORTEX to be defined.
Add CPU_CORTEXA9 as well. Use .arch armv7a to get us the isb/dsb
instructions.

Test booted to root device prompt on a Beagleboard.
All ARM kernels successfully test built.


# 1.73 16-Jun-2010 jmcneill

PR port-arm/43299: Support added for igepv2/cortexa8/omap3530

Apply patch from PR, with build fixes. ok skrll, matt


Revision tags: uebayasi-xip-base1 yamt-nfs-mp-base9 uebayasi-xip-base
# 1.72 23-Jan-2010 mrg

branches: 1.72.2; 1.72.4;
rename a local cpu_name structure member to avoid potential conflict
with <sys/cpu.h>'s.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-premerge-20091211 yamt-nfs-mp-base8 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 yamt-nfs-mp-base7 netbsd-5-0-1-RELEASE jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base nick-hppapmap-base haad-dm-base mjf-devfs2-base
# 1.71 25-Oct-2008 matt

branches: 1.71.4; 1.71.12;
Fix some missing things for CPU_ID_FA526.


Revision tags: matt-mips64-base2
# 1.70 24-Oct-2008 matt

Add entry for FA526.


# 1.69 21-Oct-2008 matt

Add Cortex cpus


Revision tags: haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base
# 1.68 27-Apr-2008 matt

branches: 1.68.6;
Merge kernel changes in matt-armv6 to HEAD.


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 chris-arm-intr-rework-base7 keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.67 15-Mar-2008 rearnsha

branches: 1.67.2; 1.67.4;
VFP support.


Revision tags: nick-net80211-sync-base chris-arm-intr-rework-base6 chris-arm-intr-rework-base5 chris-arm-intr-rework-base4 bouyer-xeni386-merge1 chris-arm-intr-rework-base3 vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 jmcneill-base mjf-devfs-base bouyer-xenamd64-base2 vmlocking-nbase yamt-x86pmap-base4 bouyer-xenamd64-base matt-armv6-base jmcneill-pm-base hpcarm-cleanup-base reinoud-bufcleanup-base
# 1.66 17-Oct-2007 garbled

branches: 1.66.12; 1.66.16;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base chris-arm-intr-rework-base2 chris-arm-intr-rework-base nick-csl-alignment-base matt-mips64-base ppcoea-renovation-base mjf-ufs-trans-base vmlocking-base
# 1.65 17-May-2007 yamt

branches: 1.65.10; 1.65.12;
merge yamt-idlelwp branch. asked by core@. some ports still needs work.

from doc/BRANCHES:

idle lwp, and some changes depending on it.

1. separate context switching and thread scheduling.
(cf. gmcgarry_ctxsw)
2. implement idle lwp.
3. clean up related MD/MI interfaces.
4. make scheduler(s) modular.


Revision tags: yamt-idlelwp-base8 thorpej-atomic-base ad-audiomp-base post-newlock2-merge newlock2-nbase newlock2-base
# 1.64 06-Jan-2007 christos

branches: 1.64.2; 1.64.6; 1.64.8; 1.64.14;
Scott Allan in http://mail-index.netbsd.org/port-arm/2006/07/31/0000.html
Patch to add support for ARM9E


# 1.63 06-Jan-2007 christos

From Scott Alan in http://mail-index.netbsd.org/port-arm/2006/07/26/0000.html
identify_arm_cpu() prints out a helpful message when it detects that you're
trying to run on a CPU that you didn't configure for. Unfortunately, the
check for class_option being NULL is backward, so it either won't print the
class_option, or it will try to dereference a NULL. The patch just flips the
!= NULL to be == NULL.


Revision tags: yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 abandoned-netbsd-4-base yamt-splraiseipl-base2 yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 netbsd-4-base yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base elad-kernelauth-base simonb-timecounters-base rpaulo-netinet-merge-pcb-base
# 1.62 15-Mar-2006 drochner

branches: 1.62.10; 1.62.14;
use km_alloc to get wired kernel memory for kernel stacks
of idle processes for secondary CPUs
(affects the MULTIPROCESSOR case only - does this exist?)
(untested)


Revision tags: yamt-pdpolicy-base2 yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.61 11-Dec-2005 christos

branches: 1.61.4; 1.61.6; 1.61.8; 1.61.10;
merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.60 20-Jul-2005 nonaka

Added i80219.


# 1.59 04-Jul-2005 bsh

branches: 1.59.2;
The first step to support Intel PXA270.

kernel config option CPU_XSCALE_PXA2X0 is now obsoleted by
CPU_XSCALE_PXA250 and CPU_XSCALE_PXA270. If both of them are defined,
CPU is determined run-time.


# 1.58 03-Jun-2005 rearnsha

Very basic support for the ARM1136.

This code takes no advantage of any 'new' features provided by
architecture 6 devices (such as physically tagged caches or new
MMU features), and basically runs the chip in a 'legacy v5' mode.


# 1.57 10-May-2005 rearnsha

Add support for arm1026ej-s.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 yamt-km-base4 yamt-km-base3 netbsd-3-base yamt-km-base2 yamt-km-base kent-audio2-base kent-audio1-beforemerge kent-audio1-base
# 1.56 14-Apr-2004 bsh

distinguish PXA255/26x from PXA2[15]0 in CPU attach message


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.55 13-Feb-2004 wiz

Uppercase CPU, plural is CPUs.


# 1.54 26-Oct-2003 chris

Fix up some unitialised variables.


# 1.53 06-Sep-2003 rearnsha

Support for ARM10E class devices.


# 1.52 03-Sep-2003 mycroft

Recognize some TI processors -- not that you'd want to use them.


# 1.51 23-Jun-2003 martin

branches: 1.51.2;
Make sure to include opt_foo.h if a defflag option FOO is used.


# 1.50 23-May-2003 ichiro

support IXP425 Intel Network Processor
running on BigEndian


# 1.49 29-Apr-2003 thorpej

Use aprint*().


# 1.48 14-Feb-2003 rjs

Add CPU IDs for PXA B2 and C0 steppings.


Revision tags: nathanw_sa_before_merge nathanw_sa_base
# 1.47 06-Jan-2003 wiz

specified, not specifed.


Revision tags: fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base
# 1.46 17-Nov-2002 chs

change uvm_uarea_alloc() to indicate whether the returned uarea is already
backed by physical pages (ie. because it reused a previously-freed one),
so that we can skip a bunch of useless work in that case.
this fixes the underlying problem behind PR 18543, and also speeds up fork()
quite a bit (eg. 7% on my pc, 1% on my ultra2) when we get a cache hit.


Revision tags: kqueue-aftermerge kqueue-beforemerge bjh21-hydra-base
# 1.45 13-Oct-2002 chris

branches: 1.45.2;
Fix arm kernel build breaks for non multiprocessor systems.


# 1.44 13-Oct-2002 bjh21

It appears that MI code requires ci_cpuid to be the CPU number of the CPU
in question, whereas the ARM code was using it to hold the model
identification. To fix this, rename:

ci_cpuid -> ci_arm_cpuid
ci_cputype -> ci_arm_cputype (for consistency)
ci_cpurev -> ci_arm_cpurev (ditto)
ci_cpunum -> ci_cpuid

This makes top(1) give correct CPU numbers in its "STATE" column (all 0 for
now).


# 1.43 12-Oct-2002 bjh21

Remember the location of each CPU's idle PCB in struct cpu_info.
Move allocation of the idle PCB from hydra.c to cpu.c and add some
extra initialisation from cpu_fork().


Revision tags: kqueue-base
# 1.42 01-Oct-2002 bjh21

constify various string tables.


# 1.41 06-Sep-2002 gehenna

Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.


Revision tags: gehenna-devsw-base
# 1.40 22-Jul-2002 briggs

Handle i80200 step D0 and i80321 step B0


# 1.39 10-Jul-2002 ichiro

add cpu id for "PXA250/210 3rd version CPUcore".

for using many PDA/xscale-core.


# 1.38 07-Jun-2002 thorpej

Add the CPU ID for the 600MHz i80321 part.


Revision tags: netbsd-1-6-base
# 1.37 12-May-2002 ichiro

branches: 1.37.2; 1.37.4;
change ICP12x0 steppings.
define CPU_IXP12X0


# 1.36 10-May-2002 thorpej

Add IXP1200 steppings.


# 1.35 03-May-2002 thorpej

Add support for the Intel PXA210 and PXA250. From Hiroyuki Bessho, PR 16617.


# 1.34 02-May-2002 rjs

Enable CPU_CLASS_SA1 for SA1100 and SA1110.


# 1.33 12-Apr-2002 thorpej

Centralize ARM CPU configuration information by adding a new header
file, <arm/cpuconf.h>, which pulls in "opt_cputypes.h" and then defines
the following:
* CPU_NTYPES -- now many CPU types are configured into the kernel. What
you really want to know is "== 1" or "> 1".
* Defines ARM_ARCH_2, ARM_ARCH_3, ARM_ARCH_4, ARM_ARCH_5, depending
on which ARM architecture versions are configured (based on CPU_*
options). Also defines ARM_NARCH to determins how many architecture
versions are configured.
* Defines ARM_MMU_MEMC, ARM_MMU_GENERIC, ARM_MMU_XSCALE depending on
which classes of ARM MMUs are configured into the kernel, and ARM_NMMUS
to determine how many MMU classes are configured.

Remove the needless inclusion of "opt_cputypes.h" in several places.
Convert remaining users to <arm/cpuconf.h>.


# 1.32 27-Mar-2002 thorpej

The 80321 manual lies; it does have a CPU ID distinct from the 80200.
Add that CPU ID, and add a case for it.


# 1.31 26-Mar-2002 thorpej

Restructure a few things in order to support other XScale core
I/O processors:
* The i80200 and the i80321 have the same CPU ID, so split the
CPU_XSCALE option into CPU_XSCALE_80200 and CPU_XSCALE_80321
options, and don't let them both be defined at the same time.
XXX May want to revisit this in the future.
* Split some registers common between the i80200 and i80321 into
<arm/xscale/xscalereg.h>.
* Rename a few existing functions.


# 1.30 24-Mar-2002 thorpej

Cache the cpu type and cpu revision in cpu_info.


Revision tags: eeh-devprop-base
# 1.29 16-Mar-2002 bjh21

Only put the CPU type into cpu_model, not the state of the control register.
Instead, print the control register state on the next line at startup.


# 1.28 16-Mar-2002 bjh21

Add CPU ID for the ARM1022ES.
Also add a CPU class for ARM10E processors in general.


# 1.27 11-Mar-2002 reinoud

When ARMFPE wasn't enabled the `usearmfpe' flag was statically initialised
but not used resulting in a compiler error. By splitting the declaration
and the initialisation this is solved.

Better would be to not even declare the flag when ARMFPE isnt enabled but
that would just add to the #ifdef jungle.


# 1.26 10-Mar-2002 bjh21

__RCSID -> __KERNEL_RCSID


# 1.25 10-Mar-2002 bjh21

Re-work the way that FPAs are handled. If ARMFPE isn't configured, don't
even bother probing for an FPA. If ARMFPE is configured, always use it,
even if there's an FPA (since it provides the FPA support code). Move all
printfs about FPAs into armfpe_init.c.

This means I can delete the last two elements from struct _cpu, so that the
structure, and the whole of <arm/cpus.h> is redundant and can be deleted.


# 1.24 10-Mar-2002 bjh21

Remove fpu_model from struct _cpu. Instead, have initialise_arm_fpe()
printf() the FPE version number itself.


# 1.23 10-Mar-2002 bjh21

Add a ci_dev element to struct cpu_info, pointing to the device that
corresponds to the CPU.


Revision tags: newlock-base
# 1.22 10-Mar-2002 bjh21

Kill the fpu_flags element from struct _cpu. It was only ever set to 0
anyway.


# 1.21 10-Mar-2002 bjh21

Clean up inline assembler. Rather than saving R0, copying FPSR to R0,
copying it to the output register and then restoring R0, just copy the
FPSR straight to the output.


# 1.20 09-Mar-2002 bjh21

Remove the cpu_model member from struct _cpu, and just use the cpu_model
variable directly. While we're at it, make cpu_model rather larger.


# 1.19 09-Mar-2002 bjh21

Remove the cpu_class element from struct _cpu, and make it a local variable
in identify_arm_cpu(), since it's almost unused elsewhere.

Change the detection of bugged StrongARMs to use the cpu ID rather than the
class. This turns "almost" into "entirely".


# 1.18 09-Mar-2002 bjh21

Replace cpu_id and cpu_ctrl in struct _cpu with ci_cpuid and ci_ctrl in
struct cpu_info. Also kill the cpuctrl global while we're here, and make
identify_arm_cpu() take a struct cpu_info * as an argument alongside the CPU
number.


# 1.17 09-Mar-2002 bjh21

Move arm700bugcount into stuct cpu_info, and attach it in
identify_master_cpu().


Revision tags: ifpoll-base
# 1.16 17-Feb-2002 bjh21

Our assembler handles FPA instructions fine, so don't use .word for them.


# 1.15 17-Feb-2002 bjh21

ANSIfy, and othe KNF cleanup.


# 1.14 27-Jan-2002 bjh21

Add revision->stepping maps for the SA-110, SA-1100 and SA-1110.
Those for the SA-1100 and SA-1110 are from Intel's documentation.
The mapping for the SA-110 is from various sources on the net, since Intel
don't seem to document it.

Also, change the layout of the maps to have four steppings per line,
so they aren't quite so unwieldy.


# 1.13 24-Jan-2002 thorpej

Use a table to look up stepping names. Add a generic stepping
table ("rev 0", "rev 1", etc.) and an i80200 stepping table that
has the stepping names that appear in the i80200 manuals/errata..


# 1.12 29-Nov-2001 thorpej

Fetch cache info from the Cache Type register on ARM7TDMI and "greater"
processors. Report this when the processor is attached.


# 1.11 24-Nov-2001 thorpej

Move the ARM, Ltd. floating point emulator to arch/arm.


# 1.10 23-Nov-2001 thorpej

Use <arm/undefined.h> instead of <machine/undefined.h>.


Revision tags: thorpej-mips-cache-base
# 1.9 06-Nov-2001 thorpej

branches: 1.9.2;
Const poisoning of cpu/class names.


# 1.8 06-Nov-2001 thorpej

"i80200", not "80200".


# 1.7 06-Nov-2001 thorpej

"XScale", not "Xscale".


# 1.6 18-Oct-2001 rearnsha

branches: 1.6.2;
Support for ARM9.


Revision tags: thorpej-devvp-base3 thorpej-devvp-base2
# 1.5 28-Sep-2001 chris

Add extra arg to fpa_test as it should have 4 args. Also add prototypes for fpa_test and fpa_handler.


Revision tags: post-chs-ubcperf pre-chs-ubcperf thorpej-devvp-base
# 1.4 05-Sep-2001 matt

branches: 1.4.2;
Flesh XSCALE support.


# 1.3 03-Jun-2001 chris

branches: 1.3.2; 1.3.4;
Add support for ARM7TDMI, as provided in a patch from John Fremlin to port-arm32.

Shouldn't effect any currently in tree ports.


# 1.2 13-May-2001 bjh21

Use get_bootconf_option() to find boot options, rather than home-grown
strstr()-based hacks.


Revision tags: thorpej_scsipi_beforemerge thorpej_scsipi_base thorpej_scsipi_nbase
# 1.1 20-Apr-2001 matt

branches: 1.1.2;
Split cpu from mainbus so that cpu can attached to other buses (like ofbus).


# 1.152 31-Oct-2021 skrll

Rework Arm (32bit and 64bit) AP startup so that cpu_hatch doesn't sleep.

The AP initialisation code in cpu_init_secondary_processor will read and
initialise the required system registers and state for the BP to attach
and report.

Rework the interrupt handler code for this new sequence. Thankfully,
this removes a bunch of code for bcm2836mp.

The VFP detection handler on <= armv7 relies on the global undefined
handler being in place until the BP attaches vfp. That is, after the
APs have been spun up.

gicv3_its.c has a serialisation issue which is protected against in
the gicv3_its_cpu_init, which is called from cpu_hatch, with a spin
lock. The serialisation issue needs addressing more completely.

Tested on RPI3, Apple M1, QEMU, and lx2k

Fixes PR port-arm/56264:
diagnostic assertion "l->l_stat == LSONPROC" failed on RPI3


# 1.151 11-Oct-2021 rin

For some classic CPUs, info->[id]cache_sets are not initialized.
Calculate and print numbers of sets in this case.


# 1.150 11-Oct-2021 rin

pN steppings are used for ARM926EJ-S, although only r0 seems to be available.


# 1.149 23-Sep-2021 skrll

Print the cache information in similar formats and arm and aarch64, e.g.

arm before
[ 1.0000000] cpu0: 32KB/64B 2-way L1 PIPT Instruction cache
[ 1.0000000] cpu0: 32KB/64B 2-way write-back-locking-C L1 PIPT Data cache
[ 1.0000000] cpu0: 2304KB/64B 16-way write-through L2 PIPT Unified cache

arm after
[ 1.0000000] cpu0: L1 32KB/64B 2-way (256 set) PIPT Instruction cache
[ 1.0000000] cpu0: L1 32KB/64B 2-way (256 set) write-back-locking-C PIPT Data cache
[ 1.0000000] cpu0: L2 2304KB/64B 16-way (2304 set) write-through PIPT Unified cache

aarch64 before
[ 1.0000030] cpu1: L1 48KB/64B*256L*3W PIPT Instruction cache
[ 1.0000030] cpu1: L1 32KB/64B*256L*2W PIPT Data cache
[ 1.0000030] cpu1: L2 2048KB/64B*2048L*16W PIPT Unified cache

aarch64 after
[ 1.0000030] cpu1: L1 48KB/64B 3-way (256 set) PIPT Instruction cache
[ 1.0000030] cpu1: L1 32KB/64B 2-way (256 set) PIPT Data cache
[ 1.0000030] cpu1: L2 2048KB/64B 16-way (2048 set) PIPT Unified cache


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base thorpej-i2c-spi-conf-base
# 1.148 06-Jul-2021 skrll

Assume all ARM11[37]6 r0 variants are missing ISAR and friends. This is
certainly the case for r0 variants I could find TRMs for.

PR/50596 CPU_ID_ARM1136JS r0p4 does not support feature registers


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-cfargs-base thorpej-futex-base
# 1.147 02-Jul-2020 martin

branches: 1.147.6;
Initialize ci_kfpu_spl earlier for secondary CPUs. From riastradh


# 1.146 29-Jun-2020 riastradh

Implement fpu_kern_enter/leave for arm32.


# 1.145 20-Jun-2020 skrll

KNF #includes

Remove some unnecessary ones while I'm here.


Revision tags: bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3
# 1.144 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}


Revision tags: ad-namecache-base2
# 1.143 22-Jan-2020 skrll

#ifdef whack-a-mole for the pmap_maxproc_set functionality


# 1.142 20-Jan-2020 skrll

s/_ARM_ARCH_6/ARM_MMU_EXTENDED/ in the #ifdef for the recent 4k pages
change


# 1.141 18-Jan-2020 skrll

Use 4K pages on ARM_MMU_EXTENDED platforms (all armv[67] except RPI) by
creating a new pool l1ttpl for the userland L1 translation table which
needs to be 8KB and 8KB aligned.

Limit the pool to maxproc and add hooks to allow the sysctl changing of
maxproc to adjust the pool.

This comes at a 5% performance penalty for build.sh -j8 kernel on a
Tegra TK1.


Revision tags: ad-namecache-base1
# 1.140 15-Jan-2020 mrg

port the arm64 cpu topology setup for big.little to arm.

rename arm64 cpu_do_topology() to arm_cpu_do_topology() and
call it from both arm cpu_attach().

replace both aarch64_set_topology() inline code in arm
cpu_attach() with new arm_cpu_do_topology(), which is called
by the arm64 locore as well (possibly not needed, which would
allow it to become static.)

not yet tested on a real big.little armv7 system. tested
on rockpro64 and pinebook pro.


# 1.139 09-Jan-2020 ad

- Many small tweaks to the SMT awareness in the scheduler. It does a much
better job now at keeping all physical CPUs busy, while using the extra
threads to help out. In particular, during preempt() if we're using SMT,
try to find a better CPU to run on and teleport curlwp there.

- Change the CPU topology stuff so it can work on asymmetric systems. This
mainly entails rearranging one of the CPU lists so it makes sense in all
configurations.

- Add a parameter to cpu_topology_set() to note that a CPU is "slow", for
where there are fast CPUs and slow CPUs, like with the Rockwell RK3399.
Extend the SMT awareness to try and handle that situation too (keep fast
CPUs busy, use slow CPUs as helpers).


# 1.138 09-Jan-2020 martin

When attaching the first fdtbus, use the root "comptabile" (or failing that:
"model") property to set the cpu model (in userland aka sysctl hw.model).
When attaching the first cpu, do not overwrite a cpu model if it already
had been set.


# 1.137 08-Jan-2020 jmcneill

cpu_hatch is too late to report AP topology, do it at attach time instead


Revision tags: ad-namecache-base
# 1.136 20-Dec-2019 ad

branches: 1.136.2;
Some more CPU topology stuff:

- Use cegger@'s ACPI SRAT parsing code to figure out NUMA node ID for each
CPU as it is attached.

- For scheduler experiments with SMT, flag CPUs with the lowest numbered SMT
IDs as "primaries", link back to the primaries from secondaries, and build
a circular list of CPUs in each package with identical SMT IDs.

- No need for package/core/smt/numa IDs to be anything other than a u_int.


# 1.135 02-Dec-2019 ad

Take the basic CPU topology information we already collect, and use it
to make circular lists of CPU siblings in the same core, and in the
same package. Nothing fancy, just enough to have a bit of fun in the
scheduler trying out different tactics.


Revision tags: phil-wifi-20191119
# 1.134 20-Oct-2019 jmcneill

cpu_hatched_p only for MULTIPROCESSOR


# 1.133 19-Oct-2019 jmcneill

Increase aarch64 MAXCPUS to 256.


# 1.132 29-Sep-2019 skrll

aprint_debug_dev output alignment


# 1.131 08-Sep-2019 tnn

report A12 as A17 to the user. A12 is retcon'ed by ARM.


# 1.130 07-Sep-2019 tnn

Cortex A12 is marketed as A17 but has a distinct part number

observed on Rockchip RK3288


Revision tags: netbsd-9-base phil-wifi-20190609 isaki-audio2-base
# 1.129 17-Mar-2019 skrll

branches: 1.129.4;
Wrap arm_cpu_marker if #ifdef MPDEBUG.

One day a9_mpsubr.S will die


# 1.128 27-Jan-2019 pgoyette

Merge the [pgoyette-compat] branch


Revision tags: pgoyette-compat-20190127
# 1.127 25-Jan-2019 skrll

Make sure ci_{smt,core,package}_id are all filled in appropriately.

Previously the BP was missed and __SHIFTOUT wasn't used.


Revision tags: pgoyette-compat-20190118
# 1.126 03-Jan-2019 jmcneill

Read mpidr and cpuid from the secondary processor itself instead of the
boot processor. While here, add Cortex-A15 r4p0 to supported list.


# 1.125 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.124 02-Jan-2019 skrll

Don't overwrite the setting of cpu_core_id from mpidr


Revision tags: pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020
# 1.123 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.122 08-Oct-2018 skrll

Trialing whitespace


# 1.121 06-Oct-2018 skrll

Use __BIT. NFC.


Revision tags: pgoyette-compat-0930 pgoyette-compat-0906
# 1.120 15-Aug-2018 skrll

KNF


# 1.119 15-Aug-2018 skrll

Fix includes (sys/cdefs.h then sys/param.h)


# 1.118 15-Aug-2018 skrll

Sprinkle #include "opt_cputypes.h"


# 1.117 10-Aug-2018 maxv

Retire CPU_ARM2, CPU_ARM250 and CPU_ARM3, they are all leftovers of
acorn26.

ok jmcneill@ skrll@


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202
# 1.116 16-Sep-2017 matt

branches: 1.116.2; 1.116.4;
Add Cortex-A35 CPU ID.


Revision tags: netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base
# 1.115 01-Jun-2017 chs

branches: 1.115.6;
remove checks for failure after memory allocation calls that cannot fail:

kmem_alloc() with KM_SLEEP
kmem_zalloc() with KM_SLEEP
percpu_alloc()
pserialize_create()
psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.114 11-Jul-2016 kiyohara

Add Cortex-A9 r1.


Revision tags: nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.113 03-Mar-2016 skrll

Get the RPI3 working (in aarch32 mode) by recognising Cortex A53 CPUs.
While I'm here add some A57/A72 info as well.

My RPI3 works with FB console - the uart needs some help with its clocks.


# 1.112 23-Jan-2016 christos

Rename the cpu_id() define to cpu_idnum() so that it does not conflict with
dtrace and friends.


Revision tags: nick-nhusb-base-20151226
# 1.111 12-Nov-2015 jmcneill

change some register dumps from aprint_verbose to aprint_debug


Revision tags: nick-nhusb-base-20150921
# 1.110 08-Jul-2015 skrll

aprint_verbose [sa]ctlr


Revision tags: nick-nhusb-base-20150606
# 1.109 05-Jun-2015 skrll

Print the Revision ID regster (verbose)


# 1.108 17-May-2015 matt

Print out mpidr on MP systems (verbose print)


Revision tags: nick-nhusb-base-20150406
# 1.107 03-Mar-2015 jmcneill

cache type 12 is "write-back", from matt


Revision tags: nick-nhusb-base
# 1.106 27-Nov-2014 matt

branches: 1.106.2;
Add entry for Cortex-A17 r1


# 1.105 01-Sep-2014 reinoud

Increase the `freqbuf' buffer that holds the result of humanize_number(). Now
it prints 1600 Mhz instead of 1 Ghz.
Pitty enough humanize_number(9) doesn't do 1.6 Ghz type output.


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.104 28-Mar-2014 matt

branches: 1.104.4;
Various MP changes.


# 1.103 24-Mar-2014 christos

use cpu_{g,s}etmodel


# 1.102 20-Mar-2014 matt

Define cache type 13


Revision tags: riastradh-drm2-base3
# 1.101 03-Mar-2014 matt

Add most of the cpu_* variables to <arm/locore.h>
Add and initialize cpu_synchprim_present


# 1.100 20-Feb-2014 matt

Keep track of what each cache is (VIVT/VIPT/PIPT).

cpu0: 32KB/32B 2-way L1 VIPT Instruction cache
cpu0: 32KB/64B 4-way write-back-locking-C L1 PIPT Data cache
cpu0: 256KB/64B 8-way write-through L2 PIPT Unified cache


# 1.99 07-Sep-2013 matt

Add a machdep.hwdiv_present sysctl (cortex A7 and A15 have hwdiv instructions)


# 1.98 07-Sep-2013 matt

Add CPU_ID_CORTEXA7R0 entry


# 1.97 18-Aug-2013 matt

Move parts of cpu.h that are not needed by MI code in <arm/locore.h>
Don't include <machine/cpu.h> or <machine/frame.h>, use <arm/locore.h>
Use <arm/asm.h> instead of <machine/arm.h>


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.96 12-Jun-2013 matt

branches: 1.96.2;
Nuke cpu_pfr, just use the armreg_pfr?_read inlines


# 1.95 12-Jun-2013 matt

Use the armreg_pfr?_read inlines.


# 1.94 19-May-2013 rkujawa

Plug support for PJ4B into our ARM CPU infrastructure.

Obtained from Marvell, Semihalf.


Revision tags: agc-symver-base
# 1.93 03-Feb-2013 matt

Add a machdep.cpu_arch sysctl


# 1.92 31-Jan-2013 matt

Add simple sysctls for cpu_id, fpu_id, neon_present, simd_present,
simdex_present.
Add struct sysctls to return the isar, mmfr, pfr, and mvfr sets.


Revision tags: yamt-pagecache-base8 yamt-pagecache-base7
# 1.91 05-Dec-2012 matt

ARMFPE hasn't compiled since NetBSD 4. Remove it.
Complete support for FPU_VFP.
fpregs now contains vfpreg.
XXX vfpreg only has space for 16 64-bit FP registers though VFPv3 and later
have 32 64-bit FP registers.


# 1.90 30-Nov-2012 msaitoh

Use snprintf() instead of sprintf().


# 1.89 30-Nov-2012 msaitoh

s/,/;/


# 1.88 12-Nov-2012 skrll

C99 types


Revision tags: yamt-pagecache-base6
# 1.87 22-Sep-2012 matt

Don't use an asm in pmap_activate to update the TTBR, use cpu_setttb instead
but add a second argument to it to indicate whether the TLB/caches need to be
flushed. Default cortex to pmap_needs_fixup = 1. But check the MMFR3 field
to see if the fixed can be skipped.
Use a cf_flag bit 0 to indicate whether the A9 L2 cache should disable (bit 0 = 1)
or enabeld (bit = 0).

With these changes, the A9 MMU can use traverse caches to do MMU tablewalks
Also, make sure all memory has the shareable bit for the A9.


# 1.86 07-Sep-2012 matt

branches: 1.86.2;
Switch cortex_a9 back to need_ptesync = 1
Add code to disable the L2 cache on cortex-a9 (for now).
Add evcnt for all the fault types.
Move cache info in a structure and have one for the pcache and one for scache.
Probe L1/L2 caches properly for ARMv7


# 1.85 29-Aug-2012 matt

Use new armv7 CP15 register to print out cache types.
If the cpu_cc_freq is set, report it.
Add macros to make inlines for reading/writing co-processor registers.


# 1.84 14-Aug-2012 matt

Use device_t


# 1.83 12-Aug-2012 matt

Rework VFP support to use PCU.
Add emulation of instruction which save/restore the VFP FPSCR.
Add a sysarch hook to VFP FPSCR manipulation.

[The emulation will be used by libc to store/fetch exception modes and
rounding mode on a per-thread basis.]


# 1.82 14-Jul-2012 matt

Refresh cortex cpus


Revision tags: jmcneill-usbmp-base10 yamt-pagecache-base5
# 1.81 20-May-2012 skrll

Remove the ARM1156T2 bloat - it only has an MPU. Prompted by matt@


# 1.80 20-May-2012 skrll

Add the ARM1156T2-S


# 1.79 20-May-2012 skrll

Add the 'Z' to the 1176 cpu product name.

ok matt@


Revision tags: jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base jym-xensuspend-nbase rmind-uvmplock-base jym-xensuspend-base
# 1.78 10-Mar-2011 bsh

branches: 1.78.4; 1.78.8; 1.78.10;
add MPCore to CPU-ID table
add branch predict bit to arm11_options


Revision tags: uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11
# 1.77 02-Oct-2010 kiyohara

branches: 1.77.2;
Add support Marvell Sheeva Core and SoC. (Orion/Kirkwood)
Discovery Innovation not yet.


Revision tags: uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.76 19-Jun-2010 matt

Fix cache probing on Cortex. Add missing CORTEX dependency in cpu.c


# 1.75 19-Jun-2010 matt

Fix c&p error.


# 1.74 19-Jun-2010 matt

Cleanup the armv7 changes. Add ARM_ARCH_7. Use CPU_CORTEX instead of
CPU_CORTEXA8 everywhere since there more types of Cortex than just the A8.
CPU_CORTEXA8 still exists but causes CPU_CORTEX to be defined.
Add CPU_CORTEXA9 as well. Use .arch armv7a to get us the isb/dsb
instructions.

Test booted to root device prompt on a Beagleboard.
All ARM kernels successfully test built.


# 1.73 16-Jun-2010 jmcneill

PR port-arm/43299: Support added for igepv2/cortexa8/omap3530

Apply patch from PR, with build fixes. ok skrll, matt


Revision tags: uebayasi-xip-base1 yamt-nfs-mp-base9 uebayasi-xip-base
# 1.72 23-Jan-2010 mrg

branches: 1.72.2; 1.72.4;
rename a local cpu_name structure member to avoid potential conflict
with <sys/cpu.h>'s.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-premerge-20091211 yamt-nfs-mp-base8 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 yamt-nfs-mp-base7 netbsd-5-0-1-RELEASE jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base nick-hppapmap-base haad-dm-base mjf-devfs2-base
# 1.71 25-Oct-2008 matt

branches: 1.71.4; 1.71.12;
Fix some missing things for CPU_ID_FA526.


Revision tags: matt-mips64-base2
# 1.70 24-Oct-2008 matt

Add entry for FA526.


# 1.69 21-Oct-2008 matt

Add Cortex cpus


Revision tags: haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base
# 1.68 27-Apr-2008 matt

branches: 1.68.6;
Merge kernel changes in matt-armv6 to HEAD.


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 chris-arm-intr-rework-base7 keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.67 15-Mar-2008 rearnsha

branches: 1.67.2; 1.67.4;
VFP support.


Revision tags: nick-net80211-sync-base chris-arm-intr-rework-base6 chris-arm-intr-rework-base5 chris-arm-intr-rework-base4 bouyer-xeni386-merge1 chris-arm-intr-rework-base3 vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 jmcneill-base mjf-devfs-base bouyer-xenamd64-base2 vmlocking-nbase yamt-x86pmap-base4 bouyer-xenamd64-base matt-armv6-base jmcneill-pm-base hpcarm-cleanup-base reinoud-bufcleanup-base
# 1.66 17-Oct-2007 garbled

branches: 1.66.12; 1.66.16;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base chris-arm-intr-rework-base2 chris-arm-intr-rework-base nick-csl-alignment-base matt-mips64-base ppcoea-renovation-base mjf-ufs-trans-base vmlocking-base
# 1.65 17-May-2007 yamt

branches: 1.65.10; 1.65.12;
merge yamt-idlelwp branch. asked by core@. some ports still needs work.

from doc/BRANCHES:

idle lwp, and some changes depending on it.

1. separate context switching and thread scheduling.
(cf. gmcgarry_ctxsw)
2. implement idle lwp.
3. clean up related MD/MI interfaces.
4. make scheduler(s) modular.


Revision tags: yamt-idlelwp-base8 thorpej-atomic-base ad-audiomp-base post-newlock2-merge newlock2-nbase newlock2-base
# 1.64 06-Jan-2007 christos

branches: 1.64.2; 1.64.6; 1.64.8; 1.64.14;
Scott Allan in http://mail-index.netbsd.org/port-arm/2006/07/31/0000.html
Patch to add support for ARM9E


# 1.63 06-Jan-2007 christos

From Scott Alan in http://mail-index.netbsd.org/port-arm/2006/07/26/0000.html
identify_arm_cpu() prints out a helpful message when it detects that you're
trying to run on a CPU that you didn't configure for. Unfortunately, the
check for class_option being NULL is backward, so it either won't print the
class_option, or it will try to dereference a NULL. The patch just flips the
!= NULL to be == NULL.


Revision tags: yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 abandoned-netbsd-4-base yamt-splraiseipl-base2 yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 netbsd-4-base yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base elad-kernelauth-base simonb-timecounters-base rpaulo-netinet-merge-pcb-base
# 1.62 15-Mar-2006 drochner

branches: 1.62.10; 1.62.14;
use km_alloc to get wired kernel memory for kernel stacks
of idle processes for secondary CPUs
(affects the MULTIPROCESSOR case only - does this exist?)
(untested)


Revision tags: yamt-pdpolicy-base2 yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.61 11-Dec-2005 christos

branches: 1.61.4; 1.61.6; 1.61.8; 1.61.10;
merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.60 20-Jul-2005 nonaka

Added i80219.


# 1.59 04-Jul-2005 bsh

branches: 1.59.2;
The first step to support Intel PXA270.

kernel config option CPU_XSCALE_PXA2X0 is now obsoleted by
CPU_XSCALE_PXA250 and CPU_XSCALE_PXA270. If both of them are defined,
CPU is determined run-time.


# 1.58 03-Jun-2005 rearnsha

Very basic support for the ARM1136.

This code takes no advantage of any 'new' features provided by
architecture 6 devices (such as physically tagged caches or new
MMU features), and basically runs the chip in a 'legacy v5' mode.


# 1.57 10-May-2005 rearnsha

Add support for arm1026ej-s.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 yamt-km-base4 yamt-km-base3 netbsd-3-base yamt-km-base2 yamt-km-base kent-audio2-base kent-audio1-beforemerge kent-audio1-base
# 1.56 14-Apr-2004 bsh

distinguish PXA255/26x from PXA2[15]0 in CPU attach message


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.55 13-Feb-2004 wiz

Uppercase CPU, plural is CPUs.


# 1.54 26-Oct-2003 chris

Fix up some unitialised variables.


# 1.53 06-Sep-2003 rearnsha

Support for ARM10E class devices.


# 1.52 03-Sep-2003 mycroft

Recognize some TI processors -- not that you'd want to use them.


# 1.51 23-Jun-2003 martin

branches: 1.51.2;
Make sure to include opt_foo.h if a defflag option FOO is used.


# 1.50 23-May-2003 ichiro

support IXP425 Intel Network Processor
running on BigEndian


# 1.49 29-Apr-2003 thorpej

Use aprint*().


# 1.48 14-Feb-2003 rjs

Add CPU IDs for PXA B2 and C0 steppings.


Revision tags: nathanw_sa_before_merge nathanw_sa_base
# 1.47 06-Jan-2003 wiz

specified, not specifed.


Revision tags: fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base
# 1.46 17-Nov-2002 chs

change uvm_uarea_alloc() to indicate whether the returned uarea is already
backed by physical pages (ie. because it reused a previously-freed one),
so that we can skip a bunch of useless work in that case.
this fixes the underlying problem behind PR 18543, and also speeds up fork()
quite a bit (eg. 7% on my pc, 1% on my ultra2) when we get a cache hit.


Revision tags: kqueue-aftermerge kqueue-beforemerge bjh21-hydra-base
# 1.45 13-Oct-2002 chris

branches: 1.45.2;
Fix arm kernel build breaks for non multiprocessor systems.


# 1.44 13-Oct-2002 bjh21

It appears that MI code requires ci_cpuid to be the CPU number of the CPU
in question, whereas the ARM code was using it to hold the model
identification. To fix this, rename:

ci_cpuid -> ci_arm_cpuid
ci_cputype -> ci_arm_cputype (for consistency)
ci_cpurev -> ci_arm_cpurev (ditto)
ci_cpunum -> ci_cpuid

This makes top(1) give correct CPU numbers in its "STATE" column (all 0 for
now).


# 1.43 12-Oct-2002 bjh21

Remember the location of each CPU's idle PCB in struct cpu_info.
Move allocation of the idle PCB from hydra.c to cpu.c and add some
extra initialisation from cpu_fork().


Revision tags: kqueue-base
# 1.42 01-Oct-2002 bjh21

constify various string tables.


# 1.41 06-Sep-2002 gehenna

Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.


Revision tags: gehenna-devsw-base
# 1.40 22-Jul-2002 briggs

Handle i80200 step D0 and i80321 step B0


# 1.39 10-Jul-2002 ichiro

add cpu id for "PXA250/210 3rd version CPUcore".

for using many PDA/xscale-core.


# 1.38 07-Jun-2002 thorpej

Add the CPU ID for the 600MHz i80321 part.


Revision tags: netbsd-1-6-base
# 1.37 12-May-2002 ichiro

branches: 1.37.2; 1.37.4;
change ICP12x0 steppings.
define CPU_IXP12X0


# 1.36 10-May-2002 thorpej

Add IXP1200 steppings.


# 1.35 03-May-2002 thorpej

Add support for the Intel PXA210 and PXA250. From Hiroyuki Bessho, PR 16617.


# 1.34 02-May-2002 rjs

Enable CPU_CLASS_SA1 for SA1100 and SA1110.


# 1.33 12-Apr-2002 thorpej

Centralize ARM CPU configuration information by adding a new header
file, <arm/cpuconf.h>, which pulls in "opt_cputypes.h" and then defines
the following:
* CPU_NTYPES -- now many CPU types are configured into the kernel. What
you really want to know is "== 1" or "> 1".
* Defines ARM_ARCH_2, ARM_ARCH_3, ARM_ARCH_4, ARM_ARCH_5, depending
on which ARM architecture versions are configured (based on CPU_*
options). Also defines ARM_NARCH to determins how many architecture
versions are configured.
* Defines ARM_MMU_MEMC, ARM_MMU_GENERIC, ARM_MMU_XSCALE depending on
which classes of ARM MMUs are configured into the kernel, and ARM_NMMUS
to determine how many MMU classes are configured.

Remove the needless inclusion of "opt_cputypes.h" in several places.
Convert remaining users to <arm/cpuconf.h>.


# 1.32 27-Mar-2002 thorpej

The 80321 manual lies; it does have a CPU ID distinct from the 80200.
Add that CPU ID, and add a case for it.


# 1.31 26-Mar-2002 thorpej

Restructure a few things in order to support other XScale core
I/O processors:
* The i80200 and the i80321 have the same CPU ID, so split the
CPU_XSCALE option into CPU_XSCALE_80200 and CPU_XSCALE_80321
options, and don't let them both be defined at the same time.
XXX May want to revisit this in the future.
* Split some registers common between the i80200 and i80321 into
<arm/xscale/xscalereg.h>.
* Rename a few existing functions.


# 1.30 24-Mar-2002 thorpej

Cache the cpu type and cpu revision in cpu_info.


Revision tags: eeh-devprop-base
# 1.29 16-Mar-2002 bjh21

Only put the CPU type into cpu_model, not the state of the control register.
Instead, print the control register state on the next line at startup.


# 1.28 16-Mar-2002 bjh21

Add CPU ID for the ARM1022ES.
Also add a CPU class for ARM10E processors in general.


# 1.27 11-Mar-2002 reinoud

When ARMFPE wasn't enabled the `usearmfpe' flag was statically initialised
but not used resulting in a compiler error. By splitting the declaration
and the initialisation this is solved.

Better would be to not even declare the flag when ARMFPE isnt enabled but
that would just add to the #ifdef jungle.


# 1.26 10-Mar-2002 bjh21

__RCSID -> __KERNEL_RCSID


# 1.25 10-Mar-2002 bjh21

Re-work the way that FPAs are handled. If ARMFPE isn't configured, don't
even bother probing for an FPA. If ARMFPE is configured, always use it,
even if there's an FPA (since it provides the FPA support code). Move all
printfs about FPAs into armfpe_init.c.

This means I can delete the last two elements from struct _cpu, so that the
structure, and the whole of <arm/cpus.h> is redundant and can be deleted.


# 1.24 10-Mar-2002 bjh21

Remove fpu_model from struct _cpu. Instead, have initialise_arm_fpe()
printf() the FPE version number itself.


# 1.23 10-Mar-2002 bjh21

Add a ci_dev element to struct cpu_info, pointing to the device that
corresponds to the CPU.


Revision tags: newlock-base
# 1.22 10-Mar-2002 bjh21

Kill the fpu_flags element from struct _cpu. It was only ever set to 0
anyway.


# 1.21 10-Mar-2002 bjh21

Clean up inline assembler. Rather than saving R0, copying FPSR to R0,
copying it to the output register and then restoring R0, just copy the
FPSR straight to the output.


# 1.20 09-Mar-2002 bjh21

Remove the cpu_model member from struct _cpu, and just use the cpu_model
variable directly. While we're at it, make cpu_model rather larger.


# 1.19 09-Mar-2002 bjh21

Remove the cpu_class element from struct _cpu, and make it a local variable
in identify_arm_cpu(), since it's almost unused elsewhere.

Change the detection of bugged StrongARMs to use the cpu ID rather than the
class. This turns "almost" into "entirely".


# 1.18 09-Mar-2002 bjh21

Replace cpu_id and cpu_ctrl in struct _cpu with ci_cpuid and ci_ctrl in
struct cpu_info. Also kill the cpuctrl global while we're here, and make
identify_arm_cpu() take a struct cpu_info * as an argument alongside the CPU
number.


# 1.17 09-Mar-2002 bjh21

Move arm700bugcount into stuct cpu_info, and attach it in
identify_master_cpu().


Revision tags: ifpoll-base
# 1.16 17-Feb-2002 bjh21

Our assembler handles FPA instructions fine, so don't use .word for them.


# 1.15 17-Feb-2002 bjh21

ANSIfy, and othe KNF cleanup.


# 1.14 27-Jan-2002 bjh21

Add revision->stepping maps for the SA-110, SA-1100 and SA-1110.
Those for the SA-1100 and SA-1110 are from Intel's documentation.
The mapping for the SA-110 is from various sources on the net, since Intel
don't seem to document it.

Also, change the layout of the maps to have four steppings per line,
so they aren't quite so unwieldy.


# 1.13 24-Jan-2002 thorpej

Use a table to look up stepping names. Add a generic stepping
table ("rev 0", "rev 1", etc.) and an i80200 stepping table that
has the stepping names that appear in the i80200 manuals/errata..


# 1.12 29-Nov-2001 thorpej

Fetch cache info from the Cache Type register on ARM7TDMI and "greater"
processors. Report this when the processor is attached.


# 1.11 24-Nov-2001 thorpej

Move the ARM, Ltd. floating point emulator to arch/arm.


# 1.10 23-Nov-2001 thorpej

Use <arm/undefined.h> instead of <machine/undefined.h>.


Revision tags: thorpej-mips-cache-base
# 1.9 06-Nov-2001 thorpej

branches: 1.9.2;
Const poisoning of cpu/class names.


# 1.8 06-Nov-2001 thorpej

"i80200", not "80200".


# 1.7 06-Nov-2001 thorpej

"XScale", not "Xscale".


# 1.6 18-Oct-2001 rearnsha

branches: 1.6.2;
Support for ARM9.


Revision tags: thorpej-devvp-base3 thorpej-devvp-base2
# 1.5 28-Sep-2001 chris

Add extra arg to fpa_test as it should have 4 args. Also add prototypes for fpa_test and fpa_handler.


Revision tags: post-chs-ubcperf pre-chs-ubcperf thorpej-devvp-base
# 1.4 05-Sep-2001 matt

branches: 1.4.2;
Flesh XSCALE support.


# 1.3 03-Jun-2001 chris

branches: 1.3.2; 1.3.4;
Add support for ARM7TDMI, as provided in a patch from John Fremlin to port-arm32.

Shouldn't effect any currently in tree ports.


# 1.2 13-May-2001 bjh21

Use get_bootconf_option() to find boot options, rather than home-grown
strstr()-based hacks.


Revision tags: thorpej_scsipi_beforemerge thorpej_scsipi_base thorpej_scsipi_nbase
# 1.1 20-Apr-2001 matt

branches: 1.1.2;
Split cpu from mainbus so that cpu can attached to other buses (like ofbus).


# 1.151 11-Oct-2021 rin

For some classic CPUs, info->[id]cache_sets are not initialized.
Calculate and print numbers of sets in this case.


# 1.150 11-Oct-2021 rin

pN steppings are used for ARM926EJ-S, although only r0 seems to be available.


# 1.149 23-Sep-2021 skrll

Print the cache information in similar formats and arm and aarch64, e.g.

arm before
[ 1.0000000] cpu0: 32KB/64B 2-way L1 PIPT Instruction cache
[ 1.0000000] cpu0: 32KB/64B 2-way write-back-locking-C L1 PIPT Data cache
[ 1.0000000] cpu0: 2304KB/64B 16-way write-through L2 PIPT Unified cache

arm after
[ 1.0000000] cpu0: L1 32KB/64B 2-way (256 set) PIPT Instruction cache
[ 1.0000000] cpu0: L1 32KB/64B 2-way (256 set) write-back-locking-C PIPT Data cache
[ 1.0000000] cpu0: L2 2304KB/64B 16-way (2304 set) write-through PIPT Unified cache

aarch64 before
[ 1.0000030] cpu1: L1 48KB/64B*256L*3W PIPT Instruction cache
[ 1.0000030] cpu1: L1 32KB/64B*256L*2W PIPT Data cache
[ 1.0000030] cpu1: L2 2048KB/64B*2048L*16W PIPT Unified cache

aarch64 after
[ 1.0000030] cpu1: L1 48KB/64B 3-way (256 set) PIPT Instruction cache
[ 1.0000030] cpu1: L1 32KB/64B 2-way (256 set) PIPT Data cache
[ 1.0000030] cpu1: L2 2048KB/64B 16-way (2048 set) PIPT Unified cache


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base thorpej-i2c-spi-conf-base
# 1.148 06-Jul-2021 skrll

Assume all ARM11[37]6 r0 variants are missing ISAR and friends. This is
certainly the case for r0 variants I could find TRMs for.

PR/50596 CPU_ID_ARM1136JS r0p4 does not support feature registers


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-cfargs-base thorpej-futex-base
# 1.147 02-Jul-2020 martin

branches: 1.147.6;
Initialize ci_kfpu_spl earlier for secondary CPUs. From riastradh


# 1.146 29-Jun-2020 riastradh

Implement fpu_kern_enter/leave for arm32.


# 1.145 20-Jun-2020 skrll

KNF #includes

Remove some unnecessary ones while I'm here.


Revision tags: bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3
# 1.144 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}


Revision tags: ad-namecache-base2
# 1.143 22-Jan-2020 skrll

#ifdef whack-a-mole for the pmap_maxproc_set functionality


# 1.142 20-Jan-2020 skrll

s/_ARM_ARCH_6/ARM_MMU_EXTENDED/ in the #ifdef for the recent 4k pages
change


# 1.141 18-Jan-2020 skrll

Use 4K pages on ARM_MMU_EXTENDED platforms (all armv[67] except RPI) by
creating a new pool l1ttpl for the userland L1 translation table which
needs to be 8KB and 8KB aligned.

Limit the pool to maxproc and add hooks to allow the sysctl changing of
maxproc to adjust the pool.

This comes at a 5% performance penalty for build.sh -j8 kernel on a
Tegra TK1.


Revision tags: ad-namecache-base1
# 1.140 15-Jan-2020 mrg

port the arm64 cpu topology setup for big.little to arm.

rename arm64 cpu_do_topology() to arm_cpu_do_topology() and
call it from both arm cpu_attach().

replace both aarch64_set_topology() inline code in arm
cpu_attach() with new arm_cpu_do_topology(), which is called
by the arm64 locore as well (possibly not needed, which would
allow it to become static.)

not yet tested on a real big.little armv7 system. tested
on rockpro64 and pinebook pro.


# 1.139 09-Jan-2020 ad

- Many small tweaks to the SMT awareness in the scheduler. It does a much
better job now at keeping all physical CPUs busy, while using the extra
threads to help out. In particular, during preempt() if we're using SMT,
try to find a better CPU to run on and teleport curlwp there.

- Change the CPU topology stuff so it can work on asymmetric systems. This
mainly entails rearranging one of the CPU lists so it makes sense in all
configurations.

- Add a parameter to cpu_topology_set() to note that a CPU is "slow", for
where there are fast CPUs and slow CPUs, like with the Rockwell RK3399.
Extend the SMT awareness to try and handle that situation too (keep fast
CPUs busy, use slow CPUs as helpers).


# 1.138 09-Jan-2020 martin

When attaching the first fdtbus, use the root "comptabile" (or failing that:
"model") property to set the cpu model (in userland aka sysctl hw.model).
When attaching the first cpu, do not overwrite a cpu model if it already
had been set.


# 1.137 08-Jan-2020 jmcneill

cpu_hatch is too late to report AP topology, do it at attach time instead


Revision tags: ad-namecache-base
# 1.136 20-Dec-2019 ad

branches: 1.136.2;
Some more CPU topology stuff:

- Use cegger@'s ACPI SRAT parsing code to figure out NUMA node ID for each
CPU as it is attached.

- For scheduler experiments with SMT, flag CPUs with the lowest numbered SMT
IDs as "primaries", link back to the primaries from secondaries, and build
a circular list of CPUs in each package with identical SMT IDs.

- No need for package/core/smt/numa IDs to be anything other than a u_int.


# 1.135 02-Dec-2019 ad

Take the basic CPU topology information we already collect, and use it
to make circular lists of CPU siblings in the same core, and in the
same package. Nothing fancy, just enough to have a bit of fun in the
scheduler trying out different tactics.


Revision tags: phil-wifi-20191119
# 1.134 20-Oct-2019 jmcneill

cpu_hatched_p only for MULTIPROCESSOR


# 1.133 19-Oct-2019 jmcneill

Increase aarch64 MAXCPUS to 256.


# 1.132 29-Sep-2019 skrll

aprint_debug_dev output alignment


# 1.131 08-Sep-2019 tnn

report A12 as A17 to the user. A12 is retcon'ed by ARM.


# 1.130 07-Sep-2019 tnn

Cortex A12 is marketed as A17 but has a distinct part number

observed on Rockchip RK3288


Revision tags: netbsd-9-base phil-wifi-20190609 isaki-audio2-base
# 1.129 17-Mar-2019 skrll

branches: 1.129.4;
Wrap arm_cpu_marker if #ifdef MPDEBUG.

One day a9_mpsubr.S will die


# 1.128 27-Jan-2019 pgoyette

Merge the [pgoyette-compat] branch


Revision tags: pgoyette-compat-20190127
# 1.127 25-Jan-2019 skrll

Make sure ci_{smt,core,package}_id are all filled in appropriately.

Previously the BP was missed and __SHIFTOUT wasn't used.


Revision tags: pgoyette-compat-20190118
# 1.126 03-Jan-2019 jmcneill

Read mpidr and cpuid from the secondary processor itself instead of the
boot processor. While here, add Cortex-A15 r4p0 to supported list.


# 1.125 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.124 02-Jan-2019 skrll

Don't overwrite the setting of cpu_core_id from mpidr


Revision tags: pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020
# 1.123 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.122 08-Oct-2018 skrll

Trialing whitespace


# 1.121 06-Oct-2018 skrll

Use __BIT. NFC.


Revision tags: pgoyette-compat-0930 pgoyette-compat-0906
# 1.120 15-Aug-2018 skrll

KNF


# 1.119 15-Aug-2018 skrll

Fix includes (sys/cdefs.h then sys/param.h)


# 1.118 15-Aug-2018 skrll

Sprinkle #include "opt_cputypes.h"


# 1.117 10-Aug-2018 maxv

Retire CPU_ARM2, CPU_ARM250 and CPU_ARM3, they are all leftovers of
acorn26.

ok jmcneill@ skrll@


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202
# 1.116 16-Sep-2017 matt

branches: 1.116.2; 1.116.4;
Add Cortex-A35 CPU ID.


Revision tags: netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base
# 1.115 01-Jun-2017 chs

branches: 1.115.6;
remove checks for failure after memory allocation calls that cannot fail:

kmem_alloc() with KM_SLEEP
kmem_zalloc() with KM_SLEEP
percpu_alloc()
pserialize_create()
psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.114 11-Jul-2016 kiyohara

Add Cortex-A9 r1.


Revision tags: nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.113 03-Mar-2016 skrll

Get the RPI3 working (in aarch32 mode) by recognising Cortex A53 CPUs.
While I'm here add some A57/A72 info as well.

My RPI3 works with FB console - the uart needs some help with its clocks.


# 1.112 23-Jan-2016 christos

Rename the cpu_id() define to cpu_idnum() so that it does not conflict with
dtrace and friends.


Revision tags: nick-nhusb-base-20151226
# 1.111 12-Nov-2015 jmcneill

change some register dumps from aprint_verbose to aprint_debug


Revision tags: nick-nhusb-base-20150921
# 1.110 08-Jul-2015 skrll

aprint_verbose [sa]ctlr


Revision tags: nick-nhusb-base-20150606
# 1.109 05-Jun-2015 skrll

Print the Revision ID regster (verbose)


# 1.108 17-May-2015 matt

Print out mpidr on MP systems (verbose print)


Revision tags: nick-nhusb-base-20150406
# 1.107 03-Mar-2015 jmcneill

cache type 12 is "write-back", from matt


Revision tags: nick-nhusb-base
# 1.106 27-Nov-2014 matt

branches: 1.106.2;
Add entry for Cortex-A17 r1


# 1.105 01-Sep-2014 reinoud

Increase the `freqbuf' buffer that holds the result of humanize_number(). Now
it prints 1600 Mhz instead of 1 Ghz.
Pitty enough humanize_number(9) doesn't do 1.6 Ghz type output.


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.104 28-Mar-2014 matt

branches: 1.104.4;
Various MP changes.


# 1.103 24-Mar-2014 christos

use cpu_{g,s}etmodel


# 1.102 20-Mar-2014 matt

Define cache type 13


Revision tags: riastradh-drm2-base3
# 1.101 03-Mar-2014 matt

Add most of the cpu_* variables to <arm/locore.h>
Add and initialize cpu_synchprim_present


# 1.100 20-Feb-2014 matt

Keep track of what each cache is (VIVT/VIPT/PIPT).

cpu0: 32KB/32B 2-way L1 VIPT Instruction cache
cpu0: 32KB/64B 4-way write-back-locking-C L1 PIPT Data cache
cpu0: 256KB/64B 8-way write-through L2 PIPT Unified cache


# 1.99 07-Sep-2013 matt

Add a machdep.hwdiv_present sysctl (cortex A7 and A15 have hwdiv instructions)


# 1.98 07-Sep-2013 matt

Add CPU_ID_CORTEXA7R0 entry


# 1.97 18-Aug-2013 matt

Move parts of cpu.h that are not needed by MI code in <arm/locore.h>
Don't include <machine/cpu.h> or <machine/frame.h>, use <arm/locore.h>
Use <arm/asm.h> instead of <machine/arm.h>


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.96 12-Jun-2013 matt

branches: 1.96.2;
Nuke cpu_pfr, just use the armreg_pfr?_read inlines


# 1.95 12-Jun-2013 matt

Use the armreg_pfr?_read inlines.


# 1.94 19-May-2013 rkujawa

Plug support for PJ4B into our ARM CPU infrastructure.

Obtained from Marvell, Semihalf.


Revision tags: agc-symver-base
# 1.93 03-Feb-2013 matt

Add a machdep.cpu_arch sysctl


# 1.92 31-Jan-2013 matt

Add simple sysctls for cpu_id, fpu_id, neon_present, simd_present,
simdex_present.
Add struct sysctls to return the isar, mmfr, pfr, and mvfr sets.


Revision tags: yamt-pagecache-base8 yamt-pagecache-base7
# 1.91 05-Dec-2012 matt

ARMFPE hasn't compiled since NetBSD 4. Remove it.
Complete support for FPU_VFP.
fpregs now contains vfpreg.
XXX vfpreg only has space for 16 64-bit FP registers though VFPv3 and later
have 32 64-bit FP registers.


# 1.90 30-Nov-2012 msaitoh

Use snprintf() instead of sprintf().


# 1.89 30-Nov-2012 msaitoh

s/,/;/


# 1.88 12-Nov-2012 skrll

C99 types


Revision tags: yamt-pagecache-base6
# 1.87 22-Sep-2012 matt

Don't use an asm in pmap_activate to update the TTBR, use cpu_setttb instead
but add a second argument to it to indicate whether the TLB/caches need to be
flushed. Default cortex to pmap_needs_fixup = 1. But check the MMFR3 field
to see if the fixed can be skipped.
Use a cf_flag bit 0 to indicate whether the A9 L2 cache should disable (bit 0 = 1)
or enabeld (bit = 0).

With these changes, the A9 MMU can use traverse caches to do MMU tablewalks
Also, make sure all memory has the shareable bit for the A9.


# 1.86 07-Sep-2012 matt

branches: 1.86.2;
Switch cortex_a9 back to need_ptesync = 1
Add code to disable the L2 cache on cortex-a9 (for now).
Add evcnt for all the fault types.
Move cache info in a structure and have one for the pcache and one for scache.
Probe L1/L2 caches properly for ARMv7


# 1.85 29-Aug-2012 matt

Use new armv7 CP15 register to print out cache types.
If the cpu_cc_freq is set, report it.
Add macros to make inlines for reading/writing co-processor registers.


# 1.84 14-Aug-2012 matt

Use device_t


# 1.83 12-Aug-2012 matt

Rework VFP support to use PCU.
Add emulation of instruction which save/restore the VFP FPSCR.
Add a sysarch hook to VFP FPSCR manipulation.

[The emulation will be used by libc to store/fetch exception modes and
rounding mode on a per-thread basis.]


# 1.82 14-Jul-2012 matt

Refresh cortex cpus


Revision tags: jmcneill-usbmp-base10 yamt-pagecache-base5
# 1.81 20-May-2012 skrll

Remove the ARM1156T2 bloat - it only has an MPU. Prompted by matt@


# 1.80 20-May-2012 skrll

Add the ARM1156T2-S


# 1.79 20-May-2012 skrll

Add the 'Z' to the 1176 cpu product name.

ok matt@


Revision tags: jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base jym-xensuspend-nbase rmind-uvmplock-base jym-xensuspend-base
# 1.78 10-Mar-2011 bsh

branches: 1.78.4; 1.78.8; 1.78.10;
add MPCore to CPU-ID table
add branch predict bit to arm11_options


Revision tags: uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11
# 1.77 02-Oct-2010 kiyohara

branches: 1.77.2;
Add support Marvell Sheeva Core and SoC. (Orion/Kirkwood)
Discovery Innovation not yet.


Revision tags: uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.76 19-Jun-2010 matt

Fix cache probing on Cortex. Add missing CORTEX dependency in cpu.c


# 1.75 19-Jun-2010 matt

Fix c&p error.


# 1.74 19-Jun-2010 matt

Cleanup the armv7 changes. Add ARM_ARCH_7. Use CPU_CORTEX instead of
CPU_CORTEXA8 everywhere since there more types of Cortex than just the A8.
CPU_CORTEXA8 still exists but causes CPU_CORTEX to be defined.
Add CPU_CORTEXA9 as well. Use .arch armv7a to get us the isb/dsb
instructions.

Test booted to root device prompt on a Beagleboard.
All ARM kernels successfully test built.


# 1.73 16-Jun-2010 jmcneill

PR port-arm/43299: Support added for igepv2/cortexa8/omap3530

Apply patch from PR, with build fixes. ok skrll, matt


Revision tags: uebayasi-xip-base1 yamt-nfs-mp-base9 uebayasi-xip-base
# 1.72 23-Jan-2010 mrg

branches: 1.72.2; 1.72.4;
rename a local cpu_name structure member to avoid potential conflict
with <sys/cpu.h>'s.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-premerge-20091211 yamt-nfs-mp-base8 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 yamt-nfs-mp-base7 netbsd-5-0-1-RELEASE jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base nick-hppapmap-base haad-dm-base mjf-devfs2-base
# 1.71 25-Oct-2008 matt

branches: 1.71.4; 1.71.12;
Fix some missing things for CPU_ID_FA526.


Revision tags: matt-mips64-base2
# 1.70 24-Oct-2008 matt

Add entry for FA526.


# 1.69 21-Oct-2008 matt

Add Cortex cpus


Revision tags: haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base
# 1.68 27-Apr-2008 matt

branches: 1.68.6;
Merge kernel changes in matt-armv6 to HEAD.


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 chris-arm-intr-rework-base7 keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.67 15-Mar-2008 rearnsha

branches: 1.67.2; 1.67.4;
VFP support.


Revision tags: nick-net80211-sync-base chris-arm-intr-rework-base6 chris-arm-intr-rework-base5 chris-arm-intr-rework-base4 bouyer-xeni386-merge1 chris-arm-intr-rework-base3 vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 jmcneill-base mjf-devfs-base bouyer-xenamd64-base2 vmlocking-nbase yamt-x86pmap-base4 bouyer-xenamd64-base matt-armv6-base jmcneill-pm-base hpcarm-cleanup-base reinoud-bufcleanup-base
# 1.66 17-Oct-2007 garbled

branches: 1.66.12; 1.66.16;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base chris-arm-intr-rework-base2 chris-arm-intr-rework-base nick-csl-alignment-base matt-mips64-base ppcoea-renovation-base mjf-ufs-trans-base vmlocking-base
# 1.65 17-May-2007 yamt

branches: 1.65.10; 1.65.12;
merge yamt-idlelwp branch. asked by core@. some ports still needs work.

from doc/BRANCHES:

idle lwp, and some changes depending on it.

1. separate context switching and thread scheduling.
(cf. gmcgarry_ctxsw)
2. implement idle lwp.
3. clean up related MD/MI interfaces.
4. make scheduler(s) modular.


Revision tags: yamt-idlelwp-base8 thorpej-atomic-base ad-audiomp-base post-newlock2-merge newlock2-nbase newlock2-base
# 1.64 06-Jan-2007 christos

branches: 1.64.2; 1.64.6; 1.64.8; 1.64.14;
Scott Allan in http://mail-index.netbsd.org/port-arm/2006/07/31/0000.html
Patch to add support for ARM9E


# 1.63 06-Jan-2007 christos

From Scott Alan in http://mail-index.netbsd.org/port-arm/2006/07/26/0000.html
identify_arm_cpu() prints out a helpful message when it detects that you're
trying to run on a CPU that you didn't configure for. Unfortunately, the
check for class_option being NULL is backward, so it either won't print the
class_option, or it will try to dereference a NULL. The patch just flips the
!= NULL to be == NULL.


Revision tags: yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 abandoned-netbsd-4-base yamt-splraiseipl-base2 yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 netbsd-4-base yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base elad-kernelauth-base simonb-timecounters-base rpaulo-netinet-merge-pcb-base
# 1.62 15-Mar-2006 drochner

branches: 1.62.10; 1.62.14;
use km_alloc to get wired kernel memory for kernel stacks
of idle processes for secondary CPUs
(affects the MULTIPROCESSOR case only - does this exist?)
(untested)


Revision tags: yamt-pdpolicy-base2 yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.61 11-Dec-2005 christos

branches: 1.61.4; 1.61.6; 1.61.8; 1.61.10;
merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.60 20-Jul-2005 nonaka

Added i80219.


# 1.59 04-Jul-2005 bsh

branches: 1.59.2;
The first step to support Intel PXA270.

kernel config option CPU_XSCALE_PXA2X0 is now obsoleted by
CPU_XSCALE_PXA250 and CPU_XSCALE_PXA270. If both of them are defined,
CPU is determined run-time.


# 1.58 03-Jun-2005 rearnsha

Very basic support for the ARM1136.

This code takes no advantage of any 'new' features provided by
architecture 6 devices (such as physically tagged caches or new
MMU features), and basically runs the chip in a 'legacy v5' mode.


# 1.57 10-May-2005 rearnsha

Add support for arm1026ej-s.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 yamt-km-base4 yamt-km-base3 netbsd-3-base yamt-km-base2 yamt-km-base kent-audio2-base kent-audio1-beforemerge kent-audio1-base
# 1.56 14-Apr-2004 bsh

distinguish PXA255/26x from PXA2[15]0 in CPU attach message


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.55 13-Feb-2004 wiz

Uppercase CPU, plural is CPUs.


# 1.54 26-Oct-2003 chris

Fix up some unitialised variables.


# 1.53 06-Sep-2003 rearnsha

Support for ARM10E class devices.


# 1.52 03-Sep-2003 mycroft

Recognize some TI processors -- not that you'd want to use them.


# 1.51 23-Jun-2003 martin

branches: 1.51.2;
Make sure to include opt_foo.h if a defflag option FOO is used.


# 1.50 23-May-2003 ichiro

support IXP425 Intel Network Processor
running on BigEndian


# 1.49 29-Apr-2003 thorpej

Use aprint*().


# 1.48 14-Feb-2003 rjs

Add CPU IDs for PXA B2 and C0 steppings.


Revision tags: nathanw_sa_before_merge nathanw_sa_base
# 1.47 06-Jan-2003 wiz

specified, not specifed.


Revision tags: fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base
# 1.46 17-Nov-2002 chs

change uvm_uarea_alloc() to indicate whether the returned uarea is already
backed by physical pages (ie. because it reused a previously-freed one),
so that we can skip a bunch of useless work in that case.
this fixes the underlying problem behind PR 18543, and also speeds up fork()
quite a bit (eg. 7% on my pc, 1% on my ultra2) when we get a cache hit.


Revision tags: kqueue-aftermerge kqueue-beforemerge bjh21-hydra-base
# 1.45 13-Oct-2002 chris

branches: 1.45.2;
Fix arm kernel build breaks for non multiprocessor systems.


# 1.44 13-Oct-2002 bjh21

It appears that MI code requires ci_cpuid to be the CPU number of the CPU
in question, whereas the ARM code was using it to hold the model
identification. To fix this, rename:

ci_cpuid -> ci_arm_cpuid
ci_cputype -> ci_arm_cputype (for consistency)
ci_cpurev -> ci_arm_cpurev (ditto)
ci_cpunum -> ci_cpuid

This makes top(1) give correct CPU numbers in its "STATE" column (all 0 for
now).


# 1.43 12-Oct-2002 bjh21

Remember the location of each CPU's idle PCB in struct cpu_info.
Move allocation of the idle PCB from hydra.c to cpu.c and add some
extra initialisation from cpu_fork().


Revision tags: kqueue-base
# 1.42 01-Oct-2002 bjh21

constify various string tables.


# 1.41 06-Sep-2002 gehenna

Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.


Revision tags: gehenna-devsw-base
# 1.40 22-Jul-2002 briggs

Handle i80200 step D0 and i80321 step B0


# 1.39 10-Jul-2002 ichiro

add cpu id for "PXA250/210 3rd version CPUcore".

for using many PDA/xscale-core.


# 1.38 07-Jun-2002 thorpej

Add the CPU ID for the 600MHz i80321 part.


Revision tags: netbsd-1-6-base
# 1.37 12-May-2002 ichiro

branches: 1.37.2; 1.37.4;
change ICP12x0 steppings.
define CPU_IXP12X0


# 1.36 10-May-2002 thorpej

Add IXP1200 steppings.


# 1.35 03-May-2002 thorpej

Add support for the Intel PXA210 and PXA250. From Hiroyuki Bessho, PR 16617.


# 1.34 02-May-2002 rjs

Enable CPU_CLASS_SA1 for SA1100 and SA1110.


# 1.33 12-Apr-2002 thorpej

Centralize ARM CPU configuration information by adding a new header
file, <arm/cpuconf.h>, which pulls in "opt_cputypes.h" and then defines
the following:
* CPU_NTYPES -- now many CPU types are configured into the kernel. What
you really want to know is "== 1" or "> 1".
* Defines ARM_ARCH_2, ARM_ARCH_3, ARM_ARCH_4, ARM_ARCH_5, depending
on which ARM architecture versions are configured (based on CPU_*
options). Also defines ARM_NARCH to determins how many architecture
versions are configured.
* Defines ARM_MMU_MEMC, ARM_MMU_GENERIC, ARM_MMU_XSCALE depending on
which classes of ARM MMUs are configured into the kernel, and ARM_NMMUS
to determine how many MMU classes are configured.

Remove the needless inclusion of "opt_cputypes.h" in several places.
Convert remaining users to <arm/cpuconf.h>.


# 1.32 27-Mar-2002 thorpej

The 80321 manual lies; it does have a CPU ID distinct from the 80200.
Add that CPU ID, and add a case for it.


# 1.31 26-Mar-2002 thorpej

Restructure a few things in order to support other XScale core
I/O processors:
* The i80200 and the i80321 have the same CPU ID, so split the
CPU_XSCALE option into CPU_XSCALE_80200 and CPU_XSCALE_80321
options, and don't let them both be defined at the same time.
XXX May want to revisit this in the future.
* Split some registers common between the i80200 and i80321 into
<arm/xscale/xscalereg.h>.
* Rename a few existing functions.


# 1.30 24-Mar-2002 thorpej

Cache the cpu type and cpu revision in cpu_info.


Revision tags: eeh-devprop-base
# 1.29 16-Mar-2002 bjh21

Only put the CPU type into cpu_model, not the state of the control register.
Instead, print the control register state on the next line at startup.


# 1.28 16-Mar-2002 bjh21

Add CPU ID for the ARM1022ES.
Also add a CPU class for ARM10E processors in general.


# 1.27 11-Mar-2002 reinoud

When ARMFPE wasn't enabled the `usearmfpe' flag was statically initialised
but not used resulting in a compiler error. By splitting the declaration
and the initialisation this is solved.

Better would be to not even declare the flag when ARMFPE isnt enabled but
that would just add to the #ifdef jungle.


# 1.26 10-Mar-2002 bjh21

__RCSID -> __KERNEL_RCSID


# 1.25 10-Mar-2002 bjh21

Re-work the way that FPAs are handled. If ARMFPE isn't configured, don't
even bother probing for an FPA. If ARMFPE is configured, always use it,
even if there's an FPA (since it provides the FPA support code). Move all
printfs about FPAs into armfpe_init.c.

This means I can delete the last two elements from struct _cpu, so that the
structure, and the whole of <arm/cpus.h> is redundant and can be deleted.


# 1.24 10-Mar-2002 bjh21

Remove fpu_model from struct _cpu. Instead, have initialise_arm_fpe()
printf() the FPE version number itself.


# 1.23 10-Mar-2002 bjh21

Add a ci_dev element to struct cpu_info, pointing to the device that
corresponds to the CPU.


Revision tags: newlock-base
# 1.22 10-Mar-2002 bjh21

Kill the fpu_flags element from struct _cpu. It was only ever set to 0
anyway.


# 1.21 10-Mar-2002 bjh21

Clean up inline assembler. Rather than saving R0, copying FPSR to R0,
copying it to the output register and then restoring R0, just copy the
FPSR straight to the output.


# 1.20 09-Mar-2002 bjh21

Remove the cpu_model member from struct _cpu, and just use the cpu_model
variable directly. While we're at it, make cpu_model rather larger.


# 1.19 09-Mar-2002 bjh21

Remove the cpu_class element from struct _cpu, and make it a local variable
in identify_arm_cpu(), since it's almost unused elsewhere.

Change the detection of bugged StrongARMs to use the cpu ID rather than the
class. This turns "almost" into "entirely".


# 1.18 09-Mar-2002 bjh21

Replace cpu_id and cpu_ctrl in struct _cpu with ci_cpuid and ci_ctrl in
struct cpu_info. Also kill the cpuctrl global while we're here, and make
identify_arm_cpu() take a struct cpu_info * as an argument alongside the CPU
number.


# 1.17 09-Mar-2002 bjh21

Move arm700bugcount into stuct cpu_info, and attach it in
identify_master_cpu().


Revision tags: ifpoll-base
# 1.16 17-Feb-2002 bjh21

Our assembler handles FPA instructions fine, so don't use .word for them.


# 1.15 17-Feb-2002 bjh21

ANSIfy, and othe KNF cleanup.


# 1.14 27-Jan-2002 bjh21

Add revision->stepping maps for the SA-110, SA-1100 and SA-1110.
Those for the SA-1100 and SA-1110 are from Intel's documentation.
The mapping for the SA-110 is from various sources on the net, since Intel
don't seem to document it.

Also, change the layout of the maps to have four steppings per line,
so they aren't quite so unwieldy.


# 1.13 24-Jan-2002 thorpej

Use a table to look up stepping names. Add a generic stepping
table ("rev 0", "rev 1", etc.) and an i80200 stepping table that
has the stepping names that appear in the i80200 manuals/errata..


# 1.12 29-Nov-2001 thorpej

Fetch cache info from the Cache Type register on ARM7TDMI and "greater"
processors. Report this when the processor is attached.


# 1.11 24-Nov-2001 thorpej

Move the ARM, Ltd. floating point emulator to arch/arm.


# 1.10 23-Nov-2001 thorpej

Use <arm/undefined.h> instead of <machine/undefined.h>.


Revision tags: thorpej-mips-cache-base
# 1.9 06-Nov-2001 thorpej

branches: 1.9.2;
Const poisoning of cpu/class names.


# 1.8 06-Nov-2001 thorpej

"i80200", not "80200".


# 1.7 06-Nov-2001 thorpej

"XScale", not "Xscale".


# 1.6 18-Oct-2001 rearnsha

branches: 1.6.2;
Support for ARM9.


Revision tags: thorpej-devvp-base3 thorpej-devvp-base2
# 1.5 28-Sep-2001 chris

Add extra arg to fpa_test as it should have 4 args. Also add prototypes for fpa_test and fpa_handler.


Revision tags: post-chs-ubcperf pre-chs-ubcperf thorpej-devvp-base
# 1.4 05-Sep-2001 matt

branches: 1.4.2;
Flesh XSCALE support.


# 1.3 03-Jun-2001 chris

branches: 1.3.2; 1.3.4;
Add support for ARM7TDMI, as provided in a patch from John Fremlin to port-arm32.

Shouldn't effect any currently in tree ports.


# 1.2 13-May-2001 bjh21

Use get_bootconf_option() to find boot options, rather than home-grown
strstr()-based hacks.


Revision tags: thorpej_scsipi_beforemerge thorpej_scsipi_base thorpej_scsipi_nbase
# 1.1 20-Apr-2001 matt

branches: 1.1.2;
Split cpu from mainbus so that cpu can attached to other buses (like ofbus).


# 1.149 23-Sep-2021 skrll

Print the cache information in similar formats and arm and aarch64, e.g.

arm before
[ 1.0000000] cpu0: 32KB/64B 2-way L1 PIPT Instruction cache
[ 1.0000000] cpu0: 32KB/64B 2-way write-back-locking-C L1 PIPT Data cache
[ 1.0000000] cpu0: 2304KB/64B 16-way write-through L2 PIPT Unified cache

arm after
[ 1.0000000] cpu0: L1 32KB/64B 2-way (256 set) PIPT Instruction cache
[ 1.0000000] cpu0: L1 32KB/64B 2-way (256 set) write-back-locking-C PIPT Data cache
[ 1.0000000] cpu0: L2 2304KB/64B 16-way (2304 set) write-through PIPT Unified cache

aarch64 before
[ 1.0000030] cpu1: L1 48KB/64B*256L*3W PIPT Instruction cache
[ 1.0000030] cpu1: L1 32KB/64B*256L*2W PIPT Data cache
[ 1.0000030] cpu1: L2 2048KB/64B*2048L*16W PIPT Unified cache

aarch64 after
[ 1.0000030] cpu1: L1 48KB/64B 3-way (256 set) PIPT Instruction cache
[ 1.0000030] cpu1: L1 32KB/64B 2-way (256 set) PIPT Data cache
[ 1.0000030] cpu1: L2 2048KB/64B 16-way (2048 set) PIPT Unified cache


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base thorpej-i2c-spi-conf-base
# 1.148 06-Jul-2021 skrll

Assume all ARM11[37]6 r0 variants are missing ISAR and friends. This is
certainly the case for r0 variants I could find TRMs for.

PR/50596 CPU_ID_ARM1136JS r0p4 does not support feature registers


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-cfargs-base thorpej-futex-base
# 1.147 02-Jul-2020 martin

branches: 1.147.6;
Initialize ci_kfpu_spl earlier for secondary CPUs. From riastradh


# 1.146 29-Jun-2020 riastradh

Implement fpu_kern_enter/leave for arm32.


# 1.145 20-Jun-2020 skrll

KNF #includes

Remove some unnecessary ones while I'm here.


Revision tags: bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3
# 1.144 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}


Revision tags: ad-namecache-base2
# 1.143 22-Jan-2020 skrll

#ifdef whack-a-mole for the pmap_maxproc_set functionality


# 1.142 20-Jan-2020 skrll

s/_ARM_ARCH_6/ARM_MMU_EXTENDED/ in the #ifdef for the recent 4k pages
change


# 1.141 18-Jan-2020 skrll

Use 4K pages on ARM_MMU_EXTENDED platforms (all armv[67] except RPI) by
creating a new pool l1ttpl for the userland L1 translation table which
needs to be 8KB and 8KB aligned.

Limit the pool to maxproc and add hooks to allow the sysctl changing of
maxproc to adjust the pool.

This comes at a 5% performance penalty for build.sh -j8 kernel on a
Tegra TK1.


Revision tags: ad-namecache-base1
# 1.140 15-Jan-2020 mrg

port the arm64 cpu topology setup for big.little to arm.

rename arm64 cpu_do_topology() to arm_cpu_do_topology() and
call it from both arm cpu_attach().

replace both aarch64_set_topology() inline code in arm
cpu_attach() with new arm_cpu_do_topology(), which is called
by the arm64 locore as well (possibly not needed, which would
allow it to become static.)

not yet tested on a real big.little armv7 system. tested
on rockpro64 and pinebook pro.


# 1.139 09-Jan-2020 ad

- Many small tweaks to the SMT awareness in the scheduler. It does a much
better job now at keeping all physical CPUs busy, while using the extra
threads to help out. In particular, during preempt() if we're using SMT,
try to find a better CPU to run on and teleport curlwp there.

- Change the CPU topology stuff so it can work on asymmetric systems. This
mainly entails rearranging one of the CPU lists so it makes sense in all
configurations.

- Add a parameter to cpu_topology_set() to note that a CPU is "slow", for
where there are fast CPUs and slow CPUs, like with the Rockwell RK3399.
Extend the SMT awareness to try and handle that situation too (keep fast
CPUs busy, use slow CPUs as helpers).


# 1.138 09-Jan-2020 martin

When attaching the first fdtbus, use the root "comptabile" (or failing that:
"model") property to set the cpu model (in userland aka sysctl hw.model).
When attaching the first cpu, do not overwrite a cpu model if it already
had been set.


# 1.137 08-Jan-2020 jmcneill

cpu_hatch is too late to report AP topology, do it at attach time instead


Revision tags: ad-namecache-base
# 1.136 20-Dec-2019 ad

branches: 1.136.2;
Some more CPU topology stuff:

- Use cegger@'s ACPI SRAT parsing code to figure out NUMA node ID for each
CPU as it is attached.

- For scheduler experiments with SMT, flag CPUs with the lowest numbered SMT
IDs as "primaries", link back to the primaries from secondaries, and build
a circular list of CPUs in each package with identical SMT IDs.

- No need for package/core/smt/numa IDs to be anything other than a u_int.


# 1.135 02-Dec-2019 ad

Take the basic CPU topology information we already collect, and use it
to make circular lists of CPU siblings in the same core, and in the
same package. Nothing fancy, just enough to have a bit of fun in the
scheduler trying out different tactics.


Revision tags: phil-wifi-20191119
# 1.134 20-Oct-2019 jmcneill

cpu_hatched_p only for MULTIPROCESSOR


# 1.133 19-Oct-2019 jmcneill

Increase aarch64 MAXCPUS to 256.


# 1.132 29-Sep-2019 skrll

aprint_debug_dev output alignment


# 1.131 08-Sep-2019 tnn

report A12 as A17 to the user. A12 is retcon'ed by ARM.


# 1.130 07-Sep-2019 tnn

Cortex A12 is marketed as A17 but has a distinct part number

observed on Rockchip RK3288


Revision tags: netbsd-9-base phil-wifi-20190609 isaki-audio2-base
# 1.129 17-Mar-2019 skrll

branches: 1.129.4;
Wrap arm_cpu_marker if #ifdef MPDEBUG.

One day a9_mpsubr.S will die


# 1.128 27-Jan-2019 pgoyette

Merge the [pgoyette-compat] branch


Revision tags: pgoyette-compat-20190127
# 1.127 25-Jan-2019 skrll

Make sure ci_{smt,core,package}_id are all filled in appropriately.

Previously the BP was missed and __SHIFTOUT wasn't used.


Revision tags: pgoyette-compat-20190118
# 1.126 03-Jan-2019 jmcneill

Read mpidr and cpuid from the secondary processor itself instead of the
boot processor. While here, add Cortex-A15 r4p0 to supported list.


# 1.125 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.124 02-Jan-2019 skrll

Don't overwrite the setting of cpu_core_id from mpidr


Revision tags: pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020
# 1.123 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.122 08-Oct-2018 skrll

Trialing whitespace


# 1.121 06-Oct-2018 skrll

Use __BIT. NFC.


Revision tags: pgoyette-compat-0930 pgoyette-compat-0906
# 1.120 15-Aug-2018 skrll

KNF


# 1.119 15-Aug-2018 skrll

Fix includes (sys/cdefs.h then sys/param.h)


# 1.118 15-Aug-2018 skrll

Sprinkle #include "opt_cputypes.h"


# 1.117 10-Aug-2018 maxv

Retire CPU_ARM2, CPU_ARM250 and CPU_ARM3, they are all leftovers of
acorn26.

ok jmcneill@ skrll@


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202
# 1.116 16-Sep-2017 matt

branches: 1.116.2; 1.116.4;
Add Cortex-A35 CPU ID.


Revision tags: netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base
# 1.115 01-Jun-2017 chs

branches: 1.115.6;
remove checks for failure after memory allocation calls that cannot fail:

kmem_alloc() with KM_SLEEP
kmem_zalloc() with KM_SLEEP
percpu_alloc()
pserialize_create()
psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.114 11-Jul-2016 kiyohara

Add Cortex-A9 r1.


Revision tags: nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.113 03-Mar-2016 skrll

Get the RPI3 working (in aarch32 mode) by recognising Cortex A53 CPUs.
While I'm here add some A57/A72 info as well.

My RPI3 works with FB console - the uart needs some help with its clocks.


# 1.112 23-Jan-2016 christos

Rename the cpu_id() define to cpu_idnum() so that it does not conflict with
dtrace and friends.


Revision tags: nick-nhusb-base-20151226
# 1.111 12-Nov-2015 jmcneill

change some register dumps from aprint_verbose to aprint_debug


Revision tags: nick-nhusb-base-20150921
# 1.110 08-Jul-2015 skrll

aprint_verbose [sa]ctlr


Revision tags: nick-nhusb-base-20150606
# 1.109 05-Jun-2015 skrll

Print the Revision ID regster (verbose)


# 1.108 17-May-2015 matt

Print out mpidr on MP systems (verbose print)


Revision tags: nick-nhusb-base-20150406
# 1.107 03-Mar-2015 jmcneill

cache type 12 is "write-back", from matt


Revision tags: nick-nhusb-base
# 1.106 27-Nov-2014 matt

branches: 1.106.2;
Add entry for Cortex-A17 r1


# 1.105 01-Sep-2014 reinoud

Increase the `freqbuf' buffer that holds the result of humanize_number(). Now
it prints 1600 Mhz instead of 1 Ghz.
Pitty enough humanize_number(9) doesn't do 1.6 Ghz type output.


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.104 28-Mar-2014 matt

branches: 1.104.4;
Various MP changes.


# 1.103 24-Mar-2014 christos

use cpu_{g,s}etmodel


# 1.102 20-Mar-2014 matt

Define cache type 13


Revision tags: riastradh-drm2-base3
# 1.101 03-Mar-2014 matt

Add most of the cpu_* variables to <arm/locore.h>
Add and initialize cpu_synchprim_present


# 1.100 20-Feb-2014 matt

Keep track of what each cache is (VIVT/VIPT/PIPT).

cpu0: 32KB/32B 2-way L1 VIPT Instruction cache
cpu0: 32KB/64B 4-way write-back-locking-C L1 PIPT Data cache
cpu0: 256KB/64B 8-way write-through L2 PIPT Unified cache


# 1.99 07-Sep-2013 matt

Add a machdep.hwdiv_present sysctl (cortex A7 and A15 have hwdiv instructions)


# 1.98 07-Sep-2013 matt

Add CPU_ID_CORTEXA7R0 entry


# 1.97 18-Aug-2013 matt

Move parts of cpu.h that are not needed by MI code in <arm/locore.h>
Don't include <machine/cpu.h> or <machine/frame.h>, use <arm/locore.h>
Use <arm/asm.h> instead of <machine/arm.h>


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.96 12-Jun-2013 matt

branches: 1.96.2;
Nuke cpu_pfr, just use the armreg_pfr?_read inlines


# 1.95 12-Jun-2013 matt

Use the armreg_pfr?_read inlines.


# 1.94 19-May-2013 rkujawa

Plug support for PJ4B into our ARM CPU infrastructure.

Obtained from Marvell, Semihalf.


Revision tags: agc-symver-base
# 1.93 03-Feb-2013 matt

Add a machdep.cpu_arch sysctl


# 1.92 31-Jan-2013 matt

Add simple sysctls for cpu_id, fpu_id, neon_present, simd_present,
simdex_present.
Add struct sysctls to return the isar, mmfr, pfr, and mvfr sets.


Revision tags: yamt-pagecache-base8 yamt-pagecache-base7
# 1.91 05-Dec-2012 matt

ARMFPE hasn't compiled since NetBSD 4. Remove it.
Complete support for FPU_VFP.
fpregs now contains vfpreg.
XXX vfpreg only has space for 16 64-bit FP registers though VFPv3 and later
have 32 64-bit FP registers.


# 1.90 30-Nov-2012 msaitoh

Use snprintf() instead of sprintf().


# 1.89 30-Nov-2012 msaitoh

s/,/;/


# 1.88 12-Nov-2012 skrll

C99 types


Revision tags: yamt-pagecache-base6
# 1.87 22-Sep-2012 matt

Don't use an asm in pmap_activate to update the TTBR, use cpu_setttb instead
but add a second argument to it to indicate whether the TLB/caches need to be
flushed. Default cortex to pmap_needs_fixup = 1. But check the MMFR3 field
to see if the fixed can be skipped.
Use a cf_flag bit 0 to indicate whether the A9 L2 cache should disable (bit 0 = 1)
or enabeld (bit = 0).

With these changes, the A9 MMU can use traverse caches to do MMU tablewalks
Also, make sure all memory has the shareable bit for the A9.


# 1.86 07-Sep-2012 matt

branches: 1.86.2;
Switch cortex_a9 back to need_ptesync = 1
Add code to disable the L2 cache on cortex-a9 (for now).
Add evcnt for all the fault types.
Move cache info in a structure and have one for the pcache and one for scache.
Probe L1/L2 caches properly for ARMv7


# 1.85 29-Aug-2012 matt

Use new armv7 CP15 register to print out cache types.
If the cpu_cc_freq is set, report it.
Add macros to make inlines for reading/writing co-processor registers.


# 1.84 14-Aug-2012 matt

Use device_t


# 1.83 12-Aug-2012 matt

Rework VFP support to use PCU.
Add emulation of instruction which save/restore the VFP FPSCR.
Add a sysarch hook to VFP FPSCR manipulation.

[The emulation will be used by libc to store/fetch exception modes and
rounding mode on a per-thread basis.]


# 1.82 14-Jul-2012 matt

Refresh cortex cpus


Revision tags: jmcneill-usbmp-base10 yamt-pagecache-base5
# 1.81 20-May-2012 skrll

Remove the ARM1156T2 bloat - it only has an MPU. Prompted by matt@


# 1.80 20-May-2012 skrll

Add the ARM1156T2-S


# 1.79 20-May-2012 skrll

Add the 'Z' to the 1176 cpu product name.

ok matt@


Revision tags: jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base jym-xensuspend-nbase rmind-uvmplock-base jym-xensuspend-base
# 1.78 10-Mar-2011 bsh

branches: 1.78.4; 1.78.8; 1.78.10;
add MPCore to CPU-ID table
add branch predict bit to arm11_options


Revision tags: uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11
# 1.77 02-Oct-2010 kiyohara

branches: 1.77.2;
Add support Marvell Sheeva Core and SoC. (Orion/Kirkwood)
Discovery Innovation not yet.


Revision tags: uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.76 19-Jun-2010 matt

Fix cache probing on Cortex. Add missing CORTEX dependency in cpu.c


# 1.75 19-Jun-2010 matt

Fix c&p error.


# 1.74 19-Jun-2010 matt

Cleanup the armv7 changes. Add ARM_ARCH_7. Use CPU_CORTEX instead of
CPU_CORTEXA8 everywhere since there more types of Cortex than just the A8.
CPU_CORTEXA8 still exists but causes CPU_CORTEX to be defined.
Add CPU_CORTEXA9 as well. Use .arch armv7a to get us the isb/dsb
instructions.

Test booted to root device prompt on a Beagleboard.
All ARM kernels successfully test built.


# 1.73 16-Jun-2010 jmcneill

PR port-arm/43299: Support added for igepv2/cortexa8/omap3530

Apply patch from PR, with build fixes. ok skrll, matt


Revision tags: uebayasi-xip-base1 yamt-nfs-mp-base9 uebayasi-xip-base
# 1.72 23-Jan-2010 mrg

branches: 1.72.2; 1.72.4;
rename a local cpu_name structure member to avoid potential conflict
with <sys/cpu.h>'s.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-premerge-20091211 yamt-nfs-mp-base8 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 yamt-nfs-mp-base7 netbsd-5-0-1-RELEASE jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base nick-hppapmap-base haad-dm-base mjf-devfs2-base
# 1.71 25-Oct-2008 matt

branches: 1.71.4; 1.71.12;
Fix some missing things for CPU_ID_FA526.


Revision tags: matt-mips64-base2
# 1.70 24-Oct-2008 matt

Add entry for FA526.


# 1.69 21-Oct-2008 matt

Add Cortex cpus


Revision tags: haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base
# 1.68 27-Apr-2008 matt

branches: 1.68.6;
Merge kernel changes in matt-armv6 to HEAD.


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 chris-arm-intr-rework-base7 keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.67 15-Mar-2008 rearnsha

branches: 1.67.2; 1.67.4;
VFP support.


Revision tags: nick-net80211-sync-base chris-arm-intr-rework-base6 chris-arm-intr-rework-base5 chris-arm-intr-rework-base4 bouyer-xeni386-merge1 chris-arm-intr-rework-base3 vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 jmcneill-base mjf-devfs-base bouyer-xenamd64-base2 vmlocking-nbase yamt-x86pmap-base4 bouyer-xenamd64-base matt-armv6-base jmcneill-pm-base hpcarm-cleanup-base reinoud-bufcleanup-base
# 1.66 17-Oct-2007 garbled

branches: 1.66.12; 1.66.16;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base chris-arm-intr-rework-base2 chris-arm-intr-rework-base nick-csl-alignment-base matt-mips64-base ppcoea-renovation-base mjf-ufs-trans-base vmlocking-base
# 1.65 17-May-2007 yamt

branches: 1.65.10; 1.65.12;
merge yamt-idlelwp branch. asked by core@. some ports still needs work.

from doc/BRANCHES:

idle lwp, and some changes depending on it.

1. separate context switching and thread scheduling.
(cf. gmcgarry_ctxsw)
2. implement idle lwp.
3. clean up related MD/MI interfaces.
4. make scheduler(s) modular.


Revision tags: yamt-idlelwp-base8 thorpej-atomic-base ad-audiomp-base post-newlock2-merge newlock2-nbase newlock2-base
# 1.64 06-Jan-2007 christos

branches: 1.64.2; 1.64.6; 1.64.8; 1.64.14;
Scott Allan in http://mail-index.netbsd.org/port-arm/2006/07/31/0000.html
Patch to add support for ARM9E


# 1.63 06-Jan-2007 christos

From Scott Alan in http://mail-index.netbsd.org/port-arm/2006/07/26/0000.html
identify_arm_cpu() prints out a helpful message when it detects that you're
trying to run on a CPU that you didn't configure for. Unfortunately, the
check for class_option being NULL is backward, so it either won't print the
class_option, or it will try to dereference a NULL. The patch just flips the
!= NULL to be == NULL.


Revision tags: yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 abandoned-netbsd-4-base yamt-splraiseipl-base2 yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 netbsd-4-base yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base elad-kernelauth-base simonb-timecounters-base rpaulo-netinet-merge-pcb-base
# 1.62 15-Mar-2006 drochner

branches: 1.62.10; 1.62.14;
use km_alloc to get wired kernel memory for kernel stacks
of idle processes for secondary CPUs
(affects the MULTIPROCESSOR case only - does this exist?)
(untested)


Revision tags: yamt-pdpolicy-base2 yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.61 11-Dec-2005 christos

branches: 1.61.4; 1.61.6; 1.61.8; 1.61.10;
merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.60 20-Jul-2005 nonaka

Added i80219.


# 1.59 04-Jul-2005 bsh

branches: 1.59.2;
The first step to support Intel PXA270.

kernel config option CPU_XSCALE_PXA2X0 is now obsoleted by
CPU_XSCALE_PXA250 and CPU_XSCALE_PXA270. If both of them are defined,
CPU is determined run-time.


# 1.58 03-Jun-2005 rearnsha

Very basic support for the ARM1136.

This code takes no advantage of any 'new' features provided by
architecture 6 devices (such as physically tagged caches or new
MMU features), and basically runs the chip in a 'legacy v5' mode.


# 1.57 10-May-2005 rearnsha

Add support for arm1026ej-s.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 yamt-km-base4 yamt-km-base3 netbsd-3-base yamt-km-base2 yamt-km-base kent-audio2-base kent-audio1-beforemerge kent-audio1-base
# 1.56 14-Apr-2004 bsh

distinguish PXA255/26x from PXA2[15]0 in CPU attach message


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.55 13-Feb-2004 wiz

Uppercase CPU, plural is CPUs.


# 1.54 26-Oct-2003 chris

Fix up some unitialised variables.


# 1.53 06-Sep-2003 rearnsha

Support for ARM10E class devices.


# 1.52 03-Sep-2003 mycroft

Recognize some TI processors -- not that you'd want to use them.


# 1.51 23-Jun-2003 martin

branches: 1.51.2;
Make sure to include opt_foo.h if a defflag option FOO is used.


# 1.50 23-May-2003 ichiro

support IXP425 Intel Network Processor
running on BigEndian


# 1.49 29-Apr-2003 thorpej

Use aprint*().


# 1.48 14-Feb-2003 rjs

Add CPU IDs for PXA B2 and C0 steppings.


Revision tags: nathanw_sa_before_merge nathanw_sa_base
# 1.47 06-Jan-2003 wiz

specified, not specifed.


Revision tags: fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base
# 1.46 17-Nov-2002 chs

change uvm_uarea_alloc() to indicate whether the returned uarea is already
backed by physical pages (ie. because it reused a previously-freed one),
so that we can skip a bunch of useless work in that case.
this fixes the underlying problem behind PR 18543, and also speeds up fork()
quite a bit (eg. 7% on my pc, 1% on my ultra2) when we get a cache hit.


Revision tags: kqueue-aftermerge kqueue-beforemerge bjh21-hydra-base
# 1.45 13-Oct-2002 chris

branches: 1.45.2;
Fix arm kernel build breaks for non multiprocessor systems.


# 1.44 13-Oct-2002 bjh21

It appears that MI code requires ci_cpuid to be the CPU number of the CPU
in question, whereas the ARM code was using it to hold the model
identification. To fix this, rename:

ci_cpuid -> ci_arm_cpuid
ci_cputype -> ci_arm_cputype (for consistency)
ci_cpurev -> ci_arm_cpurev (ditto)
ci_cpunum -> ci_cpuid

This makes top(1) give correct CPU numbers in its "STATE" column (all 0 for
now).


# 1.43 12-Oct-2002 bjh21

Remember the location of each CPU's idle PCB in struct cpu_info.
Move allocation of the idle PCB from hydra.c to cpu.c and add some
extra initialisation from cpu_fork().


Revision tags: kqueue-base
# 1.42 01-Oct-2002 bjh21

constify various string tables.


# 1.41 06-Sep-2002 gehenna

Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.


Revision tags: gehenna-devsw-base
# 1.40 22-Jul-2002 briggs

Handle i80200 step D0 and i80321 step B0


# 1.39 10-Jul-2002 ichiro

add cpu id for "PXA250/210 3rd version CPUcore".

for using many PDA/xscale-core.


# 1.38 07-Jun-2002 thorpej

Add the CPU ID for the 600MHz i80321 part.


Revision tags: netbsd-1-6-base
# 1.37 12-May-2002 ichiro

branches: 1.37.2; 1.37.4;
change ICP12x0 steppings.
define CPU_IXP12X0


# 1.36 10-May-2002 thorpej

Add IXP1200 steppings.


# 1.35 03-May-2002 thorpej

Add support for the Intel PXA210 and PXA250. From Hiroyuki Bessho, PR 16617.


# 1.34 02-May-2002 rjs

Enable CPU_CLASS_SA1 for SA1100 and SA1110.


# 1.33 12-Apr-2002 thorpej

Centralize ARM CPU configuration information by adding a new header
file, <arm/cpuconf.h>, which pulls in "opt_cputypes.h" and then defines
the following:
* CPU_NTYPES -- now many CPU types are configured into the kernel. What
you really want to know is "== 1" or "> 1".
* Defines ARM_ARCH_2, ARM_ARCH_3, ARM_ARCH_4, ARM_ARCH_5, depending
on which ARM architecture versions are configured (based on CPU_*
options). Also defines ARM_NARCH to determins how many architecture
versions are configured.
* Defines ARM_MMU_MEMC, ARM_MMU_GENERIC, ARM_MMU_XSCALE depending on
which classes of ARM MMUs are configured into the kernel, and ARM_NMMUS
to determine how many MMU classes are configured.

Remove the needless inclusion of "opt_cputypes.h" in several places.
Convert remaining users to <arm/cpuconf.h>.


# 1.32 27-Mar-2002 thorpej

The 80321 manual lies; it does have a CPU ID distinct from the 80200.
Add that CPU ID, and add a case for it.


# 1.31 26-Mar-2002 thorpej

Restructure a few things in order to support other XScale core
I/O processors:
* The i80200 and the i80321 have the same CPU ID, so split the
CPU_XSCALE option into CPU_XSCALE_80200 and CPU_XSCALE_80321
options, and don't let them both be defined at the same time.
XXX May want to revisit this in the future.
* Split some registers common between the i80200 and i80321 into
<arm/xscale/xscalereg.h>.
* Rename a few existing functions.


# 1.30 24-Mar-2002 thorpej

Cache the cpu type and cpu revision in cpu_info.


Revision tags: eeh-devprop-base
# 1.29 16-Mar-2002 bjh21

Only put the CPU type into cpu_model, not the state of the control register.
Instead, print the control register state on the next line at startup.


# 1.28 16-Mar-2002 bjh21

Add CPU ID for the ARM1022ES.
Also add a CPU class for ARM10E processors in general.


# 1.27 11-Mar-2002 reinoud

When ARMFPE wasn't enabled the `usearmfpe' flag was statically initialised
but not used resulting in a compiler error. By splitting the declaration
and the initialisation this is solved.

Better would be to not even declare the flag when ARMFPE isnt enabled but
that would just add to the #ifdef jungle.


# 1.26 10-Mar-2002 bjh21

__RCSID -> __KERNEL_RCSID


# 1.25 10-Mar-2002 bjh21

Re-work the way that FPAs are handled. If ARMFPE isn't configured, don't
even bother probing for an FPA. If ARMFPE is configured, always use it,
even if there's an FPA (since it provides the FPA support code). Move all
printfs about FPAs into armfpe_init.c.

This means I can delete the last two elements from struct _cpu, so that the
structure, and the whole of <arm/cpus.h> is redundant and can be deleted.


# 1.24 10-Mar-2002 bjh21

Remove fpu_model from struct _cpu. Instead, have initialise_arm_fpe()
printf() the FPE version number itself.


# 1.23 10-Mar-2002 bjh21

Add a ci_dev element to struct cpu_info, pointing to the device that
corresponds to the CPU.


Revision tags: newlock-base
# 1.22 10-Mar-2002 bjh21

Kill the fpu_flags element from struct _cpu. It was only ever set to 0
anyway.


# 1.21 10-Mar-2002 bjh21

Clean up inline assembler. Rather than saving R0, copying FPSR to R0,
copying it to the output register and then restoring R0, just copy the
FPSR straight to the output.


# 1.20 09-Mar-2002 bjh21

Remove the cpu_model member from struct _cpu, and just use the cpu_model
variable directly. While we're at it, make cpu_model rather larger.


# 1.19 09-Mar-2002 bjh21

Remove the cpu_class element from struct _cpu, and make it a local variable
in identify_arm_cpu(), since it's almost unused elsewhere.

Change the detection of bugged StrongARMs to use the cpu ID rather than the
class. This turns "almost" into "entirely".


# 1.18 09-Mar-2002 bjh21

Replace cpu_id and cpu_ctrl in struct _cpu with ci_cpuid and ci_ctrl in
struct cpu_info. Also kill the cpuctrl global while we're here, and make
identify_arm_cpu() take a struct cpu_info * as an argument alongside the CPU
number.


# 1.17 09-Mar-2002 bjh21

Move arm700bugcount into stuct cpu_info, and attach it in
identify_master_cpu().


Revision tags: ifpoll-base
# 1.16 17-Feb-2002 bjh21

Our assembler handles FPA instructions fine, so don't use .word for them.


# 1.15 17-Feb-2002 bjh21

ANSIfy, and othe KNF cleanup.


# 1.14 27-Jan-2002 bjh21

Add revision->stepping maps for the SA-110, SA-1100 and SA-1110.
Those for the SA-1100 and SA-1110 are from Intel's documentation.
The mapping for the SA-110 is from various sources on the net, since Intel
don't seem to document it.

Also, change the layout of the maps to have four steppings per line,
so they aren't quite so unwieldy.


# 1.13 24-Jan-2002 thorpej

Use a table to look up stepping names. Add a generic stepping
table ("rev 0", "rev 1", etc.) and an i80200 stepping table that
has the stepping names that appear in the i80200 manuals/errata..


# 1.12 29-Nov-2001 thorpej

Fetch cache info from the Cache Type register on ARM7TDMI and "greater"
processors. Report this when the processor is attached.


# 1.11 24-Nov-2001 thorpej

Move the ARM, Ltd. floating point emulator to arch/arm.


# 1.10 23-Nov-2001 thorpej

Use <arm/undefined.h> instead of <machine/undefined.h>.


Revision tags: thorpej-mips-cache-base
# 1.9 06-Nov-2001 thorpej

branches: 1.9.2;
Const poisoning of cpu/class names.


# 1.8 06-Nov-2001 thorpej

"i80200", not "80200".


# 1.7 06-Nov-2001 thorpej

"XScale", not "Xscale".


# 1.6 18-Oct-2001 rearnsha

branches: 1.6.2;
Support for ARM9.


Revision tags: thorpej-devvp-base3 thorpej-devvp-base2
# 1.5 28-Sep-2001 chris

Add extra arg to fpa_test as it should have 4 args. Also add prototypes for fpa_test and fpa_handler.


Revision tags: post-chs-ubcperf pre-chs-ubcperf thorpej-devvp-base
# 1.4 05-Sep-2001 matt

branches: 1.4.2;
Flesh XSCALE support.


# 1.3 03-Jun-2001 chris

branches: 1.3.2; 1.3.4;
Add support for ARM7TDMI, as provided in a patch from John Fremlin to port-arm32.

Shouldn't effect any currently in tree ports.


# 1.2 13-May-2001 bjh21

Use get_bootconf_option() to find boot options, rather than home-grown
strstr()-based hacks.


Revision tags: thorpej_scsipi_beforemerge thorpej_scsipi_base thorpej_scsipi_nbase
# 1.1 20-Apr-2001 matt

branches: 1.1.2;
Split cpu from mainbus so that cpu can attached to other buses (like ofbus).


# 1.148 06-Jul-2021 skrll

Assume all ARM11[37]6 r0 variants are missing ISAR and friends. This is
certainly the case for r0 variants I could find TRMs for.

PR/50596 CPU_ID_ARM1136JS r0p4 does not support feature registers


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-i2c-spi-conf-base thorpej-cfargs-base thorpej-futex-base
# 1.147 02-Jul-2020 martin

Initialize ci_kfpu_spl earlier for secondary CPUs. From riastradh


# 1.146 29-Jun-2020 riastradh

Implement fpu_kern_enter/leave for arm32.


# 1.145 20-Jun-2020 skrll

KNF #includes

Remove some unnecessary ones while I'm here.


Revision tags: bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3
# 1.144 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}


Revision tags: ad-namecache-base2
# 1.143 22-Jan-2020 skrll

#ifdef whack-a-mole for the pmap_maxproc_set functionality


# 1.142 20-Jan-2020 skrll

s/_ARM_ARCH_6/ARM_MMU_EXTENDED/ in the #ifdef for the recent 4k pages
change


# 1.141 18-Jan-2020 skrll

Use 4K pages on ARM_MMU_EXTENDED platforms (all armv[67] except RPI) by
creating a new pool l1ttpl for the userland L1 translation table which
needs to be 8KB and 8KB aligned.

Limit the pool to maxproc and add hooks to allow the sysctl changing of
maxproc to adjust the pool.

This comes at a 5% performance penalty for build.sh -j8 kernel on a
Tegra TK1.


Revision tags: ad-namecache-base1
# 1.140 15-Jan-2020 mrg

port the arm64 cpu topology setup for big.little to arm.

rename arm64 cpu_do_topology() to arm_cpu_do_topology() and
call it from both arm cpu_attach().

replace both aarch64_set_topology() inline code in arm
cpu_attach() with new arm_cpu_do_topology(), which is called
by the arm64 locore as well (possibly not needed, which would
allow it to become static.)

not yet tested on a real big.little armv7 system. tested
on rockpro64 and pinebook pro.


# 1.139 09-Jan-2020 ad

- Many small tweaks to the SMT awareness in the scheduler. It does a much
better job now at keeping all physical CPUs busy, while using the extra
threads to help out. In particular, during preempt() if we're using SMT,
try to find a better CPU to run on and teleport curlwp there.

- Change the CPU topology stuff so it can work on asymmetric systems. This
mainly entails rearranging one of the CPU lists so it makes sense in all
configurations.

- Add a parameter to cpu_topology_set() to note that a CPU is "slow", for
where there are fast CPUs and slow CPUs, like with the Rockwell RK3399.
Extend the SMT awareness to try and handle that situation too (keep fast
CPUs busy, use slow CPUs as helpers).


# 1.138 09-Jan-2020 martin

When attaching the first fdtbus, use the root "comptabile" (or failing that:
"model") property to set the cpu model (in userland aka sysctl hw.model).
When attaching the first cpu, do not overwrite a cpu model if it already
had been set.


# 1.137 08-Jan-2020 jmcneill

cpu_hatch is too late to report AP topology, do it at attach time instead


Revision tags: ad-namecache-base
# 1.136 20-Dec-2019 ad

branches: 1.136.2;
Some more CPU topology stuff:

- Use cegger@'s ACPI SRAT parsing code to figure out NUMA node ID for each
CPU as it is attached.

- For scheduler experiments with SMT, flag CPUs with the lowest numbered SMT
IDs as "primaries", link back to the primaries from secondaries, and build
a circular list of CPUs in each package with identical SMT IDs.

- No need for package/core/smt/numa IDs to be anything other than a u_int.


# 1.135 02-Dec-2019 ad

Take the basic CPU topology information we already collect, and use it
to make circular lists of CPU siblings in the same core, and in the
same package. Nothing fancy, just enough to have a bit of fun in the
scheduler trying out different tactics.


Revision tags: phil-wifi-20191119
# 1.134 20-Oct-2019 jmcneill

cpu_hatched_p only for MULTIPROCESSOR


# 1.133 19-Oct-2019 jmcneill

Increase aarch64 MAXCPUS to 256.


# 1.132 29-Sep-2019 skrll

aprint_debug_dev output alignment


# 1.131 08-Sep-2019 tnn

report A12 as A17 to the user. A12 is retcon'ed by ARM.


# 1.130 07-Sep-2019 tnn

Cortex A12 is marketed as A17 but has a distinct part number

observed on Rockchip RK3288


Revision tags: netbsd-9-base phil-wifi-20190609 isaki-audio2-base
# 1.129 17-Mar-2019 skrll

branches: 1.129.4;
Wrap arm_cpu_marker if #ifdef MPDEBUG.

One day a9_mpsubr.S will die


# 1.128 27-Jan-2019 pgoyette

Merge the [pgoyette-compat] branch


Revision tags: pgoyette-compat-20190127
# 1.127 25-Jan-2019 skrll

Make sure ci_{smt,core,package}_id are all filled in appropriately.

Previously the BP was missed and __SHIFTOUT wasn't used.


Revision tags: pgoyette-compat-20190118
# 1.126 03-Jan-2019 jmcneill

Read mpidr and cpuid from the secondary processor itself instead of the
boot processor. While here, add Cortex-A15 r4p0 to supported list.


# 1.125 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.124 02-Jan-2019 skrll

Don't overwrite the setting of cpu_core_id from mpidr


Revision tags: pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020
# 1.123 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.122 08-Oct-2018 skrll

Trialing whitespace


# 1.121 06-Oct-2018 skrll

Use __BIT. NFC.


Revision tags: pgoyette-compat-0930 pgoyette-compat-0906
# 1.120 15-Aug-2018 skrll

KNF


# 1.119 15-Aug-2018 skrll

Fix includes (sys/cdefs.h then sys/param.h)


# 1.118 15-Aug-2018 skrll

Sprinkle #include "opt_cputypes.h"


# 1.117 10-Aug-2018 maxv

Retire CPU_ARM2, CPU_ARM250 and CPU_ARM3, they are all leftovers of
acorn26.

ok jmcneill@ skrll@


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202
# 1.116 16-Sep-2017 matt

branches: 1.116.2; 1.116.4;
Add Cortex-A35 CPU ID.


Revision tags: netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base
# 1.115 01-Jun-2017 chs

branches: 1.115.6;
remove checks for failure after memory allocation calls that cannot fail:

kmem_alloc() with KM_SLEEP
kmem_zalloc() with KM_SLEEP
percpu_alloc()
pserialize_create()
psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.114 11-Jul-2016 kiyohara

Add Cortex-A9 r1.


Revision tags: nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.113 03-Mar-2016 skrll

Get the RPI3 working (in aarch32 mode) by recognising Cortex A53 CPUs.
While I'm here add some A57/A72 info as well.

My RPI3 works with FB console - the uart needs some help with its clocks.


# 1.112 23-Jan-2016 christos

Rename the cpu_id() define to cpu_idnum() so that it does not conflict with
dtrace and friends.


Revision tags: nick-nhusb-base-20151226
# 1.111 12-Nov-2015 jmcneill

change some register dumps from aprint_verbose to aprint_debug


Revision tags: nick-nhusb-base-20150921
# 1.110 08-Jul-2015 skrll

aprint_verbose [sa]ctlr


Revision tags: nick-nhusb-base-20150606
# 1.109 05-Jun-2015 skrll

Print the Revision ID regster (verbose)


# 1.108 17-May-2015 matt

Print out mpidr on MP systems (verbose print)


Revision tags: nick-nhusb-base-20150406
# 1.107 03-Mar-2015 jmcneill

cache type 12 is "write-back", from matt


Revision tags: nick-nhusb-base
# 1.106 27-Nov-2014 matt

branches: 1.106.2;
Add entry for Cortex-A17 r1


# 1.105 01-Sep-2014 reinoud

Increase the `freqbuf' buffer that holds the result of humanize_number(). Now
it prints 1600 Mhz instead of 1 Ghz.
Pitty enough humanize_number(9) doesn't do 1.6 Ghz type output.


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.104 28-Mar-2014 matt

branches: 1.104.4;
Various MP changes.


# 1.103 24-Mar-2014 christos

use cpu_{g,s}etmodel


# 1.102 20-Mar-2014 matt

Define cache type 13


Revision tags: riastradh-drm2-base3
# 1.101 03-Mar-2014 matt

Add most of the cpu_* variables to <arm/locore.h>
Add and initialize cpu_synchprim_present


# 1.100 20-Feb-2014 matt

Keep track of what each cache is (VIVT/VIPT/PIPT).

cpu0: 32KB/32B 2-way L1 VIPT Instruction cache
cpu0: 32KB/64B 4-way write-back-locking-C L1 PIPT Data cache
cpu0: 256KB/64B 8-way write-through L2 PIPT Unified cache


# 1.99 07-Sep-2013 matt

Add a machdep.hwdiv_present sysctl (cortex A7 and A15 have hwdiv instructions)


# 1.98 07-Sep-2013 matt

Add CPU_ID_CORTEXA7R0 entry


# 1.97 18-Aug-2013 matt

Move parts of cpu.h that are not needed by MI code in <arm/locore.h>
Don't include <machine/cpu.h> or <machine/frame.h>, use <arm/locore.h>
Use <arm/asm.h> instead of <machine/arm.h>


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.96 12-Jun-2013 matt

branches: 1.96.2;
Nuke cpu_pfr, just use the armreg_pfr?_read inlines


# 1.95 12-Jun-2013 matt

Use the armreg_pfr?_read inlines.


# 1.94 19-May-2013 rkujawa

Plug support for PJ4B into our ARM CPU infrastructure.

Obtained from Marvell, Semihalf.


Revision tags: agc-symver-base
# 1.93 03-Feb-2013 matt

Add a machdep.cpu_arch sysctl


# 1.92 31-Jan-2013 matt

Add simple sysctls for cpu_id, fpu_id, neon_present, simd_present,
simdex_present.
Add struct sysctls to return the isar, mmfr, pfr, and mvfr sets.


Revision tags: yamt-pagecache-base8 yamt-pagecache-base7
# 1.91 05-Dec-2012 matt

ARMFPE hasn't compiled since NetBSD 4. Remove it.
Complete support for FPU_VFP.
fpregs now contains vfpreg.
XXX vfpreg only has space for 16 64-bit FP registers though VFPv3 and later
have 32 64-bit FP registers.


# 1.90 30-Nov-2012 msaitoh

Use snprintf() instead of sprintf().


# 1.89 30-Nov-2012 msaitoh

s/,/;/


# 1.88 12-Nov-2012 skrll

C99 types


Revision tags: yamt-pagecache-base6
# 1.87 22-Sep-2012 matt

Don't use an asm in pmap_activate to update the TTBR, use cpu_setttb instead
but add a second argument to it to indicate whether the TLB/caches need to be
flushed. Default cortex to pmap_needs_fixup = 1. But check the MMFR3 field
to see if the fixed can be skipped.
Use a cf_flag bit 0 to indicate whether the A9 L2 cache should disable (bit 0 = 1)
or enabeld (bit = 0).

With these changes, the A9 MMU can use traverse caches to do MMU tablewalks
Also, make sure all memory has the shareable bit for the A9.


# 1.86 07-Sep-2012 matt

branches: 1.86.2;
Switch cortex_a9 back to need_ptesync = 1
Add code to disable the L2 cache on cortex-a9 (for now).
Add evcnt for all the fault types.
Move cache info in a structure and have one for the pcache and one for scache.
Probe L1/L2 caches properly for ARMv7


# 1.85 29-Aug-2012 matt

Use new armv7 CP15 register to print out cache types.
If the cpu_cc_freq is set, report it.
Add macros to make inlines for reading/writing co-processor registers.


# 1.84 14-Aug-2012 matt

Use device_t


# 1.83 12-Aug-2012 matt

Rework VFP support to use PCU.
Add emulation of instruction which save/restore the VFP FPSCR.
Add a sysarch hook to VFP FPSCR manipulation.

[The emulation will be used by libc to store/fetch exception modes and
rounding mode on a per-thread basis.]


# 1.82 14-Jul-2012 matt

Refresh cortex cpus


Revision tags: jmcneill-usbmp-base10 yamt-pagecache-base5
# 1.81 20-May-2012 skrll

Remove the ARM1156T2 bloat - it only has an MPU. Prompted by matt@


# 1.80 20-May-2012 skrll

Add the ARM1156T2-S


# 1.79 20-May-2012 skrll

Add the 'Z' to the 1176 cpu product name.

ok matt@


Revision tags: jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base jym-xensuspend-nbase rmind-uvmplock-base jym-xensuspend-base
# 1.78 10-Mar-2011 bsh

branches: 1.78.4; 1.78.8; 1.78.10;
add MPCore to CPU-ID table
add branch predict bit to arm11_options


Revision tags: uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11
# 1.77 02-Oct-2010 kiyohara

branches: 1.77.2;
Add support Marvell Sheeva Core and SoC. (Orion/Kirkwood)
Discovery Innovation not yet.


Revision tags: uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.76 19-Jun-2010 matt

Fix cache probing on Cortex. Add missing CORTEX dependency in cpu.c


# 1.75 19-Jun-2010 matt

Fix c&p error.


# 1.74 19-Jun-2010 matt

Cleanup the armv7 changes. Add ARM_ARCH_7. Use CPU_CORTEX instead of
CPU_CORTEXA8 everywhere since there more types of Cortex than just the A8.
CPU_CORTEXA8 still exists but causes CPU_CORTEX to be defined.
Add CPU_CORTEXA9 as well. Use .arch armv7a to get us the isb/dsb
instructions.

Test booted to root device prompt on a Beagleboard.
All ARM kernels successfully test built.


# 1.73 16-Jun-2010 jmcneill

PR port-arm/43299: Support added for igepv2/cortexa8/omap3530

Apply patch from PR, with build fixes. ok skrll, matt


Revision tags: uebayasi-xip-base1 yamt-nfs-mp-base9 uebayasi-xip-base
# 1.72 23-Jan-2010 mrg

branches: 1.72.2; 1.72.4;
rename a local cpu_name structure member to avoid potential conflict
with <sys/cpu.h>'s.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-premerge-20091211 yamt-nfs-mp-base8 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 yamt-nfs-mp-base7 netbsd-5-0-1-RELEASE jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base nick-hppapmap-base haad-dm-base mjf-devfs2-base
# 1.71 25-Oct-2008 matt

branches: 1.71.4; 1.71.12;
Fix some missing things for CPU_ID_FA526.


Revision tags: matt-mips64-base2
# 1.70 24-Oct-2008 matt

Add entry for FA526.


# 1.69 21-Oct-2008 matt

Add Cortex cpus


Revision tags: haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base
# 1.68 27-Apr-2008 matt

branches: 1.68.6;
Merge kernel changes in matt-armv6 to HEAD.


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 chris-arm-intr-rework-base7 keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.67 15-Mar-2008 rearnsha

branches: 1.67.2; 1.67.4;
VFP support.


Revision tags: nick-net80211-sync-base chris-arm-intr-rework-base6 chris-arm-intr-rework-base5 chris-arm-intr-rework-base4 bouyer-xeni386-merge1 chris-arm-intr-rework-base3 vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 jmcneill-base mjf-devfs-base bouyer-xenamd64-base2 vmlocking-nbase yamt-x86pmap-base4 bouyer-xenamd64-base matt-armv6-base jmcneill-pm-base hpcarm-cleanup-base reinoud-bufcleanup-base
# 1.66 17-Oct-2007 garbled

branches: 1.66.12; 1.66.16;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base chris-arm-intr-rework-base2 chris-arm-intr-rework-base nick-csl-alignment-base matt-mips64-base ppcoea-renovation-base mjf-ufs-trans-base vmlocking-base
# 1.65 17-May-2007 yamt

branches: 1.65.10; 1.65.12;
merge yamt-idlelwp branch. asked by core@. some ports still needs work.

from doc/BRANCHES:

idle lwp, and some changes depending on it.

1. separate context switching and thread scheduling.
(cf. gmcgarry_ctxsw)
2. implement idle lwp.
3. clean up related MD/MI interfaces.
4. make scheduler(s) modular.


Revision tags: yamt-idlelwp-base8 thorpej-atomic-base ad-audiomp-base post-newlock2-merge newlock2-nbase newlock2-base
# 1.64 06-Jan-2007 christos

branches: 1.64.2; 1.64.6; 1.64.8; 1.64.14;
Scott Allan in http://mail-index.netbsd.org/port-arm/2006/07/31/0000.html
Patch to add support for ARM9E


# 1.63 06-Jan-2007 christos

From Scott Alan in http://mail-index.netbsd.org/port-arm/2006/07/26/0000.html
identify_arm_cpu() prints out a helpful message when it detects that you're
trying to run on a CPU that you didn't configure for. Unfortunately, the
check for class_option being NULL is backward, so it either won't print the
class_option, or it will try to dereference a NULL. The patch just flips the
!= NULL to be == NULL.


Revision tags: yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 abandoned-netbsd-4-base yamt-splraiseipl-base2 yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 netbsd-4-base yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base elad-kernelauth-base simonb-timecounters-base rpaulo-netinet-merge-pcb-base
# 1.62 15-Mar-2006 drochner

branches: 1.62.10; 1.62.14;
use km_alloc to get wired kernel memory for kernel stacks
of idle processes for secondary CPUs
(affects the MULTIPROCESSOR case only - does this exist?)
(untested)


Revision tags: yamt-pdpolicy-base2 yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.61 11-Dec-2005 christos

branches: 1.61.4; 1.61.6; 1.61.8; 1.61.10;
merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.60 20-Jul-2005 nonaka

Added i80219.


# 1.59 04-Jul-2005 bsh

branches: 1.59.2;
The first step to support Intel PXA270.

kernel config option CPU_XSCALE_PXA2X0 is now obsoleted by
CPU_XSCALE_PXA250 and CPU_XSCALE_PXA270. If both of them are defined,
CPU is determined run-time.


# 1.58 03-Jun-2005 rearnsha

Very basic support for the ARM1136.

This code takes no advantage of any 'new' features provided by
architecture 6 devices (such as physically tagged caches or new
MMU features), and basically runs the chip in a 'legacy v5' mode.


# 1.57 10-May-2005 rearnsha

Add support for arm1026ej-s.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 yamt-km-base4 yamt-km-base3 netbsd-3-base yamt-km-base2 yamt-km-base kent-audio2-base kent-audio1-beforemerge kent-audio1-base
# 1.56 14-Apr-2004 bsh

distinguish PXA255/26x from PXA2[15]0 in CPU attach message


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.55 13-Feb-2004 wiz

Uppercase CPU, plural is CPUs.


# 1.54 26-Oct-2003 chris

Fix up some unitialised variables.


# 1.53 06-Sep-2003 rearnsha

Support for ARM10E class devices.


# 1.52 03-Sep-2003 mycroft

Recognize some TI processors -- not that you'd want to use them.


# 1.51 23-Jun-2003 martin

branches: 1.51.2;
Make sure to include opt_foo.h if a defflag option FOO is used.


# 1.50 23-May-2003 ichiro

support IXP425 Intel Network Processor
running on BigEndian


# 1.49 29-Apr-2003 thorpej

Use aprint*().


# 1.48 14-Feb-2003 rjs

Add CPU IDs for PXA B2 and C0 steppings.


Revision tags: nathanw_sa_before_merge nathanw_sa_base
# 1.47 06-Jan-2003 wiz

specified, not specifed.


Revision tags: fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base
# 1.46 17-Nov-2002 chs

change uvm_uarea_alloc() to indicate whether the returned uarea is already
backed by physical pages (ie. because it reused a previously-freed one),
so that we can skip a bunch of useless work in that case.
this fixes the underlying problem behind PR 18543, and also speeds up fork()
quite a bit (eg. 7% on my pc, 1% on my ultra2) when we get a cache hit.


Revision tags: kqueue-aftermerge kqueue-beforemerge bjh21-hydra-base
# 1.45 13-Oct-2002 chris

branches: 1.45.2;
Fix arm kernel build breaks for non multiprocessor systems.


# 1.44 13-Oct-2002 bjh21

It appears that MI code requires ci_cpuid to be the CPU number of the CPU
in question, whereas the ARM code was using it to hold the model
identification. To fix this, rename:

ci_cpuid -> ci_arm_cpuid
ci_cputype -> ci_arm_cputype (for consistency)
ci_cpurev -> ci_arm_cpurev (ditto)
ci_cpunum -> ci_cpuid

This makes top(1) give correct CPU numbers in its "STATE" column (all 0 for
now).


# 1.43 12-Oct-2002 bjh21

Remember the location of each CPU's idle PCB in struct cpu_info.
Move allocation of the idle PCB from hydra.c to cpu.c and add some
extra initialisation from cpu_fork().


Revision tags: kqueue-base
# 1.42 01-Oct-2002 bjh21

constify various string tables.


# 1.41 06-Sep-2002 gehenna

Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.


Revision tags: gehenna-devsw-base
# 1.40 22-Jul-2002 briggs

Handle i80200 step D0 and i80321 step B0


# 1.39 10-Jul-2002 ichiro

add cpu id for "PXA250/210 3rd version CPUcore".

for using many PDA/xscale-core.


# 1.38 07-Jun-2002 thorpej

Add the CPU ID for the 600MHz i80321 part.


Revision tags: netbsd-1-6-base
# 1.37 12-May-2002 ichiro

branches: 1.37.2; 1.37.4;
change ICP12x0 steppings.
define CPU_IXP12X0


# 1.36 10-May-2002 thorpej

Add IXP1200 steppings.


# 1.35 03-May-2002 thorpej

Add support for the Intel PXA210 and PXA250. From Hiroyuki Bessho, PR 16617.


# 1.34 02-May-2002 rjs

Enable CPU_CLASS_SA1 for SA1100 and SA1110.


# 1.33 12-Apr-2002 thorpej

Centralize ARM CPU configuration information by adding a new header
file, <arm/cpuconf.h>, which pulls in "opt_cputypes.h" and then defines
the following:
* CPU_NTYPES -- now many CPU types are configured into the kernel. What
you really want to know is "== 1" or "> 1".
* Defines ARM_ARCH_2, ARM_ARCH_3, ARM_ARCH_4, ARM_ARCH_5, depending
on which ARM architecture versions are configured (based on CPU_*
options). Also defines ARM_NARCH to determins how many architecture
versions are configured.
* Defines ARM_MMU_MEMC, ARM_MMU_GENERIC, ARM_MMU_XSCALE depending on
which classes of ARM MMUs are configured into the kernel, and ARM_NMMUS
to determine how many MMU classes are configured.

Remove the needless inclusion of "opt_cputypes.h" in several places.
Convert remaining users to <arm/cpuconf.h>.


# 1.32 27-Mar-2002 thorpej

The 80321 manual lies; it does have a CPU ID distinct from the 80200.
Add that CPU ID, and add a case for it.


# 1.31 26-Mar-2002 thorpej

Restructure a few things in order to support other XScale core
I/O processors:
* The i80200 and the i80321 have the same CPU ID, so split the
CPU_XSCALE option into CPU_XSCALE_80200 and CPU_XSCALE_80321
options, and don't let them both be defined at the same time.
XXX May want to revisit this in the future.
* Split some registers common between the i80200 and i80321 into
<arm/xscale/xscalereg.h>.
* Rename a few existing functions.


# 1.30 24-Mar-2002 thorpej

Cache the cpu type and cpu revision in cpu_info.


Revision tags: eeh-devprop-base
# 1.29 16-Mar-2002 bjh21

Only put the CPU type into cpu_model, not the state of the control register.
Instead, print the control register state on the next line at startup.


# 1.28 16-Mar-2002 bjh21

Add CPU ID for the ARM1022ES.
Also add a CPU class for ARM10E processors in general.


# 1.27 11-Mar-2002 reinoud

When ARMFPE wasn't enabled the `usearmfpe' flag was statically initialised
but not used resulting in a compiler error. By splitting the declaration
and the initialisation this is solved.

Better would be to not even declare the flag when ARMFPE isnt enabled but
that would just add to the #ifdef jungle.


# 1.26 10-Mar-2002 bjh21

__RCSID -> __KERNEL_RCSID


# 1.25 10-Mar-2002 bjh21

Re-work the way that FPAs are handled. If ARMFPE isn't configured, don't
even bother probing for an FPA. If ARMFPE is configured, always use it,
even if there's an FPA (since it provides the FPA support code). Move all
printfs about FPAs into armfpe_init.c.

This means I can delete the last two elements from struct _cpu, so that the
structure, and the whole of <arm/cpus.h> is redundant and can be deleted.


# 1.24 10-Mar-2002 bjh21

Remove fpu_model from struct _cpu. Instead, have initialise_arm_fpe()
printf() the FPE version number itself.


# 1.23 10-Mar-2002 bjh21

Add a ci_dev element to struct cpu_info, pointing to the device that
corresponds to the CPU.


Revision tags: newlock-base
# 1.22 10-Mar-2002 bjh21

Kill the fpu_flags element from struct _cpu. It was only ever set to 0
anyway.


# 1.21 10-Mar-2002 bjh21

Clean up inline assembler. Rather than saving R0, copying FPSR to R0,
copying it to the output register and then restoring R0, just copy the
FPSR straight to the output.


# 1.20 09-Mar-2002 bjh21

Remove the cpu_model member from struct _cpu, and just use the cpu_model
variable directly. While we're at it, make cpu_model rather larger.


# 1.19 09-Mar-2002 bjh21

Remove the cpu_class element from struct _cpu, and make it a local variable
in identify_arm_cpu(), since it's almost unused elsewhere.

Change the detection of bugged StrongARMs to use the cpu ID rather than the
class. This turns "almost" into "entirely".


# 1.18 09-Mar-2002 bjh21

Replace cpu_id and cpu_ctrl in struct _cpu with ci_cpuid and ci_ctrl in
struct cpu_info. Also kill the cpuctrl global while we're here, and make
identify_arm_cpu() take a struct cpu_info * as an argument alongside the CPU
number.


# 1.17 09-Mar-2002 bjh21

Move arm700bugcount into stuct cpu_info, and attach it in
identify_master_cpu().


Revision tags: ifpoll-base
# 1.16 17-Feb-2002 bjh21

Our assembler handles FPA instructions fine, so don't use .word for them.


# 1.15 17-Feb-2002 bjh21

ANSIfy, and othe KNF cleanup.


# 1.14 27-Jan-2002 bjh21

Add revision->stepping maps for the SA-110, SA-1100 and SA-1110.
Those for the SA-1100 and SA-1110 are from Intel's documentation.
The mapping for the SA-110 is from various sources on the net, since Intel
don't seem to document it.

Also, change the layout of the maps to have four steppings per line,
so they aren't quite so unwieldy.


# 1.13 24-Jan-2002 thorpej

Use a table to look up stepping names. Add a generic stepping
table ("rev 0", "rev 1", etc.) and an i80200 stepping table that
has the stepping names that appear in the i80200 manuals/errata..


# 1.12 29-Nov-2001 thorpej

Fetch cache info from the Cache Type register on ARM7TDMI and "greater"
processors. Report this when the processor is attached.


# 1.11 24-Nov-2001 thorpej

Move the ARM, Ltd. floating point emulator to arch/arm.


# 1.10 23-Nov-2001 thorpej

Use <arm/undefined.h> instead of <machine/undefined.h>.


Revision tags: thorpej-mips-cache-base
# 1.9 06-Nov-2001 thorpej

branches: 1.9.2;
Const poisoning of cpu/class names.


# 1.8 06-Nov-2001 thorpej

"i80200", not "80200".


# 1.7 06-Nov-2001 thorpej

"XScale", not "Xscale".


# 1.6 18-Oct-2001 rearnsha

branches: 1.6.2;
Support for ARM9.


Revision tags: thorpej-devvp-base3 thorpej-devvp-base2
# 1.5 28-Sep-2001 chris

Add extra arg to fpa_test as it should have 4 args. Also add prototypes for fpa_test and fpa_handler.


Revision tags: post-chs-ubcperf pre-chs-ubcperf thorpej-devvp-base
# 1.4 05-Sep-2001 matt

branches: 1.4.2;
Flesh XSCALE support.


# 1.3 03-Jun-2001 chris

branches: 1.3.2; 1.3.4;
Add support for ARM7TDMI, as provided in a patch from John Fremlin to port-arm32.

Shouldn't effect any currently in tree ports.


# 1.2 13-May-2001 bjh21

Use get_bootconf_option() to find boot options, rather than home-grown
strstr()-based hacks.


Revision tags: thorpej_scsipi_beforemerge thorpej_scsipi_base thorpej_scsipi_nbase
# 1.1 20-Apr-2001 matt

branches: 1.1.2;
Split cpu from mainbus so that cpu can attached to other buses (like ofbus).


# 1.147 02-Jul-2020 martin

Initialize ci_kfpu_spl earlier for secondary CPUs. From riastradh


# 1.146 29-Jun-2020 riastradh

Implement fpu_kern_enter/leave for arm32.


# 1.145 20-Jun-2020 skrll

KNF #includes

Remove some unnecessary ones while I'm here.


Revision tags: bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3
# 1.144 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}


Revision tags: ad-namecache-base2
# 1.143 22-Jan-2020 skrll

#ifdef whack-a-mole for the pmap_maxproc_set functionality


# 1.142 20-Jan-2020 skrll

s/_ARM_ARCH_6/ARM_MMU_EXTENDED/ in the #ifdef for the recent 4k pages
change


# 1.141 18-Jan-2020 skrll

Use 4K pages on ARM_MMU_EXTENDED platforms (all armv[67] except RPI) by
creating a new pool l1ttpl for the userland L1 translation table which
needs to be 8KB and 8KB aligned.

Limit the pool to maxproc and add hooks to allow the sysctl changing of
maxproc to adjust the pool.

This comes at a 5% performance penalty for build.sh -j8 kernel on a
Tegra TK1.


Revision tags: ad-namecache-base1
# 1.140 15-Jan-2020 mrg

port the arm64 cpu topology setup for big.little to arm.

rename arm64 cpu_do_topology() to arm_cpu_do_topology() and
call it from both arm cpu_attach().

replace both aarch64_set_topology() inline code in arm
cpu_attach() with new arm_cpu_do_topology(), which is called
by the arm64 locore as well (possibly not needed, which would
allow it to become static.)

not yet tested on a real big.little armv7 system. tested
on rockpro64 and pinebook pro.


# 1.139 09-Jan-2020 ad

- Many small tweaks to the SMT awareness in the scheduler. It does a much
better job now at keeping all physical CPUs busy, while using the extra
threads to help out. In particular, during preempt() if we're using SMT,
try to find a better CPU to run on and teleport curlwp there.

- Change the CPU topology stuff so it can work on asymmetric systems. This
mainly entails rearranging one of the CPU lists so it makes sense in all
configurations.

- Add a parameter to cpu_topology_set() to note that a CPU is "slow", for
where there are fast CPUs and slow CPUs, like with the Rockwell RK3399.
Extend the SMT awareness to try and handle that situation too (keep fast
CPUs busy, use slow CPUs as helpers).


# 1.138 09-Jan-2020 martin

When attaching the first fdtbus, use the root "comptabile" (or failing that:
"model") property to set the cpu model (in userland aka sysctl hw.model).
When attaching the first cpu, do not overwrite a cpu model if it already
had been set.


# 1.137 08-Jan-2020 jmcneill

cpu_hatch is too late to report AP topology, do it at attach time instead


Revision tags: ad-namecache-base
# 1.136 20-Dec-2019 ad

branches: 1.136.2;
Some more CPU topology stuff:

- Use cegger@'s ACPI SRAT parsing code to figure out NUMA node ID for each
CPU as it is attached.

- For scheduler experiments with SMT, flag CPUs with the lowest numbered SMT
IDs as "primaries", link back to the primaries from secondaries, and build
a circular list of CPUs in each package with identical SMT IDs.

- No need for package/core/smt/numa IDs to be anything other than a u_int.


# 1.135 02-Dec-2019 ad

Take the basic CPU topology information we already collect, and use it
to make circular lists of CPU siblings in the same core, and in the
same package. Nothing fancy, just enough to have a bit of fun in the
scheduler trying out different tactics.


Revision tags: phil-wifi-20191119
# 1.134 20-Oct-2019 jmcneill

cpu_hatched_p only for MULTIPROCESSOR


# 1.133 19-Oct-2019 jmcneill

Increase aarch64 MAXCPUS to 256.


# 1.132 29-Sep-2019 skrll

aprint_debug_dev output alignment


# 1.131 08-Sep-2019 tnn

report A12 as A17 to the user. A12 is retcon'ed by ARM.


# 1.130 07-Sep-2019 tnn

Cortex A12 is marketed as A17 but has a distinct part number

observed on Rockchip RK3288


Revision tags: netbsd-9-base phil-wifi-20190609 isaki-audio2-base
# 1.129 17-Mar-2019 skrll

branches: 1.129.4;
Wrap arm_cpu_marker if #ifdef MPDEBUG.

One day a9_mpsubr.S will die


# 1.128 27-Jan-2019 pgoyette

Merge the [pgoyette-compat] branch


Revision tags: pgoyette-compat-20190127
# 1.127 25-Jan-2019 skrll

Make sure ci_{smt,core,package}_id are all filled in appropriately.

Previously the BP was missed and __SHIFTOUT wasn't used.


Revision tags: pgoyette-compat-20190118
# 1.126 03-Jan-2019 jmcneill

Read mpidr and cpuid from the secondary processor itself instead of the
boot processor. While here, add Cortex-A15 r4p0 to supported list.


# 1.125 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.124 02-Jan-2019 skrll

Don't overwrite the setting of cpu_core_id from mpidr


Revision tags: pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020
# 1.123 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.122 08-Oct-2018 skrll

Trialing whitespace


# 1.121 06-Oct-2018 skrll

Use __BIT. NFC.


Revision tags: pgoyette-compat-0930 pgoyette-compat-0906
# 1.120 15-Aug-2018 skrll

KNF


# 1.119 15-Aug-2018 skrll

Fix includes (sys/cdefs.h then sys/param.h)


# 1.118 15-Aug-2018 skrll

Sprinkle #include "opt_cputypes.h"


# 1.117 10-Aug-2018 maxv

Retire CPU_ARM2, CPU_ARM250 and CPU_ARM3, they are all leftovers of
acorn26.

ok jmcneill@ skrll@


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202
# 1.116 16-Sep-2017 matt

branches: 1.116.2; 1.116.4;
Add Cortex-A35 CPU ID.


Revision tags: netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base
# 1.115 01-Jun-2017 chs

branches: 1.115.6;
remove checks for failure after memory allocation calls that cannot fail:

kmem_alloc() with KM_SLEEP
kmem_zalloc() with KM_SLEEP
percpu_alloc()
pserialize_create()
psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.114 11-Jul-2016 kiyohara

Add Cortex-A9 r1.


Revision tags: nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.113 03-Mar-2016 skrll

Get the RPI3 working (in aarch32 mode) by recognising Cortex A53 CPUs.
While I'm here add some A57/A72 info as well.

My RPI3 works with FB console - the uart needs some help with its clocks.


# 1.112 23-Jan-2016 christos

Rename the cpu_id() define to cpu_idnum() so that it does not conflict with
dtrace and friends.


Revision tags: nick-nhusb-base-20151226
# 1.111 12-Nov-2015 jmcneill

change some register dumps from aprint_verbose to aprint_debug


Revision tags: nick-nhusb-base-20150921
# 1.110 08-Jul-2015 skrll

aprint_verbose [sa]ctlr


Revision tags: nick-nhusb-base-20150606
# 1.109 05-Jun-2015 skrll

Print the Revision ID regster (verbose)


# 1.108 17-May-2015 matt

Print out mpidr on MP systems (verbose print)


Revision tags: nick-nhusb-base-20150406
# 1.107 03-Mar-2015 jmcneill

cache type 12 is "write-back", from matt


Revision tags: nick-nhusb-base
# 1.106 27-Nov-2014 matt

branches: 1.106.2;
Add entry for Cortex-A17 r1


# 1.105 01-Sep-2014 reinoud

Increase the `freqbuf' buffer that holds the result of humanize_number(). Now
it prints 1600 Mhz instead of 1 Ghz.
Pitty enough humanize_number(9) doesn't do 1.6 Ghz type output.


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.104 28-Mar-2014 matt

branches: 1.104.4;
Various MP changes.


# 1.103 24-Mar-2014 christos

use cpu_{g,s}etmodel


# 1.102 20-Mar-2014 matt

Define cache type 13


Revision tags: riastradh-drm2-base3
# 1.101 03-Mar-2014 matt

Add most of the cpu_* variables to <arm/locore.h>
Add and initialize cpu_synchprim_present


# 1.100 20-Feb-2014 matt

Keep track of what each cache is (VIVT/VIPT/PIPT).

cpu0: 32KB/32B 2-way L1 VIPT Instruction cache
cpu0: 32KB/64B 4-way write-back-locking-C L1 PIPT Data cache
cpu0: 256KB/64B 8-way write-through L2 PIPT Unified cache


# 1.99 07-Sep-2013 matt

Add a machdep.hwdiv_present sysctl (cortex A7 and A15 have hwdiv instructions)


# 1.98 07-Sep-2013 matt

Add CPU_ID_CORTEXA7R0 entry


# 1.97 18-Aug-2013 matt

Move parts of cpu.h that are not needed by MI code in <arm/locore.h>
Don't include <machine/cpu.h> or <machine/frame.h>, use <arm/locore.h>
Use <arm/asm.h> instead of <machine/arm.h>


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.96 12-Jun-2013 matt

branches: 1.96.2;
Nuke cpu_pfr, just use the armreg_pfr?_read inlines


# 1.95 12-Jun-2013 matt

Use the armreg_pfr?_read inlines.


# 1.94 19-May-2013 rkujawa

Plug support for PJ4B into our ARM CPU infrastructure.

Obtained from Marvell, Semihalf.


Revision tags: agc-symver-base
# 1.93 03-Feb-2013 matt

Add a machdep.cpu_arch sysctl


# 1.92 31-Jan-2013 matt

Add simple sysctls for cpu_id, fpu_id, neon_present, simd_present,
simdex_present.
Add struct sysctls to return the isar, mmfr, pfr, and mvfr sets.


Revision tags: yamt-pagecache-base8 yamt-pagecache-base7
# 1.91 05-Dec-2012 matt

ARMFPE hasn't compiled since NetBSD 4. Remove it.
Complete support for FPU_VFP.
fpregs now contains vfpreg.
XXX vfpreg only has space for 16 64-bit FP registers though VFPv3 and later
have 32 64-bit FP registers.


# 1.90 30-Nov-2012 msaitoh

Use snprintf() instead of sprintf().


# 1.89 30-Nov-2012 msaitoh

s/,/;/


# 1.88 12-Nov-2012 skrll

C99 types


Revision tags: yamt-pagecache-base6
# 1.87 22-Sep-2012 matt

Don't use an asm in pmap_activate to update the TTBR, use cpu_setttb instead
but add a second argument to it to indicate whether the TLB/caches need to be
flushed. Default cortex to pmap_needs_fixup = 1. But check the MMFR3 field
to see if the fixed can be skipped.
Use a cf_flag bit 0 to indicate whether the A9 L2 cache should disable (bit 0 = 1)
or enabeld (bit = 0).

With these changes, the A9 MMU can use traverse caches to do MMU tablewalks
Also, make sure all memory has the shareable bit for the A9.


# 1.86 07-Sep-2012 matt

branches: 1.86.2;
Switch cortex_a9 back to need_ptesync = 1
Add code to disable the L2 cache on cortex-a9 (for now).
Add evcnt for all the fault types.
Move cache info in a structure and have one for the pcache and one for scache.
Probe L1/L2 caches properly for ARMv7


# 1.85 29-Aug-2012 matt

Use new armv7 CP15 register to print out cache types.
If the cpu_cc_freq is set, report it.
Add macros to make inlines for reading/writing co-processor registers.


# 1.84 14-Aug-2012 matt

Use device_t


# 1.83 12-Aug-2012 matt

Rework VFP support to use PCU.
Add emulation of instruction which save/restore the VFP FPSCR.
Add a sysarch hook to VFP FPSCR manipulation.

[The emulation will be used by libc to store/fetch exception modes and
rounding mode on a per-thread basis.]


# 1.82 14-Jul-2012 matt

Refresh cortex cpus


Revision tags: jmcneill-usbmp-base10 yamt-pagecache-base5
# 1.81 20-May-2012 skrll

Remove the ARM1156T2 bloat - it only has an MPU. Prompted by matt@


# 1.80 20-May-2012 skrll

Add the ARM1156T2-S


# 1.79 20-May-2012 skrll

Add the 'Z' to the 1176 cpu product name.

ok matt@


Revision tags: jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base jym-xensuspend-nbase rmind-uvmplock-base jym-xensuspend-base
# 1.78 10-Mar-2011 bsh

branches: 1.78.4; 1.78.8; 1.78.10;
add MPCore to CPU-ID table
add branch predict bit to arm11_options


Revision tags: uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11
# 1.77 02-Oct-2010 kiyohara

branches: 1.77.2;
Add support Marvell Sheeva Core and SoC. (Orion/Kirkwood)
Discovery Innovation not yet.


Revision tags: uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.76 19-Jun-2010 matt

Fix cache probing on Cortex. Add missing CORTEX dependency in cpu.c


# 1.75 19-Jun-2010 matt

Fix c&p error.


# 1.74 19-Jun-2010 matt

Cleanup the armv7 changes. Add ARM_ARCH_7. Use CPU_CORTEX instead of
CPU_CORTEXA8 everywhere since there more types of Cortex than just the A8.
CPU_CORTEXA8 still exists but causes CPU_CORTEX to be defined.
Add CPU_CORTEXA9 as well. Use .arch armv7a to get us the isb/dsb
instructions.

Test booted to root device prompt on a Beagleboard.
All ARM kernels successfully test built.


# 1.73 16-Jun-2010 jmcneill

PR port-arm/43299: Support added for igepv2/cortexa8/omap3530

Apply patch from PR, with build fixes. ok skrll, matt


Revision tags: uebayasi-xip-base1 yamt-nfs-mp-base9 uebayasi-xip-base
# 1.72 23-Jan-2010 mrg

branches: 1.72.2; 1.72.4;
rename a local cpu_name structure member to avoid potential conflict
with <sys/cpu.h>'s.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-premerge-20091211 yamt-nfs-mp-base8 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 yamt-nfs-mp-base7 netbsd-5-0-1-RELEASE jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base nick-hppapmap-base haad-dm-base mjf-devfs2-base
# 1.71 25-Oct-2008 matt

branches: 1.71.4; 1.71.12;
Fix some missing things for CPU_ID_FA526.


Revision tags: matt-mips64-base2
# 1.70 24-Oct-2008 matt

Add entry for FA526.


# 1.69 21-Oct-2008 matt

Add Cortex cpus


Revision tags: haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base
# 1.68 27-Apr-2008 matt

branches: 1.68.6;
Merge kernel changes in matt-armv6 to HEAD.


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 chris-arm-intr-rework-base7 keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.67 15-Mar-2008 rearnsha

branches: 1.67.2; 1.67.4;
VFP support.


Revision tags: nick-net80211-sync-base chris-arm-intr-rework-base6 chris-arm-intr-rework-base5 chris-arm-intr-rework-base4 bouyer-xeni386-merge1 chris-arm-intr-rework-base3 vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 jmcneill-base mjf-devfs-base bouyer-xenamd64-base2 vmlocking-nbase yamt-x86pmap-base4 bouyer-xenamd64-base matt-armv6-base jmcneill-pm-base hpcarm-cleanup-base reinoud-bufcleanup-base
# 1.66 17-Oct-2007 garbled

branches: 1.66.12; 1.66.16;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base chris-arm-intr-rework-base2 chris-arm-intr-rework-base nick-csl-alignment-base matt-mips64-base ppcoea-renovation-base mjf-ufs-trans-base vmlocking-base
# 1.65 17-May-2007 yamt

branches: 1.65.10; 1.65.12;
merge yamt-idlelwp branch. asked by core@. some ports still needs work.

from doc/BRANCHES:

idle lwp, and some changes depending on it.

1. separate context switching and thread scheduling.
(cf. gmcgarry_ctxsw)
2. implement idle lwp.
3. clean up related MD/MI interfaces.
4. make scheduler(s) modular.


Revision tags: yamt-idlelwp-base8 thorpej-atomic-base ad-audiomp-base post-newlock2-merge newlock2-nbase newlock2-base
# 1.64 06-Jan-2007 christos

branches: 1.64.2; 1.64.6; 1.64.8; 1.64.14;
Scott Allan in http://mail-index.netbsd.org/port-arm/2006/07/31/0000.html
Patch to add support for ARM9E


# 1.63 06-Jan-2007 christos

From Scott Alan in http://mail-index.netbsd.org/port-arm/2006/07/26/0000.html
identify_arm_cpu() prints out a helpful message when it detects that you're
trying to run on a CPU that you didn't configure for. Unfortunately, the
check for class_option being NULL is backward, so it either won't print the
class_option, or it will try to dereference a NULL. The patch just flips the
!= NULL to be == NULL.


Revision tags: yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 abandoned-netbsd-4-base yamt-splraiseipl-base2 yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 netbsd-4-base yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base elad-kernelauth-base simonb-timecounters-base rpaulo-netinet-merge-pcb-base
# 1.62 15-Mar-2006 drochner

branches: 1.62.10; 1.62.14;
use km_alloc to get wired kernel memory for kernel stacks
of idle processes for secondary CPUs
(affects the MULTIPROCESSOR case only - does this exist?)
(untested)


Revision tags: yamt-pdpolicy-base2 yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.61 11-Dec-2005 christos

branches: 1.61.4; 1.61.6; 1.61.8; 1.61.10;
merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.60 20-Jul-2005 nonaka

Added i80219.


# 1.59 04-Jul-2005 bsh

branches: 1.59.2;
The first step to support Intel PXA270.

kernel config option CPU_XSCALE_PXA2X0 is now obsoleted by
CPU_XSCALE_PXA250 and CPU_XSCALE_PXA270. If both of them are defined,
CPU is determined run-time.


# 1.58 03-Jun-2005 rearnsha

Very basic support for the ARM1136.

This code takes no advantage of any 'new' features provided by
architecture 6 devices (such as physically tagged caches or new
MMU features), and basically runs the chip in a 'legacy v5' mode.


# 1.57 10-May-2005 rearnsha

Add support for arm1026ej-s.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 yamt-km-base4 yamt-km-base3 netbsd-3-base yamt-km-base2 yamt-km-base kent-audio2-base kent-audio1-beforemerge kent-audio1-base
# 1.56 14-Apr-2004 bsh

distinguish PXA255/26x from PXA2[15]0 in CPU attach message


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.55 13-Feb-2004 wiz

Uppercase CPU, plural is CPUs.


# 1.54 26-Oct-2003 chris

Fix up some unitialised variables.


# 1.53 06-Sep-2003 rearnsha

Support for ARM10E class devices.


# 1.52 03-Sep-2003 mycroft

Recognize some TI processors -- not that you'd want to use them.


# 1.51 23-Jun-2003 martin

branches: 1.51.2;
Make sure to include opt_foo.h if a defflag option FOO is used.


# 1.50 23-May-2003 ichiro

support IXP425 Intel Network Processor
running on BigEndian


# 1.49 29-Apr-2003 thorpej

Use aprint*().


# 1.48 14-Feb-2003 rjs

Add CPU IDs for PXA B2 and C0 steppings.


Revision tags: nathanw_sa_before_merge nathanw_sa_base
# 1.47 06-Jan-2003 wiz

specified, not specifed.


Revision tags: fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base
# 1.46 17-Nov-2002 chs

change uvm_uarea_alloc() to indicate whether the returned uarea is already
backed by physical pages (ie. because it reused a previously-freed one),
so that we can skip a bunch of useless work in that case.
this fixes the underlying problem behind PR 18543, and also speeds up fork()
quite a bit (eg. 7% on my pc, 1% on my ultra2) when we get a cache hit.


Revision tags: kqueue-aftermerge kqueue-beforemerge bjh21-hydra-base
# 1.45 13-Oct-2002 chris

branches: 1.45.2;
Fix arm kernel build breaks for non multiprocessor systems.


# 1.44 13-Oct-2002 bjh21

It appears that MI code requires ci_cpuid to be the CPU number of the CPU
in question, whereas the ARM code was using it to hold the model
identification. To fix this, rename:

ci_cpuid -> ci_arm_cpuid
ci_cputype -> ci_arm_cputype (for consistency)
ci_cpurev -> ci_arm_cpurev (ditto)
ci_cpunum -> ci_cpuid

This makes top(1) give correct CPU numbers in its "STATE" column (all 0 for
now).


# 1.43 12-Oct-2002 bjh21

Remember the location of each CPU's idle PCB in struct cpu_info.
Move allocation of the idle PCB from hydra.c to cpu.c and add some
extra initialisation from cpu_fork().


Revision tags: kqueue-base
# 1.42 01-Oct-2002 bjh21

constify various string tables.


# 1.41 06-Sep-2002 gehenna

Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.


Revision tags: gehenna-devsw-base
# 1.40 22-Jul-2002 briggs

Handle i80200 step D0 and i80321 step B0


# 1.39 10-Jul-2002 ichiro

add cpu id for "PXA250/210 3rd version CPUcore".

for using many PDA/xscale-core.


# 1.38 07-Jun-2002 thorpej

Add the CPU ID for the 600MHz i80321 part.


Revision tags: netbsd-1-6-base
# 1.37 12-May-2002 ichiro

branches: 1.37.2; 1.37.4;
change ICP12x0 steppings.
define CPU_IXP12X0


# 1.36 10-May-2002 thorpej

Add IXP1200 steppings.


# 1.35 03-May-2002 thorpej

Add support for the Intel PXA210 and PXA250. From Hiroyuki Bessho, PR 16617.


# 1.34 02-May-2002 rjs

Enable CPU_CLASS_SA1 for SA1100 and SA1110.


# 1.33 12-Apr-2002 thorpej

Centralize ARM CPU configuration information by adding a new header
file, <arm/cpuconf.h>, which pulls in "opt_cputypes.h" and then defines
the following:
* CPU_NTYPES -- now many CPU types are configured into the kernel. What
you really want to know is "== 1" or "> 1".
* Defines ARM_ARCH_2, ARM_ARCH_3, ARM_ARCH_4, ARM_ARCH_5, depending
on which ARM architecture versions are configured (based on CPU_*
options). Also defines ARM_NARCH to determins how many architecture
versions are configured.
* Defines ARM_MMU_MEMC, ARM_MMU_GENERIC, ARM_MMU_XSCALE depending on
which classes of ARM MMUs are configured into the kernel, and ARM_NMMUS
to determine how many MMU classes are configured.

Remove the needless inclusion of "opt_cputypes.h" in several places.
Convert remaining users to <arm/cpuconf.h>.


# 1.32 27-Mar-2002 thorpej

The 80321 manual lies; it does have a CPU ID distinct from the 80200.
Add that CPU ID, and add a case for it.


# 1.31 26-Mar-2002 thorpej

Restructure a few things in order to support other XScale core
I/O processors:
* The i80200 and the i80321 have the same CPU ID, so split the
CPU_XSCALE option into CPU_XSCALE_80200 and CPU_XSCALE_80321
options, and don't let them both be defined at the same time.
XXX May want to revisit this in the future.
* Split some registers common between the i80200 and i80321 into
<arm/xscale/xscalereg.h>.
* Rename a few existing functions.


# 1.30 24-Mar-2002 thorpej

Cache the cpu type and cpu revision in cpu_info.


Revision tags: eeh-devprop-base
# 1.29 16-Mar-2002 bjh21

Only put the CPU type into cpu_model, not the state of the control register.
Instead, print the control register state on the next line at startup.


# 1.28 16-Mar-2002 bjh21

Add CPU ID for the ARM1022ES.
Also add a CPU class for ARM10E processors in general.


# 1.27 11-Mar-2002 reinoud

When ARMFPE wasn't enabled the `usearmfpe' flag was statically initialised
but not used resulting in a compiler error. By splitting the declaration
and the initialisation this is solved.

Better would be to not even declare the flag when ARMFPE isnt enabled but
that would just add to the #ifdef jungle.


# 1.26 10-Mar-2002 bjh21

__RCSID -> __KERNEL_RCSID


# 1.25 10-Mar-2002 bjh21

Re-work the way that FPAs are handled. If ARMFPE isn't configured, don't
even bother probing for an FPA. If ARMFPE is configured, always use it,
even if there's an FPA (since it provides the FPA support code). Move all
printfs about FPAs into armfpe_init.c.

This means I can delete the last two elements from struct _cpu, so that the
structure, and the whole of <arm/cpus.h> is redundant and can be deleted.


# 1.24 10-Mar-2002 bjh21

Remove fpu_model from struct _cpu. Instead, have initialise_arm_fpe()
printf() the FPE version number itself.


# 1.23 10-Mar-2002 bjh21

Add a ci_dev element to struct cpu_info, pointing to the device that
corresponds to the CPU.


Revision tags: newlock-base
# 1.22 10-Mar-2002 bjh21

Kill the fpu_flags element from struct _cpu. It was only ever set to 0
anyway.


# 1.21 10-Mar-2002 bjh21

Clean up inline assembler. Rather than saving R0, copying FPSR to R0,
copying it to the output register and then restoring R0, just copy the
FPSR straight to the output.


# 1.20 09-Mar-2002 bjh21

Remove the cpu_model member from struct _cpu, and just use the cpu_model
variable directly. While we're at it, make cpu_model rather larger.


# 1.19 09-Mar-2002 bjh21

Remove the cpu_class element from struct _cpu, and make it a local variable
in identify_arm_cpu(), since it's almost unused elsewhere.

Change the detection of bugged StrongARMs to use the cpu ID rather than the
class. This turns "almost" into "entirely".


# 1.18 09-Mar-2002 bjh21

Replace cpu_id and cpu_ctrl in struct _cpu with ci_cpuid and ci_ctrl in
struct cpu_info. Also kill the cpuctrl global while we're here, and make
identify_arm_cpu() take a struct cpu_info * as an argument alongside the CPU
number.


# 1.17 09-Mar-2002 bjh21

Move arm700bugcount into stuct cpu_info, and attach it in
identify_master_cpu().


Revision tags: ifpoll-base
# 1.16 17-Feb-2002 bjh21

Our assembler handles FPA instructions fine, so don't use .word for them.


# 1.15 17-Feb-2002 bjh21

ANSIfy, and othe KNF cleanup.


# 1.14 27-Jan-2002 bjh21

Add revision->stepping maps for the SA-110, SA-1100 and SA-1110.
Those for the SA-1100 and SA-1110 are from Intel's documentation.
The mapping for the SA-110 is from various sources on the net, since Intel
don't seem to document it.

Also, change the layout of the maps to have four steppings per line,
so they aren't quite so unwieldy.


# 1.13 24-Jan-2002 thorpej

Use a table to look up stepping names. Add a generic stepping
table ("rev 0", "rev 1", etc.) and an i80200 stepping table that
has the stepping names that appear in the i80200 manuals/errata..


# 1.12 29-Nov-2001 thorpej

Fetch cache info from the Cache Type register on ARM7TDMI and "greater"
processors. Report this when the processor is attached.


# 1.11 24-Nov-2001 thorpej

Move the ARM, Ltd. floating point emulator to arch/arm.


# 1.10 23-Nov-2001 thorpej

Use <arm/undefined.h> instead of <machine/undefined.h>.


Revision tags: thorpej-mips-cache-base
# 1.9 06-Nov-2001 thorpej

branches: 1.9.2;
Const poisoning of cpu/class names.


# 1.8 06-Nov-2001 thorpej

"i80200", not "80200".


# 1.7 06-Nov-2001 thorpej

"XScale", not "Xscale".


# 1.6 18-Oct-2001 rearnsha

branches: 1.6.2;
Support for ARM9.


Revision tags: thorpej-devvp-base3 thorpej-devvp-base2
# 1.5 28-Sep-2001 chris

Add extra arg to fpa_test as it should have 4 args. Also add prototypes for fpa_test and fpa_handler.


Revision tags: post-chs-ubcperf pre-chs-ubcperf thorpej-devvp-base
# 1.4 05-Sep-2001 matt

branches: 1.4.2;
Flesh XSCALE support.


# 1.3 03-Jun-2001 chris

branches: 1.3.2; 1.3.4;
Add support for ARM7TDMI, as provided in a patch from John Fremlin to port-arm32.

Shouldn't effect any currently in tree ports.


# 1.2 13-May-2001 bjh21

Use get_bootconf_option() to find boot options, rather than home-grown
strstr()-based hacks.


Revision tags: thorpej_scsipi_beforemerge thorpej_scsipi_base thorpej_scsipi_nbase
# 1.1 20-Apr-2001 matt

branches: 1.1.2;
Split cpu from mainbus so that cpu can attached to other buses (like ofbus).


# 1.146 29-Jun-2020 riastradh

Implement fpu_kern_enter/leave for arm32.


# 1.145 20-Jun-2020 skrll

KNF #includes

Remove some unnecessary ones while I'm here.


Revision tags: bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3
# 1.144 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}


Revision tags: ad-namecache-base2
# 1.143 22-Jan-2020 skrll

#ifdef whack-a-mole for the pmap_maxproc_set functionality


# 1.142 20-Jan-2020 skrll

s/_ARM_ARCH_6/ARM_MMU_EXTENDED/ in the #ifdef for the recent 4k pages
change


# 1.141 18-Jan-2020 skrll

Use 4K pages on ARM_MMU_EXTENDED platforms (all armv[67] except RPI) by
creating a new pool l1ttpl for the userland L1 translation table which
needs to be 8KB and 8KB aligned.

Limit the pool to maxproc and add hooks to allow the sysctl changing of
maxproc to adjust the pool.

This comes at a 5% performance penalty for build.sh -j8 kernel on a
Tegra TK1.


Revision tags: ad-namecache-base1
# 1.140 15-Jan-2020 mrg

port the arm64 cpu topology setup for big.little to arm.

rename arm64 cpu_do_topology() to arm_cpu_do_topology() and
call it from both arm cpu_attach().

replace both aarch64_set_topology() inline code in arm
cpu_attach() with new arm_cpu_do_topology(), which is called
by the arm64 locore as well (possibly not needed, which would
allow it to become static.)

not yet tested on a real big.little armv7 system. tested
on rockpro64 and pinebook pro.


# 1.139 09-Jan-2020 ad

- Many small tweaks to the SMT awareness in the scheduler. It does a much
better job now at keeping all physical CPUs busy, while using the extra
threads to help out. In particular, during preempt() if we're using SMT,
try to find a better CPU to run on and teleport curlwp there.

- Change the CPU topology stuff so it can work on asymmetric systems. This
mainly entails rearranging one of the CPU lists so it makes sense in all
configurations.

- Add a parameter to cpu_topology_set() to note that a CPU is "slow", for
where there are fast CPUs and slow CPUs, like with the Rockwell RK3399.
Extend the SMT awareness to try and handle that situation too (keep fast
CPUs busy, use slow CPUs as helpers).


# 1.138 09-Jan-2020 martin

When attaching the first fdtbus, use the root "comptabile" (or failing that:
"model") property to set the cpu model (in userland aka sysctl hw.model).
When attaching the first cpu, do not overwrite a cpu model if it already
had been set.


# 1.137 08-Jan-2020 jmcneill

cpu_hatch is too late to report AP topology, do it at attach time instead


Revision tags: ad-namecache-base
# 1.136 20-Dec-2019 ad

branches: 1.136.2;
Some more CPU topology stuff:

- Use cegger@'s ACPI SRAT parsing code to figure out NUMA node ID for each
CPU as it is attached.

- For scheduler experiments with SMT, flag CPUs with the lowest numbered SMT
IDs as "primaries", link back to the primaries from secondaries, and build
a circular list of CPUs in each package with identical SMT IDs.

- No need for package/core/smt/numa IDs to be anything other than a u_int.


# 1.135 02-Dec-2019 ad

Take the basic CPU topology information we already collect, and use it
to make circular lists of CPU siblings in the same core, and in the
same package. Nothing fancy, just enough to have a bit of fun in the
scheduler trying out different tactics.


Revision tags: phil-wifi-20191119
# 1.134 20-Oct-2019 jmcneill

cpu_hatched_p only for MULTIPROCESSOR


# 1.133 19-Oct-2019 jmcneill

Increase aarch64 MAXCPUS to 256.


# 1.132 29-Sep-2019 skrll

aprint_debug_dev output alignment


# 1.131 08-Sep-2019 tnn

report A12 as A17 to the user. A12 is retcon'ed by ARM.


# 1.130 07-Sep-2019 tnn

Cortex A12 is marketed as A17 but has a distinct part number

observed on Rockchip RK3288


Revision tags: netbsd-9-base phil-wifi-20190609 isaki-audio2-base
# 1.129 17-Mar-2019 skrll

branches: 1.129.4;
Wrap arm_cpu_marker if #ifdef MPDEBUG.

One day a9_mpsubr.S will die


# 1.128 27-Jan-2019 pgoyette

Merge the [pgoyette-compat] branch


Revision tags: pgoyette-compat-20190127
# 1.127 25-Jan-2019 skrll

Make sure ci_{smt,core,package}_id are all filled in appropriately.

Previously the BP was missed and __SHIFTOUT wasn't used.


Revision tags: pgoyette-compat-20190118
# 1.126 03-Jan-2019 jmcneill

Read mpidr and cpuid from the secondary processor itself instead of the
boot processor. While here, add Cortex-A15 r4p0 to supported list.


# 1.125 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.124 02-Jan-2019 skrll

Don't overwrite the setting of cpu_core_id from mpidr


Revision tags: pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020
# 1.123 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.122 08-Oct-2018 skrll

Trialing whitespace


# 1.121 06-Oct-2018 skrll

Use __BIT. NFC.


Revision tags: pgoyette-compat-0930 pgoyette-compat-0906
# 1.120 15-Aug-2018 skrll

KNF


# 1.119 15-Aug-2018 skrll

Fix includes (sys/cdefs.h then sys/param.h)


# 1.118 15-Aug-2018 skrll

Sprinkle #include "opt_cputypes.h"


# 1.117 10-Aug-2018 maxv

Retire CPU_ARM2, CPU_ARM250 and CPU_ARM3, they are all leftovers of
acorn26.

ok jmcneill@ skrll@


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202
# 1.116 16-Sep-2017 matt

branches: 1.116.2; 1.116.4;
Add Cortex-A35 CPU ID.


Revision tags: netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base
# 1.115 01-Jun-2017 chs

branches: 1.115.6;
remove checks for failure after memory allocation calls that cannot fail:

kmem_alloc() with KM_SLEEP
kmem_zalloc() with KM_SLEEP
percpu_alloc()
pserialize_create()
psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.114 11-Jul-2016 kiyohara

Add Cortex-A9 r1.


Revision tags: nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.113 03-Mar-2016 skrll

Get the RPI3 working (in aarch32 mode) by recognising Cortex A53 CPUs.
While I'm here add some A57/A72 info as well.

My RPI3 works with FB console - the uart needs some help with its clocks.


# 1.112 23-Jan-2016 christos

Rename the cpu_id() define to cpu_idnum() so that it does not conflict with
dtrace and friends.


Revision tags: nick-nhusb-base-20151226
# 1.111 12-Nov-2015 jmcneill

change some register dumps from aprint_verbose to aprint_debug


Revision tags: nick-nhusb-base-20150921
# 1.110 08-Jul-2015 skrll

aprint_verbose [sa]ctlr


Revision tags: nick-nhusb-base-20150606
# 1.109 05-Jun-2015 skrll

Print the Revision ID regster (verbose)


# 1.108 17-May-2015 matt

Print out mpidr on MP systems (verbose print)


Revision tags: nick-nhusb-base-20150406
# 1.107 03-Mar-2015 jmcneill

cache type 12 is "write-back", from matt


Revision tags: nick-nhusb-base
# 1.106 27-Nov-2014 matt

branches: 1.106.2;
Add entry for Cortex-A17 r1


# 1.105 01-Sep-2014 reinoud

Increase the `freqbuf' buffer that holds the result of humanize_number(). Now
it prints 1600 Mhz instead of 1 Ghz.
Pitty enough humanize_number(9) doesn't do 1.6 Ghz type output.


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.104 28-Mar-2014 matt

branches: 1.104.4;
Various MP changes.


# 1.103 24-Mar-2014 christos

use cpu_{g,s}etmodel


# 1.102 20-Mar-2014 matt

Define cache type 13


Revision tags: riastradh-drm2-base3
# 1.101 03-Mar-2014 matt

Add most of the cpu_* variables to <arm/locore.h>
Add and initialize cpu_synchprim_present


# 1.100 20-Feb-2014 matt

Keep track of what each cache is (VIVT/VIPT/PIPT).

cpu0: 32KB/32B 2-way L1 VIPT Instruction cache
cpu0: 32KB/64B 4-way write-back-locking-C L1 PIPT Data cache
cpu0: 256KB/64B 8-way write-through L2 PIPT Unified cache


# 1.99 07-Sep-2013 matt

Add a machdep.hwdiv_present sysctl (cortex A7 and A15 have hwdiv instructions)


# 1.98 07-Sep-2013 matt

Add CPU_ID_CORTEXA7R0 entry


# 1.97 18-Aug-2013 matt

Move parts of cpu.h that are not needed by MI code in <arm/locore.h>
Don't include <machine/cpu.h> or <machine/frame.h>, use <arm/locore.h>
Use <arm/asm.h> instead of <machine/arm.h>


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.96 12-Jun-2013 matt

branches: 1.96.2;
Nuke cpu_pfr, just use the armreg_pfr?_read inlines


# 1.95 12-Jun-2013 matt

Use the armreg_pfr?_read inlines.


# 1.94 19-May-2013 rkujawa

Plug support for PJ4B into our ARM CPU infrastructure.

Obtained from Marvell, Semihalf.


Revision tags: agc-symver-base
# 1.93 03-Feb-2013 matt

Add a machdep.cpu_arch sysctl


# 1.92 31-Jan-2013 matt

Add simple sysctls for cpu_id, fpu_id, neon_present, simd_present,
simdex_present.
Add struct sysctls to return the isar, mmfr, pfr, and mvfr sets.


Revision tags: yamt-pagecache-base8 yamt-pagecache-base7
# 1.91 05-Dec-2012 matt

ARMFPE hasn't compiled since NetBSD 4. Remove it.
Complete support for FPU_VFP.
fpregs now contains vfpreg.
XXX vfpreg only has space for 16 64-bit FP registers though VFPv3 and later
have 32 64-bit FP registers.


# 1.90 30-Nov-2012 msaitoh

Use snprintf() instead of sprintf().


# 1.89 30-Nov-2012 msaitoh

s/,/;/


# 1.88 12-Nov-2012 skrll

C99 types


Revision tags: yamt-pagecache-base6
# 1.87 22-Sep-2012 matt

Don't use an asm in pmap_activate to update the TTBR, use cpu_setttb instead
but add a second argument to it to indicate whether the TLB/caches need to be
flushed. Default cortex to pmap_needs_fixup = 1. But check the MMFR3 field
to see if the fixed can be skipped.
Use a cf_flag bit 0 to indicate whether the A9 L2 cache should disable (bit 0 = 1)
or enabeld (bit = 0).

With these changes, the A9 MMU can use traverse caches to do MMU tablewalks
Also, make sure all memory has the shareable bit for the A9.


# 1.86 07-Sep-2012 matt

branches: 1.86.2;
Switch cortex_a9 back to need_ptesync = 1
Add code to disable the L2 cache on cortex-a9 (for now).
Add evcnt for all the fault types.
Move cache info in a structure and have one for the pcache and one for scache.
Probe L1/L2 caches properly for ARMv7


# 1.85 29-Aug-2012 matt

Use new armv7 CP15 register to print out cache types.
If the cpu_cc_freq is set, report it.
Add macros to make inlines for reading/writing co-processor registers.


# 1.84 14-Aug-2012 matt

Use device_t


# 1.83 12-Aug-2012 matt

Rework VFP support to use PCU.
Add emulation of instruction which save/restore the VFP FPSCR.
Add a sysarch hook to VFP FPSCR manipulation.

[The emulation will be used by libc to store/fetch exception modes and
rounding mode on a per-thread basis.]


# 1.82 14-Jul-2012 matt

Refresh cortex cpus


Revision tags: jmcneill-usbmp-base10 yamt-pagecache-base5
# 1.81 20-May-2012 skrll

Remove the ARM1156T2 bloat - it only has an MPU. Prompted by matt@


# 1.80 20-May-2012 skrll

Add the ARM1156T2-S


# 1.79 20-May-2012 skrll

Add the 'Z' to the 1176 cpu product name.

ok matt@


Revision tags: jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base jym-xensuspend-nbase rmind-uvmplock-base jym-xensuspend-base
# 1.78 10-Mar-2011 bsh

branches: 1.78.4; 1.78.8; 1.78.10;
add MPCore to CPU-ID table
add branch predict bit to arm11_options


Revision tags: uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11
# 1.77 02-Oct-2010 kiyohara

branches: 1.77.2;
Add support Marvell Sheeva Core and SoC. (Orion/Kirkwood)
Discovery Innovation not yet.


Revision tags: uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.76 19-Jun-2010 matt

Fix cache probing on Cortex. Add missing CORTEX dependency in cpu.c


# 1.75 19-Jun-2010 matt

Fix c&p error.


# 1.74 19-Jun-2010 matt

Cleanup the armv7 changes. Add ARM_ARCH_7. Use CPU_CORTEX instead of
CPU_CORTEXA8 everywhere since there more types of Cortex than just the A8.
CPU_CORTEXA8 still exists but causes CPU_CORTEX to be defined.
Add CPU_CORTEXA9 as well. Use .arch armv7a to get us the isb/dsb
instructions.

Test booted to root device prompt on a Beagleboard.
All ARM kernels successfully test built.


# 1.73 16-Jun-2010 jmcneill

PR port-arm/43299: Support added for igepv2/cortexa8/omap3530

Apply patch from PR, with build fixes. ok skrll, matt


Revision tags: uebayasi-xip-base1 yamt-nfs-mp-base9 uebayasi-xip-base
# 1.72 23-Jan-2010 mrg

branches: 1.72.2; 1.72.4;
rename a local cpu_name structure member to avoid potential conflict
with <sys/cpu.h>'s.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-premerge-20091211 yamt-nfs-mp-base8 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 yamt-nfs-mp-base7 netbsd-5-0-1-RELEASE jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base nick-hppapmap-base haad-dm-base mjf-devfs2-base
# 1.71 25-Oct-2008 matt

branches: 1.71.4; 1.71.12;
Fix some missing things for CPU_ID_FA526.


Revision tags: matt-mips64-base2
# 1.70 24-Oct-2008 matt

Add entry for FA526.


# 1.69 21-Oct-2008 matt

Add Cortex cpus


Revision tags: haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base
# 1.68 27-Apr-2008 matt

branches: 1.68.6;
Merge kernel changes in matt-armv6 to HEAD.


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 chris-arm-intr-rework-base7 keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.67 15-Mar-2008 rearnsha

branches: 1.67.2; 1.67.4;
VFP support.


Revision tags: nick-net80211-sync-base chris-arm-intr-rework-base6 chris-arm-intr-rework-base5 chris-arm-intr-rework-base4 bouyer-xeni386-merge1 chris-arm-intr-rework-base3 vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 jmcneill-base mjf-devfs-base bouyer-xenamd64-base2 vmlocking-nbase yamt-x86pmap-base4 bouyer-xenamd64-base matt-armv6-base jmcneill-pm-base hpcarm-cleanup-base reinoud-bufcleanup-base
# 1.66 17-Oct-2007 garbled

branches: 1.66.12; 1.66.16;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base chris-arm-intr-rework-base2 chris-arm-intr-rework-base nick-csl-alignment-base matt-mips64-base ppcoea-renovation-base mjf-ufs-trans-base vmlocking-base
# 1.65 17-May-2007 yamt

branches: 1.65.10; 1.65.12;
merge yamt-idlelwp branch. asked by core@. some ports still needs work.

from doc/BRANCHES:

idle lwp, and some changes depending on it.

1. separate context switching and thread scheduling.
(cf. gmcgarry_ctxsw)
2. implement idle lwp.
3. clean up related MD/MI interfaces.
4. make scheduler(s) modular.


Revision tags: yamt-idlelwp-base8 thorpej-atomic-base ad-audiomp-base post-newlock2-merge newlock2-nbase newlock2-base
# 1.64 06-Jan-2007 christos

branches: 1.64.2; 1.64.6; 1.64.8; 1.64.14;
Scott Allan in http://mail-index.netbsd.org/port-arm/2006/07/31/0000.html
Patch to add support for ARM9E


# 1.63 06-Jan-2007 christos

From Scott Alan in http://mail-index.netbsd.org/port-arm/2006/07/26/0000.html
identify_arm_cpu() prints out a helpful message when it detects that you're
trying to run on a CPU that you didn't configure for. Unfortunately, the
check for class_option being NULL is backward, so it either won't print the
class_option, or it will try to dereference a NULL. The patch just flips the
!= NULL to be == NULL.


Revision tags: yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 abandoned-netbsd-4-base yamt-splraiseipl-base2 yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 netbsd-4-base yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base elad-kernelauth-base simonb-timecounters-base rpaulo-netinet-merge-pcb-base
# 1.62 15-Mar-2006 drochner

branches: 1.62.10; 1.62.14;
use km_alloc to get wired kernel memory for kernel stacks
of idle processes for secondary CPUs
(affects the MULTIPROCESSOR case only - does this exist?)
(untested)


Revision tags: yamt-pdpolicy-base2 yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.61 11-Dec-2005 christos

branches: 1.61.4; 1.61.6; 1.61.8; 1.61.10;
merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.60 20-Jul-2005 nonaka

Added i80219.


# 1.59 04-Jul-2005 bsh

branches: 1.59.2;
The first step to support Intel PXA270.

kernel config option CPU_XSCALE_PXA2X0 is now obsoleted by
CPU_XSCALE_PXA250 and CPU_XSCALE_PXA270. If both of them are defined,
CPU is determined run-time.


# 1.58 03-Jun-2005 rearnsha

Very basic support for the ARM1136.

This code takes no advantage of any 'new' features provided by
architecture 6 devices (such as physically tagged caches or new
MMU features), and basically runs the chip in a 'legacy v5' mode.


# 1.57 10-May-2005 rearnsha

Add support for arm1026ej-s.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 yamt-km-base4 yamt-km-base3 netbsd-3-base yamt-km-base2 yamt-km-base kent-audio2-base kent-audio1-beforemerge kent-audio1-base
# 1.56 14-Apr-2004 bsh

distinguish PXA255/26x from PXA2[15]0 in CPU attach message


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.55 13-Feb-2004 wiz

Uppercase CPU, plural is CPUs.


# 1.54 26-Oct-2003 chris

Fix up some unitialised variables.


# 1.53 06-Sep-2003 rearnsha

Support for ARM10E class devices.


# 1.52 03-Sep-2003 mycroft

Recognize some TI processors -- not that you'd want to use them.


# 1.51 23-Jun-2003 martin

branches: 1.51.2;
Make sure to include opt_foo.h if a defflag option FOO is used.


# 1.50 23-May-2003 ichiro

support IXP425 Intel Network Processor
running on BigEndian


# 1.49 29-Apr-2003 thorpej

Use aprint*().


# 1.48 14-Feb-2003 rjs

Add CPU IDs for PXA B2 and C0 steppings.


Revision tags: nathanw_sa_before_merge nathanw_sa_base
# 1.47 06-Jan-2003 wiz

specified, not specifed.


Revision tags: fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base
# 1.46 17-Nov-2002 chs

change uvm_uarea_alloc() to indicate whether the returned uarea is already
backed by physical pages (ie. because it reused a previously-freed one),
so that we can skip a bunch of useless work in that case.
this fixes the underlying problem behind PR 18543, and also speeds up fork()
quite a bit (eg. 7% on my pc, 1% on my ultra2) when we get a cache hit.


Revision tags: kqueue-aftermerge kqueue-beforemerge bjh21-hydra-base
# 1.45 13-Oct-2002 chris

branches: 1.45.2;
Fix arm kernel build breaks for non multiprocessor systems.


# 1.44 13-Oct-2002 bjh21

It appears that MI code requires ci_cpuid to be the CPU number of the CPU
in question, whereas the ARM code was using it to hold the model
identification. To fix this, rename:

ci_cpuid -> ci_arm_cpuid
ci_cputype -> ci_arm_cputype (for consistency)
ci_cpurev -> ci_arm_cpurev (ditto)
ci_cpunum -> ci_cpuid

This makes top(1) give correct CPU numbers in its "STATE" column (all 0 for
now).


# 1.43 12-Oct-2002 bjh21

Remember the location of each CPU's idle PCB in struct cpu_info.
Move allocation of the idle PCB from hydra.c to cpu.c and add some
extra initialisation from cpu_fork().


Revision tags: kqueue-base
# 1.42 01-Oct-2002 bjh21

constify various string tables.


# 1.41 06-Sep-2002 gehenna

Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.


Revision tags: gehenna-devsw-base
# 1.40 22-Jul-2002 briggs

Handle i80200 step D0 and i80321 step B0


# 1.39 10-Jul-2002 ichiro

add cpu id for "PXA250/210 3rd version CPUcore".

for using many PDA/xscale-core.


# 1.38 07-Jun-2002 thorpej

Add the CPU ID for the 600MHz i80321 part.


Revision tags: netbsd-1-6-base
# 1.37 12-May-2002 ichiro

branches: 1.37.2; 1.37.4;
change ICP12x0 steppings.
define CPU_IXP12X0


# 1.36 10-May-2002 thorpej

Add IXP1200 steppings.


# 1.35 03-May-2002 thorpej

Add support for the Intel PXA210 and PXA250. From Hiroyuki Bessho, PR 16617.


# 1.34 02-May-2002 rjs

Enable CPU_CLASS_SA1 for SA1100 and SA1110.


# 1.33 12-Apr-2002 thorpej

Centralize ARM CPU configuration information by adding a new header
file, <arm/cpuconf.h>, which pulls in "opt_cputypes.h" and then defines
the following:
* CPU_NTYPES -- now many CPU types are configured into the kernel. What
you really want to know is "== 1" or "> 1".
* Defines ARM_ARCH_2, ARM_ARCH_3, ARM_ARCH_4, ARM_ARCH_5, depending
on which ARM architecture versions are configured (based on CPU_*
options). Also defines ARM_NARCH to determins how many architecture
versions are configured.
* Defines ARM_MMU_MEMC, ARM_MMU_GENERIC, ARM_MMU_XSCALE depending on
which classes of ARM MMUs are configured into the kernel, and ARM_NMMUS
to determine how many MMU classes are configured.

Remove the needless inclusion of "opt_cputypes.h" in several places.
Convert remaining users to <arm/cpuconf.h>.


# 1.32 27-Mar-2002 thorpej

The 80321 manual lies; it does have a CPU ID distinct from the 80200.
Add that CPU ID, and add a case for it.


# 1.31 26-Mar-2002 thorpej

Restructure a few things in order to support other XScale core
I/O processors:
* The i80200 and the i80321 have the same CPU ID, so split the
CPU_XSCALE option into CPU_XSCALE_80200 and CPU_XSCALE_80321
options, and don't let them both be defined at the same time.
XXX May want to revisit this in the future.
* Split some registers common between the i80200 and i80321 into
<arm/xscale/xscalereg.h>.
* Rename a few existing functions.


# 1.30 24-Mar-2002 thorpej

Cache the cpu type and cpu revision in cpu_info.


Revision tags: eeh-devprop-base
# 1.29 16-Mar-2002 bjh21

Only put the CPU type into cpu_model, not the state of the control register.
Instead, print the control register state on the next line at startup.


# 1.28 16-Mar-2002 bjh21

Add CPU ID for the ARM1022ES.
Also add a CPU class for ARM10E processors in general.


# 1.27 11-Mar-2002 reinoud

When ARMFPE wasn't enabled the `usearmfpe' flag was statically initialised
but not used resulting in a compiler error. By splitting the declaration
and the initialisation this is solved.

Better would be to not even declare the flag when ARMFPE isnt enabled but
that would just add to the #ifdef jungle.


# 1.26 10-Mar-2002 bjh21

__RCSID -> __KERNEL_RCSID


# 1.25 10-Mar-2002 bjh21

Re-work the way that FPAs are handled. If ARMFPE isn't configured, don't
even bother probing for an FPA. If ARMFPE is configured, always use it,
even if there's an FPA (since it provides the FPA support code). Move all
printfs about FPAs into armfpe_init.c.

This means I can delete the last two elements from struct _cpu, so that the
structure, and the whole of <arm/cpus.h> is redundant and can be deleted.


# 1.24 10-Mar-2002 bjh21

Remove fpu_model from struct _cpu. Instead, have initialise_arm_fpe()
printf() the FPE version number itself.


# 1.23 10-Mar-2002 bjh21

Add a ci_dev element to struct cpu_info, pointing to the device that
corresponds to the CPU.


Revision tags: newlock-base
# 1.22 10-Mar-2002 bjh21

Kill the fpu_flags element from struct _cpu. It was only ever set to 0
anyway.


# 1.21 10-Mar-2002 bjh21

Clean up inline assembler. Rather than saving R0, copying FPSR to R0,
copying it to the output register and then restoring R0, just copy the
FPSR straight to the output.


# 1.20 09-Mar-2002 bjh21

Remove the cpu_model member from struct _cpu, and just use the cpu_model
variable directly. While we're at it, make cpu_model rather larger.


# 1.19 09-Mar-2002 bjh21

Remove the cpu_class element from struct _cpu, and make it a local variable
in identify_arm_cpu(), since it's almost unused elsewhere.

Change the detection of bugged StrongARMs to use the cpu ID rather than the
class. This turns "almost" into "entirely".


# 1.18 09-Mar-2002 bjh21

Replace cpu_id and cpu_ctrl in struct _cpu with ci_cpuid and ci_ctrl in
struct cpu_info. Also kill the cpuctrl global while we're here, and make
identify_arm_cpu() take a struct cpu_info * as an argument alongside the CPU
number.


# 1.17 09-Mar-2002 bjh21

Move arm700bugcount into stuct cpu_info, and attach it in
identify_master_cpu().


Revision tags: ifpoll-base
# 1.16 17-Feb-2002 bjh21

Our assembler handles FPA instructions fine, so don't use .word for them.


# 1.15 17-Feb-2002 bjh21

ANSIfy, and othe KNF cleanup.


# 1.14 27-Jan-2002 bjh21

Add revision->stepping maps for the SA-110, SA-1100 and SA-1110.
Those for the SA-1100 and SA-1110 are from Intel's documentation.
The mapping for the SA-110 is from various sources on the net, since Intel
don't seem to document it.

Also, change the layout of the maps to have four steppings per line,
so they aren't quite so unwieldy.


# 1.13 24-Jan-2002 thorpej

Use a table to look up stepping names. Add a generic stepping
table ("rev 0", "rev 1", etc.) and an i80200 stepping table that
has the stepping names that appear in the i80200 manuals/errata..


# 1.12 29-Nov-2001 thorpej

Fetch cache info from the Cache Type register on ARM7TDMI and "greater"
processors. Report this when the processor is attached.


# 1.11 24-Nov-2001 thorpej

Move the ARM, Ltd. floating point emulator to arch/arm.


# 1.10 23-Nov-2001 thorpej

Use <arm/undefined.h> instead of <machine/undefined.h>.


Revision tags: thorpej-mips-cache-base
# 1.9 06-Nov-2001 thorpej

branches: 1.9.2;
Const poisoning of cpu/class names.


# 1.8 06-Nov-2001 thorpej

"i80200", not "80200".


# 1.7 06-Nov-2001 thorpej

"XScale", not "Xscale".


# 1.6 18-Oct-2001 rearnsha

branches: 1.6.2;
Support for ARM9.


Revision tags: thorpej-devvp-base3 thorpej-devvp-base2
# 1.5 28-Sep-2001 chris

Add extra arg to fpa_test as it should have 4 args. Also add prototypes for fpa_test and fpa_handler.


Revision tags: post-chs-ubcperf pre-chs-ubcperf thorpej-devvp-base
# 1.4 05-Sep-2001 matt

branches: 1.4.2;
Flesh XSCALE support.


# 1.3 03-Jun-2001 chris

branches: 1.3.2; 1.3.4;
Add support for ARM7TDMI, as provided in a patch from John Fremlin to port-arm32.

Shouldn't effect any currently in tree ports.


# 1.2 13-May-2001 bjh21

Use get_bootconf_option() to find boot options, rather than home-grown
strstr()-based hacks.


Revision tags: thorpej_scsipi_beforemerge thorpej_scsipi_base thorpej_scsipi_nbase
# 1.1 20-Apr-2001 matt

branches: 1.1.2;
Split cpu from mainbus so that cpu can attached to other buses (like ofbus).


# 1.145 20-Jun-2020 skrll

KNF #includes

Remove some unnecessary ones while I'm here.


Revision tags: bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3
# 1.144 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}


Revision tags: ad-namecache-base2
# 1.143 22-Jan-2020 skrll

#ifdef whack-a-mole for the pmap_maxproc_set functionality


# 1.142 20-Jan-2020 skrll

s/_ARM_ARCH_6/ARM_MMU_EXTENDED/ in the #ifdef for the recent 4k pages
change


# 1.141 18-Jan-2020 skrll

Use 4K pages on ARM_MMU_EXTENDED platforms (all armv[67] except RPI) by
creating a new pool l1ttpl for the userland L1 translation table which
needs to be 8KB and 8KB aligned.

Limit the pool to maxproc and add hooks to allow the sysctl changing of
maxproc to adjust the pool.

This comes at a 5% performance penalty for build.sh -j8 kernel on a
Tegra TK1.


Revision tags: ad-namecache-base1
# 1.140 15-Jan-2020 mrg

port the arm64 cpu topology setup for big.little to arm.

rename arm64 cpu_do_topology() to arm_cpu_do_topology() and
call it from both arm cpu_attach().

replace both aarch64_set_topology() inline code in arm
cpu_attach() with new arm_cpu_do_topology(), which is called
by the arm64 locore as well (possibly not needed, which would
allow it to become static.)

not yet tested on a real big.little armv7 system. tested
on rockpro64 and pinebook pro.


# 1.139 09-Jan-2020 ad

- Many small tweaks to the SMT awareness in the scheduler. It does a much
better job now at keeping all physical CPUs busy, while using the extra
threads to help out. In particular, during preempt() if we're using SMT,
try to find a better CPU to run on and teleport curlwp there.

- Change the CPU topology stuff so it can work on asymmetric systems. This
mainly entails rearranging one of the CPU lists so it makes sense in all
configurations.

- Add a parameter to cpu_topology_set() to note that a CPU is "slow", for
where there are fast CPUs and slow CPUs, like with the Rockwell RK3399.
Extend the SMT awareness to try and handle that situation too (keep fast
CPUs busy, use slow CPUs as helpers).


# 1.138 09-Jan-2020 martin

When attaching the first fdtbus, use the root "comptabile" (or failing that:
"model") property to set the cpu model (in userland aka sysctl hw.model).
When attaching the first cpu, do not overwrite a cpu model if it already
had been set.


# 1.137 08-Jan-2020 jmcneill

cpu_hatch is too late to report AP topology, do it at attach time instead


Revision tags: ad-namecache-base
# 1.136 20-Dec-2019 ad

branches: 1.136.2;
Some more CPU topology stuff:

- Use cegger@'s ACPI SRAT parsing code to figure out NUMA node ID for each
CPU as it is attached.

- For scheduler experiments with SMT, flag CPUs with the lowest numbered SMT
IDs as "primaries", link back to the primaries from secondaries, and build
a circular list of CPUs in each package with identical SMT IDs.

- No need for package/core/smt/numa IDs to be anything other than a u_int.


# 1.135 02-Dec-2019 ad

Take the basic CPU topology information we already collect, and use it
to make circular lists of CPU siblings in the same core, and in the
same package. Nothing fancy, just enough to have a bit of fun in the
scheduler trying out different tactics.


Revision tags: phil-wifi-20191119
# 1.134 20-Oct-2019 jmcneill

cpu_hatched_p only for MULTIPROCESSOR


# 1.133 19-Oct-2019 jmcneill

Increase aarch64 MAXCPUS to 256.


# 1.132 29-Sep-2019 skrll

aprint_debug_dev output alignment


# 1.131 08-Sep-2019 tnn

report A12 as A17 to the user. A12 is retcon'ed by ARM.


# 1.130 07-Sep-2019 tnn

Cortex A12 is marketed as A17 but has a distinct part number

observed on Rockchip RK3288


Revision tags: netbsd-9-base phil-wifi-20190609 isaki-audio2-base
# 1.129 17-Mar-2019 skrll

branches: 1.129.4;
Wrap arm_cpu_marker if #ifdef MPDEBUG.

One day a9_mpsubr.S will die


# 1.128 27-Jan-2019 pgoyette

Merge the [pgoyette-compat] branch


Revision tags: pgoyette-compat-20190127
# 1.127 25-Jan-2019 skrll

Make sure ci_{smt,core,package}_id are all filled in appropriately.

Previously the BP was missed and __SHIFTOUT wasn't used.


Revision tags: pgoyette-compat-20190118
# 1.126 03-Jan-2019 jmcneill

Read mpidr and cpuid from the secondary processor itself instead of the
boot processor. While here, add Cortex-A15 r4p0 to supported list.


# 1.125 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.124 02-Jan-2019 skrll

Don't overwrite the setting of cpu_core_id from mpidr


Revision tags: pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020
# 1.123 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.122 08-Oct-2018 skrll

Trialing whitespace


# 1.121 06-Oct-2018 skrll

Use __BIT. NFC.


Revision tags: pgoyette-compat-0930 pgoyette-compat-0906
# 1.120 15-Aug-2018 skrll

KNF


# 1.119 15-Aug-2018 skrll

Fix includes (sys/cdefs.h then sys/param.h)


# 1.118 15-Aug-2018 skrll

Sprinkle #include "opt_cputypes.h"


# 1.117 10-Aug-2018 maxv

Retire CPU_ARM2, CPU_ARM250 and CPU_ARM3, they are all leftovers of
acorn26.

ok jmcneill@ skrll@


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202
# 1.116 16-Sep-2017 matt

branches: 1.116.2; 1.116.4;
Add Cortex-A35 CPU ID.


Revision tags: netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base
# 1.115 01-Jun-2017 chs

branches: 1.115.6;
remove checks for failure after memory allocation calls that cannot fail:

kmem_alloc() with KM_SLEEP
kmem_zalloc() with KM_SLEEP
percpu_alloc()
pserialize_create()
psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.114 11-Jul-2016 kiyohara

Add Cortex-A9 r1.


Revision tags: nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.113 03-Mar-2016 skrll

Get the RPI3 working (in aarch32 mode) by recognising Cortex A53 CPUs.
While I'm here add some A57/A72 info as well.

My RPI3 works with FB console - the uart needs some help with its clocks.


# 1.112 23-Jan-2016 christos

Rename the cpu_id() define to cpu_idnum() so that it does not conflict with
dtrace and friends.


Revision tags: nick-nhusb-base-20151226
# 1.111 12-Nov-2015 jmcneill

change some register dumps from aprint_verbose to aprint_debug


Revision tags: nick-nhusb-base-20150921
# 1.110 08-Jul-2015 skrll

aprint_verbose [sa]ctlr


Revision tags: nick-nhusb-base-20150606
# 1.109 05-Jun-2015 skrll

Print the Revision ID regster (verbose)


# 1.108 17-May-2015 matt

Print out mpidr on MP systems (verbose print)


Revision tags: nick-nhusb-base-20150406
# 1.107 03-Mar-2015 jmcneill

cache type 12 is "write-back", from matt


Revision tags: nick-nhusb-base
# 1.106 27-Nov-2014 matt

branches: 1.106.2;
Add entry for Cortex-A17 r1


# 1.105 01-Sep-2014 reinoud

Increase the `freqbuf' buffer that holds the result of humanize_number(). Now
it prints 1600 Mhz instead of 1 Ghz.
Pitty enough humanize_number(9) doesn't do 1.6 Ghz type output.


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.104 28-Mar-2014 matt

branches: 1.104.4;
Various MP changes.


# 1.103 24-Mar-2014 christos

use cpu_{g,s}etmodel


# 1.102 20-Mar-2014 matt

Define cache type 13


Revision tags: riastradh-drm2-base3
# 1.101 03-Mar-2014 matt

Add most of the cpu_* variables to <arm/locore.h>
Add and initialize cpu_synchprim_present


# 1.100 20-Feb-2014 matt

Keep track of what each cache is (VIVT/VIPT/PIPT).

cpu0: 32KB/32B 2-way L1 VIPT Instruction cache
cpu0: 32KB/64B 4-way write-back-locking-C L1 PIPT Data cache
cpu0: 256KB/64B 8-way write-through L2 PIPT Unified cache


# 1.99 07-Sep-2013 matt

Add a machdep.hwdiv_present sysctl (cortex A7 and A15 have hwdiv instructions)


# 1.98 07-Sep-2013 matt

Add CPU_ID_CORTEXA7R0 entry


# 1.97 18-Aug-2013 matt

Move parts of cpu.h that are not needed by MI code in <arm/locore.h>
Don't include <machine/cpu.h> or <machine/frame.h>, use <arm/locore.h>
Use <arm/asm.h> instead of <machine/arm.h>


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.96 12-Jun-2013 matt

branches: 1.96.2;
Nuke cpu_pfr, just use the armreg_pfr?_read inlines


# 1.95 12-Jun-2013 matt

Use the armreg_pfr?_read inlines.


# 1.94 19-May-2013 rkujawa

Plug support for PJ4B into our ARM CPU infrastructure.

Obtained from Marvell, Semihalf.


Revision tags: agc-symver-base
# 1.93 03-Feb-2013 matt

Add a machdep.cpu_arch sysctl


# 1.92 31-Jan-2013 matt

Add simple sysctls for cpu_id, fpu_id, neon_present, simd_present,
simdex_present.
Add struct sysctls to return the isar, mmfr, pfr, and mvfr sets.


Revision tags: yamt-pagecache-base8 yamt-pagecache-base7
# 1.91 05-Dec-2012 matt

ARMFPE hasn't compiled since NetBSD 4. Remove it.
Complete support for FPU_VFP.
fpregs now contains vfpreg.
XXX vfpreg only has space for 16 64-bit FP registers though VFPv3 and later
have 32 64-bit FP registers.


# 1.90 30-Nov-2012 msaitoh

Use snprintf() instead of sprintf().


# 1.89 30-Nov-2012 msaitoh

s/,/;/


# 1.88 12-Nov-2012 skrll

C99 types


Revision tags: yamt-pagecache-base6
# 1.87 22-Sep-2012 matt

Don't use an asm in pmap_activate to update the TTBR, use cpu_setttb instead
but add a second argument to it to indicate whether the TLB/caches need to be
flushed. Default cortex to pmap_needs_fixup = 1. But check the MMFR3 field
to see if the fixed can be skipped.
Use a cf_flag bit 0 to indicate whether the A9 L2 cache should disable (bit 0 = 1)
or enabeld (bit = 0).

With these changes, the A9 MMU can use traverse caches to do MMU tablewalks
Also, make sure all memory has the shareable bit for the A9.


# 1.86 07-Sep-2012 matt

branches: 1.86.2;
Switch cortex_a9 back to need_ptesync = 1
Add code to disable the L2 cache on cortex-a9 (for now).
Add evcnt for all the fault types.
Move cache info in a structure and have one for the pcache and one for scache.
Probe L1/L2 caches properly for ARMv7


# 1.85 29-Aug-2012 matt

Use new armv7 CP15 register to print out cache types.
If the cpu_cc_freq is set, report it.
Add macros to make inlines for reading/writing co-processor registers.


# 1.84 14-Aug-2012 matt

Use device_t


# 1.83 12-Aug-2012 matt

Rework VFP support to use PCU.
Add emulation of instruction which save/restore the VFP FPSCR.
Add a sysarch hook to VFP FPSCR manipulation.

[The emulation will be used by libc to store/fetch exception modes and
rounding mode on a per-thread basis.]


# 1.82 14-Jul-2012 matt

Refresh cortex cpus


Revision tags: jmcneill-usbmp-base10 yamt-pagecache-base5
# 1.81 20-May-2012 skrll

Remove the ARM1156T2 bloat - it only has an MPU. Prompted by matt@


# 1.80 20-May-2012 skrll

Add the ARM1156T2-S


# 1.79 20-May-2012 skrll

Add the 'Z' to the 1176 cpu product name.

ok matt@


Revision tags: jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base jym-xensuspend-nbase rmind-uvmplock-base jym-xensuspend-base
# 1.78 10-Mar-2011 bsh

branches: 1.78.4; 1.78.8; 1.78.10;
add MPCore to CPU-ID table
add branch predict bit to arm11_options


Revision tags: uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11
# 1.77 02-Oct-2010 kiyohara

branches: 1.77.2;
Add support Marvell Sheeva Core and SoC. (Orion/Kirkwood)
Discovery Innovation not yet.


Revision tags: uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.76 19-Jun-2010 matt

Fix cache probing on Cortex. Add missing CORTEX dependency in cpu.c


# 1.75 19-Jun-2010 matt

Fix c&p error.


# 1.74 19-Jun-2010 matt

Cleanup the armv7 changes. Add ARM_ARCH_7. Use CPU_CORTEX instead of
CPU_CORTEXA8 everywhere since there more types of Cortex than just the A8.
CPU_CORTEXA8 still exists but causes CPU_CORTEX to be defined.
Add CPU_CORTEXA9 as well. Use .arch armv7a to get us the isb/dsb
instructions.

Test booted to root device prompt on a Beagleboard.
All ARM kernels successfully test built.


# 1.73 16-Jun-2010 jmcneill

PR port-arm/43299: Support added for igepv2/cortexa8/omap3530

Apply patch from PR, with build fixes. ok skrll, matt


Revision tags: uebayasi-xip-base1 yamt-nfs-mp-base9 uebayasi-xip-base
# 1.72 23-Jan-2010 mrg

branches: 1.72.2; 1.72.4;
rename a local cpu_name structure member to avoid potential conflict
with <sys/cpu.h>'s.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-premerge-20091211 yamt-nfs-mp-base8 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 yamt-nfs-mp-base7 netbsd-5-0-1-RELEASE jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base nick-hppapmap-base haad-dm-base mjf-devfs2-base
# 1.71 25-Oct-2008 matt

branches: 1.71.4; 1.71.12;
Fix some missing things for CPU_ID_FA526.


Revision tags: matt-mips64-base2
# 1.70 24-Oct-2008 matt

Add entry for FA526.


# 1.69 21-Oct-2008 matt

Add Cortex cpus


Revision tags: haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base
# 1.68 27-Apr-2008 matt

branches: 1.68.6;
Merge kernel changes in matt-armv6 to HEAD.


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 chris-arm-intr-rework-base7 keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.67 15-Mar-2008 rearnsha

branches: 1.67.2; 1.67.4;
VFP support.


Revision tags: nick-net80211-sync-base chris-arm-intr-rework-base6 chris-arm-intr-rework-base5 chris-arm-intr-rework-base4 bouyer-xeni386-merge1 chris-arm-intr-rework-base3 vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 jmcneill-base mjf-devfs-base bouyer-xenamd64-base2 vmlocking-nbase yamt-x86pmap-base4 bouyer-xenamd64-base matt-armv6-base jmcneill-pm-base hpcarm-cleanup-base reinoud-bufcleanup-base
# 1.66 17-Oct-2007 garbled

branches: 1.66.12; 1.66.16;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base chris-arm-intr-rework-base2 chris-arm-intr-rework-base nick-csl-alignment-base matt-mips64-base ppcoea-renovation-base mjf-ufs-trans-base vmlocking-base
# 1.65 17-May-2007 yamt

branches: 1.65.10; 1.65.12;
merge yamt-idlelwp branch. asked by core@. some ports still needs work.

from doc/BRANCHES:

idle lwp, and some changes depending on it.

1. separate context switching and thread scheduling.
(cf. gmcgarry_ctxsw)
2. implement idle lwp.
3. clean up related MD/MI interfaces.
4. make scheduler(s) modular.


Revision tags: yamt-idlelwp-base8 thorpej-atomic-base ad-audiomp-base post-newlock2-merge newlock2-nbase newlock2-base
# 1.64 06-Jan-2007 christos

branches: 1.64.2; 1.64.6; 1.64.8; 1.64.14;
Scott Allan in http://mail-index.netbsd.org/port-arm/2006/07/31/0000.html
Patch to add support for ARM9E


# 1.63 06-Jan-2007 christos

From Scott Alan in http://mail-index.netbsd.org/port-arm/2006/07/26/0000.html
identify_arm_cpu() prints out a helpful message when it detects that you're
trying to run on a CPU that you didn't configure for. Unfortunately, the
check for class_option being NULL is backward, so it either won't print the
class_option, or it will try to dereference a NULL. The patch just flips the
!= NULL to be == NULL.


Revision tags: yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 abandoned-netbsd-4-base yamt-splraiseipl-base2 yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 netbsd-4-base yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base elad-kernelauth-base simonb-timecounters-base rpaulo-netinet-merge-pcb-base
# 1.62 15-Mar-2006 drochner

branches: 1.62.10; 1.62.14;
use km_alloc to get wired kernel memory for kernel stacks
of idle processes for secondary CPUs
(affects the MULTIPROCESSOR case only - does this exist?)
(untested)


Revision tags: yamt-pdpolicy-base2 yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.61 11-Dec-2005 christos

branches: 1.61.4; 1.61.6; 1.61.8; 1.61.10;
merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.60 20-Jul-2005 nonaka

Added i80219.


# 1.59 04-Jul-2005 bsh

branches: 1.59.2;
The first step to support Intel PXA270.

kernel config option CPU_XSCALE_PXA2X0 is now obsoleted by
CPU_XSCALE_PXA250 and CPU_XSCALE_PXA270. If both of them are defined,
CPU is determined run-time.


# 1.58 03-Jun-2005 rearnsha

Very basic support for the ARM1136.

This code takes no advantage of any 'new' features provided by
architecture 6 devices (such as physically tagged caches or new
MMU features), and basically runs the chip in a 'legacy v5' mode.


# 1.57 10-May-2005 rearnsha

Add support for arm1026ej-s.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 yamt-km-base4 yamt-km-base3 netbsd-3-base yamt-km-base2 yamt-km-base kent-audio2-base kent-audio1-beforemerge kent-audio1-base
# 1.56 14-Apr-2004 bsh

distinguish PXA255/26x from PXA2[15]0 in CPU attach message


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.55 13-Feb-2004 wiz

Uppercase CPU, plural is CPUs.


# 1.54 26-Oct-2003 chris

Fix up some unitialised variables.


# 1.53 06-Sep-2003 rearnsha

Support for ARM10E class devices.


# 1.52 03-Sep-2003 mycroft

Recognize some TI processors -- not that you'd want to use them.


# 1.51 23-Jun-2003 martin

branches: 1.51.2;
Make sure to include opt_foo.h if a defflag option FOO is used.


# 1.50 23-May-2003 ichiro

support IXP425 Intel Network Processor
running on BigEndian


# 1.49 29-Apr-2003 thorpej

Use aprint*().


# 1.48 14-Feb-2003 rjs

Add CPU IDs for PXA B2 and C0 steppings.


Revision tags: nathanw_sa_before_merge nathanw_sa_base
# 1.47 06-Jan-2003 wiz

specified, not specifed.


Revision tags: fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base
# 1.46 17-Nov-2002 chs

change uvm_uarea_alloc() to indicate whether the returned uarea is already
backed by physical pages (ie. because it reused a previously-freed one),
so that we can skip a bunch of useless work in that case.
this fixes the underlying problem behind PR 18543, and also speeds up fork()
quite a bit (eg. 7% on my pc, 1% on my ultra2) when we get a cache hit.


Revision tags: kqueue-aftermerge kqueue-beforemerge bjh21-hydra-base
# 1.45 13-Oct-2002 chris

branches: 1.45.2;
Fix arm kernel build breaks for non multiprocessor systems.


# 1.44 13-Oct-2002 bjh21

It appears that MI code requires ci_cpuid to be the CPU number of the CPU
in question, whereas the ARM code was using it to hold the model
identification. To fix this, rename:

ci_cpuid -> ci_arm_cpuid
ci_cputype -> ci_arm_cputype (for consistency)
ci_cpurev -> ci_arm_cpurev (ditto)
ci_cpunum -> ci_cpuid

This makes top(1) give correct CPU numbers in its "STATE" column (all 0 for
now).


# 1.43 12-Oct-2002 bjh21

Remember the location of each CPU's idle PCB in struct cpu_info.
Move allocation of the idle PCB from hydra.c to cpu.c and add some
extra initialisation from cpu_fork().


Revision tags: kqueue-base
# 1.42 01-Oct-2002 bjh21

constify various string tables.


# 1.41 06-Sep-2002 gehenna

Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.


Revision tags: gehenna-devsw-base
# 1.40 22-Jul-2002 briggs

Handle i80200 step D0 and i80321 step B0


# 1.39 10-Jul-2002 ichiro

add cpu id for "PXA250/210 3rd version CPUcore".

for using many PDA/xscale-core.


# 1.38 07-Jun-2002 thorpej

Add the CPU ID for the 600MHz i80321 part.


Revision tags: netbsd-1-6-base
# 1.37 12-May-2002 ichiro

branches: 1.37.2; 1.37.4;
change ICP12x0 steppings.
define CPU_IXP12X0


# 1.36 10-May-2002 thorpej

Add IXP1200 steppings.


# 1.35 03-May-2002 thorpej

Add support for the Intel PXA210 and PXA250. From Hiroyuki Bessho, PR 16617.


# 1.34 02-May-2002 rjs

Enable CPU_CLASS_SA1 for SA1100 and SA1110.


# 1.33 12-Apr-2002 thorpej

Centralize ARM CPU configuration information by adding a new header
file, <arm/cpuconf.h>, which pulls in "opt_cputypes.h" and then defines
the following:
* CPU_NTYPES -- now many CPU types are configured into the kernel. What
you really want to know is "== 1" or "> 1".
* Defines ARM_ARCH_2, ARM_ARCH_3, ARM_ARCH_4, ARM_ARCH_5, depending
on which ARM architecture versions are configured (based on CPU_*
options). Also defines ARM_NARCH to determins how many architecture
versions are configured.
* Defines ARM_MMU_MEMC, ARM_MMU_GENERIC, ARM_MMU_XSCALE depending on
which classes of ARM MMUs are configured into the kernel, and ARM_NMMUS
to determine how many MMU classes are configured.

Remove the needless inclusion of "opt_cputypes.h" in several places.
Convert remaining users to <arm/cpuconf.h>.


# 1.32 27-Mar-2002 thorpej

The 80321 manual lies; it does have a CPU ID distinct from the 80200.
Add that CPU ID, and add a case for it.


# 1.31 26-Mar-2002 thorpej

Restructure a few things in order to support other XScale core
I/O processors:
* The i80200 and the i80321 have the same CPU ID, so split the
CPU_XSCALE option into CPU_XSCALE_80200 and CPU_XSCALE_80321
options, and don't let them both be defined at the same time.
XXX May want to revisit this in the future.
* Split some registers common between the i80200 and i80321 into
<arm/xscale/xscalereg.h>.
* Rename a few existing functions.


# 1.30 24-Mar-2002 thorpej

Cache the cpu type and cpu revision in cpu_info.


Revision tags: eeh-devprop-base
# 1.29 16-Mar-2002 bjh21

Only put the CPU type into cpu_model, not the state of the control register.
Instead, print the control register state on the next line at startup.


# 1.28 16-Mar-2002 bjh21

Add CPU ID for the ARM1022ES.
Also add a CPU class for ARM10E processors in general.


# 1.27 11-Mar-2002 reinoud

When ARMFPE wasn't enabled the `usearmfpe' flag was statically initialised
but not used resulting in a compiler error. By splitting the declaration
and the initialisation this is solved.

Better would be to not even declare the flag when ARMFPE isnt enabled but
that would just add to the #ifdef jungle.


# 1.26 10-Mar-2002 bjh21

__RCSID -> __KERNEL_RCSID


# 1.25 10-Mar-2002 bjh21

Re-work the way that FPAs are handled. If ARMFPE isn't configured, don't
even bother probing for an FPA. If ARMFPE is configured, always use it,
even if there's an FPA (since it provides the FPA support code). Move all
printfs about FPAs into armfpe_init.c.

This means I can delete the last two elements from struct _cpu, so that the
structure, and the whole of <arm/cpus.h> is redundant and can be deleted.


# 1.24 10-Mar-2002 bjh21

Remove fpu_model from struct _cpu. Instead, have initialise_arm_fpe()
printf() the FPE version number itself.


# 1.23 10-Mar-2002 bjh21

Add a ci_dev element to struct cpu_info, pointing to the device that
corresponds to the CPU.


Revision tags: newlock-base
# 1.22 10-Mar-2002 bjh21

Kill the fpu_flags element from struct _cpu. It was only ever set to 0
anyway.


# 1.21 10-Mar-2002 bjh21

Clean up inline assembler. Rather than saving R0, copying FPSR to R0,
copying it to the output register and then restoring R0, just copy the
FPSR straight to the output.


# 1.20 09-Mar-2002 bjh21

Remove the cpu_model member from struct _cpu, and just use the cpu_model
variable directly. While we're at it, make cpu_model rather larger.


# 1.19 09-Mar-2002 bjh21

Remove the cpu_class element from struct _cpu, and make it a local variable
in identify_arm_cpu(), since it's almost unused elsewhere.

Change the detection of bugged StrongARMs to use the cpu ID rather than the
class. This turns "almost" into "entirely".


# 1.18 09-Mar-2002 bjh21

Replace cpu_id and cpu_ctrl in struct _cpu with ci_cpuid and ci_ctrl in
struct cpu_info. Also kill the cpuctrl global while we're here, and make
identify_arm_cpu() take a struct cpu_info * as an argument alongside the CPU
number.


# 1.17 09-Mar-2002 bjh21

Move arm700bugcount into stuct cpu_info, and attach it in
identify_master_cpu().


Revision tags: ifpoll-base
# 1.16 17-Feb-2002 bjh21

Our assembler handles FPA instructions fine, so don't use .word for them.


# 1.15 17-Feb-2002 bjh21

ANSIfy, and othe KNF cleanup.


# 1.14 27-Jan-2002 bjh21

Add revision->stepping maps for the SA-110, SA-1100 and SA-1110.
Those for the SA-1100 and SA-1110 are from Intel's documentation.
The mapping for the SA-110 is from various sources on the net, since Intel
don't seem to document it.

Also, change the layout of the maps to have four steppings per line,
so they aren't quite so unwieldy.


# 1.13 24-Jan-2002 thorpej

Use a table to look up stepping names. Add a generic stepping
table ("rev 0", "rev 1", etc.) and an i80200 stepping table that
has the stepping names that appear in the i80200 manuals/errata..


# 1.12 29-Nov-2001 thorpej

Fetch cache info from the Cache Type register on ARM7TDMI and "greater"
processors. Report this when the processor is attached.


# 1.11 24-Nov-2001 thorpej

Move the ARM, Ltd. floating point emulator to arch/arm.


# 1.10 23-Nov-2001 thorpej

Use <arm/undefined.h> instead of <machine/undefined.h>.


Revision tags: thorpej-mips-cache-base
# 1.9 06-Nov-2001 thorpej

branches: 1.9.2;
Const poisoning of cpu/class names.


# 1.8 06-Nov-2001 thorpej

"i80200", not "80200".


# 1.7 06-Nov-2001 thorpej

"XScale", not "Xscale".


# 1.6 18-Oct-2001 rearnsha

branches: 1.6.2;
Support for ARM9.


Revision tags: thorpej-devvp-base3 thorpej-devvp-base2
# 1.5 28-Sep-2001 chris

Add extra arg to fpa_test as it should have 4 args. Also add prototypes for fpa_test and fpa_handler.


Revision tags: post-chs-ubcperf pre-chs-ubcperf thorpej-devvp-base
# 1.4 05-Sep-2001 matt

branches: 1.4.2;
Flesh XSCALE support.


# 1.3 03-Jun-2001 chris

branches: 1.3.2; 1.3.4;
Add support for ARM7TDMI, as provided in a patch from John Fremlin to port-arm32.

Shouldn't effect any currently in tree ports.


# 1.2 13-May-2001 bjh21

Use get_bootconf_option() to find boot options, rather than home-grown
strstr()-based hacks.


Revision tags: thorpej_scsipi_beforemerge thorpej_scsipi_base thorpej_scsipi_nbase
# 1.1 20-Apr-2001 matt

branches: 1.1.2;
Split cpu from mainbus so that cpu can attached to other buses (like ofbus).


# 1.144 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}


Revision tags: ad-namecache-base2
# 1.143 22-Jan-2020 skrll

#ifdef whack-a-mole for the pmap_maxproc_set functionality


# 1.142 20-Jan-2020 skrll

s/_ARM_ARCH_6/ARM_MMU_EXTENDED/ in the #ifdef for the recent 4k pages
change


# 1.141 18-Jan-2020 skrll

Use 4K pages on ARM_MMU_EXTENDED platforms (all armv[67] except RPI) by
creating a new pool l1ttpl for the userland L1 translation table which
needs to be 8KB and 8KB aligned.

Limit the pool to maxproc and add hooks to allow the sysctl changing of
maxproc to adjust the pool.

This comes at a 5% performance penalty for build.sh -j8 kernel on a
Tegra TK1.


Revision tags: ad-namecache-base1
# 1.140 15-Jan-2020 mrg

port the arm64 cpu topology setup for big.little to arm.

rename arm64 cpu_do_topology() to arm_cpu_do_topology() and
call it from both arm cpu_attach().

replace both aarch64_set_topology() inline code in arm
cpu_attach() with new arm_cpu_do_topology(), which is called
by the arm64 locore as well (possibly not needed, which would
allow it to become static.)

not yet tested on a real big.little armv7 system. tested
on rockpro64 and pinebook pro.


# 1.139 09-Jan-2020 ad

- Many small tweaks to the SMT awareness in the scheduler. It does a much
better job now at keeping all physical CPUs busy, while using the extra
threads to help out. In particular, during preempt() if we're using SMT,
try to find a better CPU to run on and teleport curlwp there.

- Change the CPU topology stuff so it can work on asymmetric systems. This
mainly entails rearranging one of the CPU lists so it makes sense in all
configurations.

- Add a parameter to cpu_topology_set() to note that a CPU is "slow", for
where there are fast CPUs and slow CPUs, like with the Rockwell RK3399.
Extend the SMT awareness to try and handle that situation too (keep fast
CPUs busy, use slow CPUs as helpers).


# 1.138 09-Jan-2020 martin

When attaching the first fdtbus, use the root "comptabile" (or failing that:
"model") property to set the cpu model (in userland aka sysctl hw.model).
When attaching the first cpu, do not overwrite a cpu model if it already
had been set.


# 1.137 08-Jan-2020 jmcneill

cpu_hatch is too late to report AP topology, do it at attach time instead


Revision tags: ad-namecache-base
# 1.136 20-Dec-2019 ad

branches: 1.136.2;
Some more CPU topology stuff:

- Use cegger@'s ACPI SRAT parsing code to figure out NUMA node ID for each
CPU as it is attached.

- For scheduler experiments with SMT, flag CPUs with the lowest numbered SMT
IDs as "primaries", link back to the primaries from secondaries, and build
a circular list of CPUs in each package with identical SMT IDs.

- No need for package/core/smt/numa IDs to be anything other than a u_int.


# 1.135 02-Dec-2019 ad

Take the basic CPU topology information we already collect, and use it
to make circular lists of CPU siblings in the same core, and in the
same package. Nothing fancy, just enough to have a bit of fun in the
scheduler trying out different tactics.


Revision tags: phil-wifi-20191119
# 1.134 20-Oct-2019 jmcneill

cpu_hatched_p only for MULTIPROCESSOR


# 1.133 19-Oct-2019 jmcneill

Increase aarch64 MAXCPUS to 256.


# 1.132 29-Sep-2019 skrll

aprint_debug_dev output alignment


# 1.131 08-Sep-2019 tnn

report A12 as A17 to the user. A12 is retcon'ed by ARM.


# 1.130 07-Sep-2019 tnn

Cortex A12 is marketed as A17 but has a distinct part number

observed on Rockchip RK3288


Revision tags: netbsd-9-base phil-wifi-20190609 isaki-audio2-base
# 1.129 17-Mar-2019 skrll

branches: 1.129.4;
Wrap arm_cpu_marker if #ifdef MPDEBUG.

One day a9_mpsubr.S will die


# 1.128 27-Jan-2019 pgoyette

Merge the [pgoyette-compat] branch


Revision tags: pgoyette-compat-20190127
# 1.127 25-Jan-2019 skrll

Make sure ci_{smt,core,package}_id are all filled in appropriately.

Previously the BP was missed and __SHIFTOUT wasn't used.


Revision tags: pgoyette-compat-20190118
# 1.126 03-Jan-2019 jmcneill

Read mpidr and cpuid from the secondary processor itself instead of the
boot processor. While here, add Cortex-A15 r4p0 to supported list.


# 1.125 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.124 02-Jan-2019 skrll

Don't overwrite the setting of cpu_core_id from mpidr


Revision tags: pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020
# 1.123 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.122 08-Oct-2018 skrll

Trialing whitespace


# 1.121 06-Oct-2018 skrll

Use __BIT. NFC.


Revision tags: pgoyette-compat-0930 pgoyette-compat-0906
# 1.120 15-Aug-2018 skrll

KNF


# 1.119 15-Aug-2018 skrll

Fix includes (sys/cdefs.h then sys/param.h)


# 1.118 15-Aug-2018 skrll

Sprinkle #include "opt_cputypes.h"


# 1.117 10-Aug-2018 maxv

Retire CPU_ARM2, CPU_ARM250 and CPU_ARM3, they are all leftovers of
acorn26.

ok jmcneill@ skrll@


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202
# 1.116 16-Sep-2017 matt

branches: 1.116.2; 1.116.4;
Add Cortex-A35 CPU ID.


Revision tags: netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base
# 1.115 01-Jun-2017 chs

branches: 1.115.6;
remove checks for failure after memory allocation calls that cannot fail:

kmem_alloc() with KM_SLEEP
kmem_zalloc() with KM_SLEEP
percpu_alloc()
pserialize_create()
psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.114 11-Jul-2016 kiyohara

Add Cortex-A9 r1.


Revision tags: nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.113 03-Mar-2016 skrll

Get the RPI3 working (in aarch32 mode) by recognising Cortex A53 CPUs.
While I'm here add some A57/A72 info as well.

My RPI3 works with FB console - the uart needs some help with its clocks.


# 1.112 23-Jan-2016 christos

Rename the cpu_id() define to cpu_idnum() so that it does not conflict with
dtrace and friends.


Revision tags: nick-nhusb-base-20151226
# 1.111 12-Nov-2015 jmcneill

change some register dumps from aprint_verbose to aprint_debug


Revision tags: nick-nhusb-base-20150921
# 1.110 08-Jul-2015 skrll

aprint_verbose [sa]ctlr


Revision tags: nick-nhusb-base-20150606
# 1.109 05-Jun-2015 skrll

Print the Revision ID regster (verbose)


# 1.108 17-May-2015 matt

Print out mpidr on MP systems (verbose print)


Revision tags: nick-nhusb-base-20150406
# 1.107 03-Mar-2015 jmcneill

cache type 12 is "write-back", from matt


Revision tags: nick-nhusb-base
# 1.106 27-Nov-2014 matt

branches: 1.106.2;
Add entry for Cortex-A17 r1


# 1.105 01-Sep-2014 reinoud

Increase the `freqbuf' buffer that holds the result of humanize_number(). Now
it prints 1600 Mhz instead of 1 Ghz.
Pitty enough humanize_number(9) doesn't do 1.6 Ghz type output.


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.104 28-Mar-2014 matt

branches: 1.104.4;
Various MP changes.


# 1.103 24-Mar-2014 christos

use cpu_{g,s}etmodel


# 1.102 20-Mar-2014 matt

Define cache type 13


Revision tags: riastradh-drm2-base3
# 1.101 03-Mar-2014 matt

Add most of the cpu_* variables to <arm/locore.h>
Add and initialize cpu_synchprim_present


# 1.100 20-Feb-2014 matt

Keep track of what each cache is (VIVT/VIPT/PIPT).

cpu0: 32KB/32B 2-way L1 VIPT Instruction cache
cpu0: 32KB/64B 4-way write-back-locking-C L1 PIPT Data cache
cpu0: 256KB/64B 8-way write-through L2 PIPT Unified cache


# 1.99 07-Sep-2013 matt

Add a machdep.hwdiv_present sysctl (cortex A7 and A15 have hwdiv instructions)


# 1.98 07-Sep-2013 matt

Add CPU_ID_CORTEXA7R0 entry


# 1.97 18-Aug-2013 matt

Move parts of cpu.h that are not needed by MI code in <arm/locore.h>
Don't include <machine/cpu.h> or <machine/frame.h>, use <arm/locore.h>
Use <arm/asm.h> instead of <machine/arm.h>


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.96 12-Jun-2013 matt

branches: 1.96.2;
Nuke cpu_pfr, just use the armreg_pfr?_read inlines


# 1.95 12-Jun-2013 matt

Use the armreg_pfr?_read inlines.


# 1.94 19-May-2013 rkujawa

Plug support for PJ4B into our ARM CPU infrastructure.

Obtained from Marvell, Semihalf.


Revision tags: agc-symver-base
# 1.93 03-Feb-2013 matt

Add a machdep.cpu_arch sysctl


# 1.92 31-Jan-2013 matt

Add simple sysctls for cpu_id, fpu_id, neon_present, simd_present,
simdex_present.
Add struct sysctls to return the isar, mmfr, pfr, and mvfr sets.


Revision tags: yamt-pagecache-base8 yamt-pagecache-base7
# 1.91 05-Dec-2012 matt

ARMFPE hasn't compiled since NetBSD 4. Remove it.
Complete support for FPU_VFP.
fpregs now contains vfpreg.
XXX vfpreg only has space for 16 64-bit FP registers though VFPv3 and later
have 32 64-bit FP registers.


# 1.90 30-Nov-2012 msaitoh

Use snprintf() instead of sprintf().


# 1.89 30-Nov-2012 msaitoh

s/,/;/


# 1.88 12-Nov-2012 skrll

C99 types


Revision tags: yamt-pagecache-base6
# 1.87 22-Sep-2012 matt

Don't use an asm in pmap_activate to update the TTBR, use cpu_setttb instead
but add a second argument to it to indicate whether the TLB/caches need to be
flushed. Default cortex to pmap_needs_fixup = 1. But check the MMFR3 field
to see if the fixed can be skipped.
Use a cf_flag bit 0 to indicate whether the A9 L2 cache should disable (bit 0 = 1)
or enabeld (bit = 0).

With these changes, the A9 MMU can use traverse caches to do MMU tablewalks
Also, make sure all memory has the shareable bit for the A9.


# 1.86 07-Sep-2012 matt

branches: 1.86.2;
Switch cortex_a9 back to need_ptesync = 1
Add code to disable the L2 cache on cortex-a9 (for now).
Add evcnt for all the fault types.
Move cache info in a structure and have one for the pcache and one for scache.
Probe L1/L2 caches properly for ARMv7


# 1.85 29-Aug-2012 matt

Use new armv7 CP15 register to print out cache types.
If the cpu_cc_freq is set, report it.
Add macros to make inlines for reading/writing co-processor registers.


# 1.84 14-Aug-2012 matt

Use device_t


# 1.83 12-Aug-2012 matt

Rework VFP support to use PCU.
Add emulation of instruction which save/restore the VFP FPSCR.
Add a sysarch hook to VFP FPSCR manipulation.

[The emulation will be used by libc to store/fetch exception modes and
rounding mode on a per-thread basis.]


# 1.82 14-Jul-2012 matt

Refresh cortex cpus


Revision tags: jmcneill-usbmp-base10 yamt-pagecache-base5
# 1.81 20-May-2012 skrll

Remove the ARM1156T2 bloat - it only has an MPU. Prompted by matt@


# 1.80 20-May-2012 skrll

Add the ARM1156T2-S


# 1.79 20-May-2012 skrll

Add the 'Z' to the 1176 cpu product name.

ok matt@


Revision tags: jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base jym-xensuspend-nbase rmind-uvmplock-base jym-xensuspend-base
# 1.78 10-Mar-2011 bsh

branches: 1.78.4; 1.78.8; 1.78.10;
add MPCore to CPU-ID table
add branch predict bit to arm11_options


Revision tags: uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11
# 1.77 02-Oct-2010 kiyohara

branches: 1.77.2;
Add support Marvell Sheeva Core and SoC. (Orion/Kirkwood)
Discovery Innovation not yet.


Revision tags: uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.76 19-Jun-2010 matt

Fix cache probing on Cortex. Add missing CORTEX dependency in cpu.c


# 1.75 19-Jun-2010 matt

Fix c&p error.


# 1.74 19-Jun-2010 matt

Cleanup the armv7 changes. Add ARM_ARCH_7. Use CPU_CORTEX instead of
CPU_CORTEXA8 everywhere since there more types of Cortex than just the A8.
CPU_CORTEXA8 still exists but causes CPU_CORTEX to be defined.
Add CPU_CORTEXA9 as well. Use .arch armv7a to get us the isb/dsb
instructions.

Test booted to root device prompt on a Beagleboard.
All ARM kernels successfully test built.


# 1.73 16-Jun-2010 jmcneill

PR port-arm/43299: Support added for igepv2/cortexa8/omap3530

Apply patch from PR, with build fixes. ok skrll, matt


Revision tags: uebayasi-xip-base1 yamt-nfs-mp-base9 uebayasi-xip-base
# 1.72 23-Jan-2010 mrg

branches: 1.72.2; 1.72.4;
rename a local cpu_name structure member to avoid potential conflict
with <sys/cpu.h>'s.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-premerge-20091211 yamt-nfs-mp-base8 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 yamt-nfs-mp-base7 netbsd-5-0-1-RELEASE jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base nick-hppapmap-base haad-dm-base mjf-devfs2-base
# 1.71 25-Oct-2008 matt

branches: 1.71.4; 1.71.12;
Fix some missing things for CPU_ID_FA526.


Revision tags: matt-mips64-base2
# 1.70 24-Oct-2008 matt

Add entry for FA526.


# 1.69 21-Oct-2008 matt

Add Cortex cpus


Revision tags: haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base
# 1.68 27-Apr-2008 matt

branches: 1.68.6;
Merge kernel changes in matt-armv6 to HEAD.


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 chris-arm-intr-rework-base7 keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.67 15-Mar-2008 rearnsha

branches: 1.67.2; 1.67.4;
VFP support.


Revision tags: nick-net80211-sync-base chris-arm-intr-rework-base6 chris-arm-intr-rework-base5 chris-arm-intr-rework-base4 bouyer-xeni386-merge1 chris-arm-intr-rework-base3 vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 jmcneill-base mjf-devfs-base bouyer-xenamd64-base2 vmlocking-nbase yamt-x86pmap-base4 bouyer-xenamd64-base matt-armv6-base jmcneill-pm-base hpcarm-cleanup-base reinoud-bufcleanup-base
# 1.66 17-Oct-2007 garbled

branches: 1.66.12; 1.66.16;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base chris-arm-intr-rework-base2 chris-arm-intr-rework-base nick-csl-alignment-base matt-mips64-base ppcoea-renovation-base mjf-ufs-trans-base vmlocking-base
# 1.65 17-May-2007 yamt

branches: 1.65.10; 1.65.12;
merge yamt-idlelwp branch. asked by core@. some ports still needs work.

from doc/BRANCHES:

idle lwp, and some changes depending on it.

1. separate context switching and thread scheduling.
(cf. gmcgarry_ctxsw)
2. implement idle lwp.
3. clean up related MD/MI interfaces.
4. make scheduler(s) modular.


Revision tags: yamt-idlelwp-base8 thorpej-atomic-base ad-audiomp-base post-newlock2-merge newlock2-nbase newlock2-base
# 1.64 06-Jan-2007 christos

branches: 1.64.2; 1.64.6; 1.64.8; 1.64.14;
Scott Allan in http://mail-index.netbsd.org/port-arm/2006/07/31/0000.html
Patch to add support for ARM9E


# 1.63 06-Jan-2007 christos

From Scott Alan in http://mail-index.netbsd.org/port-arm/2006/07/26/0000.html
identify_arm_cpu() prints out a helpful message when it detects that you're
trying to run on a CPU that you didn't configure for. Unfortunately, the
check for class_option being NULL is backward, so it either won't print the
class_option, or it will try to dereference a NULL. The patch just flips the
!= NULL to be == NULL.


Revision tags: yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 abandoned-netbsd-4-base yamt-splraiseipl-base2 yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 netbsd-4-base yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base elad-kernelauth-base simonb-timecounters-base rpaulo-netinet-merge-pcb-base
# 1.62 15-Mar-2006 drochner

branches: 1.62.10; 1.62.14;
use km_alloc to get wired kernel memory for kernel stacks
of idle processes for secondary CPUs
(affects the MULTIPROCESSOR case only - does this exist?)
(untested)


Revision tags: yamt-pdpolicy-base2 yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.61 11-Dec-2005 christos

branches: 1.61.4; 1.61.6; 1.61.8; 1.61.10;
merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.60 20-Jul-2005 nonaka

Added i80219.


# 1.59 04-Jul-2005 bsh

branches: 1.59.2;
The first step to support Intel PXA270.

kernel config option CPU_XSCALE_PXA2X0 is now obsoleted by
CPU_XSCALE_PXA250 and CPU_XSCALE_PXA270. If both of them are defined,
CPU is determined run-time.


# 1.58 03-Jun-2005 rearnsha

Very basic support for the ARM1136.

This code takes no advantage of any 'new' features provided by
architecture 6 devices (such as physically tagged caches or new
MMU features), and basically runs the chip in a 'legacy v5' mode.


# 1.57 10-May-2005 rearnsha

Add support for arm1026ej-s.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 yamt-km-base4 yamt-km-base3 netbsd-3-base yamt-km-base2 yamt-km-base kent-audio2-base kent-audio1-beforemerge kent-audio1-base
# 1.56 14-Apr-2004 bsh

distinguish PXA255/26x from PXA2[15]0 in CPU attach message


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.55 13-Feb-2004 wiz

Uppercase CPU, plural is CPUs.


# 1.54 26-Oct-2003 chris

Fix up some unitialised variables.


# 1.53 06-Sep-2003 rearnsha

Support for ARM10E class devices.


# 1.52 03-Sep-2003 mycroft

Recognize some TI processors -- not that you'd want to use them.


# 1.51 23-Jun-2003 martin

branches: 1.51.2;
Make sure to include opt_foo.h if a defflag option FOO is used.


# 1.50 23-May-2003 ichiro

support IXP425 Intel Network Processor
running on BigEndian


# 1.49 29-Apr-2003 thorpej

Use aprint*().


# 1.48 14-Feb-2003 rjs

Add CPU IDs for PXA B2 and C0 steppings.


Revision tags: nathanw_sa_before_merge nathanw_sa_base
# 1.47 06-Jan-2003 wiz

specified, not specifed.


Revision tags: fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base
# 1.46 17-Nov-2002 chs

change uvm_uarea_alloc() to indicate whether the returned uarea is already
backed by physical pages (ie. because it reused a previously-freed one),
so that we can skip a bunch of useless work in that case.
this fixes the underlying problem behind PR 18543, and also speeds up fork()
quite a bit (eg. 7% on my pc, 1% on my ultra2) when we get a cache hit.


Revision tags: kqueue-aftermerge kqueue-beforemerge bjh21-hydra-base
# 1.45 13-Oct-2002 chris

branches: 1.45.2;
Fix arm kernel build breaks for non multiprocessor systems.


# 1.44 13-Oct-2002 bjh21

It appears that MI code requires ci_cpuid to be the CPU number of the CPU
in question, whereas the ARM code was using it to hold the model
identification. To fix this, rename:

ci_cpuid -> ci_arm_cpuid
ci_cputype -> ci_arm_cputype (for consistency)
ci_cpurev -> ci_arm_cpurev (ditto)
ci_cpunum -> ci_cpuid

This makes top(1) give correct CPU numbers in its "STATE" column (all 0 for
now).


# 1.43 12-Oct-2002 bjh21

Remember the location of each CPU's idle PCB in struct cpu_info.
Move allocation of the idle PCB from hydra.c to cpu.c and add some
extra initialisation from cpu_fork().


Revision tags: kqueue-base
# 1.42 01-Oct-2002 bjh21

constify various string tables.


# 1.41 06-Sep-2002 gehenna

Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.


Revision tags: gehenna-devsw-base
# 1.40 22-Jul-2002 briggs

Handle i80200 step D0 and i80321 step B0


# 1.39 10-Jul-2002 ichiro

add cpu id for "PXA250/210 3rd version CPUcore".

for using many PDA/xscale-core.


# 1.38 07-Jun-2002 thorpej

Add the CPU ID for the 600MHz i80321 part.


Revision tags: netbsd-1-6-base
# 1.37 12-May-2002 ichiro

branches: 1.37.2; 1.37.4;
change ICP12x0 steppings.
define CPU_IXP12X0


# 1.36 10-May-2002 thorpej

Add IXP1200 steppings.


# 1.35 03-May-2002 thorpej

Add support for the Intel PXA210 and PXA250. From Hiroyuki Bessho, PR 16617.


# 1.34 02-May-2002 rjs

Enable CPU_CLASS_SA1 for SA1100 and SA1110.


# 1.33 12-Apr-2002 thorpej

Centralize ARM CPU configuration information by adding a new header
file, <arm/cpuconf.h>, which pulls in "opt_cputypes.h" and then defines
the following:
* CPU_NTYPES -- now many CPU types are configured into the kernel. What
you really want to know is "== 1" or "> 1".
* Defines ARM_ARCH_2, ARM_ARCH_3, ARM_ARCH_4, ARM_ARCH_5, depending
on which ARM architecture versions are configured (based on CPU_*
options). Also defines ARM_NARCH to determins how many architecture
versions are configured.
* Defines ARM_MMU_MEMC, ARM_MMU_GENERIC, ARM_MMU_XSCALE depending on
which classes of ARM MMUs are configured into the kernel, and ARM_NMMUS
to determine how many MMU classes are configured.

Remove the needless inclusion of "opt_cputypes.h" in several places.
Convert remaining users to <arm/cpuconf.h>.


# 1.32 27-Mar-2002 thorpej

The 80321 manual lies; it does have a CPU ID distinct from the 80200.
Add that CPU ID, and add a case for it.


# 1.31 26-Mar-2002 thorpej

Restructure a few things in order to support other XScale core
I/O processors:
* The i80200 and the i80321 have the same CPU ID, so split the
CPU_XSCALE option into CPU_XSCALE_80200 and CPU_XSCALE_80321
options, and don't let them both be defined at the same time.
XXX May want to revisit this in the future.
* Split some registers common between the i80200 and i80321 into
<arm/xscale/xscalereg.h>.
* Rename a few existing functions.


# 1.30 24-Mar-2002 thorpej

Cache the cpu type and cpu revision in cpu_info.


Revision tags: eeh-devprop-base
# 1.29 16-Mar-2002 bjh21

Only put the CPU type into cpu_model, not the state of the control register.
Instead, print the control register state on the next line at startup.


# 1.28 16-Mar-2002 bjh21

Add CPU ID for the ARM1022ES.
Also add a CPU class for ARM10E processors in general.


# 1.27 11-Mar-2002 reinoud

When ARMFPE wasn't enabled the `usearmfpe' flag was statically initialised
but not used resulting in a compiler error. By splitting the declaration
and the initialisation this is solved.

Better would be to not even declare the flag when ARMFPE isnt enabled but
that would just add to the #ifdef jungle.


# 1.26 10-Mar-2002 bjh21

__RCSID -> __KERNEL_RCSID


# 1.25 10-Mar-2002 bjh21

Re-work the way that FPAs are handled. If ARMFPE isn't configured, don't
even bother probing for an FPA. If ARMFPE is configured, always use it,
even if there's an FPA (since it provides the FPA support code). Move all
printfs about FPAs into armfpe_init.c.

This means I can delete the last two elements from struct _cpu, so that the
structure, and the whole of <arm/cpus.h> is redundant and can be deleted.


# 1.24 10-Mar-2002 bjh21

Remove fpu_model from struct _cpu. Instead, have initialise_arm_fpe()
printf() the FPE version number itself.


# 1.23 10-Mar-2002 bjh21

Add a ci_dev element to struct cpu_info, pointing to the device that
corresponds to the CPU.


Revision tags: newlock-base
# 1.22 10-Mar-2002 bjh21

Kill the fpu_flags element from struct _cpu. It was only ever set to 0
anyway.


# 1.21 10-Mar-2002 bjh21

Clean up inline assembler. Rather than saving R0, copying FPSR to R0,
copying it to the output register and then restoring R0, just copy the
FPSR straight to the output.


# 1.20 09-Mar-2002 bjh21

Remove the cpu_model member from struct _cpu, and just use the cpu_model
variable directly. While we're at it, make cpu_model rather larger.


# 1.19 09-Mar-2002 bjh21

Remove the cpu_class element from struct _cpu, and make it a local variable
in identify_arm_cpu(), since it's almost unused elsewhere.

Change the detection of bugged StrongARMs to use the cpu ID rather than the
class. This turns "almost" into "entirely".


# 1.18 09-Mar-2002 bjh21

Replace cpu_id and cpu_ctrl in struct _cpu with ci_cpuid and ci_ctrl in
struct cpu_info. Also kill the cpuctrl global while we're here, and make
identify_arm_cpu() take a struct cpu_info * as an argument alongside the CPU
number.


# 1.17 09-Mar-2002 bjh21

Move arm700bugcount into stuct cpu_info, and attach it in
identify_master_cpu().


Revision tags: ifpoll-base
# 1.16 17-Feb-2002 bjh21

Our assembler handles FPA instructions fine, so don't use .word for them.


# 1.15 17-Feb-2002 bjh21

ANSIfy, and othe KNF cleanup.


# 1.14 27-Jan-2002 bjh21

Add revision->stepping maps for the SA-110, SA-1100 and SA-1110.
Those for the SA-1100 and SA-1110 are from Intel's documentation.
The mapping for the SA-110 is from various sources on the net, since Intel
don't seem to document it.

Also, change the layout of the maps to have four steppings per line,
so they aren't quite so unwieldy.


# 1.13 24-Jan-2002 thorpej

Use a table to look up stepping names. Add a generic stepping
table ("rev 0", "rev 1", etc.) and an i80200 stepping table that
has the stepping names that appear in the i80200 manuals/errata..


# 1.12 29-Nov-2001 thorpej

Fetch cache info from the Cache Type register on ARM7TDMI and "greater"
processors. Report this when the processor is attached.


# 1.11 24-Nov-2001 thorpej

Move the ARM, Ltd. floating point emulator to arch/arm.


# 1.10 23-Nov-2001 thorpej

Use <arm/undefined.h> instead of <machine/undefined.h>.


Revision tags: thorpej-mips-cache-base
# 1.9 06-Nov-2001 thorpej

branches: 1.9.2;
Const poisoning of cpu/class names.


# 1.8 06-Nov-2001 thorpej

"i80200", not "80200".


# 1.7 06-Nov-2001 thorpej

"XScale", not "Xscale".


# 1.6 18-Oct-2001 rearnsha

branches: 1.6.2;
Support for ARM9.


Revision tags: thorpej-devvp-base3 thorpej-devvp-base2
# 1.5 28-Sep-2001 chris

Add extra arg to fpa_test as it should have 4 args. Also add prototypes for fpa_test and fpa_handler.


Revision tags: post-chs-ubcperf pre-chs-ubcperf thorpej-devvp-base
# 1.4 05-Sep-2001 matt

branches: 1.4.2;
Flesh XSCALE support.


# 1.3 03-Jun-2001 chris

branches: 1.3.2; 1.3.4;
Add support for ARM7TDMI, as provided in a patch from John Fremlin to port-arm32.

Shouldn't effect any currently in tree ports.


# 1.2 13-May-2001 bjh21

Use get_bootconf_option() to find boot options, rather than home-grown
strstr()-based hacks.


Revision tags: thorpej_scsipi_beforemerge thorpej_scsipi_base thorpej_scsipi_nbase
# 1.1 20-Apr-2001 matt

branches: 1.1.2;
Split cpu from mainbus so that cpu can attached to other buses (like ofbus).


# 1.143 22-Jan-2020 skrll

#ifdef whack-a-mole for the pmap_maxproc_set functionality


# 1.142 20-Jan-2020 skrll

s/_ARM_ARCH_6/ARM_MMU_EXTENDED/ in the #ifdef for the recent 4k pages
change


# 1.141 18-Jan-2020 skrll

Use 4K pages on ARM_MMU_EXTENDED platforms (all armv[67] except RPI) by
creating a new pool l1ttpl for the userland L1 translation table which
needs to be 8KB and 8KB aligned.

Limit the pool to maxproc and add hooks to allow the sysctl changing of
maxproc to adjust the pool.

This comes at a 5% performance penalty for build.sh -j8 kernel on a
Tegra TK1.


Revision tags: ad-namecache-base1
# 1.140 15-Jan-2020 mrg

port the arm64 cpu topology setup for big.little to arm.

rename arm64 cpu_do_topology() to arm_cpu_do_topology() and
call it from both arm cpu_attach().

replace both aarch64_set_topology() inline code in arm
cpu_attach() with new arm_cpu_do_topology(), which is called
by the arm64 locore as well (possibly not needed, which would
allow it to become static.)

not yet tested on a real big.little armv7 system. tested
on rockpro64 and pinebook pro.


# 1.139 09-Jan-2020 ad

- Many small tweaks to the SMT awareness in the scheduler. It does a much
better job now at keeping all physical CPUs busy, while using the extra
threads to help out. In particular, during preempt() if we're using SMT,
try to find a better CPU to run on and teleport curlwp there.

- Change the CPU topology stuff so it can work on asymmetric systems. This
mainly entails rearranging one of the CPU lists so it makes sense in all
configurations.

- Add a parameter to cpu_topology_set() to note that a CPU is "slow", for
where there are fast CPUs and slow CPUs, like with the Rockwell RK3399.
Extend the SMT awareness to try and handle that situation too (keep fast
CPUs busy, use slow CPUs as helpers).


# 1.138 09-Jan-2020 martin

When attaching the first fdtbus, use the root "comptabile" (or failing that:
"model") property to set the cpu model (in userland aka sysctl hw.model).
When attaching the first cpu, do not overwrite a cpu model if it already
had been set.


# 1.137 08-Jan-2020 jmcneill

cpu_hatch is too late to report AP topology, do it at attach time instead


Revision tags: ad-namecache-base
# 1.136 20-Dec-2019 ad

branches: 1.136.2;
Some more CPU topology stuff:

- Use cegger@'s ACPI SRAT parsing code to figure out NUMA node ID for each
CPU as it is attached.

- For scheduler experiments with SMT, flag CPUs with the lowest numbered SMT
IDs as "primaries", link back to the primaries from secondaries, and build
a circular list of CPUs in each package with identical SMT IDs.

- No need for package/core/smt/numa IDs to be anything other than a u_int.


# 1.135 02-Dec-2019 ad

Take the basic CPU topology information we already collect, and use it
to make circular lists of CPU siblings in the same core, and in the
same package. Nothing fancy, just enough to have a bit of fun in the
scheduler trying out different tactics.


Revision tags: phil-wifi-20191119
# 1.134 20-Oct-2019 jmcneill

cpu_hatched_p only for MULTIPROCESSOR


# 1.133 19-Oct-2019 jmcneill

Increase aarch64 MAXCPUS to 256.


# 1.132 29-Sep-2019 skrll

aprint_debug_dev output alignment


# 1.131 08-Sep-2019 tnn

report A12 as A17 to the user. A12 is retcon'ed by ARM.


# 1.130 07-Sep-2019 tnn

Cortex A12 is marketed as A17 but has a distinct part number

observed on Rockchip RK3288


Revision tags: netbsd-9-base phil-wifi-20190609 isaki-audio2-base
# 1.129 17-Mar-2019 skrll

branches: 1.129.4;
Wrap arm_cpu_marker if #ifdef MPDEBUG.

One day a9_mpsubr.S will die


# 1.128 27-Jan-2019 pgoyette

Merge the [pgoyette-compat] branch


Revision tags: pgoyette-compat-20190127
# 1.127 25-Jan-2019 skrll

Make sure ci_{smt,core,package}_id are all filled in appropriately.

Previously the BP was missed and __SHIFTOUT wasn't used.


Revision tags: pgoyette-compat-20190118
# 1.126 03-Jan-2019 jmcneill

Read mpidr and cpuid from the secondary processor itself instead of the
boot processor. While here, add Cortex-A15 r4p0 to supported list.


# 1.125 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.124 02-Jan-2019 skrll

Don't overwrite the setting of cpu_core_id from mpidr


Revision tags: pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020
# 1.123 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.122 08-Oct-2018 skrll

Trialing whitespace


# 1.121 06-Oct-2018 skrll

Use __BIT. NFC.


Revision tags: pgoyette-compat-0930 pgoyette-compat-0906
# 1.120 15-Aug-2018 skrll

KNF


# 1.119 15-Aug-2018 skrll

Fix includes (sys/cdefs.h then sys/param.h)


# 1.118 15-Aug-2018 skrll

Sprinkle #include "opt_cputypes.h"


# 1.117 10-Aug-2018 maxv

Retire CPU_ARM2, CPU_ARM250 and CPU_ARM3, they are all leftovers of
acorn26.

ok jmcneill@ skrll@


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202
# 1.116 16-Sep-2017 matt

branches: 1.116.2; 1.116.4;
Add Cortex-A35 CPU ID.


Revision tags: netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base
# 1.115 01-Jun-2017 chs

branches: 1.115.6;
remove checks for failure after memory allocation calls that cannot fail:

kmem_alloc() with KM_SLEEP
kmem_zalloc() with KM_SLEEP
percpu_alloc()
pserialize_create()
psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.114 11-Jul-2016 kiyohara

Add Cortex-A9 r1.


Revision tags: nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.113 03-Mar-2016 skrll

Get the RPI3 working (in aarch32 mode) by recognising Cortex A53 CPUs.
While I'm here add some A57/A72 info as well.

My RPI3 works with FB console - the uart needs some help with its clocks.


# 1.112 23-Jan-2016 christos

Rename the cpu_id() define to cpu_idnum() so that it does not conflict with
dtrace and friends.


Revision tags: nick-nhusb-base-20151226
# 1.111 12-Nov-2015 jmcneill

change some register dumps from aprint_verbose to aprint_debug


Revision tags: nick-nhusb-base-20150921
# 1.110 08-Jul-2015 skrll

aprint_verbose [sa]ctlr


Revision tags: nick-nhusb-base-20150606
# 1.109 05-Jun-2015 skrll

Print the Revision ID regster (verbose)


# 1.108 17-May-2015 matt

Print out mpidr on MP systems (verbose print)


Revision tags: nick-nhusb-base-20150406
# 1.107 03-Mar-2015 jmcneill

cache type 12 is "write-back", from matt


Revision tags: nick-nhusb-base
# 1.106 27-Nov-2014 matt

branches: 1.106.2;
Add entry for Cortex-A17 r1


# 1.105 01-Sep-2014 reinoud

Increase the `freqbuf' buffer that holds the result of humanize_number(). Now
it prints 1600 Mhz instead of 1 Ghz.
Pitty enough humanize_number(9) doesn't do 1.6 Ghz type output.


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.104 28-Mar-2014 matt

branches: 1.104.4;
Various MP changes.


# 1.103 24-Mar-2014 christos

use cpu_{g,s}etmodel


# 1.102 20-Mar-2014 matt

Define cache type 13


Revision tags: riastradh-drm2-base3
# 1.101 03-Mar-2014 matt

Add most of the cpu_* variables to <arm/locore.h>
Add and initialize cpu_synchprim_present


# 1.100 20-Feb-2014 matt

Keep track of what each cache is (VIVT/VIPT/PIPT).

cpu0: 32KB/32B 2-way L1 VIPT Instruction cache
cpu0: 32KB/64B 4-way write-back-locking-C L1 PIPT Data cache
cpu0: 256KB/64B 8-way write-through L2 PIPT Unified cache


# 1.99 07-Sep-2013 matt

Add a machdep.hwdiv_present sysctl (cortex A7 and A15 have hwdiv instructions)


# 1.98 07-Sep-2013 matt

Add CPU_ID_CORTEXA7R0 entry


# 1.97 18-Aug-2013 matt

Move parts of cpu.h that are not needed by MI code in <arm/locore.h>
Don't include <machine/cpu.h> or <machine/frame.h>, use <arm/locore.h>
Use <arm/asm.h> instead of <machine/arm.h>


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.96 12-Jun-2013 matt

branches: 1.96.2;
Nuke cpu_pfr, just use the armreg_pfr?_read inlines


# 1.95 12-Jun-2013 matt

Use the armreg_pfr?_read inlines.


# 1.94 19-May-2013 rkujawa

Plug support for PJ4B into our ARM CPU infrastructure.

Obtained from Marvell, Semihalf.


Revision tags: agc-symver-base
# 1.93 03-Feb-2013 matt

Add a machdep.cpu_arch sysctl


# 1.92 31-Jan-2013 matt

Add simple sysctls for cpu_id, fpu_id, neon_present, simd_present,
simdex_present.
Add struct sysctls to return the isar, mmfr, pfr, and mvfr sets.


Revision tags: yamt-pagecache-base8 yamt-pagecache-base7
# 1.91 05-Dec-2012 matt

ARMFPE hasn't compiled since NetBSD 4. Remove it.
Complete support for FPU_VFP.
fpregs now contains vfpreg.
XXX vfpreg only has space for 16 64-bit FP registers though VFPv3 and later
have 32 64-bit FP registers.


# 1.90 30-Nov-2012 msaitoh

Use snprintf() instead of sprintf().


# 1.89 30-Nov-2012 msaitoh

s/,/;/


# 1.88 12-Nov-2012 skrll

C99 types


Revision tags: yamt-pagecache-base6
# 1.87 22-Sep-2012 matt

Don't use an asm in pmap_activate to update the TTBR, use cpu_setttb instead
but add a second argument to it to indicate whether the TLB/caches need to be
flushed. Default cortex to pmap_needs_fixup = 1. But check the MMFR3 field
to see if the fixed can be skipped.
Use a cf_flag bit 0 to indicate whether the A9 L2 cache should disable (bit 0 = 1)
or enabeld (bit = 0).

With these changes, the A9 MMU can use traverse caches to do MMU tablewalks
Also, make sure all memory has the shareable bit for the A9.


# 1.86 07-Sep-2012 matt

branches: 1.86.2;
Switch cortex_a9 back to need_ptesync = 1
Add code to disable the L2 cache on cortex-a9 (for now).
Add evcnt for all the fault types.
Move cache info in a structure and have one for the pcache and one for scache.
Probe L1/L2 caches properly for ARMv7


# 1.85 29-Aug-2012 matt

Use new armv7 CP15 register to print out cache types.
If the cpu_cc_freq is set, report it.
Add macros to make inlines for reading/writing co-processor registers.


# 1.84 14-Aug-2012 matt

Use device_t


# 1.83 12-Aug-2012 matt

Rework VFP support to use PCU.
Add emulation of instruction which save/restore the VFP FPSCR.
Add a sysarch hook to VFP FPSCR manipulation.

[The emulation will be used by libc to store/fetch exception modes and
rounding mode on a per-thread basis.]


# 1.82 14-Jul-2012 matt

Refresh cortex cpus


Revision tags: jmcneill-usbmp-base10 yamt-pagecache-base5
# 1.81 20-May-2012 skrll

Remove the ARM1156T2 bloat - it only has an MPU. Prompted by matt@


# 1.80 20-May-2012 skrll

Add the ARM1156T2-S


# 1.79 20-May-2012 skrll

Add the 'Z' to the 1176 cpu product name.

ok matt@


Revision tags: jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base jym-xensuspend-nbase rmind-uvmplock-base jym-xensuspend-base
# 1.78 10-Mar-2011 bsh

branches: 1.78.4; 1.78.8; 1.78.10;
add MPCore to CPU-ID table
add branch predict bit to arm11_options


Revision tags: uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11
# 1.77 02-Oct-2010 kiyohara

branches: 1.77.2;
Add support Marvell Sheeva Core and SoC. (Orion/Kirkwood)
Discovery Innovation not yet.


Revision tags: uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.76 19-Jun-2010 matt

Fix cache probing on Cortex. Add missing CORTEX dependency in cpu.c


# 1.75 19-Jun-2010 matt

Fix c&p error.


# 1.74 19-Jun-2010 matt

Cleanup the armv7 changes. Add ARM_ARCH_7. Use CPU_CORTEX instead of
CPU_CORTEXA8 everywhere since there more types of Cortex than just the A8.
CPU_CORTEXA8 still exists but causes CPU_CORTEX to be defined.
Add CPU_CORTEXA9 as well. Use .arch armv7a to get us the isb/dsb
instructions.

Test booted to root device prompt on a Beagleboard.
All ARM kernels successfully test built.


# 1.73 16-Jun-2010 jmcneill

PR port-arm/43299: Support added for igepv2/cortexa8/omap3530

Apply patch from PR, with build fixes. ok skrll, matt


Revision tags: uebayasi-xip-base1 yamt-nfs-mp-base9 uebayasi-xip-base
# 1.72 23-Jan-2010 mrg

branches: 1.72.2; 1.72.4;
rename a local cpu_name structure member to avoid potential conflict
with <sys/cpu.h>'s.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-premerge-20091211 yamt-nfs-mp-base8 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 yamt-nfs-mp-base7 netbsd-5-0-1-RELEASE jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base nick-hppapmap-base haad-dm-base mjf-devfs2-base
# 1.71 25-Oct-2008 matt

branches: 1.71.4; 1.71.12;
Fix some missing things for CPU_ID_FA526.


Revision tags: matt-mips64-base2
# 1.70 24-Oct-2008 matt

Add entry for FA526.


# 1.69 21-Oct-2008 matt

Add Cortex cpus


Revision tags: haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base
# 1.68 27-Apr-2008 matt

branches: 1.68.6;
Merge kernel changes in matt-armv6 to HEAD.


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 chris-arm-intr-rework-base7 keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.67 15-Mar-2008 rearnsha

branches: 1.67.2; 1.67.4;
VFP support.


Revision tags: nick-net80211-sync-base chris-arm-intr-rework-base6 chris-arm-intr-rework-base5 chris-arm-intr-rework-base4 bouyer-xeni386-merge1 chris-arm-intr-rework-base3 vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 jmcneill-base mjf-devfs-base bouyer-xenamd64-base2 vmlocking-nbase yamt-x86pmap-base4 bouyer-xenamd64-base matt-armv6-base jmcneill-pm-base hpcarm-cleanup-base reinoud-bufcleanup-base
# 1.66 17-Oct-2007 garbled

branches: 1.66.12; 1.66.16;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base chris-arm-intr-rework-base2 chris-arm-intr-rework-base nick-csl-alignment-base matt-mips64-base ppcoea-renovation-base mjf-ufs-trans-base vmlocking-base
# 1.65 17-May-2007 yamt

branches: 1.65.10; 1.65.12;
merge yamt-idlelwp branch. asked by core@. some ports still needs work.

from doc/BRANCHES:

idle lwp, and some changes depending on it.

1. separate context switching and thread scheduling.
(cf. gmcgarry_ctxsw)
2. implement idle lwp.
3. clean up related MD/MI interfaces.
4. make scheduler(s) modular.


Revision tags: yamt-idlelwp-base8 thorpej-atomic-base ad-audiomp-base post-newlock2-merge newlock2-nbase newlock2-base
# 1.64 06-Jan-2007 christos

branches: 1.64.2; 1.64.6; 1.64.8; 1.64.14;
Scott Allan in http://mail-index.netbsd.org/port-arm/2006/07/31/0000.html
Patch to add support for ARM9E


# 1.63 06-Jan-2007 christos

From Scott Alan in http://mail-index.netbsd.org/port-arm/2006/07/26/0000.html
identify_arm_cpu() prints out a helpful message when it detects that you're
trying to run on a CPU that you didn't configure for. Unfortunately, the
check for class_option being NULL is backward, so it either won't print the
class_option, or it will try to dereference a NULL. The patch just flips the
!= NULL to be == NULL.


Revision tags: yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 abandoned-netbsd-4-base yamt-splraiseipl-base2 yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 netbsd-4-base yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base elad-kernelauth-base simonb-timecounters-base rpaulo-netinet-merge-pcb-base
# 1.62 15-Mar-2006 drochner

branches: 1.62.10; 1.62.14;
use km_alloc to get wired kernel memory for kernel stacks
of idle processes for secondary CPUs
(affects the MULTIPROCESSOR case only - does this exist?)
(untested)


Revision tags: yamt-pdpolicy-base2 yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.61 11-Dec-2005 christos

branches: 1.61.4; 1.61.6; 1.61.8; 1.61.10;
merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.60 20-Jul-2005 nonaka

Added i80219.


# 1.59 04-Jul-2005 bsh

branches: 1.59.2;
The first step to support Intel PXA270.

kernel config option CPU_XSCALE_PXA2X0 is now obsoleted by
CPU_XSCALE_PXA250 and CPU_XSCALE_PXA270. If both of them are defined,
CPU is determined run-time.


# 1.58 03-Jun-2005 rearnsha

Very basic support for the ARM1136.

This code takes no advantage of any 'new' features provided by
architecture 6 devices (such as physically tagged caches or new
MMU features), and basically runs the chip in a 'legacy v5' mode.


# 1.57 10-May-2005 rearnsha

Add support for arm1026ej-s.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 yamt-km-base4 yamt-km-base3 netbsd-3-base yamt-km-base2 yamt-km-base kent-audio2-base kent-audio1-beforemerge kent-audio1-base
# 1.56 14-Apr-2004 bsh

distinguish PXA255/26x from PXA2[15]0 in CPU attach message


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.55 13-Feb-2004 wiz

Uppercase CPU, plural is CPUs.


# 1.54 26-Oct-2003 chris

Fix up some unitialised variables.


# 1.53 06-Sep-2003 rearnsha

Support for ARM10E class devices.


# 1.52 03-Sep-2003 mycroft

Recognize some TI processors -- not that you'd want to use them.


# 1.51 23-Jun-2003 martin

branches: 1.51.2;
Make sure to include opt_foo.h if a defflag option FOO is used.


# 1.50 23-May-2003 ichiro

support IXP425 Intel Network Processor
running on BigEndian


# 1.49 29-Apr-2003 thorpej

Use aprint*().


# 1.48 14-Feb-2003 rjs

Add CPU IDs for PXA B2 and C0 steppings.


Revision tags: nathanw_sa_before_merge nathanw_sa_base
# 1.47 06-Jan-2003 wiz

specified, not specifed.


Revision tags: fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base
# 1.46 17-Nov-2002 chs

change uvm_uarea_alloc() to indicate whether the returned uarea is already
backed by physical pages (ie. because it reused a previously-freed one),
so that we can skip a bunch of useless work in that case.
this fixes the underlying problem behind PR 18543, and also speeds up fork()
quite a bit (eg. 7% on my pc, 1% on my ultra2) when we get a cache hit.


Revision tags: kqueue-aftermerge kqueue-beforemerge bjh21-hydra-base
# 1.45 13-Oct-2002 chris

branches: 1.45.2;
Fix arm kernel build breaks for non multiprocessor systems.


# 1.44 13-Oct-2002 bjh21

It appears that MI code requires ci_cpuid to be the CPU number of the CPU
in question, whereas the ARM code was using it to hold the model
identification. To fix this, rename:

ci_cpuid -> ci_arm_cpuid
ci_cputype -> ci_arm_cputype (for consistency)
ci_cpurev -> ci_arm_cpurev (ditto)
ci_cpunum -> ci_cpuid

This makes top(1) give correct CPU numbers in its "STATE" column (all 0 for
now).


# 1.43 12-Oct-2002 bjh21

Remember the location of each CPU's idle PCB in struct cpu_info.
Move allocation of the idle PCB from hydra.c to cpu.c and add some
extra initialisation from cpu_fork().


Revision tags: kqueue-base
# 1.42 01-Oct-2002 bjh21

constify various string tables.


# 1.41 06-Sep-2002 gehenna

Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.


Revision tags: gehenna-devsw-base
# 1.40 22-Jul-2002 briggs

Handle i80200 step D0 and i80321 step B0


# 1.39 10-Jul-2002 ichiro

add cpu id for "PXA250/210 3rd version CPUcore".

for using many PDA/xscale-core.


# 1.38 07-Jun-2002 thorpej

Add the CPU ID for the 600MHz i80321 part.


Revision tags: netbsd-1-6-base
# 1.37 12-May-2002 ichiro

branches: 1.37.2; 1.37.4;
change ICP12x0 steppings.
define CPU_IXP12X0


# 1.36 10-May-2002 thorpej

Add IXP1200 steppings.


# 1.35 03-May-2002 thorpej

Add support for the Intel PXA210 and PXA250. From Hiroyuki Bessho, PR 16617.


# 1.34 02-May-2002 rjs

Enable CPU_CLASS_SA1 for SA1100 and SA1110.


# 1.33 12-Apr-2002 thorpej

Centralize ARM CPU configuration information by adding a new header
file, <arm/cpuconf.h>, which pulls in "opt_cputypes.h" and then defines
the following:
* CPU_NTYPES -- now many CPU types are configured into the kernel. What
you really want to know is "== 1" or "> 1".
* Defines ARM_ARCH_2, ARM_ARCH_3, ARM_ARCH_4, ARM_ARCH_5, depending
on which ARM architecture versions are configured (based on CPU_*
options). Also defines ARM_NARCH to determins how many architecture
versions are configured.
* Defines ARM_MMU_MEMC, ARM_MMU_GENERIC, ARM_MMU_XSCALE depending on
which classes of ARM MMUs are configured into the kernel, and ARM_NMMUS
to determine how many MMU classes are configured.

Remove the needless inclusion of "opt_cputypes.h" in several places.
Convert remaining users to <arm/cpuconf.h>.


# 1.32 27-Mar-2002 thorpej

The 80321 manual lies; it does have a CPU ID distinct from the 80200.
Add that CPU ID, and add a case for it.


# 1.31 26-Mar-2002 thorpej

Restructure a few things in order to support other XScale core
I/O processors:
* The i80200 and the i80321 have the same CPU ID, so split the
CPU_XSCALE option into CPU_XSCALE_80200 and CPU_XSCALE_80321
options, and don't let them both be defined at the same time.
XXX May want to revisit this in the future.
* Split some registers common between the i80200 and i80321 into
<arm/xscale/xscalereg.h>.
* Rename a few existing functions.


# 1.30 24-Mar-2002 thorpej

Cache the cpu type and cpu revision in cpu_info.


Revision tags: eeh-devprop-base
# 1.29 16-Mar-2002 bjh21

Only put the CPU type into cpu_model, not the state of the control register.
Instead, print the control register state on the next line at startup.


# 1.28 16-Mar-2002 bjh21

Add CPU ID for the ARM1022ES.
Also add a CPU class for ARM10E processors in general.


# 1.27 11-Mar-2002 reinoud

When ARMFPE wasn't enabled the `usearmfpe' flag was statically initialised
but not used resulting in a compiler error. By splitting the declaration
and the initialisation this is solved.

Better would be to not even declare the flag when ARMFPE isnt enabled but
that would just add to the #ifdef jungle.


# 1.26 10-Mar-2002 bjh21

__RCSID -> __KERNEL_RCSID


# 1.25 10-Mar-2002 bjh21

Re-work the way that FPAs are handled. If ARMFPE isn't configured, don't
even bother probing for an FPA. If ARMFPE is configured, always use it,
even if there's an FPA (since it provides the FPA support code). Move all
printfs about FPAs into armfpe_init.c.

This means I can delete the last two elements from struct _cpu, so that the
structure, and the whole of <arm/cpus.h> is redundant and can be deleted.


# 1.24 10-Mar-2002 bjh21

Remove fpu_model from struct _cpu. Instead, have initialise_arm_fpe()
printf() the FPE version number itself.


# 1.23 10-Mar-2002 bjh21

Add a ci_dev element to struct cpu_info, pointing to the device that
corresponds to the CPU.


Revision tags: newlock-base
# 1.22 10-Mar-2002 bjh21

Kill the fpu_flags element from struct _cpu. It was only ever set to 0
anyway.


# 1.21 10-Mar-2002 bjh21

Clean up inline assembler. Rather than saving R0, copying FPSR to R0,
copying it to the output register and then restoring R0, just copy the
FPSR straight to the output.


# 1.20 09-Mar-2002 bjh21

Remove the cpu_model member from struct _cpu, and just use the cpu_model
variable directly. While we're at it, make cpu_model rather larger.


# 1.19 09-Mar-2002 bjh21

Remove the cpu_class element from struct _cpu, and make it a local variable
in identify_arm_cpu(), since it's almost unused elsewhere.

Change the detection of bugged StrongARMs to use the cpu ID rather than the
class. This turns "almost" into "entirely".


# 1.18 09-Mar-2002 bjh21

Replace cpu_id and cpu_ctrl in struct _cpu with ci_cpuid and ci_ctrl in
struct cpu_info. Also kill the cpuctrl global while we're here, and make
identify_arm_cpu() take a struct cpu_info * as an argument alongside the CPU
number.


# 1.17 09-Mar-2002 bjh21

Move arm700bugcount into stuct cpu_info, and attach it in
identify_master_cpu().


Revision tags: ifpoll-base
# 1.16 17-Feb-2002 bjh21

Our assembler handles FPA instructions fine, so don't use .word for them.


# 1.15 17-Feb-2002 bjh21

ANSIfy, and othe KNF cleanup.


# 1.14 27-Jan-2002 bjh21

Add revision->stepping maps for the SA-110, SA-1100 and SA-1110.
Those for the SA-1100 and SA-1110 are from Intel's documentation.
The mapping for the SA-110 is from various sources on the net, since Intel
don't seem to document it.

Also, change the layout of the maps to have four steppings per line,
so they aren't quite so unwieldy.


# 1.13 24-Jan-2002 thorpej

Use a table to look up stepping names. Add a generic stepping
table ("rev 0", "rev 1", etc.) and an i80200 stepping table that
has the stepping names that appear in the i80200 manuals/errata..


# 1.12 29-Nov-2001 thorpej

Fetch cache info from the Cache Type register on ARM7TDMI and "greater"
processors. Report this when the processor is attached.


# 1.11 24-Nov-2001 thorpej

Move the ARM, Ltd. floating point emulator to arch/arm.


# 1.10 23-Nov-2001 thorpej

Use <arm/undefined.h> instead of <machine/undefined.h>.


Revision tags: thorpej-mips-cache-base
# 1.9 06-Nov-2001 thorpej

branches: 1.9.2;
Const poisoning of cpu/class names.


# 1.8 06-Nov-2001 thorpej

"i80200", not "80200".


# 1.7 06-Nov-2001 thorpej

"XScale", not "Xscale".


# 1.6 18-Oct-2001 rearnsha

branches: 1.6.2;
Support for ARM9.


Revision tags: thorpej-devvp-base3 thorpej-devvp-base2
# 1.5 28-Sep-2001 chris

Add extra arg to fpa_test as it should have 4 args. Also add prototypes for fpa_test and fpa_handler.


Revision tags: post-chs-ubcperf pre-chs-ubcperf thorpej-devvp-base
# 1.4 05-Sep-2001 matt

branches: 1.4.2;
Flesh XSCALE support.


# 1.3 03-Jun-2001 chris

branches: 1.3.2; 1.3.4;
Add support for ARM7TDMI, as provided in a patch from John Fremlin to port-arm32.

Shouldn't effect any currently in tree ports.


# 1.2 13-May-2001 bjh21

Use get_bootconf_option() to find boot options, rather than home-grown
strstr()-based hacks.


Revision tags: thorpej_scsipi_beforemerge thorpej_scsipi_base thorpej_scsipi_nbase
# 1.1 20-Apr-2001 matt

branches: 1.1.2;
Split cpu from mainbus so that cpu can attached to other buses (like ofbus).


# 1.142 20-Jan-2020 skrll

s/_ARM_ARCH_6/ARM_MMU_EXTENDED/ in the #ifdef for the recent 4k pages
change


# 1.141 18-Jan-2020 skrll

Use 4K pages on ARM_MMU_EXTENDED platforms (all armv[67] except RPI) by
creating a new pool l1ttpl for the userland L1 translation table which
needs to be 8KB and 8KB aligned.

Limit the pool to maxproc and add hooks to allow the sysctl changing of
maxproc to adjust the pool.

This comes at a 5% performance penalty for build.sh -j8 kernel on a
Tegra TK1.


Revision tags: ad-namecache-base1
# 1.140 15-Jan-2020 mrg

port the arm64 cpu topology setup for big.little to arm.

rename arm64 cpu_do_topology() to arm_cpu_do_topology() and
call it from both arm cpu_attach().

replace both aarch64_set_topology() inline code in arm
cpu_attach() with new arm_cpu_do_topology(), which is called
by the arm64 locore as well (possibly not needed, which would
allow it to become static.)

not yet tested on a real big.little armv7 system. tested
on rockpro64 and pinebook pro.


# 1.139 09-Jan-2020 ad

- Many small tweaks to the SMT awareness in the scheduler. It does a much
better job now at keeping all physical CPUs busy, while using the extra
threads to help out. In particular, during preempt() if we're using SMT,
try to find a better CPU to run on and teleport curlwp there.

- Change the CPU topology stuff so it can work on asymmetric systems. This
mainly entails rearranging one of the CPU lists so it makes sense in all
configurations.

- Add a parameter to cpu_topology_set() to note that a CPU is "slow", for
where there are fast CPUs and slow CPUs, like with the Rockwell RK3399.
Extend the SMT awareness to try and handle that situation too (keep fast
CPUs busy, use slow CPUs as helpers).


# 1.138 09-Jan-2020 martin

When attaching the first fdtbus, use the root "comptabile" (or failing that:
"model") property to set the cpu model (in userland aka sysctl hw.model).
When attaching the first cpu, do not overwrite a cpu model if it already
had been set.


# 1.137 08-Jan-2020 jmcneill

cpu_hatch is too late to report AP topology, do it at attach time instead


Revision tags: ad-namecache-base
# 1.136 20-Dec-2019 ad

branches: 1.136.2;
Some more CPU topology stuff:

- Use cegger@'s ACPI SRAT parsing code to figure out NUMA node ID for each
CPU as it is attached.

- For scheduler experiments with SMT, flag CPUs with the lowest numbered SMT
IDs as "primaries", link back to the primaries from secondaries, and build
a circular list of CPUs in each package with identical SMT IDs.

- No need for package/core/smt/numa IDs to be anything other than a u_int.


# 1.135 02-Dec-2019 ad

Take the basic CPU topology information we already collect, and use it
to make circular lists of CPU siblings in the same core, and in the
same package. Nothing fancy, just enough to have a bit of fun in the
scheduler trying out different tactics.


Revision tags: phil-wifi-20191119
# 1.134 20-Oct-2019 jmcneill

cpu_hatched_p only for MULTIPROCESSOR


# 1.133 19-Oct-2019 jmcneill

Increase aarch64 MAXCPUS to 256.


# 1.132 29-Sep-2019 skrll

aprint_debug_dev output alignment


# 1.131 08-Sep-2019 tnn

report A12 as A17 to the user. A12 is retcon'ed by ARM.


# 1.130 07-Sep-2019 tnn

Cortex A12 is marketed as A17 but has a distinct part number

observed on Rockchip RK3288


Revision tags: netbsd-9-base phil-wifi-20190609 isaki-audio2-base
# 1.129 17-Mar-2019 skrll

branches: 1.129.4;
Wrap arm_cpu_marker if #ifdef MPDEBUG.

One day a9_mpsubr.S will die


# 1.128 27-Jan-2019 pgoyette

Merge the [pgoyette-compat] branch


Revision tags: pgoyette-compat-20190127
# 1.127 25-Jan-2019 skrll

Make sure ci_{smt,core,package}_id are all filled in appropriately.

Previously the BP was missed and __SHIFTOUT wasn't used.


Revision tags: pgoyette-compat-20190118
# 1.126 03-Jan-2019 jmcneill

Read mpidr and cpuid from the secondary processor itself instead of the
boot processor. While here, add Cortex-A15 r4p0 to supported list.


# 1.125 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.124 02-Jan-2019 skrll

Don't overwrite the setting of cpu_core_id from mpidr


Revision tags: pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020
# 1.123 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.122 08-Oct-2018 skrll

Trialing whitespace


# 1.121 06-Oct-2018 skrll

Use __BIT. NFC.


Revision tags: pgoyette-compat-0930 pgoyette-compat-0906
# 1.120 15-Aug-2018 skrll

KNF


# 1.119 15-Aug-2018 skrll

Fix includes (sys/cdefs.h then sys/param.h)


# 1.118 15-Aug-2018 skrll

Sprinkle #include "opt_cputypes.h"


# 1.117 10-Aug-2018 maxv

Retire CPU_ARM2, CPU_ARM250 and CPU_ARM3, they are all leftovers of
acorn26.

ok jmcneill@ skrll@


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202
# 1.116 16-Sep-2017 matt

branches: 1.116.2; 1.116.4;
Add Cortex-A35 CPU ID.


Revision tags: netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base
# 1.115 01-Jun-2017 chs

branches: 1.115.6;
remove checks for failure after memory allocation calls that cannot fail:

kmem_alloc() with KM_SLEEP
kmem_zalloc() with KM_SLEEP
percpu_alloc()
pserialize_create()
psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.114 11-Jul-2016 kiyohara

Add Cortex-A9 r1.


Revision tags: nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.113 03-Mar-2016 skrll

Get the RPI3 working (in aarch32 mode) by recognising Cortex A53 CPUs.
While I'm here add some A57/A72 info as well.

My RPI3 works with FB console - the uart needs some help with its clocks.


# 1.112 23-Jan-2016 christos

Rename the cpu_id() define to cpu_idnum() so that it does not conflict with
dtrace and friends.


Revision tags: nick-nhusb-base-20151226
# 1.111 12-Nov-2015 jmcneill

change some register dumps from aprint_verbose to aprint_debug


Revision tags: nick-nhusb-base-20150921
# 1.110 08-Jul-2015 skrll

aprint_verbose [sa]ctlr


Revision tags: nick-nhusb-base-20150606
# 1.109 05-Jun-2015 skrll

Print the Revision ID regster (verbose)


# 1.108 17-May-2015 matt

Print out mpidr on MP systems (verbose print)


Revision tags: nick-nhusb-base-20150406
# 1.107 03-Mar-2015 jmcneill

cache type 12 is "write-back", from matt


Revision tags: nick-nhusb-base
# 1.106 27-Nov-2014 matt

branches: 1.106.2;
Add entry for Cortex-A17 r1


# 1.105 01-Sep-2014 reinoud

Increase the `freqbuf' buffer that holds the result of humanize_number(). Now
it prints 1600 Mhz instead of 1 Ghz.
Pitty enough humanize_number(9) doesn't do 1.6 Ghz type output.


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.104 28-Mar-2014 matt

branches: 1.104.4;
Various MP changes.


# 1.103 24-Mar-2014 christos

use cpu_{g,s}etmodel


# 1.102 20-Mar-2014 matt

Define cache type 13


Revision tags: riastradh-drm2-base3
# 1.101 03-Mar-2014 matt

Add most of the cpu_* variables to <arm/locore.h>
Add and initialize cpu_synchprim_present


# 1.100 20-Feb-2014 matt

Keep track of what each cache is (VIVT/VIPT/PIPT).

cpu0: 32KB/32B 2-way L1 VIPT Instruction cache
cpu0: 32KB/64B 4-way write-back-locking-C L1 PIPT Data cache
cpu0: 256KB/64B 8-way write-through L2 PIPT Unified cache


# 1.99 07-Sep-2013 matt

Add a machdep.hwdiv_present sysctl (cortex A7 and A15 have hwdiv instructions)


# 1.98 07-Sep-2013 matt

Add CPU_ID_CORTEXA7R0 entry


# 1.97 18-Aug-2013 matt

Move parts of cpu.h that are not needed by MI code in <arm/locore.h>
Don't include <machine/cpu.h> or <machine/frame.h>, use <arm/locore.h>
Use <arm/asm.h> instead of <machine/arm.h>


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.96 12-Jun-2013 matt

branches: 1.96.2;
Nuke cpu_pfr, just use the armreg_pfr?_read inlines


# 1.95 12-Jun-2013 matt

Use the armreg_pfr?_read inlines.


# 1.94 19-May-2013 rkujawa

Plug support for PJ4B into our ARM CPU infrastructure.

Obtained from Marvell, Semihalf.


Revision tags: agc-symver-base
# 1.93 03-Feb-2013 matt

Add a machdep.cpu_arch sysctl


# 1.92 31-Jan-2013 matt

Add simple sysctls for cpu_id, fpu_id, neon_present, simd_present,
simdex_present.
Add struct sysctls to return the isar, mmfr, pfr, and mvfr sets.


Revision tags: yamt-pagecache-base8 yamt-pagecache-base7
# 1.91 05-Dec-2012 matt

ARMFPE hasn't compiled since NetBSD 4. Remove it.
Complete support for FPU_VFP.
fpregs now contains vfpreg.
XXX vfpreg only has space for 16 64-bit FP registers though VFPv3 and later
have 32 64-bit FP registers.


# 1.90 30-Nov-2012 msaitoh

Use snprintf() instead of sprintf().


# 1.89 30-Nov-2012 msaitoh

s/,/;/


# 1.88 12-Nov-2012 skrll

C99 types


Revision tags: yamt-pagecache-base6
# 1.87 22-Sep-2012 matt

Don't use an asm in pmap_activate to update the TTBR, use cpu_setttb instead
but add a second argument to it to indicate whether the TLB/caches need to be
flushed. Default cortex to pmap_needs_fixup = 1. But check the MMFR3 field
to see if the fixed can be skipped.
Use a cf_flag bit 0 to indicate whether the A9 L2 cache should disable (bit 0 = 1)
or enabeld (bit = 0).

With these changes, the A9 MMU can use traverse caches to do MMU tablewalks
Also, make sure all memory has the shareable bit for the A9.


# 1.86 07-Sep-2012 matt

branches: 1.86.2;
Switch cortex_a9 back to need_ptesync = 1
Add code to disable the L2 cache on cortex-a9 (for now).
Add evcnt for all the fault types.
Move cache info in a structure and have one for the pcache and one for scache.
Probe L1/L2 caches properly for ARMv7


# 1.85 29-Aug-2012 matt

Use new armv7 CP15 register to print out cache types.
If the cpu_cc_freq is set, report it.
Add macros to make inlines for reading/writing co-processor registers.


# 1.84 14-Aug-2012 matt

Use device_t


# 1.83 12-Aug-2012 matt

Rework VFP support to use PCU.
Add emulation of instruction which save/restore the VFP FPSCR.
Add a sysarch hook to VFP FPSCR manipulation.

[The emulation will be used by libc to store/fetch exception modes and
rounding mode on a per-thread basis.]


# 1.82 14-Jul-2012 matt

Refresh cortex cpus


Revision tags: jmcneill-usbmp-base10 yamt-pagecache-base5
# 1.81 20-May-2012 skrll

Remove the ARM1156T2 bloat - it only has an MPU. Prompted by matt@


# 1.80 20-May-2012 skrll

Add the ARM1156T2-S


# 1.79 20-May-2012 skrll

Add the 'Z' to the 1176 cpu product name.

ok matt@


Revision tags: jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base jym-xensuspend-nbase rmind-uvmplock-base jym-xensuspend-base
# 1.78 10-Mar-2011 bsh

branches: 1.78.4; 1.78.8; 1.78.10;
add MPCore to CPU-ID table
add branch predict bit to arm11_options


Revision tags: uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11
# 1.77 02-Oct-2010 kiyohara

branches: 1.77.2;
Add support Marvell Sheeva Core and SoC. (Orion/Kirkwood)
Discovery Innovation not yet.


Revision tags: uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.76 19-Jun-2010 matt

Fix cache probing on Cortex. Add missing CORTEX dependency in cpu.c


# 1.75 19-Jun-2010 matt

Fix c&p error.


# 1.74 19-Jun-2010 matt

Cleanup the armv7 changes. Add ARM_ARCH_7. Use CPU_CORTEX instead of
CPU_CORTEXA8 everywhere since there more types of Cortex than just the A8.
CPU_CORTEXA8 still exists but causes CPU_CORTEX to be defined.
Add CPU_CORTEXA9 as well. Use .arch armv7a to get us the isb/dsb
instructions.

Test booted to root device prompt on a Beagleboard.
All ARM kernels successfully test built.


# 1.73 16-Jun-2010 jmcneill

PR port-arm/43299: Support added for igepv2/cortexa8/omap3530

Apply patch from PR, with build fixes. ok skrll, matt


Revision tags: uebayasi-xip-base1 yamt-nfs-mp-base9 uebayasi-xip-base
# 1.72 23-Jan-2010 mrg

branches: 1.72.2; 1.72.4;
rename a local cpu_name structure member to avoid potential conflict
with <sys/cpu.h>'s.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-premerge-20091211 yamt-nfs-mp-base8 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 yamt-nfs-mp-base7 netbsd-5-0-1-RELEASE jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base nick-hppapmap-base haad-dm-base mjf-devfs2-base
# 1.71 25-Oct-2008 matt

branches: 1.71.4; 1.71.12;
Fix some missing things for CPU_ID_FA526.


Revision tags: matt-mips64-base2
# 1.70 24-Oct-2008 matt

Add entry for FA526.


# 1.69 21-Oct-2008 matt

Add Cortex cpus


Revision tags: haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base
# 1.68 27-Apr-2008 matt

branches: 1.68.6;
Merge kernel changes in matt-armv6 to HEAD.


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 chris-arm-intr-rework-base7 keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.67 15-Mar-2008 rearnsha

branches: 1.67.2; 1.67.4;
VFP support.


Revision tags: nick-net80211-sync-base chris-arm-intr-rework-base6 chris-arm-intr-rework-base5 chris-arm-intr-rework-base4 bouyer-xeni386-merge1 chris-arm-intr-rework-base3 vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 jmcneill-base mjf-devfs-base bouyer-xenamd64-base2 vmlocking-nbase yamt-x86pmap-base4 bouyer-xenamd64-base matt-armv6-base jmcneill-pm-base hpcarm-cleanup-base reinoud-bufcleanup-base
# 1.66 17-Oct-2007 garbled

branches: 1.66.12; 1.66.16;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base chris-arm-intr-rework-base2 chris-arm-intr-rework-base nick-csl-alignment-base matt-mips64-base ppcoea-renovation-base mjf-ufs-trans-base vmlocking-base
# 1.65 17-May-2007 yamt

branches: 1.65.10; 1.65.12;
merge yamt-idlelwp branch. asked by core@. some ports still needs work.

from doc/BRANCHES:

idle lwp, and some changes depending on it.

1. separate context switching and thread scheduling.
(cf. gmcgarry_ctxsw)
2. implement idle lwp.
3. clean up related MD/MI interfaces.
4. make scheduler(s) modular.


Revision tags: yamt-idlelwp-base8 thorpej-atomic-base ad-audiomp-base post-newlock2-merge newlock2-nbase newlock2-base
# 1.64 06-Jan-2007 christos

branches: 1.64.2; 1.64.6; 1.64.8; 1.64.14;
Scott Allan in http://mail-index.netbsd.org/port-arm/2006/07/31/0000.html
Patch to add support for ARM9E


# 1.63 06-Jan-2007 christos

From Scott Alan in http://mail-index.netbsd.org/port-arm/2006/07/26/0000.html
identify_arm_cpu() prints out a helpful message when it detects that you're
trying to run on a CPU that you didn't configure for. Unfortunately, the
check for class_option being NULL is backward, so it either won't print the
class_option, or it will try to dereference a NULL. The patch just flips the
!= NULL to be == NULL.


Revision tags: yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 abandoned-netbsd-4-base yamt-splraiseipl-base2 yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 netbsd-4-base yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base elad-kernelauth-base simonb-timecounters-base rpaulo-netinet-merge-pcb-base
# 1.62 15-Mar-2006 drochner

branches: 1.62.10; 1.62.14;
use km_alloc to get wired kernel memory for kernel stacks
of idle processes for secondary CPUs
(affects the MULTIPROCESSOR case only - does this exist?)
(untested)


Revision tags: yamt-pdpolicy-base2 yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.61 11-Dec-2005 christos

branches: 1.61.4; 1.61.6; 1.61.8; 1.61.10;
merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.60 20-Jul-2005 nonaka

Added i80219.


# 1.59 04-Jul-2005 bsh

branches: 1.59.2;
The first step to support Intel PXA270.

kernel config option CPU_XSCALE_PXA2X0 is now obsoleted by
CPU_XSCALE_PXA250 and CPU_XSCALE_PXA270. If both of them are defined,
CPU is determined run-time.


# 1.58 03-Jun-2005 rearnsha

Very basic support for the ARM1136.

This code takes no advantage of any 'new' features provided by
architecture 6 devices (such as physically tagged caches or new
MMU features), and basically runs the chip in a 'legacy v5' mode.


# 1.57 10-May-2005 rearnsha

Add support for arm1026ej-s.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 yamt-km-base4 yamt-km-base3 netbsd-3-base yamt-km-base2 yamt-km-base kent-audio2-base kent-audio1-beforemerge kent-audio1-base
# 1.56 14-Apr-2004 bsh

distinguish PXA255/26x from PXA2[15]0 in CPU attach message


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.55 13-Feb-2004 wiz

Uppercase CPU, plural is CPUs.


# 1.54 26-Oct-2003 chris

Fix up some unitialised variables.


# 1.53 06-Sep-2003 rearnsha

Support for ARM10E class devices.


# 1.52 03-Sep-2003 mycroft

Recognize some TI processors -- not that you'd want to use them.


# 1.51 23-Jun-2003 martin

branches: 1.51.2;
Make sure to include opt_foo.h if a defflag option FOO is used.


# 1.50 23-May-2003 ichiro

support IXP425 Intel Network Processor
running on BigEndian


# 1.49 29-Apr-2003 thorpej

Use aprint*().


# 1.48 14-Feb-2003 rjs

Add CPU IDs for PXA B2 and C0 steppings.


Revision tags: nathanw_sa_before_merge nathanw_sa_base
# 1.47 06-Jan-2003 wiz

specified, not specifed.


Revision tags: fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base
# 1.46 17-Nov-2002 chs

change uvm_uarea_alloc() to indicate whether the returned uarea is already
backed by physical pages (ie. because it reused a previously-freed one),
so that we can skip a bunch of useless work in that case.
this fixes the underlying problem behind PR 18543, and also speeds up fork()
quite a bit (eg. 7% on my pc, 1% on my ultra2) when we get a cache hit.


Revision tags: kqueue-aftermerge kqueue-beforemerge bjh21-hydra-base
# 1.45 13-Oct-2002 chris

branches: 1.45.2;
Fix arm kernel build breaks for non multiprocessor systems.


# 1.44 13-Oct-2002 bjh21

It appears that MI code requires ci_cpuid to be the CPU number of the CPU
in question, whereas the ARM code was using it to hold the model
identification. To fix this, rename:

ci_cpuid -> ci_arm_cpuid
ci_cputype -> ci_arm_cputype (for consistency)
ci_cpurev -> ci_arm_cpurev (ditto)
ci_cpunum -> ci_cpuid

This makes top(1) give correct CPU numbers in its "STATE" column (all 0 for
now).


# 1.43 12-Oct-2002 bjh21

Remember the location of each CPU's idle PCB in struct cpu_info.
Move allocation of the idle PCB from hydra.c to cpu.c and add some
extra initialisation from cpu_fork().


Revision tags: kqueue-base
# 1.42 01-Oct-2002 bjh21

constify various string tables.


# 1.41 06-Sep-2002 gehenna

Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.


Revision tags: gehenna-devsw-base
# 1.40 22-Jul-2002 briggs

Handle i80200 step D0 and i80321 step B0


# 1.39 10-Jul-2002 ichiro

add cpu id for "PXA250/210 3rd version CPUcore".

for using many PDA/xscale-core.


# 1.38 07-Jun-2002 thorpej

Add the CPU ID for the 600MHz i80321 part.


Revision tags: netbsd-1-6-base
# 1.37 12-May-2002 ichiro

branches: 1.37.2; 1.37.4;
change ICP12x0 steppings.
define CPU_IXP12X0


# 1.36 10-May-2002 thorpej

Add IXP1200 steppings.


# 1.35 03-May-2002 thorpej

Add support for the Intel PXA210 and PXA250. From Hiroyuki Bessho, PR 16617.


# 1.34 02-May-2002 rjs

Enable CPU_CLASS_SA1 for SA1100 and SA1110.


# 1.33 12-Apr-2002 thorpej

Centralize ARM CPU configuration information by adding a new header
file, <arm/cpuconf.h>, which pulls in "opt_cputypes.h" and then defines
the following:
* CPU_NTYPES -- now many CPU types are configured into the kernel. What
you really want to know is "== 1" or "> 1".
* Defines ARM_ARCH_2, ARM_ARCH_3, ARM_ARCH_4, ARM_ARCH_5, depending
on which ARM architecture versions are configured (based on CPU_*
options). Also defines ARM_NARCH to determins how many architecture
versions are configured.
* Defines ARM_MMU_MEMC, ARM_MMU_GENERIC, ARM_MMU_XSCALE depending on
which classes of ARM MMUs are configured into the kernel, and ARM_NMMUS
to determine how many MMU classes are configured.

Remove the needless inclusion of "opt_cputypes.h" in several places.
Convert remaining users to <arm/cpuconf.h>.


# 1.32 27-Mar-2002 thorpej

The 80321 manual lies; it does have a CPU ID distinct from the 80200.
Add that CPU ID, and add a case for it.


# 1.31 26-Mar-2002 thorpej

Restructure a few things in order to support other XScale core
I/O processors:
* The i80200 and the i80321 have the same CPU ID, so split the
CPU_XSCALE option into CPU_XSCALE_80200 and CPU_XSCALE_80321
options, and don't let them both be defined at the same time.
XXX May want to revisit this in the future.
* Split some registers common between the i80200 and i80321 into
<arm/xscale/xscalereg.h>.
* Rename a few existing functions.


# 1.30 24-Mar-2002 thorpej

Cache the cpu type and cpu revision in cpu_info.


Revision tags: eeh-devprop-base
# 1.29 16-Mar-2002 bjh21

Only put the CPU type into cpu_model, not the state of the control register.
Instead, print the control register state on the next line at startup.


# 1.28 16-Mar-2002 bjh21

Add CPU ID for the ARM1022ES.
Also add a CPU class for ARM10E processors in general.


# 1.27 11-Mar-2002 reinoud

When ARMFPE wasn't enabled the `usearmfpe' flag was statically initialised
but not used resulting in a compiler error. By splitting the declaration
and the initialisation this is solved.

Better would be to not even declare the flag when ARMFPE isnt enabled but
that would just add to the #ifdef jungle.


# 1.26 10-Mar-2002 bjh21

__RCSID -> __KERNEL_RCSID


# 1.25 10-Mar-2002 bjh21

Re-work the way that FPAs are handled. If ARMFPE isn't configured, don't
even bother probing for an FPA. If ARMFPE is configured, always use it,
even if there's an FPA (since it provides the FPA support code). Move all
printfs about FPAs into armfpe_init.c.

This means I can delete the last two elements from struct _cpu, so that the
structure, and the whole of <arm/cpus.h> is redundant and can be deleted.


# 1.24 10-Mar-2002 bjh21

Remove fpu_model from struct _cpu. Instead, have initialise_arm_fpe()
printf() the FPE version number itself.


# 1.23 10-Mar-2002 bjh21

Add a ci_dev element to struct cpu_info, pointing to the device that
corresponds to the CPU.


Revision tags: newlock-base
# 1.22 10-Mar-2002 bjh21

Kill the fpu_flags element from struct _cpu. It was only ever set to 0
anyway.


# 1.21 10-Mar-2002 bjh21

Clean up inline assembler. Rather than saving R0, copying FPSR to R0,
copying it to the output register and then restoring R0, just copy the
FPSR straight to the output.


# 1.20 09-Mar-2002 bjh21

Remove the cpu_model member from struct _cpu, and just use the cpu_model
variable directly. While we're at it, make cpu_model rather larger.


# 1.19 09-Mar-2002 bjh21

Remove the cpu_class element from struct _cpu, and make it a local variable
in identify_arm_cpu(), since it's almost unused elsewhere.

Change the detection of bugged StrongARMs to use the cpu ID rather than the
class. This turns "almost" into "entirely".


# 1.18 09-Mar-2002 bjh21

Replace cpu_id and cpu_ctrl in struct _cpu with ci_cpuid and ci_ctrl in
struct cpu_info. Also kill the cpuctrl global while we're here, and make
identify_arm_cpu() take a struct cpu_info * as an argument alongside the CPU
number.


# 1.17 09-Mar-2002 bjh21

Move arm700bugcount into stuct cpu_info, and attach it in
identify_master_cpu().


Revision tags: ifpoll-base
# 1.16 17-Feb-2002 bjh21

Our assembler handles FPA instructions fine, so don't use .word for them.


# 1.15 17-Feb-2002 bjh21

ANSIfy, and othe KNF cleanup.


# 1.14 27-Jan-2002 bjh21

Add revision->stepping maps for the SA-110, SA-1100 and SA-1110.
Those for the SA-1100 and SA-1110 are from Intel's documentation.
The mapping for the SA-110 is from various sources on the net, since Intel
don't seem to document it.

Also, change the layout of the maps to have four steppings per line,
so they aren't quite so unwieldy.


# 1.13 24-Jan-2002 thorpej

Use a table to look up stepping names. Add a generic stepping
table ("rev 0", "rev 1", etc.) and an i80200 stepping table that
has the stepping names that appear in the i80200 manuals/errata..


# 1.12 29-Nov-2001 thorpej

Fetch cache info from the Cache Type register on ARM7TDMI and "greater"
processors. Report this when the processor is attached.


# 1.11 24-Nov-2001 thorpej

Move the ARM, Ltd. floating point emulator to arch/arm.


# 1.10 23-Nov-2001 thorpej

Use <arm/undefined.h> instead of <machine/undefined.h>.


Revision tags: thorpej-mips-cache-base
# 1.9 06-Nov-2001 thorpej

branches: 1.9.2;
Const poisoning of cpu/class names.


# 1.8 06-Nov-2001 thorpej

"i80200", not "80200".


# 1.7 06-Nov-2001 thorpej

"XScale", not "Xscale".


# 1.6 18-Oct-2001 rearnsha

branches: 1.6.2;
Support for ARM9.


Revision tags: thorpej-devvp-base3 thorpej-devvp-base2
# 1.5 28-Sep-2001 chris

Add extra arg to fpa_test as it should have 4 args. Also add prototypes for fpa_test and fpa_handler.


Revision tags: post-chs-ubcperf pre-chs-ubcperf thorpej-devvp-base
# 1.4 05-Sep-2001 matt

branches: 1.4.2;
Flesh XSCALE support.


# 1.3 03-Jun-2001 chris

branches: 1.3.2; 1.3.4;
Add support for ARM7TDMI, as provided in a patch from John Fremlin to port-arm32.

Shouldn't effect any currently in tree ports.


# 1.2 13-May-2001 bjh21

Use get_bootconf_option() to find boot options, rather than home-grown
strstr()-based hacks.


Revision tags: thorpej_scsipi_beforemerge thorpej_scsipi_base thorpej_scsipi_nbase
# 1.1 20-Apr-2001 matt

branches: 1.1.2;
Split cpu from mainbus so that cpu can attached to other buses (like ofbus).


# 1.141 18-Jan-2020 skrll

Use 4K pages on ARM_MMU_EXTENDED platforms (all armv[67] except RPI) by
creating a new pool l1ttpl for the userland L1 translation table which
needs to be 8KB and 8KB aligned.

Limit the pool to maxproc and add hooks to allow the sysctl changing of
maxproc to adjust the pool.

This comes at a 5% performance penalty for build.sh -j8 kernel on a
Tegra TK1.


Revision tags: ad-namecache-base1
# 1.140 15-Jan-2020 mrg

port the arm64 cpu topology setup for big.little to arm.

rename arm64 cpu_do_topology() to arm_cpu_do_topology() and
call it from both arm cpu_attach().

replace both aarch64_set_topology() inline code in arm
cpu_attach() with new arm_cpu_do_topology(), which is called
by the arm64 locore as well (possibly not needed, which would
allow it to become static.)

not yet tested on a real big.little armv7 system. tested
on rockpro64 and pinebook pro.


# 1.139 09-Jan-2020 ad

- Many small tweaks to the SMT awareness in the scheduler. It does a much
better job now at keeping all physical CPUs busy, while using the extra
threads to help out. In particular, during preempt() if we're using SMT,
try to find a better CPU to run on and teleport curlwp there.

- Change the CPU topology stuff so it can work on asymmetric systems. This
mainly entails rearranging one of the CPU lists so it makes sense in all
configurations.

- Add a parameter to cpu_topology_set() to note that a CPU is "slow", for
where there are fast CPUs and slow CPUs, like with the Rockwell RK3399.
Extend the SMT awareness to try and handle that situation too (keep fast
CPUs busy, use slow CPUs as helpers).


# 1.138 09-Jan-2020 martin

When attaching the first fdtbus, use the root "comptabile" (or failing that:
"model") property to set the cpu model (in userland aka sysctl hw.model).
When attaching the first cpu, do not overwrite a cpu model if it already
had been set.


# 1.137 08-Jan-2020 jmcneill

cpu_hatch is too late to report AP topology, do it at attach time instead


Revision tags: ad-namecache-base
# 1.136 20-Dec-2019 ad

branches: 1.136.2;
Some more CPU topology stuff:

- Use cegger@'s ACPI SRAT parsing code to figure out NUMA node ID for each
CPU as it is attached.

- For scheduler experiments with SMT, flag CPUs with the lowest numbered SMT
IDs as "primaries", link back to the primaries from secondaries, and build
a circular list of CPUs in each package with identical SMT IDs.

- No need for package/core/smt/numa IDs to be anything other than a u_int.


# 1.135 02-Dec-2019 ad

Take the basic CPU topology information we already collect, and use it
to make circular lists of CPU siblings in the same core, and in the
same package. Nothing fancy, just enough to have a bit of fun in the
scheduler trying out different tactics.


Revision tags: phil-wifi-20191119
# 1.134 20-Oct-2019 jmcneill

cpu_hatched_p only for MULTIPROCESSOR


# 1.133 19-Oct-2019 jmcneill

Increase aarch64 MAXCPUS to 256.


# 1.132 29-Sep-2019 skrll

aprint_debug_dev output alignment


# 1.131 08-Sep-2019 tnn

report A12 as A17 to the user. A12 is retcon'ed by ARM.


# 1.130 07-Sep-2019 tnn

Cortex A12 is marketed as A17 but has a distinct part number

observed on Rockchip RK3288


Revision tags: netbsd-9-base phil-wifi-20190609 isaki-audio2-base
# 1.129 17-Mar-2019 skrll

branches: 1.129.4;
Wrap arm_cpu_marker if #ifdef MPDEBUG.

One day a9_mpsubr.S will die


# 1.128 27-Jan-2019 pgoyette

Merge the [pgoyette-compat] branch


Revision tags: pgoyette-compat-20190127
# 1.127 25-Jan-2019 skrll

Make sure ci_{smt,core,package}_id are all filled in appropriately.

Previously the BP was missed and __SHIFTOUT wasn't used.


Revision tags: pgoyette-compat-20190118
# 1.126 03-Jan-2019 jmcneill

Read mpidr and cpuid from the secondary processor itself instead of the
boot processor. While here, add Cortex-A15 r4p0 to supported list.


# 1.125 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.124 02-Jan-2019 skrll

Don't overwrite the setting of cpu_core_id from mpidr


Revision tags: pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020
# 1.123 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.122 08-Oct-2018 skrll

Trialing whitespace


# 1.121 06-Oct-2018 skrll

Use __BIT. NFC.


Revision tags: pgoyette-compat-0930 pgoyette-compat-0906
# 1.120 15-Aug-2018 skrll

KNF


# 1.119 15-Aug-2018 skrll

Fix includes (sys/cdefs.h then sys/param.h)


# 1.118 15-Aug-2018 skrll

Sprinkle #include "opt_cputypes.h"


# 1.117 10-Aug-2018 maxv

Retire CPU_ARM2, CPU_ARM250 and CPU_ARM3, they are all leftovers of
acorn26.

ok jmcneill@ skrll@


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202
# 1.116 16-Sep-2017 matt

branches: 1.116.2; 1.116.4;
Add Cortex-A35 CPU ID.


Revision tags: netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base
# 1.115 01-Jun-2017 chs

branches: 1.115.6;
remove checks for failure after memory allocation calls that cannot fail:

kmem_alloc() with KM_SLEEP
kmem_zalloc() with KM_SLEEP
percpu_alloc()
pserialize_create()
psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.114 11-Jul-2016 kiyohara

Add Cortex-A9 r1.


Revision tags: nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.113 03-Mar-2016 skrll

Get the RPI3 working (in aarch32 mode) by recognising Cortex A53 CPUs.
While I'm here add some A57/A72 info as well.

My RPI3 works with FB console - the uart needs some help with its clocks.


# 1.112 23-Jan-2016 christos

Rename the cpu_id() define to cpu_idnum() so that it does not conflict with
dtrace and friends.


Revision tags: nick-nhusb-base-20151226
# 1.111 12-Nov-2015 jmcneill

change some register dumps from aprint_verbose to aprint_debug


Revision tags: nick-nhusb-base-20150921
# 1.110 08-Jul-2015 skrll

aprint_verbose [sa]ctlr


Revision tags: nick-nhusb-base-20150606
# 1.109 05-Jun-2015 skrll

Print the Revision ID regster (verbose)


# 1.108 17-May-2015 matt

Print out mpidr on MP systems (verbose print)


Revision tags: nick-nhusb-base-20150406
# 1.107 03-Mar-2015 jmcneill

cache type 12 is "write-back", from matt


Revision tags: nick-nhusb-base
# 1.106 27-Nov-2014 matt

branches: 1.106.2;
Add entry for Cortex-A17 r1


# 1.105 01-Sep-2014 reinoud

Increase the `freqbuf' buffer that holds the result of humanize_number(). Now
it prints 1600 Mhz instead of 1 Ghz.
Pitty enough humanize_number(9) doesn't do 1.6 Ghz type output.


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.104 28-Mar-2014 matt

branches: 1.104.4;
Various MP changes.


# 1.103 24-Mar-2014 christos

use cpu_{g,s}etmodel


# 1.102 20-Mar-2014 matt

Define cache type 13


Revision tags: riastradh-drm2-base3
# 1.101 03-Mar-2014 matt

Add most of the cpu_* variables to <arm/locore.h>
Add and initialize cpu_synchprim_present


# 1.100 20-Feb-2014 matt

Keep track of what each cache is (VIVT/VIPT/PIPT).

cpu0: 32KB/32B 2-way L1 VIPT Instruction cache
cpu0: 32KB/64B 4-way write-back-locking-C L1 PIPT Data cache
cpu0: 256KB/64B 8-way write-through L2 PIPT Unified cache


# 1.99 07-Sep-2013 matt

Add a machdep.hwdiv_present sysctl (cortex A7 and A15 have hwdiv instructions)


# 1.98 07-Sep-2013 matt

Add CPU_ID_CORTEXA7R0 entry


# 1.97 18-Aug-2013 matt

Move parts of cpu.h that are not needed by MI code in <arm/locore.h>
Don't include <machine/cpu.h> or <machine/frame.h>, use <arm/locore.h>
Use <arm/asm.h> instead of <machine/arm.h>


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.96 12-Jun-2013 matt

branches: 1.96.2;
Nuke cpu_pfr, just use the armreg_pfr?_read inlines


# 1.95 12-Jun-2013 matt

Use the armreg_pfr?_read inlines.


# 1.94 19-May-2013 rkujawa

Plug support for PJ4B into our ARM CPU infrastructure.

Obtained from Marvell, Semihalf.


Revision tags: agc-symver-base
# 1.93 03-Feb-2013 matt

Add a machdep.cpu_arch sysctl


# 1.92 31-Jan-2013 matt

Add simple sysctls for cpu_id, fpu_id, neon_present, simd_present,
simdex_present.
Add struct sysctls to return the isar, mmfr, pfr, and mvfr sets.


Revision tags: yamt-pagecache-base8 yamt-pagecache-base7
# 1.91 05-Dec-2012 matt

ARMFPE hasn't compiled since NetBSD 4. Remove it.
Complete support for FPU_VFP.
fpregs now contains vfpreg.
XXX vfpreg only has space for 16 64-bit FP registers though VFPv3 and later
have 32 64-bit FP registers.


# 1.90 30-Nov-2012 msaitoh

Use snprintf() instead of sprintf().


# 1.89 30-Nov-2012 msaitoh

s/,/;/


# 1.88 12-Nov-2012 skrll

C99 types


Revision tags: yamt-pagecache-base6
# 1.87 22-Sep-2012 matt

Don't use an asm in pmap_activate to update the TTBR, use cpu_setttb instead
but add a second argument to it to indicate whether the TLB/caches need to be
flushed. Default cortex to pmap_needs_fixup = 1. But check the MMFR3 field
to see if the fixed can be skipped.
Use a cf_flag bit 0 to indicate whether the A9 L2 cache should disable (bit 0 = 1)
or enabeld (bit = 0).

With these changes, the A9 MMU can use traverse caches to do MMU tablewalks
Also, make sure all memory has the shareable bit for the A9.


# 1.86 07-Sep-2012 matt

branches: 1.86.2;
Switch cortex_a9 back to need_ptesync = 1
Add code to disable the L2 cache on cortex-a9 (for now).
Add evcnt for all the fault types.
Move cache info in a structure and have one for the pcache and one for scache.
Probe L1/L2 caches properly for ARMv7


# 1.85 29-Aug-2012 matt

Use new armv7 CP15 register to print out cache types.
If the cpu_cc_freq is set, report it.
Add macros to make inlines for reading/writing co-processor registers.


# 1.84 14-Aug-2012 matt

Use device_t


# 1.83 12-Aug-2012 matt

Rework VFP support to use PCU.
Add emulation of instruction which save/restore the VFP FPSCR.
Add a sysarch hook to VFP FPSCR manipulation.

[The emulation will be used by libc to store/fetch exception modes and
rounding mode on a per-thread basis.]


# 1.82 14-Jul-2012 matt

Refresh cortex cpus


Revision tags: jmcneill-usbmp-base10 yamt-pagecache-base5
# 1.81 20-May-2012 skrll

Remove the ARM1156T2 bloat - it only has an MPU. Prompted by matt@


# 1.80 20-May-2012 skrll

Add the ARM1156T2-S


# 1.79 20-May-2012 skrll

Add the 'Z' to the 1176 cpu product name.

ok matt@


Revision tags: jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base jym-xensuspend-nbase rmind-uvmplock-base jym-xensuspend-base
# 1.78 10-Mar-2011 bsh

branches: 1.78.4; 1.78.8; 1.78.10;
add MPCore to CPU-ID table
add branch predict bit to arm11_options


Revision tags: uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11
# 1.77 02-Oct-2010 kiyohara

branches: 1.77.2;
Add support Marvell Sheeva Core and SoC. (Orion/Kirkwood)
Discovery Innovation not yet.


Revision tags: uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.76 19-Jun-2010 matt

Fix cache probing on Cortex. Add missing CORTEX dependency in cpu.c


# 1.75 19-Jun-2010 matt

Fix c&p error.


# 1.74 19-Jun-2010 matt

Cleanup the armv7 changes. Add ARM_ARCH_7. Use CPU_CORTEX instead of
CPU_CORTEXA8 everywhere since there more types of Cortex than just the A8.
CPU_CORTEXA8 still exists but causes CPU_CORTEX to be defined.
Add CPU_CORTEXA9 as well. Use .arch armv7a to get us the isb/dsb
instructions.

Test booted to root device prompt on a Beagleboard.
All ARM kernels successfully test built.


# 1.73 16-Jun-2010 jmcneill

PR port-arm/43299: Support added for igepv2/cortexa8/omap3530

Apply patch from PR, with build fixes. ok skrll, matt


Revision tags: uebayasi-xip-base1 yamt-nfs-mp-base9 uebayasi-xip-base
# 1.72 23-Jan-2010 mrg

branches: 1.72.2; 1.72.4;
rename a local cpu_name structure member to avoid potential conflict
with <sys/cpu.h>'s.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-premerge-20091211 yamt-nfs-mp-base8 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 yamt-nfs-mp-base7 netbsd-5-0-1-RELEASE jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base nick-hppapmap-base haad-dm-base mjf-devfs2-base
# 1.71 25-Oct-2008 matt

branches: 1.71.4; 1.71.12;
Fix some missing things for CPU_ID_FA526.


Revision tags: matt-mips64-base2
# 1.70 24-Oct-2008 matt

Add entry for FA526.


# 1.69 21-Oct-2008 matt

Add Cortex cpus


Revision tags: haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base
# 1.68 27-Apr-2008 matt

branches: 1.68.6;
Merge kernel changes in matt-armv6 to HEAD.


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 chris-arm-intr-rework-base7 keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.67 15-Mar-2008 rearnsha

branches: 1.67.2; 1.67.4;
VFP support.


Revision tags: nick-net80211-sync-base chris-arm-intr-rework-base6 chris-arm-intr-rework-base5 chris-arm-intr-rework-base4 bouyer-xeni386-merge1 chris-arm-intr-rework-base3 vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 jmcneill-base mjf-devfs-base bouyer-xenamd64-base2 vmlocking-nbase yamt-x86pmap-base4 bouyer-xenamd64-base matt-armv6-base jmcneill-pm-base hpcarm-cleanup-base reinoud-bufcleanup-base
# 1.66 17-Oct-2007 garbled

branches: 1.66.12; 1.66.16;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base chris-arm-intr-rework-base2 chris-arm-intr-rework-base nick-csl-alignment-base matt-mips64-base ppcoea-renovation-base mjf-ufs-trans-base vmlocking-base
# 1.65 17-May-2007 yamt

branches: 1.65.10; 1.65.12;
merge yamt-idlelwp branch. asked by core@. some ports still needs work.

from doc/BRANCHES:

idle lwp, and some changes depending on it.

1. separate context switching and thread scheduling.
(cf. gmcgarry_ctxsw)
2. implement idle lwp.
3. clean up related MD/MI interfaces.
4. make scheduler(s) modular.


Revision tags: yamt-idlelwp-base8 thorpej-atomic-base ad-audiomp-base post-newlock2-merge newlock2-nbase newlock2-base
# 1.64 06-Jan-2007 christos

branches: 1.64.2; 1.64.6; 1.64.8; 1.64.14;
Scott Allan in http://mail-index.netbsd.org/port-arm/2006/07/31/0000.html
Patch to add support for ARM9E


# 1.63 06-Jan-2007 christos

From Scott Alan in http://mail-index.netbsd.org/port-arm/2006/07/26/0000.html
identify_arm_cpu() prints out a helpful message when it detects that you're
trying to run on a CPU that you didn't configure for. Unfortunately, the
check for class_option being NULL is backward, so it either won't print the
class_option, or it will try to dereference a NULL. The patch just flips the
!= NULL to be == NULL.


Revision tags: yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 abandoned-netbsd-4-base yamt-splraiseipl-base2 yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 netbsd-4-base yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base elad-kernelauth-base simonb-timecounters-base rpaulo-netinet-merge-pcb-base
# 1.62 15-Mar-2006 drochner

branches: 1.62.10; 1.62.14;
use km_alloc to get wired kernel memory for kernel stacks
of idle processes for secondary CPUs
(affects the MULTIPROCESSOR case only - does this exist?)
(untested)


Revision tags: yamt-pdpolicy-base2 yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.61 11-Dec-2005 christos

branches: 1.61.4; 1.61.6; 1.61.8; 1.61.10;
merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.60 20-Jul-2005 nonaka

Added i80219.


# 1.59 04-Jul-2005 bsh

branches: 1.59.2;
The first step to support Intel PXA270.

kernel config option CPU_XSCALE_PXA2X0 is now obsoleted by
CPU_XSCALE_PXA250 and CPU_XSCALE_PXA270. If both of them are defined,
CPU is determined run-time.


# 1.58 03-Jun-2005 rearnsha

Very basic support for the ARM1136.

This code takes no advantage of any 'new' features provided by
architecture 6 devices (such as physically tagged caches or new
MMU features), and basically runs the chip in a 'legacy v5' mode.


# 1.57 10-May-2005 rearnsha

Add support for arm1026ej-s.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 yamt-km-base4 yamt-km-base3 netbsd-3-base yamt-km-base2 yamt-km-base kent-audio2-base kent-audio1-beforemerge kent-audio1-base
# 1.56 14-Apr-2004 bsh

distinguish PXA255/26x from PXA2[15]0 in CPU attach message


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.55 13-Feb-2004 wiz

Uppercase CPU, plural is CPUs.


# 1.54 26-Oct-2003 chris

Fix up some unitialised variables.


# 1.53 06-Sep-2003 rearnsha

Support for ARM10E class devices.


# 1.52 03-Sep-2003 mycroft

Recognize some TI processors -- not that you'd want to use them.


# 1.51 23-Jun-2003 martin

branches: 1.51.2;
Make sure to include opt_foo.h if a defflag option FOO is used.


# 1.50 23-May-2003 ichiro

support IXP425 Intel Network Processor
running on BigEndian


# 1.49 29-Apr-2003 thorpej

Use aprint*().


# 1.48 14-Feb-2003 rjs

Add CPU IDs for PXA B2 and C0 steppings.


Revision tags: nathanw_sa_before_merge nathanw_sa_base
# 1.47 06-Jan-2003 wiz

specified, not specifed.


Revision tags: fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base
# 1.46 17-Nov-2002 chs

change uvm_uarea_alloc() to indicate whether the returned uarea is already
backed by physical pages (ie. because it reused a previously-freed one),
so that we can skip a bunch of useless work in that case.
this fixes the underlying problem behind PR 18543, and also speeds up fork()
quite a bit (eg. 7% on my pc, 1% on my ultra2) when we get a cache hit.


Revision tags: kqueue-aftermerge kqueue-beforemerge bjh21-hydra-base
# 1.45 13-Oct-2002 chris

branches: 1.45.2;
Fix arm kernel build breaks for non multiprocessor systems.


# 1.44 13-Oct-2002 bjh21

It appears that MI code requires ci_cpuid to be the CPU number of the CPU
in question, whereas the ARM code was using it to hold the model
identification. To fix this, rename:

ci_cpuid -> ci_arm_cpuid
ci_cputype -> ci_arm_cputype (for consistency)
ci_cpurev -> ci_arm_cpurev (ditto)
ci_cpunum -> ci_cpuid

This makes top(1) give correct CPU numbers in its "STATE" column (all 0 for
now).


# 1.43 12-Oct-2002 bjh21

Remember the location of each CPU's idle PCB in struct cpu_info.
Move allocation of the idle PCB from hydra.c to cpu.c and add some
extra initialisation from cpu_fork().


Revision tags: kqueue-base
# 1.42 01-Oct-2002 bjh21

constify various string tables.


# 1.41 06-Sep-2002 gehenna

Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.


Revision tags: gehenna-devsw-base
# 1.40 22-Jul-2002 briggs

Handle i80200 step D0 and i80321 step B0


# 1.39 10-Jul-2002 ichiro

add cpu id for "PXA250/210 3rd version CPUcore".

for using many PDA/xscale-core.


# 1.38 07-Jun-2002 thorpej

Add the CPU ID for the 600MHz i80321 part.


Revision tags: netbsd-1-6-base
# 1.37 12-May-2002 ichiro

branches: 1.37.2; 1.37.4;
change ICP12x0 steppings.
define CPU_IXP12X0


# 1.36 10-May-2002 thorpej

Add IXP1200 steppings.


# 1.35 03-May-2002 thorpej

Add support for the Intel PXA210 and PXA250. From Hiroyuki Bessho, PR 16617.


# 1.34 02-May-2002 rjs

Enable CPU_CLASS_SA1 for SA1100 and SA1110.


# 1.33 12-Apr-2002 thorpej

Centralize ARM CPU configuration information by adding a new header
file, <arm/cpuconf.h>, which pulls in "opt_cputypes.h" and then defines
the following:
* CPU_NTYPES -- now many CPU types are configured into the kernel. What
you really want to know is "== 1" or "> 1".
* Defines ARM_ARCH_2, ARM_ARCH_3, ARM_ARCH_4, ARM_ARCH_5, depending
on which ARM architecture versions are configured (based on CPU_*
options). Also defines ARM_NARCH to determins how many architecture
versions are configured.
* Defines ARM_MMU_MEMC, ARM_MMU_GENERIC, ARM_MMU_XSCALE depending on
which classes of ARM MMUs are configured into the kernel, and ARM_NMMUS
to determine how many MMU classes are configured.

Remove the needless inclusion of "opt_cputypes.h" in several places.
Convert remaining users to <arm/cpuconf.h>.


# 1.32 27-Mar-2002 thorpej

The 80321 manual lies; it does have a CPU ID distinct from the 80200.
Add that CPU ID, and add a case for it.


# 1.31 26-Mar-2002 thorpej

Restructure a few things in order to support other XScale core
I/O processors:
* The i80200 and the i80321 have the same CPU ID, so split the
CPU_XSCALE option into CPU_XSCALE_80200 and CPU_XSCALE_80321
options, and don't let them both be defined at the same time.
XXX May want to revisit this in the future.
* Split some registers common between the i80200 and i80321 into
<arm/xscale/xscalereg.h>.
* Rename a few existing functions.


# 1.30 24-Mar-2002 thorpej

Cache the cpu type and cpu revision in cpu_info.


Revision tags: eeh-devprop-base
# 1.29 16-Mar-2002 bjh21

Only put the CPU type into cpu_model, not the state of the control register.
Instead, print the control register state on the next line at startup.


# 1.28 16-Mar-2002 bjh21

Add CPU ID for the ARM1022ES.
Also add a CPU class for ARM10E processors in general.


# 1.27 11-Mar-2002 reinoud

When ARMFPE wasn't enabled the `usearmfpe' flag was statically initialised
but not used resulting in a compiler error. By splitting the declaration
and the initialisation this is solved.

Better would be to not even declare the flag when ARMFPE isnt enabled but
that would just add to the #ifdef jungle.


# 1.26 10-Mar-2002 bjh21

__RCSID -> __KERNEL_RCSID


# 1.25 10-Mar-2002 bjh21

Re-work the way that FPAs are handled. If ARMFPE isn't configured, don't
even bother probing for an FPA. If ARMFPE is configured, always use it,
even if there's an FPA (since it provides the FPA support code). Move all
printfs about FPAs into armfpe_init.c.

This means I can delete the last two elements from struct _cpu, so that the
structure, and the whole of <arm/cpus.h> is redundant and can be deleted.


# 1.24 10-Mar-2002 bjh21

Remove fpu_model from struct _cpu. Instead, have initialise_arm_fpe()
printf() the FPE version number itself.


# 1.23 10-Mar-2002 bjh21

Add a ci_dev element to struct cpu_info, pointing to the device that
corresponds to the CPU.


Revision tags: newlock-base
# 1.22 10-Mar-2002 bjh21

Kill the fpu_flags element from struct _cpu. It was only ever set to 0
anyway.


# 1.21 10-Mar-2002 bjh21

Clean up inline assembler. Rather than saving R0, copying FPSR to R0,
copying it to the output register and then restoring R0, just copy the
FPSR straight to the output.


# 1.20 09-Mar-2002 bjh21

Remove the cpu_model member from struct _cpu, and just use the cpu_model
variable directly. While we're at it, make cpu_model rather larger.


# 1.19 09-Mar-2002 bjh21

Remove the cpu_class element from struct _cpu, and make it a local variable
in identify_arm_cpu(), since it's almost unused elsewhere.

Change the detection of bugged StrongARMs to use the cpu ID rather than the
class. This turns "almost" into "entirely".


# 1.18 09-Mar-2002 bjh21

Replace cpu_id and cpu_ctrl in struct _cpu with ci_cpuid and ci_ctrl in
struct cpu_info. Also kill the cpuctrl global while we're here, and make
identify_arm_cpu() take a struct cpu_info * as an argument alongside the CPU
number.


# 1.17 09-Mar-2002 bjh21

Move arm700bugcount into stuct cpu_info, and attach it in
identify_master_cpu().


Revision tags: ifpoll-base
# 1.16 17-Feb-2002 bjh21

Our assembler handles FPA instructions fine, so don't use .word for them.


# 1.15 17-Feb-2002 bjh21

ANSIfy, and othe KNF cleanup.


# 1.14 27-Jan-2002 bjh21

Add revision->stepping maps for the SA-110, SA-1100 and SA-1110.
Those for the SA-1100 and SA-1110 are from Intel's documentation.
The mapping for the SA-110 is from various sources on the net, since Intel
don't seem to document it.

Also, change the layout of the maps to have four steppings per line,
so they aren't quite so unwieldy.


# 1.13 24-Jan-2002 thorpej

Use a table to look up stepping names. Add a generic stepping
table ("rev 0", "rev 1", etc.) and an i80200 stepping table that
has the stepping names that appear in the i80200 manuals/errata..


# 1.12 29-Nov-2001 thorpej

Fetch cache info from the Cache Type register on ARM7TDMI and "greater"
processors. Report this when the processor is attached.


# 1.11 24-Nov-2001 thorpej

Move the ARM, Ltd. floating point emulator to arch/arm.


# 1.10 23-Nov-2001 thorpej

Use <arm/undefined.h> instead of <machine/undefined.h>.


Revision tags: thorpej-mips-cache-base
# 1.9 06-Nov-2001 thorpej

branches: 1.9.2;
Const poisoning of cpu/class names.


# 1.8 06-Nov-2001 thorpej

"i80200", not "80200".


# 1.7 06-Nov-2001 thorpej

"XScale", not "Xscale".


# 1.6 18-Oct-2001 rearnsha

branches: 1.6.2;
Support for ARM9.


Revision tags: thorpej-devvp-base3 thorpej-devvp-base2
# 1.5 28-Sep-2001 chris

Add extra arg to fpa_test as it should have 4 args. Also add prototypes for fpa_test and fpa_handler.


Revision tags: post-chs-ubcperf pre-chs-ubcperf thorpej-devvp-base
# 1.4 05-Sep-2001 matt

branches: 1.4.2;
Flesh XSCALE support.


# 1.3 03-Jun-2001 chris

branches: 1.3.2; 1.3.4;
Add support for ARM7TDMI, as provided in a patch from John Fremlin to port-arm32.

Shouldn't effect any currently in tree ports.


# 1.2 13-May-2001 bjh21

Use get_bootconf_option() to find boot options, rather than home-grown
strstr()-based hacks.


Revision tags: thorpej_scsipi_beforemerge thorpej_scsipi_base thorpej_scsipi_nbase
# 1.1 20-Apr-2001 matt

branches: 1.1.2;
Split cpu from mainbus so that cpu can attached to other buses (like ofbus).


# 1.140 15-Jan-2020 mrg

port the arm64 cpu topology setup for big.little to arm.

rename arm64 cpu_do_topology() to arm_cpu_do_topology() and
call it from both arm cpu_attach().

replace both aarch64_set_topology() inline code in arm
cpu_attach() with new arm_cpu_do_topology(), which is called
by the arm64 locore as well (possibly not needed, which would
allow it to become static.)

not yet tested on a real big.little armv7 system. tested
on rockpro64 and pinebook pro.


# 1.139 09-Jan-2020 ad

- Many small tweaks to the SMT awareness in the scheduler. It does a much
better job now at keeping all physical CPUs busy, while using the extra
threads to help out. In particular, during preempt() if we're using SMT,
try to find a better CPU to run on and teleport curlwp there.

- Change the CPU topology stuff so it can work on asymmetric systems. This
mainly entails rearranging one of the CPU lists so it makes sense in all
configurations.

- Add a parameter to cpu_topology_set() to note that a CPU is "slow", for
where there are fast CPUs and slow CPUs, like with the Rockwell RK3399.
Extend the SMT awareness to try and handle that situation too (keep fast
CPUs busy, use slow CPUs as helpers).


# 1.138 09-Jan-2020 martin

When attaching the first fdtbus, use the root "comptabile" (or failing that:
"model") property to set the cpu model (in userland aka sysctl hw.model).
When attaching the first cpu, do not overwrite a cpu model if it already
had been set.


# 1.137 08-Jan-2020 jmcneill

cpu_hatch is too late to report AP topology, do it at attach time instead


Revision tags: ad-namecache-base
# 1.136 20-Dec-2019 ad

Some more CPU topology stuff:

- Use cegger@'s ACPI SRAT parsing code to figure out NUMA node ID for each
CPU as it is attached.

- For scheduler experiments with SMT, flag CPUs with the lowest numbered SMT
IDs as "primaries", link back to the primaries from secondaries, and build
a circular list of CPUs in each package with identical SMT IDs.

- No need for package/core/smt/numa IDs to be anything other than a u_int.


# 1.135 02-Dec-2019 ad

Take the basic CPU topology information we already collect, and use it
to make circular lists of CPU siblings in the same core, and in the
same package. Nothing fancy, just enough to have a bit of fun in the
scheduler trying out different tactics.


Revision tags: phil-wifi-20191119
# 1.134 20-Oct-2019 jmcneill

cpu_hatched_p only for MULTIPROCESSOR


# 1.133 19-Oct-2019 jmcneill

Increase aarch64 MAXCPUS to 256.


# 1.132 29-Sep-2019 skrll

aprint_debug_dev output alignment


# 1.131 08-Sep-2019 tnn

report A12 as A17 to the user. A12 is retcon'ed by ARM.


# 1.130 07-Sep-2019 tnn

Cortex A12 is marketed as A17 but has a distinct part number

observed on Rockchip RK3288


Revision tags: netbsd-9-base phil-wifi-20190609 isaki-audio2-base
# 1.129 17-Mar-2019 skrll

branches: 1.129.4;
Wrap arm_cpu_marker if #ifdef MPDEBUG.

One day a9_mpsubr.S will die


# 1.128 27-Jan-2019 pgoyette

Merge the [pgoyette-compat] branch


Revision tags: pgoyette-compat-20190127
# 1.127 25-Jan-2019 skrll

Make sure ci_{smt,core,package}_id are all filled in appropriately.

Previously the BP was missed and __SHIFTOUT wasn't used.


Revision tags: pgoyette-compat-20190118
# 1.126 03-Jan-2019 jmcneill

Read mpidr and cpuid from the secondary processor itself instead of the
boot processor. While here, add Cortex-A15 r4p0 to supported list.


# 1.125 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.124 02-Jan-2019 skrll

Don't overwrite the setting of cpu_core_id from mpidr


Revision tags: pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020
# 1.123 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.122 08-Oct-2018 skrll

Trialing whitespace


# 1.121 06-Oct-2018 skrll

Use __BIT. NFC.


Revision tags: pgoyette-compat-0930 pgoyette-compat-0906
# 1.120 15-Aug-2018 skrll

KNF


# 1.119 15-Aug-2018 skrll

Fix includes (sys/cdefs.h then sys/param.h)


# 1.118 15-Aug-2018 skrll

Sprinkle #include "opt_cputypes.h"


# 1.117 10-Aug-2018 maxv

Retire CPU_ARM2, CPU_ARM250 and CPU_ARM3, they are all leftovers of
acorn26.

ok jmcneill@ skrll@


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202
# 1.116 16-Sep-2017 matt

branches: 1.116.2; 1.116.4;
Add Cortex-A35 CPU ID.


Revision tags: netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base
# 1.115 01-Jun-2017 chs

branches: 1.115.6;
remove checks for failure after memory allocation calls that cannot fail:

kmem_alloc() with KM_SLEEP
kmem_zalloc() with KM_SLEEP
percpu_alloc()
pserialize_create()
psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.114 11-Jul-2016 kiyohara

Add Cortex-A9 r1.


Revision tags: nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.113 03-Mar-2016 skrll

Get the RPI3 working (in aarch32 mode) by recognising Cortex A53 CPUs.
While I'm here add some A57/A72 info as well.

My RPI3 works with FB console - the uart needs some help with its clocks.


# 1.112 23-Jan-2016 christos

Rename the cpu_id() define to cpu_idnum() so that it does not conflict with
dtrace and friends.


Revision tags: nick-nhusb-base-20151226
# 1.111 12-Nov-2015 jmcneill

change some register dumps from aprint_verbose to aprint_debug


Revision tags: nick-nhusb-base-20150921
# 1.110 08-Jul-2015 skrll

aprint_verbose [sa]ctlr


Revision tags: nick-nhusb-base-20150606
# 1.109 05-Jun-2015 skrll

Print the Revision ID regster (verbose)


# 1.108 17-May-2015 matt

Print out mpidr on MP systems (verbose print)


Revision tags: nick-nhusb-base-20150406
# 1.107 03-Mar-2015 jmcneill

cache type 12 is "write-back", from matt


Revision tags: nick-nhusb-base
# 1.106 27-Nov-2014 matt

branches: 1.106.2;
Add entry for Cortex-A17 r1


# 1.105 01-Sep-2014 reinoud

Increase the `freqbuf' buffer that holds the result of humanize_number(). Now
it prints 1600 Mhz instead of 1 Ghz.
Pitty enough humanize_number(9) doesn't do 1.6 Ghz type output.


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.104 28-Mar-2014 matt

branches: 1.104.4;
Various MP changes.


# 1.103 24-Mar-2014 christos

use cpu_{g,s}etmodel


# 1.102 20-Mar-2014 matt

Define cache type 13


Revision tags: riastradh-drm2-base3
# 1.101 03-Mar-2014 matt

Add most of the cpu_* variables to <arm/locore.h>
Add and initialize cpu_synchprim_present


# 1.100 20-Feb-2014 matt

Keep track of what each cache is (VIVT/VIPT/PIPT).

cpu0: 32KB/32B 2-way L1 VIPT Instruction cache
cpu0: 32KB/64B 4-way write-back-locking-C L1 PIPT Data cache
cpu0: 256KB/64B 8-way write-through L2 PIPT Unified cache


# 1.99 07-Sep-2013 matt

Add a machdep.hwdiv_present sysctl (cortex A7 and A15 have hwdiv instructions)


# 1.98 07-Sep-2013 matt

Add CPU_ID_CORTEXA7R0 entry


# 1.97 18-Aug-2013 matt

Move parts of cpu.h that are not needed by MI code in <arm/locore.h>
Don't include <machine/cpu.h> or <machine/frame.h>, use <arm/locore.h>
Use <arm/asm.h> instead of <machine/arm.h>


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.96 12-Jun-2013 matt

branches: 1.96.2;
Nuke cpu_pfr, just use the armreg_pfr?_read inlines


# 1.95 12-Jun-2013 matt

Use the armreg_pfr?_read inlines.


# 1.94 19-May-2013 rkujawa

Plug support for PJ4B into our ARM CPU infrastructure.

Obtained from Marvell, Semihalf.


Revision tags: agc-symver-base
# 1.93 03-Feb-2013 matt

Add a machdep.cpu_arch sysctl


# 1.92 31-Jan-2013 matt

Add simple sysctls for cpu_id, fpu_id, neon_present, simd_present,
simdex_present.
Add struct sysctls to return the isar, mmfr, pfr, and mvfr sets.


Revision tags: yamt-pagecache-base8 yamt-pagecache-base7
# 1.91 05-Dec-2012 matt

ARMFPE hasn't compiled since NetBSD 4. Remove it.
Complete support for FPU_VFP.
fpregs now contains vfpreg.
XXX vfpreg only has space for 16 64-bit FP registers though VFPv3 and later
have 32 64-bit FP registers.


# 1.90 30-Nov-2012 msaitoh

Use snprintf() instead of sprintf().


# 1.89 30-Nov-2012 msaitoh

s/,/;/


# 1.88 12-Nov-2012 skrll

C99 types


Revision tags: yamt-pagecache-base6
# 1.87 22-Sep-2012 matt

Don't use an asm in pmap_activate to update the TTBR, use cpu_setttb instead
but add a second argument to it to indicate whether the TLB/caches need to be
flushed. Default cortex to pmap_needs_fixup = 1. But check the MMFR3 field
to see if the fixed can be skipped.
Use a cf_flag bit 0 to indicate whether the A9 L2 cache should disable (bit 0 = 1)
or enabeld (bit = 0).

With these changes, the A9 MMU can use traverse caches to do MMU tablewalks
Also, make sure all memory has the shareable bit for the A9.


# 1.86 07-Sep-2012 matt

branches: 1.86.2;
Switch cortex_a9 back to need_ptesync = 1
Add code to disable the L2 cache on cortex-a9 (for now).
Add evcnt for all the fault types.
Move cache info in a structure and have one for the pcache and one for scache.
Probe L1/L2 caches properly for ARMv7


# 1.85 29-Aug-2012 matt

Use new armv7 CP15 register to print out cache types.
If the cpu_cc_freq is set, report it.
Add macros to make inlines for reading/writing co-processor registers.


# 1.84 14-Aug-2012 matt

Use device_t


# 1.83 12-Aug-2012 matt

Rework VFP support to use PCU.
Add emulation of instruction which save/restore the VFP FPSCR.
Add a sysarch hook to VFP FPSCR manipulation.

[The emulation will be used by libc to store/fetch exception modes and
rounding mode on a per-thread basis.]


# 1.82 14-Jul-2012 matt

Refresh cortex cpus


Revision tags: jmcneill-usbmp-base10 yamt-pagecache-base5
# 1.81 20-May-2012 skrll

Remove the ARM1156T2 bloat - it only has an MPU. Prompted by matt@


# 1.80 20-May-2012 skrll

Add the ARM1156T2-S


# 1.79 20-May-2012 skrll

Add the 'Z' to the 1176 cpu product name.

ok matt@


Revision tags: jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base jym-xensuspend-nbase rmind-uvmplock-base jym-xensuspend-base
# 1.78 10-Mar-2011 bsh

branches: 1.78.4; 1.78.8; 1.78.10;
add MPCore to CPU-ID table
add branch predict bit to arm11_options


Revision tags: uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11
# 1.77 02-Oct-2010 kiyohara

branches: 1.77.2;
Add support Marvell Sheeva Core and SoC. (Orion/Kirkwood)
Discovery Innovation not yet.


Revision tags: uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.76 19-Jun-2010 matt

Fix cache probing on Cortex. Add missing CORTEX dependency in cpu.c


# 1.75 19-Jun-2010 matt

Fix c&p error.


# 1.74 19-Jun-2010 matt

Cleanup the armv7 changes. Add ARM_ARCH_7. Use CPU_CORTEX instead of
CPU_CORTEXA8 everywhere since there more types of Cortex than just the A8.
CPU_CORTEXA8 still exists but causes CPU_CORTEX to be defined.
Add CPU_CORTEXA9 as well. Use .arch armv7a to get us the isb/dsb
instructions.

Test booted to root device prompt on a Beagleboard.
All ARM kernels successfully test built.


# 1.73 16-Jun-2010 jmcneill

PR port-arm/43299: Support added for igepv2/cortexa8/omap3530

Apply patch from PR, with build fixes. ok skrll, matt


Revision tags: uebayasi-xip-base1 yamt-nfs-mp-base9 uebayasi-xip-base
# 1.72 23-Jan-2010 mrg

branches: 1.72.2; 1.72.4;
rename a local cpu_name structure member to avoid potential conflict
with <sys/cpu.h>'s.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-premerge-20091211 yamt-nfs-mp-base8 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 yamt-nfs-mp-base7 netbsd-5-0-1-RELEASE jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base nick-hppapmap-base haad-dm-base mjf-devfs2-base
# 1.71 25-Oct-2008 matt

branches: 1.71.4; 1.71.12;
Fix some missing things for CPU_ID_FA526.


Revision tags: matt-mips64-base2
# 1.70 24-Oct-2008 matt

Add entry for FA526.


# 1.69 21-Oct-2008 matt

Add Cortex cpus


Revision tags: haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base
# 1.68 27-Apr-2008 matt

branches: 1.68.6;
Merge kernel changes in matt-armv6 to HEAD.


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 chris-arm-intr-rework-base7 keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.67 15-Mar-2008 rearnsha

branches: 1.67.2; 1.67.4;
VFP support.


Revision tags: nick-net80211-sync-base chris-arm-intr-rework-base6 chris-arm-intr-rework-base5 chris-arm-intr-rework-base4 bouyer-xeni386-merge1 chris-arm-intr-rework-base3 vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 jmcneill-base mjf-devfs-base bouyer-xenamd64-base2 vmlocking-nbase yamt-x86pmap-base4 bouyer-xenamd64-base matt-armv6-base jmcneill-pm-base hpcarm-cleanup-base reinoud-bufcleanup-base
# 1.66 17-Oct-2007 garbled

branches: 1.66.12; 1.66.16;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base chris-arm-intr-rework-base2 chris-arm-intr-rework-base nick-csl-alignment-base matt-mips64-base ppcoea-renovation-base mjf-ufs-trans-base vmlocking-base
# 1.65 17-May-2007 yamt

branches: 1.65.10; 1.65.12;
merge yamt-idlelwp branch. asked by core@. some ports still needs work.

from doc/BRANCHES:

idle lwp, and some changes depending on it.

1. separate context switching and thread scheduling.
(cf. gmcgarry_ctxsw)
2. implement idle lwp.
3. clean up related MD/MI interfaces.
4. make scheduler(s) modular.


Revision tags: yamt-idlelwp-base8 thorpej-atomic-base ad-audiomp-base post-newlock2-merge newlock2-nbase newlock2-base
# 1.64 06-Jan-2007 christos

branches: 1.64.2; 1.64.6; 1.64.8; 1.64.14;
Scott Allan in http://mail-index.netbsd.org/port-arm/2006/07/31/0000.html
Patch to add support for ARM9E


# 1.63 06-Jan-2007 christos

From Scott Alan in http://mail-index.netbsd.org/port-arm/2006/07/26/0000.html
identify_arm_cpu() prints out a helpful message when it detects that you're
trying to run on a CPU that you didn't configure for. Unfortunately, the
check for class_option being NULL is backward, so it either won't print the
class_option, or it will try to dereference a NULL. The patch just flips the
!= NULL to be == NULL.


Revision tags: yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 abandoned-netbsd-4-base yamt-splraiseipl-base2 yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 netbsd-4-base yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base elad-kernelauth-base simonb-timecounters-base rpaulo-netinet-merge-pcb-base
# 1.62 15-Mar-2006 drochner

branches: 1.62.10; 1.62.14;
use km_alloc to get wired kernel memory for kernel stacks
of idle processes for secondary CPUs
(affects the MULTIPROCESSOR case only - does this exist?)
(untested)


Revision tags: yamt-pdpolicy-base2 yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.61 11-Dec-2005 christos

branches: 1.61.4; 1.61.6; 1.61.8; 1.61.10;
merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.60 20-Jul-2005 nonaka

Added i80219.


# 1.59 04-Jul-2005 bsh

branches: 1.59.2;
The first step to support Intel PXA270.

kernel config option CPU_XSCALE_PXA2X0 is now obsoleted by
CPU_XSCALE_PXA250 and CPU_XSCALE_PXA270. If both of them are defined,
CPU is determined run-time.


# 1.58 03-Jun-2005 rearnsha

Very basic support for the ARM1136.

This code takes no advantage of any 'new' features provided by
architecture 6 devices (such as physically tagged caches or new
MMU features), and basically runs the chip in a 'legacy v5' mode.


# 1.57 10-May-2005 rearnsha

Add support for arm1026ej-s.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 yamt-km-base4 yamt-km-base3 netbsd-3-base yamt-km-base2 yamt-km-base kent-audio2-base kent-audio1-beforemerge kent-audio1-base
# 1.56 14-Apr-2004 bsh

distinguish PXA255/26x from PXA2[15]0 in CPU attach message


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.55 13-Feb-2004 wiz

Uppercase CPU, plural is CPUs.


# 1.54 26-Oct-2003 chris

Fix up some unitialised variables.


# 1.53 06-Sep-2003 rearnsha

Support for ARM10E class devices.


# 1.52 03-Sep-2003 mycroft

Recognize some TI processors -- not that you'd want to use them.


# 1.51 23-Jun-2003 martin

branches: 1.51.2;
Make sure to include opt_foo.h if a defflag option FOO is used.


# 1.50 23-May-2003 ichiro

support IXP425 Intel Network Processor
running on BigEndian


# 1.49 29-Apr-2003 thorpej

Use aprint*().


# 1.48 14-Feb-2003 rjs

Add CPU IDs for PXA B2 and C0 steppings.


Revision tags: nathanw_sa_before_merge nathanw_sa_base
# 1.47 06-Jan-2003 wiz

specified, not specifed.


Revision tags: fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base
# 1.46 17-Nov-2002 chs

change uvm_uarea_alloc() to indicate whether the returned uarea is already
backed by physical pages (ie. because it reused a previously-freed one),
so that we can skip a bunch of useless work in that case.
this fixes the underlying problem behind PR 18543, and also speeds up fork()
quite a bit (eg. 7% on my pc, 1% on my ultra2) when we get a cache hit.


Revision tags: kqueue-aftermerge kqueue-beforemerge bjh21-hydra-base
# 1.45 13-Oct-2002 chris

branches: 1.45.2;
Fix arm kernel build breaks for non multiprocessor systems.


# 1.44 13-Oct-2002 bjh21

It appears that MI code requires ci_cpuid to be the CPU number of the CPU
in question, whereas the ARM code was using it to hold the model
identification. To fix this, rename:

ci_cpuid -> ci_arm_cpuid
ci_cputype -> ci_arm_cputype (for consistency)
ci_cpurev -> ci_arm_cpurev (ditto)
ci_cpunum -> ci_cpuid

This makes top(1) give correct CPU numbers in its "STATE" column (all 0 for
now).


# 1.43 12-Oct-2002 bjh21

Remember the location of each CPU's idle PCB in struct cpu_info.
Move allocation of the idle PCB from hydra.c to cpu.c and add some
extra initialisation from cpu_fork().


Revision tags: kqueue-base
# 1.42 01-Oct-2002 bjh21

constify various string tables.


# 1.41 06-Sep-2002 gehenna

Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.


Revision tags: gehenna-devsw-base
# 1.40 22-Jul-2002 briggs

Handle i80200 step D0 and i80321 step B0


# 1.39 10-Jul-2002 ichiro

add cpu id for "PXA250/210 3rd version CPUcore".

for using many PDA/xscale-core.


# 1.38 07-Jun-2002 thorpej

Add the CPU ID for the 600MHz i80321 part.


Revision tags: netbsd-1-6-base
# 1.37 12-May-2002 ichiro

branches: 1.37.2; 1.37.4;
change ICP12x0 steppings.
define CPU_IXP12X0


# 1.36 10-May-2002 thorpej

Add IXP1200 steppings.


# 1.35 03-May-2002 thorpej

Add support for the Intel PXA210 and PXA250. From Hiroyuki Bessho, PR 16617.


# 1.34 02-May-2002 rjs

Enable CPU_CLASS_SA1 for SA1100 and SA1110.


# 1.33 12-Apr-2002 thorpej

Centralize ARM CPU configuration information by adding a new header
file, <arm/cpuconf.h>, which pulls in "opt_cputypes.h" and then defines
the following:
* CPU_NTYPES -- now many CPU types are configured into the kernel. What
you really want to know is "== 1" or "> 1".
* Defines ARM_ARCH_2, ARM_ARCH_3, ARM_ARCH_4, ARM_ARCH_5, depending
on which ARM architecture versions are configured (based on CPU_*
options). Also defines ARM_NARCH to determins how many architecture
versions are configured.
* Defines ARM_MMU_MEMC, ARM_MMU_GENERIC, ARM_MMU_XSCALE depending on
which classes of ARM MMUs are configured into the kernel, and ARM_NMMUS
to determine how many MMU classes are configured.

Remove the needless inclusion of "opt_cputypes.h" in several places.
Convert remaining users to <arm/cpuconf.h>.


# 1.32 27-Mar-2002 thorpej

The 80321 manual lies; it does have a CPU ID distinct from the 80200.
Add that CPU ID, and add a case for it.


# 1.31 26-Mar-2002 thorpej

Restructure a few things in order to support other XScale core
I/O processors:
* The i80200 and the i80321 have the same CPU ID, so split the
CPU_XSCALE option into CPU_XSCALE_80200 and CPU_XSCALE_80321
options, and don't let them both be defined at the same time.
XXX May want to revisit this in the future.
* Split some registers common between the i80200 and i80321 into
<arm/xscale/xscalereg.h>.
* Rename a few existing functions.


# 1.30 24-Mar-2002 thorpej

Cache the cpu type and cpu revision in cpu_info.


Revision tags: eeh-devprop-base
# 1.29 16-Mar-2002 bjh21

Only put the CPU type into cpu_model, not the state of the control register.
Instead, print the control register state on the next line at startup.


# 1.28 16-Mar-2002 bjh21

Add CPU ID for the ARM1022ES.
Also add a CPU class for ARM10E processors in general.


# 1.27 11-Mar-2002 reinoud

When ARMFPE wasn't enabled the `usearmfpe' flag was statically initialised
but not used resulting in a compiler error. By splitting the declaration
and the initialisation this is solved.

Better would be to not even declare the flag when ARMFPE isnt enabled but
that would just add to the #ifdef jungle.


# 1.26 10-Mar-2002 bjh21

__RCSID -> __KERNEL_RCSID


# 1.25 10-Mar-2002 bjh21

Re-work the way that FPAs are handled. If ARMFPE isn't configured, don't
even bother probing for an FPA. If ARMFPE is configured, always use it,
even if there's an FPA (since it provides the FPA support code). Move all
printfs about FPAs into armfpe_init.c.

This means I can delete the last two elements from struct _cpu, so that the
structure, and the whole of <arm/cpus.h> is redundant and can be deleted.


# 1.24 10-Mar-2002 bjh21

Remove fpu_model from struct _cpu. Instead, have initialise_arm_fpe()
printf() the FPE version number itself.


# 1.23 10-Mar-2002 bjh21

Add a ci_dev element to struct cpu_info, pointing to the device that
corresponds to the CPU.


Revision tags: newlock-base
# 1.22 10-Mar-2002 bjh21

Kill the fpu_flags element from struct _cpu. It was only ever set to 0
anyway.


# 1.21 10-Mar-2002 bjh21

Clean up inline assembler. Rather than saving R0, copying FPSR to R0,
copying it to the output register and then restoring R0, just copy the
FPSR straight to the output.


# 1.20 09-Mar-2002 bjh21

Remove the cpu_model member from struct _cpu, and just use the cpu_model
variable directly. While we're at it, make cpu_model rather larger.


# 1.19 09-Mar-2002 bjh21

Remove the cpu_class element from struct _cpu, and make it a local variable
in identify_arm_cpu(), since it's almost unused elsewhere.

Change the detection of bugged StrongARMs to use the cpu ID rather than the
class. This turns "almost" into "entirely".


# 1.18 09-Mar-2002 bjh21

Replace cpu_id and cpu_ctrl in struct _cpu with ci_cpuid and ci_ctrl in
struct cpu_info. Also kill the cpuctrl global while we're here, and make
identify_arm_cpu() take a struct cpu_info * as an argument alongside the CPU
number.


# 1.17 09-Mar-2002 bjh21

Move arm700bugcount into stuct cpu_info, and attach it in
identify_master_cpu().


Revision tags: ifpoll-base
# 1.16 17-Feb-2002 bjh21

Our assembler handles FPA instructions fine, so don't use .word for them.


# 1.15 17-Feb-2002 bjh21

ANSIfy, and othe KNF cleanup.


# 1.14 27-Jan-2002 bjh21

Add revision->stepping maps for the SA-110, SA-1100 and SA-1110.
Those for the SA-1100 and SA-1110 are from Intel's documentation.
The mapping for the SA-110 is from various sources on the net, since Intel
don't seem to document it.

Also, change the layout of the maps to have four steppings per line,
so they aren't quite so unwieldy.


# 1.13 24-Jan-2002 thorpej

Use a table to look up stepping names. Add a generic stepping
table ("rev 0", "rev 1", etc.) and an i80200 stepping table that
has the stepping names that appear in the i80200 manuals/errata..


# 1.12 29-Nov-2001 thorpej

Fetch cache info from the Cache Type register on ARM7TDMI and "greater"
processors. Report this when the processor is attached.


# 1.11 24-Nov-2001 thorpej

Move the ARM, Ltd. floating point emulator to arch/arm.


# 1.10 23-Nov-2001 thorpej

Use <arm/undefined.h> instead of <machine/undefined.h>.


Revision tags: thorpej-mips-cache-base
# 1.9 06-Nov-2001 thorpej

branches: 1.9.2;
Const poisoning of cpu/class names.


# 1.8 06-Nov-2001 thorpej

"i80200", not "80200".


# 1.7 06-Nov-2001 thorpej

"XScale", not "Xscale".


# 1.6 18-Oct-2001 rearnsha

branches: 1.6.2;
Support for ARM9.


Revision tags: thorpej-devvp-base3 thorpej-devvp-base2
# 1.5 28-Sep-2001 chris

Add extra arg to fpa_test as it should have 4 args. Also add prototypes for fpa_test and fpa_handler.


Revision tags: post-chs-ubcperf pre-chs-ubcperf thorpej-devvp-base
# 1.4 05-Sep-2001 matt

branches: 1.4.2;
Flesh XSCALE support.


# 1.3 03-Jun-2001 chris

branches: 1.3.2; 1.3.4;
Add support for ARM7TDMI, as provided in a patch from John Fremlin to port-arm32.

Shouldn't effect any currently in tree ports.


# 1.2 13-May-2001 bjh21

Use get_bootconf_option() to find boot options, rather than home-grown
strstr()-based hacks.


Revision tags: thorpej_scsipi_beforemerge thorpej_scsipi_base thorpej_scsipi_nbase
# 1.1 20-Apr-2001 matt

branches: 1.1.2;
Split cpu from mainbus so that cpu can attached to other buses (like ofbus).


# 1.139 09-Jan-2020 ad

- Many small tweaks to the SMT awareness in the scheduler. It does a much
better job now at keeping all physical CPUs busy, while using the extra
threads to help out. In particular, during preempt() if we're using SMT,
try to find a better CPU to run on and teleport curlwp there.

- Change the CPU topology stuff so it can work on asymmetric systems. This
mainly entails rearranging one of the CPU lists so it makes sense in all
configurations.

- Add a parameter to cpu_topology_set() to note that a CPU is "slow", for
where there are fast CPUs and slow CPUs, like with the Rockwell RK3399.
Extend the SMT awareness to try and handle that situation too (keep fast
CPUs busy, use slow CPUs as helpers).


# 1.138 09-Jan-2020 martin

When attaching the first fdtbus, use the root "comptabile" (or failing that:
"model") property to set the cpu model (in userland aka sysctl hw.model).
When attaching the first cpu, do not overwrite a cpu model if it already
had been set.


# 1.137 08-Jan-2020 jmcneill

cpu_hatch is too late to report AP topology, do it at attach time instead


Revision tags: ad-namecache-base
# 1.136 20-Dec-2019 ad

Some more CPU topology stuff:

- Use cegger@'s ACPI SRAT parsing code to figure out NUMA node ID for each
CPU as it is attached.

- For scheduler experiments with SMT, flag CPUs with the lowest numbered SMT
IDs as "primaries", link back to the primaries from secondaries, and build
a circular list of CPUs in each package with identical SMT IDs.

- No need for package/core/smt/numa IDs to be anything other than a u_int.


# 1.135 02-Dec-2019 ad

Take the basic CPU topology information we already collect, and use it
to make circular lists of CPU siblings in the same core, and in the
same package. Nothing fancy, just enough to have a bit of fun in the
scheduler trying out different tactics.


Revision tags: phil-wifi-20191119
# 1.134 20-Oct-2019 jmcneill

cpu_hatched_p only for MULTIPROCESSOR


# 1.133 19-Oct-2019 jmcneill

Increase aarch64 MAXCPUS to 256.


# 1.132 29-Sep-2019 skrll

aprint_debug_dev output alignment


# 1.131 08-Sep-2019 tnn

report A12 as A17 to the user. A12 is retcon'ed by ARM.


# 1.130 07-Sep-2019 tnn

Cortex A12 is marketed as A17 but has a distinct part number

observed on Rockchip RK3288


Revision tags: netbsd-9-base phil-wifi-20190609 isaki-audio2-base
# 1.129 17-Mar-2019 skrll

branches: 1.129.4;
Wrap arm_cpu_marker if #ifdef MPDEBUG.

One day a9_mpsubr.S will die


# 1.128 27-Jan-2019 pgoyette

Merge the [pgoyette-compat] branch


Revision tags: pgoyette-compat-20190127
# 1.127 25-Jan-2019 skrll

Make sure ci_{smt,core,package}_id are all filled in appropriately.

Previously the BP was missed and __SHIFTOUT wasn't used.


Revision tags: pgoyette-compat-20190118
# 1.126 03-Jan-2019 jmcneill

Read mpidr and cpuid from the secondary processor itself instead of the
boot processor. While here, add Cortex-A15 r4p0 to supported list.


# 1.125 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.124 02-Jan-2019 skrll

Don't overwrite the setting of cpu_core_id from mpidr


Revision tags: pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020
# 1.123 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.122 08-Oct-2018 skrll

Trialing whitespace


# 1.121 06-Oct-2018 skrll

Use __BIT. NFC.


Revision tags: pgoyette-compat-0930 pgoyette-compat-0906
# 1.120 15-Aug-2018 skrll

KNF


# 1.119 15-Aug-2018 skrll

Fix includes (sys/cdefs.h then sys/param.h)


# 1.118 15-Aug-2018 skrll

Sprinkle #include "opt_cputypes.h"


# 1.117 10-Aug-2018 maxv

Retire CPU_ARM2, CPU_ARM250 and CPU_ARM3, they are all leftovers of
acorn26.

ok jmcneill@ skrll@


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202
# 1.116 16-Sep-2017 matt

branches: 1.116.2; 1.116.4;
Add Cortex-A35 CPU ID.


Revision tags: netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base
# 1.115 01-Jun-2017 chs

branches: 1.115.6;
remove checks for failure after memory allocation calls that cannot fail:

kmem_alloc() with KM_SLEEP
kmem_zalloc() with KM_SLEEP
percpu_alloc()
pserialize_create()
psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.114 11-Jul-2016 kiyohara

Add Cortex-A9 r1.


Revision tags: nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.113 03-Mar-2016 skrll

Get the RPI3 working (in aarch32 mode) by recognising Cortex A53 CPUs.
While I'm here add some A57/A72 info as well.

My RPI3 works with FB console - the uart needs some help with its clocks.


# 1.112 23-Jan-2016 christos

Rename the cpu_id() define to cpu_idnum() so that it does not conflict with
dtrace and friends.


Revision tags: nick-nhusb-base-20151226
# 1.111 12-Nov-2015 jmcneill

change some register dumps from aprint_verbose to aprint_debug


Revision tags: nick-nhusb-base-20150921
# 1.110 08-Jul-2015 skrll

aprint_verbose [sa]ctlr


Revision tags: nick-nhusb-base-20150606
# 1.109 05-Jun-2015 skrll

Print the Revision ID regster (verbose)


# 1.108 17-May-2015 matt

Print out mpidr on MP systems (verbose print)


Revision tags: nick-nhusb-base-20150406
# 1.107 03-Mar-2015 jmcneill

cache type 12 is "write-back", from matt


Revision tags: nick-nhusb-base
# 1.106 27-Nov-2014 matt

branches: 1.106.2;
Add entry for Cortex-A17 r1


# 1.105 01-Sep-2014 reinoud

Increase the `freqbuf' buffer that holds the result of humanize_number(). Now
it prints 1600 Mhz instead of 1 Ghz.
Pitty enough humanize_number(9) doesn't do 1.6 Ghz type output.


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.104 28-Mar-2014 matt

branches: 1.104.4;
Various MP changes.


# 1.103 24-Mar-2014 christos

use cpu_{g,s}etmodel


# 1.102 20-Mar-2014 matt

Define cache type 13


Revision tags: riastradh-drm2-base3
# 1.101 03-Mar-2014 matt

Add most of the cpu_* variables to <arm/locore.h>
Add and initialize cpu_synchprim_present


# 1.100 20-Feb-2014 matt

Keep track of what each cache is (VIVT/VIPT/PIPT).

cpu0: 32KB/32B 2-way L1 VIPT Instruction cache
cpu0: 32KB/64B 4-way write-back-locking-C L1 PIPT Data cache
cpu0: 256KB/64B 8-way write-through L2 PIPT Unified cache


# 1.99 07-Sep-2013 matt

Add a machdep.hwdiv_present sysctl (cortex A7 and A15 have hwdiv instructions)


# 1.98 07-Sep-2013 matt

Add CPU_ID_CORTEXA7R0 entry


# 1.97 18-Aug-2013 matt

Move parts of cpu.h that are not needed by MI code in <arm/locore.h>
Don't include <machine/cpu.h> or <machine/frame.h>, use <arm/locore.h>
Use <arm/asm.h> instead of <machine/arm.h>


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.96 12-Jun-2013 matt

branches: 1.96.2;
Nuke cpu_pfr, just use the armreg_pfr?_read inlines


# 1.95 12-Jun-2013 matt

Use the armreg_pfr?_read inlines.


# 1.94 19-May-2013 rkujawa

Plug support for PJ4B into our ARM CPU infrastructure.

Obtained from Marvell, Semihalf.


Revision tags: agc-symver-base
# 1.93 03-Feb-2013 matt

Add a machdep.cpu_arch sysctl


# 1.92 31-Jan-2013 matt

Add simple sysctls for cpu_id, fpu_id, neon_present, simd_present,
simdex_present.
Add struct sysctls to return the isar, mmfr, pfr, and mvfr sets.


Revision tags: yamt-pagecache-base8 yamt-pagecache-base7
# 1.91 05-Dec-2012 matt

ARMFPE hasn't compiled since NetBSD 4. Remove it.
Complete support for FPU_VFP.
fpregs now contains vfpreg.
XXX vfpreg only has space for 16 64-bit FP registers though VFPv3 and later
have 32 64-bit FP registers.


# 1.90 30-Nov-2012 msaitoh

Use snprintf() instead of sprintf().


# 1.89 30-Nov-2012 msaitoh

s/,/;/


# 1.88 12-Nov-2012 skrll

C99 types


Revision tags: yamt-pagecache-base6
# 1.87 22-Sep-2012 matt

Don't use an asm in pmap_activate to update the TTBR, use cpu_setttb instead
but add a second argument to it to indicate whether the TLB/caches need to be
flushed. Default cortex to pmap_needs_fixup = 1. But check the MMFR3 field
to see if the fixed can be skipped.
Use a cf_flag bit 0 to indicate whether the A9 L2 cache should disable (bit 0 = 1)
or enabeld (bit = 0).

With these changes, the A9 MMU can use traverse caches to do MMU tablewalks
Also, make sure all memory has the shareable bit for the A9.


# 1.86 07-Sep-2012 matt

branches: 1.86.2;
Switch cortex_a9 back to need_ptesync = 1
Add code to disable the L2 cache on cortex-a9 (for now).
Add evcnt for all the fault types.
Move cache info in a structure and have one for the pcache and one for scache.
Probe L1/L2 caches properly for ARMv7


# 1.85 29-Aug-2012 matt

Use new armv7 CP15 register to print out cache types.
If the cpu_cc_freq is set, report it.
Add macros to make inlines for reading/writing co-processor registers.


# 1.84 14-Aug-2012 matt

Use device_t


# 1.83 12-Aug-2012 matt

Rework VFP support to use PCU.
Add emulation of instruction which save/restore the VFP FPSCR.
Add a sysarch hook to VFP FPSCR manipulation.

[The emulation will be used by libc to store/fetch exception modes and
rounding mode on a per-thread basis.]


# 1.82 14-Jul-2012 matt

Refresh cortex cpus


Revision tags: jmcneill-usbmp-base10 yamt-pagecache-base5
# 1.81 20-May-2012 skrll

Remove the ARM1156T2 bloat - it only has an MPU. Prompted by matt@


# 1.80 20-May-2012 skrll

Add the ARM1156T2-S


# 1.79 20-May-2012 skrll

Add the 'Z' to the 1176 cpu product name.

ok matt@


Revision tags: jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base jym-xensuspend-nbase rmind-uvmplock-base jym-xensuspend-base
# 1.78 10-Mar-2011 bsh

branches: 1.78.4; 1.78.8; 1.78.10;
add MPCore to CPU-ID table
add branch predict bit to arm11_options


Revision tags: uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11
# 1.77 02-Oct-2010 kiyohara

branches: 1.77.2;
Add support Marvell Sheeva Core and SoC. (Orion/Kirkwood)
Discovery Innovation not yet.


Revision tags: uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.76 19-Jun-2010 matt

Fix cache probing on Cortex. Add missing CORTEX dependency in cpu.c


# 1.75 19-Jun-2010 matt

Fix c&p error.


# 1.74 19-Jun-2010 matt

Cleanup the armv7 changes. Add ARM_ARCH_7. Use CPU_CORTEX instead of
CPU_CORTEXA8 everywhere since there more types of Cortex than just the A8.
CPU_CORTEXA8 still exists but causes CPU_CORTEX to be defined.
Add CPU_CORTEXA9 as well. Use .arch armv7a to get us the isb/dsb
instructions.

Test booted to root device prompt on a Beagleboard.
All ARM kernels successfully test built.


# 1.73 16-Jun-2010 jmcneill

PR port-arm/43299: Support added for igepv2/cortexa8/omap3530

Apply patch from PR, with build fixes. ok skrll, matt


Revision tags: uebayasi-xip-base1 yamt-nfs-mp-base9 uebayasi-xip-base
# 1.72 23-Jan-2010 mrg

branches: 1.72.2; 1.72.4;
rename a local cpu_name structure member to avoid potential conflict
with <sys/cpu.h>'s.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-premerge-20091211 yamt-nfs-mp-base8 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 yamt-nfs-mp-base7 netbsd-5-0-1-RELEASE jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base nick-hppapmap-base haad-dm-base mjf-devfs2-base
# 1.71 25-Oct-2008 matt

branches: 1.71.4; 1.71.12;
Fix some missing things for CPU_ID_FA526.


Revision tags: matt-mips64-base2
# 1.70 24-Oct-2008 matt

Add entry for FA526.


# 1.69 21-Oct-2008 matt

Add Cortex cpus


Revision tags: haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base
# 1.68 27-Apr-2008 matt

branches: 1.68.6;
Merge kernel changes in matt-armv6 to HEAD.


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 chris-arm-intr-rework-base7 keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.67 15-Mar-2008 rearnsha

branches: 1.67.2; 1.67.4;
VFP support.


Revision tags: nick-net80211-sync-base chris-arm-intr-rework-base6 chris-arm-intr-rework-base5 chris-arm-intr-rework-base4 bouyer-xeni386-merge1 chris-arm-intr-rework-base3 vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 jmcneill-base mjf-devfs-base bouyer-xenamd64-base2 vmlocking-nbase yamt-x86pmap-base4 bouyer-xenamd64-base matt-armv6-base jmcneill-pm-base hpcarm-cleanup-base reinoud-bufcleanup-base
# 1.66 17-Oct-2007 garbled

branches: 1.66.12; 1.66.16;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base chris-arm-intr-rework-base2 chris-arm-intr-rework-base nick-csl-alignment-base matt-mips64-base ppcoea-renovation-base mjf-ufs-trans-base vmlocking-base
# 1.65 17-May-2007 yamt

branches: 1.65.10; 1.65.12;
merge yamt-idlelwp branch. asked by core@. some ports still needs work.

from doc/BRANCHES:

idle lwp, and some changes depending on it.

1. separate context switching and thread scheduling.
(cf. gmcgarry_ctxsw)
2. implement idle lwp.
3. clean up related MD/MI interfaces.
4. make scheduler(s) modular.


Revision tags: yamt-idlelwp-base8 thorpej-atomic-base ad-audiomp-base post-newlock2-merge newlock2-nbase newlock2-base
# 1.64 06-Jan-2007 christos

branches: 1.64.2; 1.64.6; 1.64.8; 1.64.14;
Scott Allan in http://mail-index.netbsd.org/port-arm/2006/07/31/0000.html
Patch to add support for ARM9E


# 1.63 06-Jan-2007 christos

From Scott Alan in http://mail-index.netbsd.org/port-arm/2006/07/26/0000.html
identify_arm_cpu() prints out a helpful message when it detects that you're
trying to run on a CPU that you didn't configure for. Unfortunately, the
check for class_option being NULL is backward, so it either won't print the
class_option, or it will try to dereference a NULL. The patch just flips the
!= NULL to be == NULL.


Revision tags: yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 abandoned-netbsd-4-base yamt-splraiseipl-base2 yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 netbsd-4-base yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base elad-kernelauth-base simonb-timecounters-base rpaulo-netinet-merge-pcb-base
# 1.62 15-Mar-2006 drochner

branches: 1.62.10; 1.62.14;
use km_alloc to get wired kernel memory for kernel stacks
of idle processes for secondary CPUs
(affects the MULTIPROCESSOR case only - does this exist?)
(untested)


Revision tags: yamt-pdpolicy-base2 yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.61 11-Dec-2005 christos

branches: 1.61.4; 1.61.6; 1.61.8; 1.61.10;
merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.60 20-Jul-2005 nonaka

Added i80219.


# 1.59 04-Jul-2005 bsh

branches: 1.59.2;
The first step to support Intel PXA270.

kernel config option CPU_XSCALE_PXA2X0 is now obsoleted by
CPU_XSCALE_PXA250 and CPU_XSCALE_PXA270. If both of them are defined,
CPU is determined run-time.


# 1.58 03-Jun-2005 rearnsha

Very basic support for the ARM1136.

This code takes no advantage of any 'new' features provided by
architecture 6 devices (such as physically tagged caches or new
MMU features), and basically runs the chip in a 'legacy v5' mode.


# 1.57 10-May-2005 rearnsha

Add support for arm1026ej-s.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 yamt-km-base4 yamt-km-base3 netbsd-3-base yamt-km-base2 yamt-km-base kent-audio2-base kent-audio1-beforemerge kent-audio1-base
# 1.56 14-Apr-2004 bsh

distinguish PXA255/26x from PXA2[15]0 in CPU attach message


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.55 13-Feb-2004 wiz

Uppercase CPU, plural is CPUs.


# 1.54 26-Oct-2003 chris

Fix up some unitialised variables.


# 1.53 06-Sep-2003 rearnsha

Support for ARM10E class devices.


# 1.52 03-Sep-2003 mycroft

Recognize some TI processors -- not that you'd want to use them.


# 1.51 23-Jun-2003 martin

branches: 1.51.2;
Make sure to include opt_foo.h if a defflag option FOO is used.


# 1.50 23-May-2003 ichiro

support IXP425 Intel Network Processor
running on BigEndian


# 1.49 29-Apr-2003 thorpej

Use aprint*().


# 1.48 14-Feb-2003 rjs

Add CPU IDs for PXA B2 and C0 steppings.


Revision tags: nathanw_sa_before_merge nathanw_sa_base
# 1.47 06-Jan-2003 wiz

specified, not specifed.


Revision tags: fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base
# 1.46 17-Nov-2002 chs

change uvm_uarea_alloc() to indicate whether the returned uarea is already
backed by physical pages (ie. because it reused a previously-freed one),
so that we can skip a bunch of useless work in that case.
this fixes the underlying problem behind PR 18543, and also speeds up fork()
quite a bit (eg. 7% on my pc, 1% on my ultra2) when we get a cache hit.


Revision tags: kqueue-aftermerge kqueue-beforemerge bjh21-hydra-base
# 1.45 13-Oct-2002 chris

branches: 1.45.2;
Fix arm kernel build breaks for non multiprocessor systems.


# 1.44 13-Oct-2002 bjh21

It appears that MI code requires ci_cpuid to be the CPU number of the CPU
in question, whereas the ARM code was using it to hold the model
identification. To fix this, rename:

ci_cpuid -> ci_arm_cpuid
ci_cputype -> ci_arm_cputype (for consistency)
ci_cpurev -> ci_arm_cpurev (ditto)
ci_cpunum -> ci_cpuid

This makes top(1) give correct CPU numbers in its "STATE" column (all 0 for
now).


# 1.43 12-Oct-2002 bjh21

Remember the location of each CPU's idle PCB in struct cpu_info.
Move allocation of the idle PCB from hydra.c to cpu.c and add some
extra initialisation from cpu_fork().


Revision tags: kqueue-base
# 1.42 01-Oct-2002 bjh21

constify various string tables.


# 1.41 06-Sep-2002 gehenna

Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.


Revision tags: gehenna-devsw-base
# 1.40 22-Jul-2002 briggs

Handle i80200 step D0 and i80321 step B0


# 1.39 10-Jul-2002 ichiro

add cpu id for "PXA250/210 3rd version CPUcore".

for using many PDA/xscale-core.


# 1.38 07-Jun-2002 thorpej

Add the CPU ID for the 600MHz i80321 part.


Revision tags: netbsd-1-6-base
# 1.37 12-May-2002 ichiro

branches: 1.37.2; 1.37.4;
change ICP12x0 steppings.
define CPU_IXP12X0


# 1.36 10-May-2002 thorpej

Add IXP1200 steppings.


# 1.35 03-May-2002 thorpej

Add support for the Intel PXA210 and PXA250. From Hiroyuki Bessho, PR 16617.


# 1.34 02-May-2002 rjs

Enable CPU_CLASS_SA1 for SA1100 and SA1110.


# 1.33 12-Apr-2002 thorpej

Centralize ARM CPU configuration information by adding a new header
file, <arm/cpuconf.h>, which pulls in "opt_cputypes.h" and then defines
the following:
* CPU_NTYPES -- now many CPU types are configured into the kernel. What
you really want to know is "== 1" or "> 1".
* Defines ARM_ARCH_2, ARM_ARCH_3, ARM_ARCH_4, ARM_ARCH_5, depending
on which ARM architecture versions are configured (based on CPU_*
options). Also defines ARM_NARCH to determins how many architecture
versions are configured.
* Defines ARM_MMU_MEMC, ARM_MMU_GENERIC, ARM_MMU_XSCALE depending on
which classes of ARM MMUs are configured into the kernel, and ARM_NMMUS
to determine how many MMU classes are configured.

Remove the needless inclusion of "opt_cputypes.h" in several places.
Convert remaining users to <arm/cpuconf.h>.


# 1.32 27-Mar-2002 thorpej

The 80321 manual lies; it does have a CPU ID distinct from the 80200.
Add that CPU ID, and add a case for it.


# 1.31 26-Mar-2002 thorpej

Restructure a few things in order to support other XScale core
I/O processors:
* The i80200 and the i80321 have the same CPU ID, so split the
CPU_XSCALE option into CPU_XSCALE_80200 and CPU_XSCALE_80321
options, and don't let them both be defined at the same time.
XXX May want to revisit this in the future.
* Split some registers common between the i80200 and i80321 into
<arm/xscale/xscalereg.h>.
* Rename a few existing functions.


# 1.30 24-Mar-2002 thorpej

Cache the cpu type and cpu revision in cpu_info.


Revision tags: eeh-devprop-base
# 1.29 16-Mar-2002 bjh21

Only put the CPU type into cpu_model, not the state of the control register.
Instead, print the control register state on the next line at startup.


# 1.28 16-Mar-2002 bjh21

Add CPU ID for the ARM1022ES.
Also add a CPU class for ARM10E processors in general.


# 1.27 11-Mar-2002 reinoud

When ARMFPE wasn't enabled the `usearmfpe' flag was statically initialised
but not used resulting in a compiler error. By splitting the declaration
and the initialisation this is solved.

Better would be to not even declare the flag when ARMFPE isnt enabled but
that would just add to the #ifdef jungle.


# 1.26 10-Mar-2002 bjh21

__RCSID -> __KERNEL_RCSID


# 1.25 10-Mar-2002 bjh21

Re-work the way that FPAs are handled. If ARMFPE isn't configured, don't
even bother probing for an FPA. If ARMFPE is configured, always use it,
even if there's an FPA (since it provides the FPA support code). Move all
printfs about FPAs into armfpe_init.c.

This means I can delete the last two elements from struct _cpu, so that the
structure, and the whole of <arm/cpus.h> is redundant and can be deleted.


# 1.24 10-Mar-2002 bjh21

Remove fpu_model from struct _cpu. Instead, have initialise_arm_fpe()
printf() the FPE version number itself.


# 1.23 10-Mar-2002 bjh21

Add a ci_dev element to struct cpu_info, pointing to the device that
corresponds to the CPU.


Revision tags: newlock-base
# 1.22 10-Mar-2002 bjh21

Kill the fpu_flags element from struct _cpu. It was only ever set to 0
anyway.


# 1.21 10-Mar-2002 bjh21

Clean up inline assembler. Rather than saving R0, copying FPSR to R0,
copying it to the output register and then restoring R0, just copy the
FPSR straight to the output.


# 1.20 09-Mar-2002 bjh21

Remove the cpu_model member from struct _cpu, and just use the cpu_model
variable directly. While we're at it, make cpu_model rather larger.


# 1.19 09-Mar-2002 bjh21

Remove the cpu_class element from struct _cpu, and make it a local variable
in identify_arm_cpu(), since it's almost unused elsewhere.

Change the detection of bugged StrongARMs to use the cpu ID rather than the
class. This turns "almost" into "entirely".


# 1.18 09-Mar-2002 bjh21

Replace cpu_id and cpu_ctrl in struct _cpu with ci_cpuid and ci_ctrl in
struct cpu_info. Also kill the cpuctrl global while we're here, and make
identify_arm_cpu() take a struct cpu_info * as an argument alongside the CPU
number.


# 1.17 09-Mar-2002 bjh21

Move arm700bugcount into stuct cpu_info, and attach it in
identify_master_cpu().


Revision tags: ifpoll-base
# 1.16 17-Feb-2002 bjh21

Our assembler handles FPA instructions fine, so don't use .word for them.


# 1.15 17-Feb-2002 bjh21

ANSIfy, and othe KNF cleanup.


# 1.14 27-Jan-2002 bjh21

Add revision->stepping maps for the SA-110, SA-1100 and SA-1110.
Those for the SA-1100 and SA-1110 are from Intel's documentation.
The mapping for the SA-110 is from various sources on the net, since Intel
don't seem to document it.

Also, change the layout of the maps to have four steppings per line,
so they aren't quite so unwieldy.


# 1.13 24-Jan-2002 thorpej

Use a table to look up stepping names. Add a generic stepping
table ("rev 0", "rev 1", etc.) and an i80200 stepping table that
has the stepping names that appear in the i80200 manuals/errata..


# 1.12 29-Nov-2001 thorpej

Fetch cache info from the Cache Type register on ARM7TDMI and "greater"
processors. Report this when the processor is attached.


# 1.11 24-Nov-2001 thorpej

Move the ARM, Ltd. floating point emulator to arch/arm.


# 1.10 23-Nov-2001 thorpej

Use <arm/undefined.h> instead of <machine/undefined.h>.


Revision tags: thorpej-mips-cache-base
# 1.9 06-Nov-2001 thorpej

branches: 1.9.2;
Const poisoning of cpu/class names.


# 1.8 06-Nov-2001 thorpej

"i80200", not "80200".


# 1.7 06-Nov-2001 thorpej

"XScale", not "Xscale".


# 1.6 18-Oct-2001 rearnsha

branches: 1.6.2;
Support for ARM9.


Revision tags: thorpej-devvp-base3 thorpej-devvp-base2
# 1.5 28-Sep-2001 chris

Add extra arg to fpa_test as it should have 4 args. Also add prototypes for fpa_test and fpa_handler.


Revision tags: post-chs-ubcperf pre-chs-ubcperf thorpej-devvp-base
# 1.4 05-Sep-2001 matt

branches: 1.4.2;
Flesh XSCALE support.


# 1.3 03-Jun-2001 chris

branches: 1.3.2; 1.3.4;
Add support for ARM7TDMI, as provided in a patch from John Fremlin to port-arm32.

Shouldn't effect any currently in tree ports.


# 1.2 13-May-2001 bjh21

Use get_bootconf_option() to find boot options, rather than home-grown
strstr()-based hacks.


Revision tags: thorpej_scsipi_beforemerge thorpej_scsipi_base thorpej_scsipi_nbase
# 1.1 20-Apr-2001 matt

branches: 1.1.2;
Split cpu from mainbus so that cpu can attached to other buses (like ofbus).


# 1.137 08-Jan-2020 jmcneill

cpu_hatch is too late to report AP topology, do it at attach time instead


Revision tags: ad-namecache-base
# 1.136 20-Dec-2019 ad

Some more CPU topology stuff:

- Use cegger@'s ACPI SRAT parsing code to figure out NUMA node ID for each
CPU as it is attached.

- For scheduler experiments with SMT, flag CPUs with the lowest numbered SMT
IDs as "primaries", link back to the primaries from secondaries, and build
a circular list of CPUs in each package with identical SMT IDs.

- No need for package/core/smt/numa IDs to be anything other than a u_int.


# 1.135 02-Dec-2019 ad

Take the basic CPU topology information we already collect, and use it
to make circular lists of CPU siblings in the same core, and in the
same package. Nothing fancy, just enough to have a bit of fun in the
scheduler trying out different tactics.


Revision tags: phil-wifi-20191119
# 1.134 20-Oct-2019 jmcneill

cpu_hatched_p only for MULTIPROCESSOR


# 1.133 19-Oct-2019 jmcneill

Increase aarch64 MAXCPUS to 256.


# 1.132 29-Sep-2019 skrll

aprint_debug_dev output alignment


# 1.131 08-Sep-2019 tnn

report A12 as A17 to the user. A12 is retcon'ed by ARM.


# 1.130 07-Sep-2019 tnn

Cortex A12 is marketed as A17 but has a distinct part number

observed on Rockchip RK3288


Revision tags: netbsd-9-base phil-wifi-20190609 isaki-audio2-base
# 1.129 17-Mar-2019 skrll

branches: 1.129.4;
Wrap arm_cpu_marker if #ifdef MPDEBUG.

One day a9_mpsubr.S will die


# 1.128 27-Jan-2019 pgoyette

Merge the [pgoyette-compat] branch


Revision tags: pgoyette-compat-20190127
# 1.127 25-Jan-2019 skrll

Make sure ci_{smt,core,package}_id are all filled in appropriately.

Previously the BP was missed and __SHIFTOUT wasn't used.


Revision tags: pgoyette-compat-20190118
# 1.126 03-Jan-2019 jmcneill

Read mpidr and cpuid from the secondary processor itself instead of the
boot processor. While here, add Cortex-A15 r4p0 to supported list.


# 1.125 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.124 02-Jan-2019 skrll

Don't overwrite the setting of cpu_core_id from mpidr


Revision tags: pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020
# 1.123 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.122 08-Oct-2018 skrll

Trialing whitespace


# 1.121 06-Oct-2018 skrll

Use __BIT. NFC.


Revision tags: pgoyette-compat-0930 pgoyette-compat-0906
# 1.120 15-Aug-2018 skrll

KNF


# 1.119 15-Aug-2018 skrll

Fix includes (sys/cdefs.h then sys/param.h)


# 1.118 15-Aug-2018 skrll

Sprinkle #include "opt_cputypes.h"


# 1.117 10-Aug-2018 maxv

Retire CPU_ARM2, CPU_ARM250 and CPU_ARM3, they are all leftovers of
acorn26.

ok jmcneill@ skrll@


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202
# 1.116 16-Sep-2017 matt

branches: 1.116.2; 1.116.4;
Add Cortex-A35 CPU ID.


Revision tags: netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base
# 1.115 01-Jun-2017 chs

branches: 1.115.6;
remove checks for failure after memory allocation calls that cannot fail:

kmem_alloc() with KM_SLEEP
kmem_zalloc() with KM_SLEEP
percpu_alloc()
pserialize_create()
psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.114 11-Jul-2016 kiyohara

Add Cortex-A9 r1.


Revision tags: nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.113 03-Mar-2016 skrll

Get the RPI3 working (in aarch32 mode) by recognising Cortex A53 CPUs.
While I'm here add some A57/A72 info as well.

My RPI3 works with FB console - the uart needs some help with its clocks.


# 1.112 23-Jan-2016 christos

Rename the cpu_id() define to cpu_idnum() so that it does not conflict with
dtrace and friends.


Revision tags: nick-nhusb-base-20151226
# 1.111 12-Nov-2015 jmcneill

change some register dumps from aprint_verbose to aprint_debug


Revision tags: nick-nhusb-base-20150921
# 1.110 08-Jul-2015 skrll

aprint_verbose [sa]ctlr


Revision tags: nick-nhusb-base-20150606
# 1.109 05-Jun-2015 skrll

Print the Revision ID regster (verbose)


# 1.108 17-May-2015 matt

Print out mpidr on MP systems (verbose print)


Revision tags: nick-nhusb-base-20150406
# 1.107 03-Mar-2015 jmcneill

cache type 12 is "write-back", from matt


Revision tags: nick-nhusb-base
# 1.106 27-Nov-2014 matt

branches: 1.106.2;
Add entry for Cortex-A17 r1


# 1.105 01-Sep-2014 reinoud

Increase the `freqbuf' buffer that holds the result of humanize_number(). Now
it prints 1600 Mhz instead of 1 Ghz.
Pitty enough humanize_number(9) doesn't do 1.6 Ghz type output.


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.104 28-Mar-2014 matt

branches: 1.104.4;
Various MP changes.


# 1.103 24-Mar-2014 christos

use cpu_{g,s}etmodel


# 1.102 20-Mar-2014 matt

Define cache type 13


Revision tags: riastradh-drm2-base3
# 1.101 03-Mar-2014 matt

Add most of the cpu_* variables to <arm/locore.h>
Add and initialize cpu_synchprim_present


# 1.100 20-Feb-2014 matt

Keep track of what each cache is (VIVT/VIPT/PIPT).

cpu0: 32KB/32B 2-way L1 VIPT Instruction cache
cpu0: 32KB/64B 4-way write-back-locking-C L1 PIPT Data cache
cpu0: 256KB/64B 8-way write-through L2 PIPT Unified cache


# 1.99 07-Sep-2013 matt

Add a machdep.hwdiv_present sysctl (cortex A7 and A15 have hwdiv instructions)


# 1.98 07-Sep-2013 matt

Add CPU_ID_CORTEXA7R0 entry


# 1.97 18-Aug-2013 matt

Move parts of cpu.h that are not needed by MI code in <arm/locore.h>
Don't include <machine/cpu.h> or <machine/frame.h>, use <arm/locore.h>
Use <arm/asm.h> instead of <machine/arm.h>


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.96 12-Jun-2013 matt

branches: 1.96.2;
Nuke cpu_pfr, just use the armreg_pfr?_read inlines


# 1.95 12-Jun-2013 matt

Use the armreg_pfr?_read inlines.


# 1.94 19-May-2013 rkujawa

Plug support for PJ4B into our ARM CPU infrastructure.

Obtained from Marvell, Semihalf.


Revision tags: agc-symver-base
# 1.93 03-Feb-2013 matt

Add a machdep.cpu_arch sysctl


# 1.92 31-Jan-2013 matt

Add simple sysctls for cpu_id, fpu_id, neon_present, simd_present,
simdex_present.
Add struct sysctls to return the isar, mmfr, pfr, and mvfr sets.


Revision tags: yamt-pagecache-base8 yamt-pagecache-base7
# 1.91 05-Dec-2012 matt

ARMFPE hasn't compiled since NetBSD 4. Remove it.
Complete support for FPU_VFP.
fpregs now contains vfpreg.
XXX vfpreg only has space for 16 64-bit FP registers though VFPv3 and later
have 32 64-bit FP registers.


# 1.90 30-Nov-2012 msaitoh

Use snprintf() instead of sprintf().


# 1.89 30-Nov-2012 msaitoh

s/,/;/


# 1.88 12-Nov-2012 skrll

C99 types


Revision tags: yamt-pagecache-base6
# 1.87 22-Sep-2012 matt

Don't use an asm in pmap_activate to update the TTBR, use cpu_setttb instead
but add a second argument to it to indicate whether the TLB/caches need to be
flushed. Default cortex to pmap_needs_fixup = 1. But check the MMFR3 field
to see if the fixed can be skipped.
Use a cf_flag bit 0 to indicate whether the A9 L2 cache should disable (bit 0 = 1)
or enabeld (bit = 0).

With these changes, the A9 MMU can use traverse caches to do MMU tablewalks
Also, make sure all memory has the shareable bit for the A9.


# 1.86 07-Sep-2012 matt

branches: 1.86.2;
Switch cortex_a9 back to need_ptesync = 1
Add code to disable the L2 cache on cortex-a9 (for now).
Add evcnt for all the fault types.
Move cache info in a structure and have one for the pcache and one for scache.
Probe L1/L2 caches properly for ARMv7


# 1.85 29-Aug-2012 matt

Use new armv7 CP15 register to print out cache types.
If the cpu_cc_freq is set, report it.
Add macros to make inlines for reading/writing co-processor registers.


# 1.84 14-Aug-2012 matt

Use device_t


# 1.83 12-Aug-2012 matt

Rework VFP support to use PCU.
Add emulation of instruction which save/restore the VFP FPSCR.
Add a sysarch hook to VFP FPSCR manipulation.

[The emulation will be used by libc to store/fetch exception modes and
rounding mode on a per-thread basis.]


# 1.82 14-Jul-2012 matt

Refresh cortex cpus


Revision tags: jmcneill-usbmp-base10 yamt-pagecache-base5
# 1.81 20-May-2012 skrll

Remove the ARM1156T2 bloat - it only has an MPU. Prompted by matt@


# 1.80 20-May-2012 skrll

Add the ARM1156T2-S


# 1.79 20-May-2012 skrll

Add the 'Z' to the 1176 cpu product name.

ok matt@


Revision tags: jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base jym-xensuspend-nbase rmind-uvmplock-base jym-xensuspend-base
# 1.78 10-Mar-2011 bsh

branches: 1.78.4; 1.78.8; 1.78.10;
add MPCore to CPU-ID table
add branch predict bit to arm11_options


Revision tags: uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11
# 1.77 02-Oct-2010 kiyohara

branches: 1.77.2;
Add support Marvell Sheeva Core and SoC. (Orion/Kirkwood)
Discovery Innovation not yet.


Revision tags: uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.76 19-Jun-2010 matt

Fix cache probing on Cortex. Add missing CORTEX dependency in cpu.c


# 1.75 19-Jun-2010 matt

Fix c&p error.


# 1.74 19-Jun-2010 matt

Cleanup the armv7 changes. Add ARM_ARCH_7. Use CPU_CORTEX instead of
CPU_CORTEXA8 everywhere since there more types of Cortex than just the A8.
CPU_CORTEXA8 still exists but causes CPU_CORTEX to be defined.
Add CPU_CORTEXA9 as well. Use .arch armv7a to get us the isb/dsb
instructions.

Test booted to root device prompt on a Beagleboard.
All ARM kernels successfully test built.


# 1.73 16-Jun-2010 jmcneill

PR port-arm/43299: Support added for igepv2/cortexa8/omap3530

Apply patch from PR, with build fixes. ok skrll, matt


Revision tags: uebayasi-xip-base1 yamt-nfs-mp-base9 uebayasi-xip-base
# 1.72 23-Jan-2010 mrg

branches: 1.72.2; 1.72.4;
rename a local cpu_name structure member to avoid potential conflict
with <sys/cpu.h>'s.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-premerge-20091211 yamt-nfs-mp-base8 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 yamt-nfs-mp-base7 netbsd-5-0-1-RELEASE jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base nick-hppapmap-base haad-dm-base mjf-devfs2-base
# 1.71 25-Oct-2008 matt

branches: 1.71.4; 1.71.12;
Fix some missing things for CPU_ID_FA526.


Revision tags: matt-mips64-base2
# 1.70 24-Oct-2008 matt

Add entry for FA526.


# 1.69 21-Oct-2008 matt

Add Cortex cpus


Revision tags: haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base
# 1.68 27-Apr-2008 matt

branches: 1.68.6;
Merge kernel changes in matt-armv6 to HEAD.


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 chris-arm-intr-rework-base7 keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.67 15-Mar-2008 rearnsha

branches: 1.67.2; 1.67.4;
VFP support.


Revision tags: nick-net80211-sync-base chris-arm-intr-rework-base6 chris-arm-intr-rework-base5 chris-arm-intr-rework-base4 bouyer-xeni386-merge1 chris-arm-intr-rework-base3 vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 jmcneill-base mjf-devfs-base bouyer-xenamd64-base2 vmlocking-nbase yamt-x86pmap-base4 bouyer-xenamd64-base matt-armv6-base jmcneill-pm-base hpcarm-cleanup-base reinoud-bufcleanup-base
# 1.66 17-Oct-2007 garbled

branches: 1.66.12; 1.66.16;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base chris-arm-intr-rework-base2 chris-arm-intr-rework-base nick-csl-alignment-base matt-mips64-base ppcoea-renovation-base mjf-ufs-trans-base vmlocking-base
# 1.65 17-May-2007 yamt

branches: 1.65.10; 1.65.12;
merge yamt-idlelwp branch. asked by core@. some ports still needs work.

from doc/BRANCHES:

idle lwp, and some changes depending on it.

1. separate context switching and thread scheduling.
(cf. gmcgarry_ctxsw)
2. implement idle lwp.
3. clean up related MD/MI interfaces.
4. make scheduler(s) modular.


Revision tags: yamt-idlelwp-base8 thorpej-atomic-base ad-audiomp-base post-newlock2-merge newlock2-nbase newlock2-base
# 1.64 06-Jan-2007 christos

branches: 1.64.2; 1.64.6; 1.64.8; 1.64.14;
Scott Allan in http://mail-index.netbsd.org/port-arm/2006/07/31/0000.html
Patch to add support for ARM9E


# 1.63 06-Jan-2007 christos

From Scott Alan in http://mail-index.netbsd.org/port-arm/2006/07/26/0000.html
identify_arm_cpu() prints out a helpful message when it detects that you're
trying to run on a CPU that you didn't configure for. Unfortunately, the
check for class_option being NULL is backward, so it either won't print the
class_option, or it will try to dereference a NULL. The patch just flips the
!= NULL to be == NULL.


Revision tags: yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 abandoned-netbsd-4-base yamt-splraiseipl-base2 yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 netbsd-4-base yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base elad-kernelauth-base simonb-timecounters-base rpaulo-netinet-merge-pcb-base
# 1.62 15-Mar-2006 drochner

branches: 1.62.10; 1.62.14;
use km_alloc to get wired kernel memory for kernel stacks
of idle processes for secondary CPUs
(affects the MULTIPROCESSOR case only - does this exist?)
(untested)


Revision tags: yamt-pdpolicy-base2 yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.61 11-Dec-2005 christos

branches: 1.61.4; 1.61.6; 1.61.8; 1.61.10;
merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.60 20-Jul-2005 nonaka

Added i80219.


# 1.59 04-Jul-2005 bsh

branches: 1.59.2;
The first step to support Intel PXA270.

kernel config option CPU_XSCALE_PXA2X0 is now obsoleted by
CPU_XSCALE_PXA250 and CPU_XSCALE_PXA270. If both of them are defined,
CPU is determined run-time.


# 1.58 03-Jun-2005 rearnsha

Very basic support for the ARM1136.

This code takes no advantage of any 'new' features provided by
architecture 6 devices (such as physically tagged caches or new
MMU features), and basically runs the chip in a 'legacy v5' mode.


# 1.57 10-May-2005 rearnsha

Add support for arm1026ej-s.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 yamt-km-base4 yamt-km-base3 netbsd-3-base yamt-km-base2 yamt-km-base kent-audio2-base kent-audio1-beforemerge kent-audio1-base
# 1.56 14-Apr-2004 bsh

distinguish PXA255/26x from PXA2[15]0 in CPU attach message


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.55 13-Feb-2004 wiz

Uppercase CPU, plural is CPUs.


# 1.54 26-Oct-2003 chris

Fix up some unitialised variables.


# 1.53 06-Sep-2003 rearnsha

Support for ARM10E class devices.


# 1.52 03-Sep-2003 mycroft

Recognize some TI processors -- not that you'd want to use them.


# 1.51 23-Jun-2003 martin

branches: 1.51.2;
Make sure to include opt_foo.h if a defflag option FOO is used.


# 1.50 23-May-2003 ichiro

support IXP425 Intel Network Processor
running on BigEndian


# 1.49 29-Apr-2003 thorpej

Use aprint*().


# 1.48 14-Feb-2003 rjs

Add CPU IDs for PXA B2 and C0 steppings.


Revision tags: nathanw_sa_before_merge nathanw_sa_base
# 1.47 06-Jan-2003 wiz

specified, not specifed.


Revision tags: fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base
# 1.46 17-Nov-2002 chs

change uvm_uarea_alloc() to indicate whether the returned uarea is already
backed by physical pages (ie. because it reused a previously-freed one),
so that we can skip a bunch of useless work in that case.
this fixes the underlying problem behind PR 18543, and also speeds up fork()
quite a bit (eg. 7% on my pc, 1% on my ultra2) when we get a cache hit.


Revision tags: kqueue-aftermerge kqueue-beforemerge bjh21-hydra-base
# 1.45 13-Oct-2002 chris

branches: 1.45.2;
Fix arm kernel build breaks for non multiprocessor systems.


# 1.44 13-Oct-2002 bjh21

It appears that MI code requires ci_cpuid to be the CPU number of the CPU
in question, whereas the ARM code was using it to hold the model
identification. To fix this, rename:

ci_cpuid -> ci_arm_cpuid
ci_cputype -> ci_arm_cputype (for consistency)
ci_cpurev -> ci_arm_cpurev (ditto)
ci_cpunum -> ci_cpuid

This makes top(1) give correct CPU numbers in its "STATE" column (all 0 for
now).


# 1.43 12-Oct-2002 bjh21

Remember the location of each CPU's idle PCB in struct cpu_info.
Move allocation of the idle PCB from hydra.c to cpu.c and add some
extra initialisation from cpu_fork().


Revision tags: kqueue-base
# 1.42 01-Oct-2002 bjh21

constify various string tables.


# 1.41 06-Sep-2002 gehenna

Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.


Revision tags: gehenna-devsw-base
# 1.40 22-Jul-2002 briggs

Handle i80200 step D0 and i80321 step B0


# 1.39 10-Jul-2002 ichiro

add cpu id for "PXA250/210 3rd version CPUcore".

for using many PDA/xscale-core.


# 1.38 07-Jun-2002 thorpej

Add the CPU ID for the 600MHz i80321 part.


Revision tags: netbsd-1-6-base
# 1.37 12-May-2002 ichiro

branches: 1.37.2; 1.37.4;
change ICP12x0 steppings.
define CPU_IXP12X0


# 1.36 10-May-2002 thorpej

Add IXP1200 steppings.


# 1.35 03-May-2002 thorpej

Add support for the Intel PXA210 and PXA250. From Hiroyuki Bessho, PR 16617.


# 1.34 02-May-2002 rjs

Enable CPU_CLASS_SA1 for SA1100 and SA1110.


# 1.33 12-Apr-2002 thorpej

Centralize ARM CPU configuration information by adding a new header
file, <arm/cpuconf.h>, which pulls in "opt_cputypes.h" and then defines
the following:
* CPU_NTYPES -- now many CPU types are configured into the kernel. What
you really want to know is "== 1" or "> 1".
* Defines ARM_ARCH_2, ARM_ARCH_3, ARM_ARCH_4, ARM_ARCH_5, depending
on which ARM architecture versions are configured (based on CPU_*
options). Also defines ARM_NARCH to determins how many architecture
versions are configured.
* Defines ARM_MMU_MEMC, ARM_MMU_GENERIC, ARM_MMU_XSCALE depending on
which classes of ARM MMUs are configured into the kernel, and ARM_NMMUS
to determine how many MMU classes are configured.

Remove the needless inclusion of "opt_cputypes.h" in several places.
Convert remaining users to <arm/cpuconf.h>.


# 1.32 27-Mar-2002 thorpej

The 80321 manual lies; it does have a CPU ID distinct from the 80200.
Add that CPU ID, and add a case for it.


# 1.31 26-Mar-2002 thorpej

Restructure a few things in order to support other XScale core
I/O processors:
* The i80200 and the i80321 have the same CPU ID, so split the
CPU_XSCALE option into CPU_XSCALE_80200 and CPU_XSCALE_80321
options, and don't let them both be defined at the same time.
XXX May want to revisit this in the future.
* Split some registers common between the i80200 and i80321 into
<arm/xscale/xscalereg.h>.
* Rename a few existing functions.


# 1.30 24-Mar-2002 thorpej

Cache the cpu type and cpu revision in cpu_info.


Revision tags: eeh-devprop-base
# 1.29 16-Mar-2002 bjh21

Only put the CPU type into cpu_model, not the state of the control register.
Instead, print the control register state on the next line at startup.


# 1.28 16-Mar-2002 bjh21

Add CPU ID for the ARM1022ES.
Also add a CPU class for ARM10E processors in general.


# 1.27 11-Mar-2002 reinoud

When ARMFPE wasn't enabled the `usearmfpe' flag was statically initialised
but not used resulting in a compiler error. By splitting the declaration
and the initialisation this is solved.

Better would be to not even declare the flag when ARMFPE isnt enabled but
that would just add to the #ifdef jungle.


# 1.26 10-Mar-2002 bjh21

__RCSID -> __KERNEL_RCSID


# 1.25 10-Mar-2002 bjh21

Re-work the way that FPAs are handled. If ARMFPE isn't configured, don't
even bother probing for an FPA. If ARMFPE is configured, always use it,
even if there's an FPA (since it provides the FPA support code). Move all
printfs about FPAs into armfpe_init.c.

This means I can delete the last two elements from struct _cpu, so that the
structure, and the whole of <arm/cpus.h> is redundant and can be deleted.


# 1.24 10-Mar-2002 bjh21

Remove fpu_model from struct _cpu. Instead, have initialise_arm_fpe()
printf() the FPE version number itself.


# 1.23 10-Mar-2002 bjh21

Add a ci_dev element to struct cpu_info, pointing to the device that
corresponds to the CPU.


Revision tags: newlock-base
# 1.22 10-Mar-2002 bjh21

Kill the fpu_flags element from struct _cpu. It was only ever set to 0
anyway.


# 1.21 10-Mar-2002 bjh21

Clean up inline assembler. Rather than saving R0, copying FPSR to R0,
copying it to the output register and then restoring R0, just copy the
FPSR straight to the output.


# 1.20 09-Mar-2002 bjh21

Remove the cpu_model member from struct _cpu, and just use the cpu_model
variable directly. While we're at it, make cpu_model rather larger.


# 1.19 09-Mar-2002 bjh21

Remove the cpu_class element from struct _cpu, and make it a local variable
in identify_arm_cpu(), since it's almost unused elsewhere.

Change the detection of bugged StrongARMs to use the cpu ID rather than the
class. This turns "almost" into "entirely".


# 1.18 09-Mar-2002 bjh21

Replace cpu_id and cpu_ctrl in struct _cpu with ci_cpuid and ci_ctrl in
struct cpu_info. Also kill the cpuctrl global while we're here, and make
identify_arm_cpu() take a struct cpu_info * as an argument alongside the CPU
number.


# 1.17 09-Mar-2002 bjh21

Move arm700bugcount into stuct cpu_info, and attach it in
identify_master_cpu().


Revision tags: ifpoll-base
# 1.16 17-Feb-2002 bjh21

Our assembler handles FPA instructions fine, so don't use .word for them.


# 1.15 17-Feb-2002 bjh21

ANSIfy, and othe KNF cleanup.


# 1.14 27-Jan-2002 bjh21

Add revision->stepping maps for the SA-110, SA-1100 and SA-1110.
Those for the SA-1100 and SA-1110 are from Intel's documentation.
The mapping for the SA-110 is from various sources on the net, since Intel
don't seem to document it.

Also, change the layout of the maps to have four steppings per line,
so they aren't quite so unwieldy.


# 1.13 24-Jan-2002 thorpej

Use a table to look up stepping names. Add a generic stepping
table ("rev 0", "rev 1", etc.) and an i80200 stepping table that
has the stepping names that appear in the i80200 manuals/errata..


# 1.12 29-Nov-2001 thorpej

Fetch cache info from the Cache Type register on ARM7TDMI and "greater"
processors. Report this when the processor is attached.


# 1.11 24-Nov-2001 thorpej

Move the ARM, Ltd. floating point emulator to arch/arm.


# 1.10 23-Nov-2001 thorpej

Use <arm/undefined.h> instead of <machine/undefined.h>.


Revision tags: thorpej-mips-cache-base
# 1.9 06-Nov-2001 thorpej

branches: 1.9.2;
Const poisoning of cpu/class names.


# 1.8 06-Nov-2001 thorpej

"i80200", not "80200".


# 1.7 06-Nov-2001 thorpej

"XScale", not "Xscale".


# 1.6 18-Oct-2001 rearnsha

branches: 1.6.2;
Support for ARM9.


Revision tags: thorpej-devvp-base3 thorpej-devvp-base2
# 1.5 28-Sep-2001 chris

Add extra arg to fpa_test as it should have 4 args. Also add prototypes for fpa_test and fpa_handler.


Revision tags: post-chs-ubcperf pre-chs-ubcperf thorpej-devvp-base
# 1.4 05-Sep-2001 matt

branches: 1.4.2;
Flesh XSCALE support.


# 1.3 03-Jun-2001 chris

branches: 1.3.2; 1.3.4;
Add support for ARM7TDMI, as provided in a patch from John Fremlin to port-arm32.

Shouldn't effect any currently in tree ports.


# 1.2 13-May-2001 bjh21

Use get_bootconf_option() to find boot options, rather than home-grown
strstr()-based hacks.


Revision tags: thorpej_scsipi_beforemerge thorpej_scsipi_base thorpej_scsipi_nbase
# 1.1 20-Apr-2001 matt

branches: 1.1.2;
Split cpu from mainbus so that cpu can attached to other buses (like ofbus).


# 1.136 20-Dec-2019 ad

Some more CPU topology stuff:

- Use cegger@'s ACPI SRAT parsing code to figure out NUMA node ID for each
CPU as it is attached.

- For scheduler experiments with SMT, flag CPUs with the lowest numbered SMT
IDs as "primaries", link back to the primaries from secondaries, and build
a circular list of CPUs in each package with identical SMT IDs.

- No need for package/core/smt/numa IDs to be anything other than a u_int.


# 1.135 02-Dec-2019 ad

Take the basic CPU topology information we already collect, and use it
to make circular lists of CPU siblings in the same core, and in the
same package. Nothing fancy, just enough to have a bit of fun in the
scheduler trying out different tactics.


Revision tags: phil-wifi-20191119
# 1.134 20-Oct-2019 jmcneill

cpu_hatched_p only for MULTIPROCESSOR


# 1.133 19-Oct-2019 jmcneill

Increase aarch64 MAXCPUS to 256.


# 1.132 29-Sep-2019 skrll

aprint_debug_dev output alignment


# 1.131 08-Sep-2019 tnn

report A12 as A17 to the user. A12 is retcon'ed by ARM.


# 1.130 07-Sep-2019 tnn

Cortex A12 is marketed as A17 but has a distinct part number

observed on Rockchip RK3288


Revision tags: netbsd-9-base phil-wifi-20190609 isaki-audio2-base
# 1.129 17-Mar-2019 skrll

branches: 1.129.4;
Wrap arm_cpu_marker if #ifdef MPDEBUG.

One day a9_mpsubr.S will die


# 1.128 27-Jan-2019 pgoyette

Merge the [pgoyette-compat] branch


Revision tags: pgoyette-compat-20190127
# 1.127 25-Jan-2019 skrll

Make sure ci_{smt,core,package}_id are all filled in appropriately.

Previously the BP was missed and __SHIFTOUT wasn't used.


Revision tags: pgoyette-compat-20190118
# 1.126 03-Jan-2019 jmcneill

Read mpidr and cpuid from the secondary processor itself instead of the
boot processor. While here, add Cortex-A15 r4p0 to supported list.


# 1.125 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.124 02-Jan-2019 skrll

Don't overwrite the setting of cpu_core_id from mpidr


Revision tags: pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020
# 1.123 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.122 08-Oct-2018 skrll

Trialing whitespace


# 1.121 06-Oct-2018 skrll

Use __BIT. NFC.


Revision tags: pgoyette-compat-0930 pgoyette-compat-0906
# 1.120 15-Aug-2018 skrll

KNF


# 1.119 15-Aug-2018 skrll

Fix includes (sys/cdefs.h then sys/param.h)


# 1.118 15-Aug-2018 skrll

Sprinkle #include "opt_cputypes.h"


# 1.117 10-Aug-2018 maxv

Retire CPU_ARM2, CPU_ARM250 and CPU_ARM3, they are all leftovers of
acorn26.

ok jmcneill@ skrll@


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202
# 1.116 16-Sep-2017 matt

branches: 1.116.2; 1.116.4;
Add Cortex-A35 CPU ID.


Revision tags: netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base
# 1.115 01-Jun-2017 chs

branches: 1.115.6;
remove checks for failure after memory allocation calls that cannot fail:

kmem_alloc() with KM_SLEEP
kmem_zalloc() with KM_SLEEP
percpu_alloc()
pserialize_create()
psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.114 11-Jul-2016 kiyohara

Add Cortex-A9 r1.


Revision tags: nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.113 03-Mar-2016 skrll

Get the RPI3 working (in aarch32 mode) by recognising Cortex A53 CPUs.
While I'm here add some A57/A72 info as well.

My RPI3 works with FB console - the uart needs some help with its clocks.


# 1.112 23-Jan-2016 christos

Rename the cpu_id() define to cpu_idnum() so that it does not conflict with
dtrace and friends.


Revision tags: nick-nhusb-base-20151226
# 1.111 12-Nov-2015 jmcneill

change some register dumps from aprint_verbose to aprint_debug


Revision tags: nick-nhusb-base-20150921
# 1.110 08-Jul-2015 skrll

aprint_verbose [sa]ctlr


Revision tags: nick-nhusb-base-20150606
# 1.109 05-Jun-2015 skrll

Print the Revision ID regster (verbose)


# 1.108 17-May-2015 matt

Print out mpidr on MP systems (verbose print)


Revision tags: nick-nhusb-base-20150406
# 1.107 03-Mar-2015 jmcneill

cache type 12 is "write-back", from matt


Revision tags: nick-nhusb-base
# 1.106 27-Nov-2014 matt

branches: 1.106.2;
Add entry for Cortex-A17 r1


# 1.105 01-Sep-2014 reinoud

Increase the `freqbuf' buffer that holds the result of humanize_number(). Now
it prints 1600 Mhz instead of 1 Ghz.
Pitty enough humanize_number(9) doesn't do 1.6 Ghz type output.


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.104 28-Mar-2014 matt

branches: 1.104.4;
Various MP changes.


# 1.103 24-Mar-2014 christos

use cpu_{g,s}etmodel


# 1.102 20-Mar-2014 matt

Define cache type 13


Revision tags: riastradh-drm2-base3
# 1.101 03-Mar-2014 matt

Add most of the cpu_* variables to <arm/locore.h>
Add and initialize cpu_synchprim_present


# 1.100 20-Feb-2014 matt

Keep track of what each cache is (VIVT/VIPT/PIPT).

cpu0: 32KB/32B 2-way L1 VIPT Instruction cache
cpu0: 32KB/64B 4-way write-back-locking-C L1 PIPT Data cache
cpu0: 256KB/64B 8-way write-through L2 PIPT Unified cache


# 1.99 07-Sep-2013 matt

Add a machdep.hwdiv_present sysctl (cortex A7 and A15 have hwdiv instructions)


# 1.98 07-Sep-2013 matt

Add CPU_ID_CORTEXA7R0 entry


# 1.97 18-Aug-2013 matt

Move parts of cpu.h that are not needed by MI code in <arm/locore.h>
Don't include <machine/cpu.h> or <machine/frame.h>, use <arm/locore.h>
Use <arm/asm.h> instead of <machine/arm.h>


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.96 12-Jun-2013 matt

branches: 1.96.2;
Nuke cpu_pfr, just use the armreg_pfr?_read inlines


# 1.95 12-Jun-2013 matt

Use the armreg_pfr?_read inlines.


# 1.94 19-May-2013 rkujawa

Plug support for PJ4B into our ARM CPU infrastructure.

Obtained from Marvell, Semihalf.


Revision tags: agc-symver-base
# 1.93 03-Feb-2013 matt

Add a machdep.cpu_arch sysctl


# 1.92 31-Jan-2013 matt

Add simple sysctls for cpu_id, fpu_id, neon_present, simd_present,
simdex_present.
Add struct sysctls to return the isar, mmfr, pfr, and mvfr sets.


Revision tags: yamt-pagecache-base8 yamt-pagecache-base7
# 1.91 05-Dec-2012 matt

ARMFPE hasn't compiled since NetBSD 4. Remove it.
Complete support for FPU_VFP.
fpregs now contains vfpreg.
XXX vfpreg only has space for 16 64-bit FP registers though VFPv3 and later
have 32 64-bit FP registers.


# 1.90 30-Nov-2012 msaitoh

Use snprintf() instead of sprintf().


# 1.89 30-Nov-2012 msaitoh

s/,/;/


# 1.88 12-Nov-2012 skrll

C99 types


Revision tags: yamt-pagecache-base6
# 1.87 22-Sep-2012 matt

Don't use an asm in pmap_activate to update the TTBR, use cpu_setttb instead
but add a second argument to it to indicate whether the TLB/caches need to be
flushed. Default cortex to pmap_needs_fixup = 1. But check the MMFR3 field
to see if the fixed can be skipped.
Use a cf_flag bit 0 to indicate whether the A9 L2 cache should disable (bit 0 = 1)
or enabeld (bit = 0).

With these changes, the A9 MMU can use traverse caches to do MMU tablewalks
Also, make sure all memory has the shareable bit for the A9.


# 1.86 07-Sep-2012 matt

branches: 1.86.2;
Switch cortex_a9 back to need_ptesync = 1
Add code to disable the L2 cache on cortex-a9 (for now).
Add evcnt for all the fault types.
Move cache info in a structure and have one for the pcache and one for scache.
Probe L1/L2 caches properly for ARMv7


# 1.85 29-Aug-2012 matt

Use new armv7 CP15 register to print out cache types.
If the cpu_cc_freq is set, report it.
Add macros to make inlines for reading/writing co-processor registers.


# 1.84 14-Aug-2012 matt

Use device_t


# 1.83 12-Aug-2012 matt

Rework VFP support to use PCU.
Add emulation of instruction which save/restore the VFP FPSCR.
Add a sysarch hook to VFP FPSCR manipulation.

[The emulation will be used by libc to store/fetch exception modes and
rounding mode on a per-thread basis.]


# 1.82 14-Jul-2012 matt

Refresh cortex cpus


Revision tags: jmcneill-usbmp-base10 yamt-pagecache-base5
# 1.81 20-May-2012 skrll

Remove the ARM1156T2 bloat - it only has an MPU. Prompted by matt@


# 1.80 20-May-2012 skrll

Add the ARM1156T2-S


# 1.79 20-May-2012 skrll

Add the 'Z' to the 1176 cpu product name.

ok matt@


Revision tags: jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base jym-xensuspend-nbase rmind-uvmplock-base jym-xensuspend-base
# 1.78 10-Mar-2011 bsh

branches: 1.78.4; 1.78.8; 1.78.10;
add MPCore to CPU-ID table
add branch predict bit to arm11_options


Revision tags: uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11
# 1.77 02-Oct-2010 kiyohara

branches: 1.77.2;
Add support Marvell Sheeva Core and SoC. (Orion/Kirkwood)
Discovery Innovation not yet.


Revision tags: uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.76 19-Jun-2010 matt

Fix cache probing on Cortex. Add missing CORTEX dependency in cpu.c


# 1.75 19-Jun-2010 matt

Fix c&p error.


# 1.74 19-Jun-2010 matt

Cleanup the armv7 changes. Add ARM_ARCH_7. Use CPU_CORTEX instead of
CPU_CORTEXA8 everywhere since there more types of Cortex than just the A8.
CPU_CORTEXA8 still exists but causes CPU_CORTEX to be defined.
Add CPU_CORTEXA9 as well. Use .arch armv7a to get us the isb/dsb
instructions.

Test booted to root device prompt on a Beagleboard.
All ARM kernels successfully test built.


# 1.73 16-Jun-2010 jmcneill

PR port-arm/43299: Support added for igepv2/cortexa8/omap3530

Apply patch from PR, with build fixes. ok skrll, matt


Revision tags: uebayasi-xip-base1 yamt-nfs-mp-base9 uebayasi-xip-base
# 1.72 23-Jan-2010 mrg

branches: 1.72.2; 1.72.4;
rename a local cpu_name structure member to avoid potential conflict
with <sys/cpu.h>'s.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-premerge-20091211 yamt-nfs-mp-base8 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 yamt-nfs-mp-base7 netbsd-5-0-1-RELEASE jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base nick-hppapmap-base haad-dm-base mjf-devfs2-base
# 1.71 25-Oct-2008 matt

branches: 1.71.4; 1.71.12;
Fix some missing things for CPU_ID_FA526.


Revision tags: matt-mips64-base2
# 1.70 24-Oct-2008 matt

Add entry for FA526.


# 1.69 21-Oct-2008 matt

Add Cortex cpus


Revision tags: haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base
# 1.68 27-Apr-2008 matt

branches: 1.68.6;
Merge kernel changes in matt-armv6 to HEAD.


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 chris-arm-intr-rework-base7 keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.67 15-Mar-2008 rearnsha

branches: 1.67.2; 1.67.4;
VFP support.


Revision tags: nick-net80211-sync-base chris-arm-intr-rework-base6 chris-arm-intr-rework-base5 chris-arm-intr-rework-base4 bouyer-xeni386-merge1 chris-arm-intr-rework-base3 vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 jmcneill-base mjf-devfs-base bouyer-xenamd64-base2 vmlocking-nbase yamt-x86pmap-base4 bouyer-xenamd64-base matt-armv6-base jmcneill-pm-base hpcarm-cleanup-base reinoud-bufcleanup-base
# 1.66 17-Oct-2007 garbled

branches: 1.66.12; 1.66.16;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base chris-arm-intr-rework-base2 chris-arm-intr-rework-base nick-csl-alignment-base matt-mips64-base ppcoea-renovation-base mjf-ufs-trans-base vmlocking-base
# 1.65 17-May-2007 yamt

branches: 1.65.10; 1.65.12;
merge yamt-idlelwp branch. asked by core@. some ports still needs work.

from doc/BRANCHES:

idle lwp, and some changes depending on it.

1. separate context switching and thread scheduling.
(cf. gmcgarry_ctxsw)
2. implement idle lwp.
3. clean up related MD/MI interfaces.
4. make scheduler(s) modular.


Revision tags: yamt-idlelwp-base8 thorpej-atomic-base ad-audiomp-base post-newlock2-merge newlock2-nbase newlock2-base
# 1.64 06-Jan-2007 christos

branches: 1.64.2; 1.64.6; 1.64.8; 1.64.14;
Scott Allan in http://mail-index.netbsd.org/port-arm/2006/07/31/0000.html
Patch to add support for ARM9E


# 1.63 06-Jan-2007 christos

From Scott Alan in http://mail-index.netbsd.org/port-arm/2006/07/26/0000.html
identify_arm_cpu() prints out a helpful message when it detects that you're
trying to run on a CPU that you didn't configure for. Unfortunately, the
check for class_option being NULL is backward, so it either won't print the
class_option, or it will try to dereference a NULL. The patch just flips the
!= NULL to be == NULL.


Revision tags: yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 abandoned-netbsd-4-base yamt-splraiseipl-base2 yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 netbsd-4-base yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base elad-kernelauth-base simonb-timecounters-base rpaulo-netinet-merge-pcb-base
# 1.62 15-Mar-2006 drochner

branches: 1.62.10; 1.62.14;
use km_alloc to get wired kernel memory for kernel stacks
of idle processes for secondary CPUs
(affects the MULTIPROCESSOR case only - does this exist?)
(untested)


Revision tags: yamt-pdpolicy-base2 yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.61 11-Dec-2005 christos

branches: 1.61.4; 1.61.6; 1.61.8; 1.61.10;
merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.60 20-Jul-2005 nonaka

Added i80219.


# 1.59 04-Jul-2005 bsh

branches: 1.59.2;
The first step to support Intel PXA270.

kernel config option CPU_XSCALE_PXA2X0 is now obsoleted by
CPU_XSCALE_PXA250 and CPU_XSCALE_PXA270. If both of them are defined,
CPU is determined run-time.


# 1.58 03-Jun-2005 rearnsha

Very basic support for the ARM1136.

This code takes no advantage of any 'new' features provided by
architecture 6 devices (such as physically tagged caches or new
MMU features), and basically runs the chip in a 'legacy v5' mode.


# 1.57 10-May-2005 rearnsha

Add support for arm1026ej-s.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 yamt-km-base4 yamt-km-base3 netbsd-3-base yamt-km-base2 yamt-km-base kent-audio2-base kent-audio1-beforemerge kent-audio1-base
# 1.56 14-Apr-2004 bsh

distinguish PXA255/26x from PXA2[15]0 in CPU attach message


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.55 13-Feb-2004 wiz

Uppercase CPU, plural is CPUs.


# 1.54 26-Oct-2003 chris

Fix up some unitialised variables.


# 1.53 06-Sep-2003 rearnsha

Support for ARM10E class devices.


# 1.52 03-Sep-2003 mycroft

Recognize some TI processors -- not that you'd want to use them.


# 1.51 23-Jun-2003 martin

branches: 1.51.2;
Make sure to include opt_foo.h if a defflag option FOO is used.


# 1.50 23-May-2003 ichiro

support IXP425 Intel Network Processor
running on BigEndian


# 1.49 29-Apr-2003 thorpej

Use aprint*().


# 1.48 14-Feb-2003 rjs

Add CPU IDs for PXA B2 and C0 steppings.


Revision tags: nathanw_sa_before_merge nathanw_sa_base
# 1.47 06-Jan-2003 wiz

specified, not specifed.


Revision tags: fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base
# 1.46 17-Nov-2002 chs

change uvm_uarea_alloc() to indicate whether the returned uarea is already
backed by physical pages (ie. because it reused a previously-freed one),
so that we can skip a bunch of useless work in that case.
this fixes the underlying problem behind PR 18543, and also speeds up fork()
quite a bit (eg. 7% on my pc, 1% on my ultra2) when we get a cache hit.


Revision tags: kqueue-aftermerge kqueue-beforemerge bjh21-hydra-base
# 1.45 13-Oct-2002 chris

branches: 1.45.2;
Fix arm kernel build breaks for non multiprocessor systems.


# 1.44 13-Oct-2002 bjh21

It appears that MI code requires ci_cpuid to be the CPU number of the CPU
in question, whereas the ARM code was using it to hold the model
identification. To fix this, rename:

ci_cpuid -> ci_arm_cpuid
ci_cputype -> ci_arm_cputype (for consistency)
ci_cpurev -> ci_arm_cpurev (ditto)
ci_cpunum -> ci_cpuid

This makes top(1) give correct CPU numbers in its "STATE" column (all 0 for
now).


# 1.43 12-Oct-2002 bjh21

Remember the location of each CPU's idle PCB in struct cpu_info.
Move allocation of the idle PCB from hydra.c to cpu.c and add some
extra initialisation from cpu_fork().


Revision tags: kqueue-base
# 1.42 01-Oct-2002 bjh21

constify various string tables.


# 1.41 06-Sep-2002 gehenna

Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.


Revision tags: gehenna-devsw-base
# 1.40 22-Jul-2002 briggs

Handle i80200 step D0 and i80321 step B0


# 1.39 10-Jul-2002 ichiro

add cpu id for "PXA250/210 3rd version CPUcore".

for using many PDA/xscale-core.


# 1.38 07-Jun-2002 thorpej

Add the CPU ID for the 600MHz i80321 part.


Revision tags: netbsd-1-6-base
# 1.37 12-May-2002 ichiro

branches: 1.37.2; 1.37.4;
change ICP12x0 steppings.
define CPU_IXP12X0


# 1.36 10-May-2002 thorpej

Add IXP1200 steppings.


# 1.35 03-May-2002 thorpej

Add support for the Intel PXA210 and PXA250. From Hiroyuki Bessho, PR 16617.


# 1.34 02-May-2002 rjs

Enable CPU_CLASS_SA1 for SA1100 and SA1110.


# 1.33 12-Apr-2002 thorpej

Centralize ARM CPU configuration information by adding a new header
file, <arm/cpuconf.h>, which pulls in "opt_cputypes.h" and then defines
the following:
* CPU_NTYPES -- now many CPU types are configured into the kernel. What
you really want to know is "== 1" or "> 1".
* Defines ARM_ARCH_2, ARM_ARCH_3, ARM_ARCH_4, ARM_ARCH_5, depending
on which ARM architecture versions are configured (based on CPU_*
options). Also defines ARM_NARCH to determins how many architecture
versions are configured.
* Defines ARM_MMU_MEMC, ARM_MMU_GENERIC, ARM_MMU_XSCALE depending on
which classes of ARM MMUs are configured into the kernel, and ARM_NMMUS
to determine how many MMU classes are configured.

Remove the needless inclusion of "opt_cputypes.h" in several places.
Convert remaining users to <arm/cpuconf.h>.


# 1.32 27-Mar-2002 thorpej

The 80321 manual lies; it does have a CPU ID distinct from the 80200.
Add that CPU ID, and add a case for it.


# 1.31 26-Mar-2002 thorpej

Restructure a few things in order to support other XScale core
I/O processors:
* The i80200 and the i80321 have the same CPU ID, so split the
CPU_XSCALE option into CPU_XSCALE_80200 and CPU_XSCALE_80321
options, and don't let them both be defined at the same time.
XXX May want to revisit this in the future.
* Split some registers common between the i80200 and i80321 into
<arm/xscale/xscalereg.h>.
* Rename a few existing functions.


# 1.30 24-Mar-2002 thorpej

Cache the cpu type and cpu revision in cpu_info.


Revision tags: eeh-devprop-base
# 1.29 16-Mar-2002 bjh21

Only put the CPU type into cpu_model, not the state of the control register.
Instead, print the control register state on the next line at startup.


# 1.28 16-Mar-2002 bjh21

Add CPU ID for the ARM1022ES.
Also add a CPU class for ARM10E processors in general.


# 1.27 11-Mar-2002 reinoud

When ARMFPE wasn't enabled the `usearmfpe' flag was statically initialised
but not used resulting in a compiler error. By splitting the declaration
and the initialisation this is solved.

Better would be to not even declare the flag when ARMFPE isnt enabled but
that would just add to the #ifdef jungle.


# 1.26 10-Mar-2002 bjh21

__RCSID -> __KERNEL_RCSID


# 1.25 10-Mar-2002 bjh21

Re-work the way that FPAs are handled. If ARMFPE isn't configured, don't
even bother probing for an FPA. If ARMFPE is configured, always use it,
even if there's an FPA (since it provides the FPA support code). Move all
printfs about FPAs into armfpe_init.c.

This means I can delete the last two elements from struct _cpu, so that the
structure, and the whole of <arm/cpus.h> is redundant and can be deleted.


# 1.24 10-Mar-2002 bjh21

Remove fpu_model from struct _cpu. Instead, have initialise_arm_fpe()
printf() the FPE version number itself.


# 1.23 10-Mar-2002 bjh21

Add a ci_dev element to struct cpu_info, pointing to the device that
corresponds to the CPU.


Revision tags: newlock-base
# 1.22 10-Mar-2002 bjh21

Kill the fpu_flags element from struct _cpu. It was only ever set to 0
anyway.


# 1.21 10-Mar-2002 bjh21

Clean up inline assembler. Rather than saving R0, copying FPSR to R0,
copying it to the output register and then restoring R0, just copy the
FPSR straight to the output.


# 1.20 09-Mar-2002 bjh21

Remove the cpu_model member from struct _cpu, and just use the cpu_model
variable directly. While we're at it, make cpu_model rather larger.


# 1.19 09-Mar-2002 bjh21

Remove the cpu_class element from struct _cpu, and make it a local variable
in identify_arm_cpu(), since it's almost unused elsewhere.

Change the detection of bugged StrongARMs to use the cpu ID rather than the
class. This turns "almost" into "entirely".


# 1.18 09-Mar-2002 bjh21

Replace cpu_id and cpu_ctrl in struct _cpu with ci_cpuid and ci_ctrl in
struct cpu_info. Also kill the cpuctrl global while we're here, and make
identify_arm_cpu() take a struct cpu_info * as an argument alongside the CPU
number.


# 1.17 09-Mar-2002 bjh21

Move arm700bugcount into stuct cpu_info, and attach it in
identify_master_cpu().


Revision tags: ifpoll-base
# 1.16 17-Feb-2002 bjh21

Our assembler handles FPA instructions fine, so don't use .word for them.


# 1.15 17-Feb-2002 bjh21

ANSIfy, and othe KNF cleanup.


# 1.14 27-Jan-2002 bjh21

Add revision->stepping maps for the SA-110, SA-1100 and SA-1110.
Those for the SA-1100 and SA-1110 are from Intel's documentation.
The mapping for the SA-110 is from various sources on the net, since Intel
don't seem to document it.

Also, change the layout of the maps to have four steppings per line,
so they aren't quite so unwieldy.


# 1.13 24-Jan-2002 thorpej

Use a table to look up stepping names. Add a generic stepping
table ("rev 0", "rev 1", etc.) and an i80200 stepping table that
has the stepping names that appear in the i80200 manuals/errata..


# 1.12 29-Nov-2001 thorpej

Fetch cache info from the Cache Type register on ARM7TDMI and "greater"
processors. Report this when the processor is attached.


# 1.11 24-Nov-2001 thorpej

Move the ARM, Ltd. floating point emulator to arch/arm.


# 1.10 23-Nov-2001 thorpej

Use <arm/undefined.h> instead of <machine/undefined.h>.


Revision tags: thorpej-mips-cache-base
# 1.9 06-Nov-2001 thorpej

branches: 1.9.2;
Const poisoning of cpu/class names.


# 1.8 06-Nov-2001 thorpej

"i80200", not "80200".


# 1.7 06-Nov-2001 thorpej

"XScale", not "Xscale".


# 1.6 18-Oct-2001 rearnsha

branches: 1.6.2;
Support for ARM9.


Revision tags: thorpej-devvp-base3 thorpej-devvp-base2
# 1.5 28-Sep-2001 chris

Add extra arg to fpa_test as it should have 4 args. Also add prototypes for fpa_test and fpa_handler.


Revision tags: post-chs-ubcperf pre-chs-ubcperf thorpej-devvp-base
# 1.4 05-Sep-2001 matt

branches: 1.4.2;
Flesh XSCALE support.


# 1.3 03-Jun-2001 chris

branches: 1.3.2; 1.3.4;
Add support for ARM7TDMI, as provided in a patch from John Fremlin to port-arm32.

Shouldn't effect any currently in tree ports.


# 1.2 13-May-2001 bjh21

Use get_bootconf_option() to find boot options, rather than home-grown
strstr()-based hacks.


Revision tags: thorpej_scsipi_beforemerge thorpej_scsipi_base thorpej_scsipi_nbase
# 1.1 20-Apr-2001 matt

branches: 1.1.2;
Split cpu from mainbus so that cpu can attached to other buses (like ofbus).


# 1.135 02-Dec-2019 ad

Take the basic CPU topology information we already collect, and use it
to make circular lists of CPU siblings in the same core, and in the
same package. Nothing fancy, just enough to have a bit of fun in the
scheduler trying out different tactics.


Revision tags: phil-wifi-20191119
# 1.134 20-Oct-2019 jmcneill

cpu_hatched_p only for MULTIPROCESSOR


# 1.133 19-Oct-2019 jmcneill

Increase aarch64 MAXCPUS to 256.


# 1.132 29-Sep-2019 skrll

aprint_debug_dev output alignment


# 1.131 08-Sep-2019 tnn

report A12 as A17 to the user. A12 is retcon'ed by ARM.


# 1.130 07-Sep-2019 tnn

Cortex A12 is marketed as A17 but has a distinct part number

observed on Rockchip RK3288


Revision tags: netbsd-9-base phil-wifi-20190609 isaki-audio2-base
# 1.129 17-Mar-2019 skrll

branches: 1.129.4;
Wrap arm_cpu_marker if #ifdef MPDEBUG.

One day a9_mpsubr.S will die


# 1.128 27-Jan-2019 pgoyette

Merge the [pgoyette-compat] branch


Revision tags: pgoyette-compat-20190127
# 1.127 25-Jan-2019 skrll

Make sure ci_{smt,core,package}_id are all filled in appropriately.

Previously the BP was missed and __SHIFTOUT wasn't used.


Revision tags: pgoyette-compat-20190118
# 1.126 03-Jan-2019 jmcneill

Read mpidr and cpuid from the secondary processor itself instead of the
boot processor. While here, add Cortex-A15 r4p0 to supported list.


# 1.125 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.124 02-Jan-2019 skrll

Don't overwrite the setting of cpu_core_id from mpidr


Revision tags: pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020
# 1.123 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.122 08-Oct-2018 skrll

Trialing whitespace


# 1.121 06-Oct-2018 skrll

Use __BIT. NFC.


Revision tags: pgoyette-compat-0930 pgoyette-compat-0906
# 1.120 15-Aug-2018 skrll

KNF


# 1.119 15-Aug-2018 skrll

Fix includes (sys/cdefs.h then sys/param.h)


# 1.118 15-Aug-2018 skrll

Sprinkle #include "opt_cputypes.h"


# 1.117 10-Aug-2018 maxv

Retire CPU_ARM2, CPU_ARM250 and CPU_ARM3, they are all leftovers of
acorn26.

ok jmcneill@ skrll@


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202
# 1.116 16-Sep-2017 matt

branches: 1.116.2; 1.116.4;
Add Cortex-A35 CPU ID.


Revision tags: netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base
# 1.115 01-Jun-2017 chs

branches: 1.115.6;
remove checks for failure after memory allocation calls that cannot fail:

kmem_alloc() with KM_SLEEP
kmem_zalloc() with KM_SLEEP
percpu_alloc()
pserialize_create()
psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.114 11-Jul-2016 kiyohara

Add Cortex-A9 r1.


Revision tags: nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.113 03-Mar-2016 skrll

Get the RPI3 working (in aarch32 mode) by recognising Cortex A53 CPUs.
While I'm here add some A57/A72 info as well.

My RPI3 works with FB console - the uart needs some help with its clocks.


# 1.112 23-Jan-2016 christos

Rename the cpu_id() define to cpu_idnum() so that it does not conflict with
dtrace and friends.


Revision tags: nick-nhusb-base-20151226
# 1.111 12-Nov-2015 jmcneill

change some register dumps from aprint_verbose to aprint_debug


Revision tags: nick-nhusb-base-20150921
# 1.110 08-Jul-2015 skrll

aprint_verbose [sa]ctlr


Revision tags: nick-nhusb-base-20150606
# 1.109 05-Jun-2015 skrll

Print the Revision ID regster (verbose)


# 1.108 17-May-2015 matt

Print out mpidr on MP systems (verbose print)


Revision tags: nick-nhusb-base-20150406
# 1.107 03-Mar-2015 jmcneill

cache type 12 is "write-back", from matt


Revision tags: nick-nhusb-base
# 1.106 27-Nov-2014 matt

branches: 1.106.2;
Add entry for Cortex-A17 r1


# 1.105 01-Sep-2014 reinoud

Increase the `freqbuf' buffer that holds the result of humanize_number(). Now
it prints 1600 Mhz instead of 1 Ghz.
Pitty enough humanize_number(9) doesn't do 1.6 Ghz type output.


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.104 28-Mar-2014 matt

branches: 1.104.4;
Various MP changes.


# 1.103 24-Mar-2014 christos

use cpu_{g,s}etmodel


# 1.102 20-Mar-2014 matt

Define cache type 13


Revision tags: riastradh-drm2-base3
# 1.101 03-Mar-2014 matt

Add most of the cpu_* variables to <arm/locore.h>
Add and initialize cpu_synchprim_present


# 1.100 20-Feb-2014 matt

Keep track of what each cache is (VIVT/VIPT/PIPT).

cpu0: 32KB/32B 2-way L1 VIPT Instruction cache
cpu0: 32KB/64B 4-way write-back-locking-C L1 PIPT Data cache
cpu0: 256KB/64B 8-way write-through L2 PIPT Unified cache


# 1.99 07-Sep-2013 matt

Add a machdep.hwdiv_present sysctl (cortex A7 and A15 have hwdiv instructions)


# 1.98 07-Sep-2013 matt

Add CPU_ID_CORTEXA7R0 entry


# 1.97 18-Aug-2013 matt

Move parts of cpu.h that are not needed by MI code in <arm/locore.h>
Don't include <machine/cpu.h> or <machine/frame.h>, use <arm/locore.h>
Use <arm/asm.h> instead of <machine/arm.h>


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.96 12-Jun-2013 matt

branches: 1.96.2;
Nuke cpu_pfr, just use the armreg_pfr?_read inlines


# 1.95 12-Jun-2013 matt

Use the armreg_pfr?_read inlines.


# 1.94 19-May-2013 rkujawa

Plug support for PJ4B into our ARM CPU infrastructure.

Obtained from Marvell, Semihalf.


Revision tags: agc-symver-base
# 1.93 03-Feb-2013 matt

Add a machdep.cpu_arch sysctl


# 1.92 31-Jan-2013 matt

Add simple sysctls for cpu_id, fpu_id, neon_present, simd_present,
simdex_present.
Add struct sysctls to return the isar, mmfr, pfr, and mvfr sets.


Revision tags: yamt-pagecache-base8 yamt-pagecache-base7
# 1.91 05-Dec-2012 matt

ARMFPE hasn't compiled since NetBSD 4. Remove it.
Complete support for FPU_VFP.
fpregs now contains vfpreg.
XXX vfpreg only has space for 16 64-bit FP registers though VFPv3 and later
have 32 64-bit FP registers.


# 1.90 30-Nov-2012 msaitoh

Use snprintf() instead of sprintf().


# 1.89 30-Nov-2012 msaitoh

s/,/;/


# 1.88 12-Nov-2012 skrll

C99 types


Revision tags: yamt-pagecache-base6
# 1.87 22-Sep-2012 matt

Don't use an asm in pmap_activate to update the TTBR, use cpu_setttb instead
but add a second argument to it to indicate whether the TLB/caches need to be
flushed. Default cortex to pmap_needs_fixup = 1. But check the MMFR3 field
to see if the fixed can be skipped.
Use a cf_flag bit 0 to indicate whether the A9 L2 cache should disable (bit 0 = 1)
or enabeld (bit = 0).

With these changes, the A9 MMU can use traverse caches to do MMU tablewalks
Also, make sure all memory has the shareable bit for the A9.


# 1.86 07-Sep-2012 matt

branches: 1.86.2;
Switch cortex_a9 back to need_ptesync = 1
Add code to disable the L2 cache on cortex-a9 (for now).
Add evcnt for all the fault types.
Move cache info in a structure and have one for the pcache and one for scache.
Probe L1/L2 caches properly for ARMv7


# 1.85 29-Aug-2012 matt

Use new armv7 CP15 register to print out cache types.
If the cpu_cc_freq is set, report it.
Add macros to make inlines for reading/writing co-processor registers.


# 1.84 14-Aug-2012 matt

Use device_t


# 1.83 12-Aug-2012 matt

Rework VFP support to use PCU.
Add emulation of instruction which save/restore the VFP FPSCR.
Add a sysarch hook to VFP FPSCR manipulation.

[The emulation will be used by libc to store/fetch exception modes and
rounding mode on a per-thread basis.]


# 1.82 14-Jul-2012 matt

Refresh cortex cpus


Revision tags: jmcneill-usbmp-base10 yamt-pagecache-base5
# 1.81 20-May-2012 skrll

Remove the ARM1156T2 bloat - it only has an MPU. Prompted by matt@


# 1.80 20-May-2012 skrll

Add the ARM1156T2-S


# 1.79 20-May-2012 skrll

Add the 'Z' to the 1176 cpu product name.

ok matt@


Revision tags: jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base jym-xensuspend-nbase rmind-uvmplock-base jym-xensuspend-base
# 1.78 10-Mar-2011 bsh

branches: 1.78.4; 1.78.8; 1.78.10;
add MPCore to CPU-ID table
add branch predict bit to arm11_options


Revision tags: uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11
# 1.77 02-Oct-2010 kiyohara

branches: 1.77.2;
Add support Marvell Sheeva Core and SoC. (Orion/Kirkwood)
Discovery Innovation not yet.


Revision tags: uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.76 19-Jun-2010 matt

Fix cache probing on Cortex. Add missing CORTEX dependency in cpu.c


# 1.75 19-Jun-2010 matt

Fix c&p error.


# 1.74 19-Jun-2010 matt

Cleanup the armv7 changes. Add ARM_ARCH_7. Use CPU_CORTEX instead of
CPU_CORTEXA8 everywhere since there more types of Cortex than just the A8.
CPU_CORTEXA8 still exists but causes CPU_CORTEX to be defined.
Add CPU_CORTEXA9 as well. Use .arch armv7a to get us the isb/dsb
instructions.

Test booted to root device prompt on a Beagleboard.
All ARM kernels successfully test built.


# 1.73 16-Jun-2010 jmcneill

PR port-arm/43299: Support added for igepv2/cortexa8/omap3530

Apply patch from PR, with build fixes. ok skrll, matt


Revision tags: uebayasi-xip-base1 yamt-nfs-mp-base9 uebayasi-xip-base
# 1.72 23-Jan-2010 mrg

branches: 1.72.2; 1.72.4;
rename a local cpu_name structure member to avoid potential conflict
with <sys/cpu.h>'s.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-premerge-20091211 yamt-nfs-mp-base8 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 yamt-nfs-mp-base7 netbsd-5-0-1-RELEASE jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base nick-hppapmap-base haad-dm-base mjf-devfs2-base
# 1.71 25-Oct-2008 matt

branches: 1.71.4; 1.71.12;
Fix some missing things for CPU_ID_FA526.


Revision tags: matt-mips64-base2
# 1.70 24-Oct-2008 matt

Add entry for FA526.


# 1.69 21-Oct-2008 matt

Add Cortex cpus


Revision tags: haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base
# 1.68 27-Apr-2008 matt

branches: 1.68.6;
Merge kernel changes in matt-armv6 to HEAD.


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 chris-arm-intr-rework-base7 keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.67 15-Mar-2008 rearnsha

branches: 1.67.2; 1.67.4;
VFP support.


Revision tags: nick-net80211-sync-base chris-arm-intr-rework-base6 chris-arm-intr-rework-base5 chris-arm-intr-rework-base4 bouyer-xeni386-merge1 chris-arm-intr-rework-base3 vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 jmcneill-base mjf-devfs-base bouyer-xenamd64-base2 vmlocking-nbase yamt-x86pmap-base4 bouyer-xenamd64-base matt-armv6-base jmcneill-pm-base hpcarm-cleanup-base reinoud-bufcleanup-base
# 1.66 17-Oct-2007 garbled

branches: 1.66.12; 1.66.16;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base chris-arm-intr-rework-base2 chris-arm-intr-rework-base nick-csl-alignment-base matt-mips64-base ppcoea-renovation-base mjf-ufs-trans-base vmlocking-base
# 1.65 17-May-2007 yamt

branches: 1.65.10; 1.65.12;
merge yamt-idlelwp branch. asked by core@. some ports still needs work.

from doc/BRANCHES:

idle lwp, and some changes depending on it.

1. separate context switching and thread scheduling.
(cf. gmcgarry_ctxsw)
2. implement idle lwp.
3. clean up related MD/MI interfaces.
4. make scheduler(s) modular.


Revision tags: yamt-idlelwp-base8 thorpej-atomic-base ad-audiomp-base post-newlock2-merge newlock2-nbase newlock2-base
# 1.64 06-Jan-2007 christos

branches: 1.64.2; 1.64.6; 1.64.8; 1.64.14;
Scott Allan in http://mail-index.netbsd.org/port-arm/2006/07/31/0000.html
Patch to add support for ARM9E


# 1.63 06-Jan-2007 christos

From Scott Alan in http://mail-index.netbsd.org/port-arm/2006/07/26/0000.html
identify_arm_cpu() prints out a helpful message when it detects that you're
trying to run on a CPU that you didn't configure for. Unfortunately, the
check for class_option being NULL is backward, so it either won't print the
class_option, or it will try to dereference a NULL. The patch just flips the
!= NULL to be == NULL.


Revision tags: yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 abandoned-netbsd-4-base yamt-splraiseipl-base2 yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 netbsd-4-base yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base elad-kernelauth-base simonb-timecounters-base rpaulo-netinet-merge-pcb-base
# 1.62 15-Mar-2006 drochner

branches: 1.62.10; 1.62.14;
use km_alloc to get wired kernel memory for kernel stacks
of idle processes for secondary CPUs
(affects the MULTIPROCESSOR case only - does this exist?)
(untested)


Revision tags: yamt-pdpolicy-base2 yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.61 11-Dec-2005 christos

branches: 1.61.4; 1.61.6; 1.61.8; 1.61.10;
merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.60 20-Jul-2005 nonaka

Added i80219.


# 1.59 04-Jul-2005 bsh

branches: 1.59.2;
The first step to support Intel PXA270.

kernel config option CPU_XSCALE_PXA2X0 is now obsoleted by
CPU_XSCALE_PXA250 and CPU_XSCALE_PXA270. If both of them are defined,
CPU is determined run-time.


# 1.58 03-Jun-2005 rearnsha

Very basic support for the ARM1136.

This code takes no advantage of any 'new' features provided by
architecture 6 devices (such as physically tagged caches or new
MMU features), and basically runs the chip in a 'legacy v5' mode.


# 1.57 10-May-2005 rearnsha

Add support for arm1026ej-s.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 yamt-km-base4 yamt-km-base3 netbsd-3-base yamt-km-base2 yamt-km-base kent-audio2-base kent-audio1-beforemerge kent-audio1-base
# 1.56 14-Apr-2004 bsh

distinguish PXA255/26x from PXA2[15]0 in CPU attach message


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.55 13-Feb-2004 wiz

Uppercase CPU, plural is CPUs.


# 1.54 26-Oct-2003 chris

Fix up some unitialised variables.


# 1.53 06-Sep-2003 rearnsha

Support for ARM10E class devices.


# 1.52 03-Sep-2003 mycroft

Recognize some TI processors -- not that you'd want to use them.


# 1.51 23-Jun-2003 martin

branches: 1.51.2;
Make sure to include opt_foo.h if a defflag option FOO is used.


# 1.50 23-May-2003 ichiro

support IXP425 Intel Network Processor
running on BigEndian


# 1.49 29-Apr-2003 thorpej

Use aprint*().


# 1.48 14-Feb-2003 rjs

Add CPU IDs for PXA B2 and C0 steppings.


Revision tags: nathanw_sa_before_merge nathanw_sa_base
# 1.47 06-Jan-2003 wiz

specified, not specifed.


Revision tags: fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base
# 1.46 17-Nov-2002 chs

change uvm_uarea_alloc() to indicate whether the returned uarea is already
backed by physical pages (ie. because it reused a previously-freed one),
so that we can skip a bunch of useless work in that case.
this fixes the underlying problem behind PR 18543, and also speeds up fork()
quite a bit (eg. 7% on my pc, 1% on my ultra2) when we get a cache hit.


Revision tags: kqueue-aftermerge kqueue-beforemerge bjh21-hydra-base
# 1.45 13-Oct-2002 chris

branches: 1.45.2;
Fix arm kernel build breaks for non multiprocessor systems.


# 1.44 13-Oct-2002 bjh21

It appears that MI code requires ci_cpuid to be the CPU number of the CPU
in question, whereas the ARM code was using it to hold the model
identification. To fix this, rename:

ci_cpuid -> ci_arm_cpuid
ci_cputype -> ci_arm_cputype (for consistency)
ci_cpurev -> ci_arm_cpurev (ditto)
ci_cpunum -> ci_cpuid

This makes top(1) give correct CPU numbers in its "STATE" column (all 0 for
now).


# 1.43 12-Oct-2002 bjh21

Remember the location of each CPU's idle PCB in struct cpu_info.
Move allocation of the idle PCB from hydra.c to cpu.c and add some
extra initialisation from cpu_fork().


Revision tags: kqueue-base
# 1.42 01-Oct-2002 bjh21

constify various string tables.


# 1.41 06-Sep-2002 gehenna

Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.


Revision tags: gehenna-devsw-base
# 1.40 22-Jul-2002 briggs

Handle i80200 step D0 and i80321 step B0


# 1.39 10-Jul-2002 ichiro

add cpu id for "PXA250/210 3rd version CPUcore".

for using many PDA/xscale-core.


# 1.38 07-Jun-2002 thorpej

Add the CPU ID for the 600MHz i80321 part.


Revision tags: netbsd-1-6-base
# 1.37 12-May-2002 ichiro

branches: 1.37.2; 1.37.4;
change ICP12x0 steppings.
define CPU_IXP12X0


# 1.36 10-May-2002 thorpej

Add IXP1200 steppings.


# 1.35 03-May-2002 thorpej

Add support for the Intel PXA210 and PXA250. From Hiroyuki Bessho, PR 16617.


# 1.34 02-May-2002 rjs

Enable CPU_CLASS_SA1 for SA1100 and SA1110.


# 1.33 12-Apr-2002 thorpej

Centralize ARM CPU configuration information by adding a new header
file, <arm/cpuconf.h>, which pulls in "opt_cputypes.h" and then defines
the following:
* CPU_NTYPES -- now many CPU types are configured into the kernel. What
you really want to know is "== 1" or "> 1".
* Defines ARM_ARCH_2, ARM_ARCH_3, ARM_ARCH_4, ARM_ARCH_5, depending
on which ARM architecture versions are configured (based on CPU_*
options). Also defines ARM_NARCH to determins how many architecture
versions are configured.
* Defines ARM_MMU_MEMC, ARM_MMU_GENERIC, ARM_MMU_XSCALE depending on
which classes of ARM MMUs are configured into the kernel, and ARM_NMMUS
to determine how many MMU classes are configured.

Remove the needless inclusion of "opt_cputypes.h" in several places.
Convert remaining users to <arm/cpuconf.h>.


# 1.32 27-Mar-2002 thorpej

The 80321 manual lies; it does have a CPU ID distinct from the 80200.
Add that CPU ID, and add a case for it.


# 1.31 26-Mar-2002 thorpej

Restructure a few things in order to support other XScale core
I/O processors:
* The i80200 and the i80321 have the same CPU ID, so split the
CPU_XSCALE option into CPU_XSCALE_80200 and CPU_XSCALE_80321
options, and don't let them both be defined at the same time.
XXX May want to revisit this in the future.
* Split some registers common between the i80200 and i80321 into
<arm/xscale/xscalereg.h>.
* Rename a few existing functions.


# 1.30 24-Mar-2002 thorpej

Cache the cpu type and cpu revision in cpu_info.


Revision tags: eeh-devprop-base
# 1.29 16-Mar-2002 bjh21

Only put the CPU type into cpu_model, not the state of the control register.
Instead, print the control register state on the next line at startup.


# 1.28 16-Mar-2002 bjh21

Add CPU ID for the ARM1022ES.
Also add a CPU class for ARM10E processors in general.


# 1.27 11-Mar-2002 reinoud

When ARMFPE wasn't enabled the `usearmfpe' flag was statically initialised
but not used resulting in a compiler error. By splitting the declaration
and the initialisation this is solved.

Better would be to not even declare the flag when ARMFPE isnt enabled but
that would just add to the #ifdef jungle.


# 1.26 10-Mar-2002 bjh21

__RCSID -> __KERNEL_RCSID


# 1.25 10-Mar-2002 bjh21

Re-work the way that FPAs are handled. If ARMFPE isn't configured, don't
even bother probing for an FPA. If ARMFPE is configured, always use it,
even if there's an FPA (since it provides the FPA support code). Move all
printfs about FPAs into armfpe_init.c.

This means I can delete the last two elements from struct _cpu, so that the
structure, and the whole of <arm/cpus.h> is redundant and can be deleted.


# 1.24 10-Mar-2002 bjh21

Remove fpu_model from struct _cpu. Instead, have initialise_arm_fpe()
printf() the FPE version number itself.


# 1.23 10-Mar-2002 bjh21

Add a ci_dev element to struct cpu_info, pointing to the device that
corresponds to the CPU.


Revision tags: newlock-base
# 1.22 10-Mar-2002 bjh21

Kill the fpu_flags element from struct _cpu. It was only ever set to 0
anyway.


# 1.21 10-Mar-2002 bjh21

Clean up inline assembler. Rather than saving R0, copying FPSR to R0,
copying it to the output register and then restoring R0, just copy the
FPSR straight to the output.


# 1.20 09-Mar-2002 bjh21

Remove the cpu_model member from struct _cpu, and just use the cpu_model
variable directly. While we're at it, make cpu_model rather larger.


# 1.19 09-Mar-2002 bjh21

Remove the cpu_class element from struct _cpu, and make it a local variable
in identify_arm_cpu(), since it's almost unused elsewhere.

Change the detection of bugged StrongARMs to use the cpu ID rather than the
class. This turns "almost" into "entirely".


# 1.18 09-Mar-2002 bjh21

Replace cpu_id and cpu_ctrl in struct _cpu with ci_cpuid and ci_ctrl in
struct cpu_info. Also kill the cpuctrl global while we're here, and make
identify_arm_cpu() take a struct cpu_info * as an argument alongside the CPU
number.


# 1.17 09-Mar-2002 bjh21

Move arm700bugcount into stuct cpu_info, and attach it in
identify_master_cpu().


Revision tags: ifpoll-base
# 1.16 17-Feb-2002 bjh21

Our assembler handles FPA instructions fine, so don't use .word for them.


# 1.15 17-Feb-2002 bjh21

ANSIfy, and othe KNF cleanup.


# 1.14 27-Jan-2002 bjh21

Add revision->stepping maps for the SA-110, SA-1100 and SA-1110.
Those for the SA-1100 and SA-1110 are from Intel's documentation.
The mapping for the SA-110 is from various sources on the net, since Intel
don't seem to document it.

Also, change the layout of the maps to have four steppings per line,
so they aren't quite so unwieldy.


# 1.13 24-Jan-2002 thorpej

Use a table to look up stepping names. Add a generic stepping
table ("rev 0", "rev 1", etc.) and an i80200 stepping table that
has the stepping names that appear in the i80200 manuals/errata..


# 1.12 29-Nov-2001 thorpej

Fetch cache info from the Cache Type register on ARM7TDMI and "greater"
processors. Report this when the processor is attached.


# 1.11 24-Nov-2001 thorpej

Move the ARM, Ltd. floating point emulator to arch/arm.


# 1.10 23-Nov-2001 thorpej

Use <arm/undefined.h> instead of <machine/undefined.h>.


Revision tags: thorpej-mips-cache-base
# 1.9 06-Nov-2001 thorpej

branches: 1.9.2;
Const poisoning of cpu/class names.


# 1.8 06-Nov-2001 thorpej

"i80200", not "80200".


# 1.7 06-Nov-2001 thorpej

"XScale", not "Xscale".


# 1.6 18-Oct-2001 rearnsha

branches: 1.6.2;
Support for ARM9.


Revision tags: thorpej-devvp-base3 thorpej-devvp-base2
# 1.5 28-Sep-2001 chris

Add extra arg to fpa_test as it should have 4 args. Also add prototypes for fpa_test and fpa_handler.


Revision tags: post-chs-ubcperf pre-chs-ubcperf thorpej-devvp-base
# 1.4 05-Sep-2001 matt

branches: 1.4.2;
Flesh XSCALE support.


# 1.3 03-Jun-2001 chris

branches: 1.3.2; 1.3.4;
Add support for ARM7TDMI, as provided in a patch from John Fremlin to port-arm32.

Shouldn't effect any currently in tree ports.


# 1.2 13-May-2001 bjh21

Use get_bootconf_option() to find boot options, rather than home-grown
strstr()-based hacks.


Revision tags: thorpej_scsipi_beforemerge thorpej_scsipi_base thorpej_scsipi_nbase
# 1.1 20-Apr-2001 matt

branches: 1.1.2;
Split cpu from mainbus so that cpu can attached to other buses (like ofbus).


# 1.134 20-Oct-2019 jmcneill

cpu_hatched_p only for MULTIPROCESSOR


# 1.133 19-Oct-2019 jmcneill

Increase aarch64 MAXCPUS to 256.


# 1.132 29-Sep-2019 skrll

aprint_debug_dev output alignment


# 1.131 08-Sep-2019 tnn

report A12 as A17 to the user. A12 is retcon'ed by ARM.


# 1.130 07-Sep-2019 tnn

Cortex A12 is marketed as A17 but has a distinct part number

observed on Rockchip RK3288


Revision tags: netbsd-9-base phil-wifi-20190609 isaki-audio2-base
# 1.129 17-Mar-2019 skrll

Wrap arm_cpu_marker if #ifdef MPDEBUG.

One day a9_mpsubr.S will die


# 1.128 27-Jan-2019 pgoyette

Merge the [pgoyette-compat] branch


Revision tags: pgoyette-compat-20190127
# 1.127 25-Jan-2019 skrll

Make sure ci_{smt,core,package}_id are all filled in appropriately.

Previously the BP was missed and __SHIFTOUT wasn't used.


Revision tags: pgoyette-compat-20190118
# 1.126 03-Jan-2019 jmcneill

Read mpidr and cpuid from the secondary processor itself instead of the
boot processor. While here, add Cortex-A15 r4p0 to supported list.


# 1.125 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.124 02-Jan-2019 skrll

Don't overwrite the setting of cpu_core_id from mpidr


Revision tags: pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020
# 1.123 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.122 08-Oct-2018 skrll

Trialing whitespace


# 1.121 06-Oct-2018 skrll

Use __BIT. NFC.


Revision tags: pgoyette-compat-0930 pgoyette-compat-0906
# 1.120 15-Aug-2018 skrll

KNF


# 1.119 15-Aug-2018 skrll

Fix includes (sys/cdefs.h then sys/param.h)


# 1.118 15-Aug-2018 skrll

Sprinkle #include "opt_cputypes.h"


# 1.117 10-Aug-2018 maxv

Retire CPU_ARM2, CPU_ARM250 and CPU_ARM3, they are all leftovers of
acorn26.

ok jmcneill@ skrll@


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202
# 1.116 16-Sep-2017 matt

branches: 1.116.2; 1.116.4;
Add Cortex-A35 CPU ID.


Revision tags: netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base
# 1.115 01-Jun-2017 chs

branches: 1.115.6;
remove checks for failure after memory allocation calls that cannot fail:

kmem_alloc() with KM_SLEEP
kmem_zalloc() with KM_SLEEP
percpu_alloc()
pserialize_create()
psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.114 11-Jul-2016 kiyohara

Add Cortex-A9 r1.


Revision tags: nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.113 03-Mar-2016 skrll

Get the RPI3 working (in aarch32 mode) by recognising Cortex A53 CPUs.
While I'm here add some A57/A72 info as well.

My RPI3 works with FB console - the uart needs some help with its clocks.


# 1.112 23-Jan-2016 christos

Rename the cpu_id() define to cpu_idnum() so that it does not conflict with
dtrace and friends.


Revision tags: nick-nhusb-base-20151226
# 1.111 12-Nov-2015 jmcneill

change some register dumps from aprint_verbose to aprint_debug


Revision tags: nick-nhusb-base-20150921
# 1.110 08-Jul-2015 skrll

aprint_verbose [sa]ctlr


Revision tags: nick-nhusb-base-20150606
# 1.109 05-Jun-2015 skrll

Print the Revision ID regster (verbose)


# 1.108 17-May-2015 matt

Print out mpidr on MP systems (verbose print)


Revision tags: nick-nhusb-base-20150406
# 1.107 03-Mar-2015 jmcneill

cache type 12 is "write-back", from matt


Revision tags: nick-nhusb-base
# 1.106 27-Nov-2014 matt

branches: 1.106.2;
Add entry for Cortex-A17 r1


# 1.105 01-Sep-2014 reinoud

Increase the `freqbuf' buffer that holds the result of humanize_number(). Now
it prints 1600 Mhz instead of 1 Ghz.
Pitty enough humanize_number(9) doesn't do 1.6 Ghz type output.


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.104 28-Mar-2014 matt

branches: 1.104.4;
Various MP changes.


# 1.103 24-Mar-2014 christos

use cpu_{g,s}etmodel


# 1.102 20-Mar-2014 matt

Define cache type 13


Revision tags: riastradh-drm2-base3
# 1.101 03-Mar-2014 matt

Add most of the cpu_* variables to <arm/locore.h>
Add and initialize cpu_synchprim_present


# 1.100 20-Feb-2014 matt

Keep track of what each cache is (VIVT/VIPT/PIPT).

cpu0: 32KB/32B 2-way L1 VIPT Instruction cache
cpu0: 32KB/64B 4-way write-back-locking-C L1 PIPT Data cache
cpu0: 256KB/64B 8-way write-through L2 PIPT Unified cache


# 1.99 07-Sep-2013 matt

Add a machdep.hwdiv_present sysctl (cortex A7 and A15 have hwdiv instructions)


# 1.98 07-Sep-2013 matt

Add CPU_ID_CORTEXA7R0 entry


# 1.97 18-Aug-2013 matt

Move parts of cpu.h that are not needed by MI code in <arm/locore.h>
Don't include <machine/cpu.h> or <machine/frame.h>, use <arm/locore.h>
Use <arm/asm.h> instead of <machine/arm.h>


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.96 12-Jun-2013 matt

branches: 1.96.2;
Nuke cpu_pfr, just use the armreg_pfr?_read inlines


# 1.95 12-Jun-2013 matt

Use the armreg_pfr?_read inlines.


# 1.94 19-May-2013 rkujawa

Plug support for PJ4B into our ARM CPU infrastructure.

Obtained from Marvell, Semihalf.


Revision tags: agc-symver-base
# 1.93 03-Feb-2013 matt

Add a machdep.cpu_arch sysctl


# 1.92 31-Jan-2013 matt

Add simple sysctls for cpu_id, fpu_id, neon_present, simd_present,
simdex_present.
Add struct sysctls to return the isar, mmfr, pfr, and mvfr sets.


Revision tags: yamt-pagecache-base8 yamt-pagecache-base7
# 1.91 05-Dec-2012 matt

ARMFPE hasn't compiled since NetBSD 4. Remove it.
Complete support for FPU_VFP.
fpregs now contains vfpreg.
XXX vfpreg only has space for 16 64-bit FP registers though VFPv3 and later
have 32 64-bit FP registers.


# 1.90 30-Nov-2012 msaitoh

Use snprintf() instead of sprintf().


# 1.89 30-Nov-2012 msaitoh

s/,/;/


# 1.88 12-Nov-2012 skrll

C99 types


Revision tags: yamt-pagecache-base6
# 1.87 22-Sep-2012 matt

Don't use an asm in pmap_activate to update the TTBR, use cpu_setttb instead
but add a second argument to it to indicate whether the TLB/caches need to be
flushed. Default cortex to pmap_needs_fixup = 1. But check the MMFR3 field
to see if the fixed can be skipped.
Use a cf_flag bit 0 to indicate whether the A9 L2 cache should disable (bit 0 = 1)
or enabeld (bit = 0).

With these changes, the A9 MMU can use traverse caches to do MMU tablewalks
Also, make sure all memory has the shareable bit for the A9.


# 1.86 07-Sep-2012 matt

branches: 1.86.2;
Switch cortex_a9 back to need_ptesync = 1
Add code to disable the L2 cache on cortex-a9 (for now).
Add evcnt for all the fault types.
Move cache info in a structure and have one for the pcache and one for scache.
Probe L1/L2 caches properly for ARMv7


# 1.85 29-Aug-2012 matt

Use new armv7 CP15 register to print out cache types.
If the cpu_cc_freq is set, report it.
Add macros to make inlines for reading/writing co-processor registers.


# 1.84 14-Aug-2012 matt

Use device_t


# 1.83 12-Aug-2012 matt

Rework VFP support to use PCU.
Add emulation of instruction which save/restore the VFP FPSCR.
Add a sysarch hook to VFP FPSCR manipulation.

[The emulation will be used by libc to store/fetch exception modes and
rounding mode on a per-thread basis.]


# 1.82 14-Jul-2012 matt

Refresh cortex cpus


Revision tags: jmcneill-usbmp-base10 yamt-pagecache-base5
# 1.81 20-May-2012 skrll

Remove the ARM1156T2 bloat - it only has an MPU. Prompted by matt@


# 1.80 20-May-2012 skrll

Add the ARM1156T2-S


# 1.79 20-May-2012 skrll

Add the 'Z' to the 1176 cpu product name.

ok matt@


Revision tags: jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base jym-xensuspend-nbase rmind-uvmplock-base jym-xensuspend-base
# 1.78 10-Mar-2011 bsh

branches: 1.78.4; 1.78.8; 1.78.10;
add MPCore to CPU-ID table
add branch predict bit to arm11_options


Revision tags: uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11
# 1.77 02-Oct-2010 kiyohara

branches: 1.77.2;
Add support Marvell Sheeva Core and SoC. (Orion/Kirkwood)
Discovery Innovation not yet.


Revision tags: uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.76 19-Jun-2010 matt

Fix cache probing on Cortex. Add missing CORTEX dependency in cpu.c


# 1.75 19-Jun-2010 matt

Fix c&p error.


# 1.74 19-Jun-2010 matt

Cleanup the armv7 changes. Add ARM_ARCH_7. Use CPU_CORTEX instead of
CPU_CORTEXA8 everywhere since there more types of Cortex than just the A8.
CPU_CORTEXA8 still exists but causes CPU_CORTEX to be defined.
Add CPU_CORTEXA9 as well. Use .arch armv7a to get us the isb/dsb
instructions.

Test booted to root device prompt on a Beagleboard.
All ARM kernels successfully test built.


# 1.73 16-Jun-2010 jmcneill

PR port-arm/43299: Support added for igepv2/cortexa8/omap3530

Apply patch from PR, with build fixes. ok skrll, matt


Revision tags: uebayasi-xip-base1 yamt-nfs-mp-base9 uebayasi-xip-base
# 1.72 23-Jan-2010 mrg

branches: 1.72.2; 1.72.4;
rename a local cpu_name structure member to avoid potential conflict
with <sys/cpu.h>'s.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-premerge-20091211 yamt-nfs-mp-base8 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 yamt-nfs-mp-base7 netbsd-5-0-1-RELEASE jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base nick-hppapmap-base haad-dm-base mjf-devfs2-base
# 1.71 25-Oct-2008 matt

branches: 1.71.4; 1.71.12;
Fix some missing things for CPU_ID_FA526.


Revision tags: matt-mips64-base2
# 1.70 24-Oct-2008 matt

Add entry for FA526.


# 1.69 21-Oct-2008 matt

Add Cortex cpus


Revision tags: haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base
# 1.68 27-Apr-2008 matt

branches: 1.68.6;
Merge kernel changes in matt-armv6 to HEAD.


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 chris-arm-intr-rework-base7 keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.67 15-Mar-2008 rearnsha

branches: 1.67.2; 1.67.4;
VFP support.


Revision tags: nick-net80211-sync-base chris-arm-intr-rework-base6 chris-arm-intr-rework-base5 chris-arm-intr-rework-base4 bouyer-xeni386-merge1 chris-arm-intr-rework-base3 vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 jmcneill-base mjf-devfs-base bouyer-xenamd64-base2 vmlocking-nbase yamt-x86pmap-base4 bouyer-xenamd64-base matt-armv6-base jmcneill-pm-base hpcarm-cleanup-base reinoud-bufcleanup-base
# 1.66 17-Oct-2007 garbled

branches: 1.66.12; 1.66.16;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base chris-arm-intr-rework-base2 chris-arm-intr-rework-base nick-csl-alignment-base matt-mips64-base ppcoea-renovation-base mjf-ufs-trans-base vmlocking-base
# 1.65 17-May-2007 yamt

branches: 1.65.10; 1.65.12;
merge yamt-idlelwp branch. asked by core@. some ports still needs work.

from doc/BRANCHES:

idle lwp, and some changes depending on it.

1. separate context switching and thread scheduling.
(cf. gmcgarry_ctxsw)
2. implement idle lwp.
3. clean up related MD/MI interfaces.
4. make scheduler(s) modular.


Revision tags: yamt-idlelwp-base8 thorpej-atomic-base ad-audiomp-base post-newlock2-merge newlock2-nbase newlock2-base
# 1.64 06-Jan-2007 christos

branches: 1.64.2; 1.64.6; 1.64.8; 1.64.14;
Scott Allan in http://mail-index.netbsd.org/port-arm/2006/07/31/0000.html
Patch to add support for ARM9E


# 1.63 06-Jan-2007 christos

From Scott Alan in http://mail-index.netbsd.org/port-arm/2006/07/26/0000.html
identify_arm_cpu() prints out a helpful message when it detects that you're
trying to run on a CPU that you didn't configure for. Unfortunately, the
check for class_option being NULL is backward, so it either won't print the
class_option, or it will try to dereference a NULL. The patch just flips the
!= NULL to be == NULL.


Revision tags: yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 abandoned-netbsd-4-base yamt-splraiseipl-base2 yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 netbsd-4-base yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base elad-kernelauth-base simonb-timecounters-base rpaulo-netinet-merge-pcb-base
# 1.62 15-Mar-2006 drochner

branches: 1.62.10; 1.62.14;
use km_alloc to get wired kernel memory for kernel stacks
of idle processes for secondary CPUs
(affects the MULTIPROCESSOR case only - does this exist?)
(untested)


Revision tags: yamt-pdpolicy-base2 yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.61 11-Dec-2005 christos

branches: 1.61.4; 1.61.6; 1.61.8; 1.61.10;
merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.60 20-Jul-2005 nonaka

Added i80219.


# 1.59 04-Jul-2005 bsh

branches: 1.59.2;
The first step to support Intel PXA270.

kernel config option CPU_XSCALE_PXA2X0 is now obsoleted by
CPU_XSCALE_PXA250 and CPU_XSCALE_PXA270. If both of them are defined,
CPU is determined run-time.


# 1.58 03-Jun-2005 rearnsha

Very basic support for the ARM1136.

This code takes no advantage of any 'new' features provided by
architecture 6 devices (such as physically tagged caches or new
MMU features), and basically runs the chip in a 'legacy v5' mode.


# 1.57 10-May-2005 rearnsha

Add support for arm1026ej-s.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 yamt-km-base4 yamt-km-base3 netbsd-3-base yamt-km-base2 yamt-km-base kent-audio2-base kent-audio1-beforemerge kent-audio1-base
# 1.56 14-Apr-2004 bsh

distinguish PXA255/26x from PXA2[15]0 in CPU attach message


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.55 13-Feb-2004 wiz

Uppercase CPU, plural is CPUs.


# 1.54 26-Oct-2003 chris

Fix up some unitialised variables.


# 1.53 06-Sep-2003 rearnsha

Support for ARM10E class devices.


# 1.52 03-Sep-2003 mycroft

Recognize some TI processors -- not that you'd want to use them.


# 1.51 23-Jun-2003 martin

branches: 1.51.2;
Make sure to include opt_foo.h if a defflag option FOO is used.


# 1.50 23-May-2003 ichiro

support IXP425 Intel Network Processor
running on BigEndian


# 1.49 29-Apr-2003 thorpej

Use aprint*().


# 1.48 14-Feb-2003 rjs

Add CPU IDs for PXA B2 and C0 steppings.


Revision tags: nathanw_sa_before_merge nathanw_sa_base
# 1.47 06-Jan-2003 wiz

specified, not specifed.


Revision tags: fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base
# 1.46 17-Nov-2002 chs

change uvm_uarea_alloc() to indicate whether the returned uarea is already
backed by physical pages (ie. because it reused a previously-freed one),
so that we can skip a bunch of useless work in that case.
this fixes the underlying problem behind PR 18543, and also speeds up fork()
quite a bit (eg. 7% on my pc, 1% on my ultra2) when we get a cache hit.


Revision tags: kqueue-aftermerge kqueue-beforemerge bjh21-hydra-base
# 1.45 13-Oct-2002 chris

branches: 1.45.2;
Fix arm kernel build breaks for non multiprocessor systems.


# 1.44 13-Oct-2002 bjh21

It appears that MI code requires ci_cpuid to be the CPU number of the CPU
in question, whereas the ARM code was using it to hold the model
identification. To fix this, rename:

ci_cpuid -> ci_arm_cpuid
ci_cputype -> ci_arm_cputype (for consistency)
ci_cpurev -> ci_arm_cpurev (ditto)
ci_cpunum -> ci_cpuid

This makes top(1) give correct CPU numbers in its "STATE" column (all 0 for
now).


# 1.43 12-Oct-2002 bjh21

Remember the location of each CPU's idle PCB in struct cpu_info.
Move allocation of the idle PCB from hydra.c to cpu.c and add some
extra initialisation from cpu_fork().


Revision tags: kqueue-base
# 1.42 01-Oct-2002 bjh21

constify various string tables.


# 1.41 06-Sep-2002 gehenna

Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.


Revision tags: gehenna-devsw-base
# 1.40 22-Jul-2002 briggs

Handle i80200 step D0 and i80321 step B0


# 1.39 10-Jul-2002 ichiro

add cpu id for "PXA250/210 3rd version CPUcore".

for using many PDA/xscale-core.


# 1.38 07-Jun-2002 thorpej

Add the CPU ID for the 600MHz i80321 part.


Revision tags: netbsd-1-6-base
# 1.37 12-May-2002 ichiro

branches: 1.37.2; 1.37.4;
change ICP12x0 steppings.
define CPU_IXP12X0


# 1.36 10-May-2002 thorpej

Add IXP1200 steppings.


# 1.35 03-May-2002 thorpej

Add support for the Intel PXA210 and PXA250. From Hiroyuki Bessho, PR 16617.


# 1.34 02-May-2002 rjs

Enable CPU_CLASS_SA1 for SA1100 and SA1110.


# 1.33 12-Apr-2002 thorpej

Centralize ARM CPU configuration information by adding a new header
file, <arm/cpuconf.h>, which pulls in "opt_cputypes.h" and then defines
the following:
* CPU_NTYPES -- now many CPU types are configured into the kernel. What
you really want to know is "== 1" or "> 1".
* Defines ARM_ARCH_2, ARM_ARCH_3, ARM_ARCH_4, ARM_ARCH_5, depending
on which ARM architecture versions are configured (based on CPU_*
options). Also defines ARM_NARCH to determins how many architecture
versions are configured.
* Defines ARM_MMU_MEMC, ARM_MMU_GENERIC, ARM_MMU_XSCALE depending on
which classes of ARM MMUs are configured into the kernel, and ARM_NMMUS
to determine how many MMU classes are configured.

Remove the needless inclusion of "opt_cputypes.h" in several places.
Convert remaining users to <arm/cpuconf.h>.


# 1.32 27-Mar-2002 thorpej

The 80321 manual lies; it does have a CPU ID distinct from the 80200.
Add that CPU ID, and add a case for it.


# 1.31 26-Mar-2002 thorpej

Restructure a few things in order to support other XScale core
I/O processors:
* The i80200 and the i80321 have the same CPU ID, so split the
CPU_XSCALE option into CPU_XSCALE_80200 and CPU_XSCALE_80321
options, and don't let them both be defined at the same time.
XXX May want to revisit this in the future.
* Split some registers common between the i80200 and i80321 into
<arm/xscale/xscalereg.h>.
* Rename a few existing functions.


# 1.30 24-Mar-2002 thorpej

Cache the cpu type and cpu revision in cpu_info.


Revision tags: eeh-devprop-base
# 1.29 16-Mar-2002 bjh21

Only put the CPU type into cpu_model, not the state of the control register.
Instead, print the control register state on the next line at startup.


# 1.28 16-Mar-2002 bjh21

Add CPU ID for the ARM1022ES.
Also add a CPU class for ARM10E processors in general.


# 1.27 11-Mar-2002 reinoud

When ARMFPE wasn't enabled the `usearmfpe' flag was statically initialised
but not used resulting in a compiler error. By splitting the declaration
and the initialisation this is solved.

Better would be to not even declare the flag when ARMFPE isnt enabled but
that would just add to the #ifdef jungle.


# 1.26 10-Mar-2002 bjh21

__RCSID -> __KERNEL_RCSID


# 1.25 10-Mar-2002 bjh21

Re-work the way that FPAs are handled. If ARMFPE isn't configured, don't
even bother probing for an FPA. If ARMFPE is configured, always use it,
even if there's an FPA (since it provides the FPA support code). Move all
printfs about FPAs into armfpe_init.c.

This means I can delete the last two elements from struct _cpu, so that the
structure, and the whole of <arm/cpus.h> is redundant and can be deleted.


# 1.24 10-Mar-2002 bjh21

Remove fpu_model from struct _cpu. Instead, have initialise_arm_fpe()
printf() the FPE version number itself.


# 1.23 10-Mar-2002 bjh21

Add a ci_dev element to struct cpu_info, pointing to the device that
corresponds to the CPU.


Revision tags: newlock-base
# 1.22 10-Mar-2002 bjh21

Kill the fpu_flags element from struct _cpu. It was only ever set to 0
anyway.


# 1.21 10-Mar-2002 bjh21

Clean up inline assembler. Rather than saving R0, copying FPSR to R0,
copying it to the output register and then restoring R0, just copy the
FPSR straight to the output.


# 1.20 09-Mar-2002 bjh21

Remove the cpu_model member from struct _cpu, and just use the cpu_model
variable directly. While we're at it, make cpu_model rather larger.


# 1.19 09-Mar-2002 bjh21

Remove the cpu_class element from struct _cpu, and make it a local variable
in identify_arm_cpu(), since it's almost unused elsewhere.

Change the detection of bugged StrongARMs to use the cpu ID rather than the
class. This turns "almost" into "entirely".


# 1.18 09-Mar-2002 bjh21

Replace cpu_id and cpu_ctrl in struct _cpu with ci_cpuid and ci_ctrl in
struct cpu_info. Also kill the cpuctrl global while we're here, and make
identify_arm_cpu() take a struct cpu_info * as an argument alongside the CPU
number.


# 1.17 09-Mar-2002 bjh21

Move arm700bugcount into stuct cpu_info, and attach it in
identify_master_cpu().


Revision tags: ifpoll-base
# 1.16 17-Feb-2002 bjh21

Our assembler handles FPA instructions fine, so don't use .word for them.


# 1.15 17-Feb-2002 bjh21

ANSIfy, and othe KNF cleanup.


# 1.14 27-Jan-2002 bjh21

Add revision->stepping maps for the SA-110, SA-1100 and SA-1110.
Those for the SA-1100 and SA-1110 are from Intel's documentation.
The mapping for the SA-110 is from various sources on the net, since Intel
don't seem to document it.

Also, change the layout of the maps to have four steppings per line,
so they aren't quite so unwieldy.


# 1.13 24-Jan-2002 thorpej

Use a table to look up stepping names. Add a generic stepping
table ("rev 0", "rev 1", etc.) and an i80200 stepping table that
has the stepping names that appear in the i80200 manuals/errata..


# 1.12 29-Nov-2001 thorpej

Fetch cache info from the Cache Type register on ARM7TDMI and "greater"
processors. Report this when the processor is attached.


# 1.11 24-Nov-2001 thorpej

Move the ARM, Ltd. floating point emulator to arch/arm.


# 1.10 23-Nov-2001 thorpej

Use <arm/undefined.h> instead of <machine/undefined.h>.


Revision tags: thorpej-mips-cache-base
# 1.9 06-Nov-2001 thorpej

branches: 1.9.2;
Const poisoning of cpu/class names.


# 1.8 06-Nov-2001 thorpej

"i80200", not "80200".


# 1.7 06-Nov-2001 thorpej

"XScale", not "Xscale".


# 1.6 18-Oct-2001 rearnsha

branches: 1.6.2;
Support for ARM9.


Revision tags: thorpej-devvp-base3 thorpej-devvp-base2
# 1.5 28-Sep-2001 chris

Add extra arg to fpa_test as it should have 4 args. Also add prototypes for fpa_test and fpa_handler.


Revision tags: post-chs-ubcperf pre-chs-ubcperf thorpej-devvp-base
# 1.4 05-Sep-2001 matt

branches: 1.4.2;
Flesh XSCALE support.


# 1.3 03-Jun-2001 chris

branches: 1.3.2; 1.3.4;
Add support for ARM7TDMI, as provided in a patch from John Fremlin to port-arm32.

Shouldn't effect any currently in tree ports.


# 1.2 13-May-2001 bjh21

Use get_bootconf_option() to find boot options, rather than home-grown
strstr()-based hacks.


Revision tags: thorpej_scsipi_beforemerge thorpej_scsipi_base thorpej_scsipi_nbase
# 1.1 20-Apr-2001 matt

branches: 1.1.2;
Split cpu from mainbus so that cpu can attached to other buses (like ofbus).


# 1.133 19-Oct-2019 jmcneill

Increase aarch64 MAXCPUS to 256.


# 1.132 29-Sep-2019 skrll

aprint_debug_dev output alignment


# 1.131 08-Sep-2019 tnn

report A12 as A17 to the user. A12 is retcon'ed by ARM.


# 1.130 07-Sep-2019 tnn

Cortex A12 is marketed as A17 but has a distinct part number

observed on Rockchip RK3288


Revision tags: netbsd-9-base phil-wifi-20190609 isaki-audio2-base
# 1.129 17-Mar-2019 skrll

Wrap arm_cpu_marker if #ifdef MPDEBUG.

One day a9_mpsubr.S will die


# 1.128 27-Jan-2019 pgoyette

Merge the [pgoyette-compat] branch


Revision tags: pgoyette-compat-20190127
# 1.127 25-Jan-2019 skrll

Make sure ci_{smt,core,package}_id are all filled in appropriately.

Previously the BP was missed and __SHIFTOUT wasn't used.


Revision tags: pgoyette-compat-20190118
# 1.126 03-Jan-2019 jmcneill

Read mpidr and cpuid from the secondary processor itself instead of the
boot processor. While here, add Cortex-A15 r4p0 to supported list.


# 1.125 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.124 02-Jan-2019 skrll

Don't overwrite the setting of cpu_core_id from mpidr


Revision tags: pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020
# 1.123 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.122 08-Oct-2018 skrll

Trialing whitespace


# 1.121 06-Oct-2018 skrll

Use __BIT. NFC.


Revision tags: pgoyette-compat-0930 pgoyette-compat-0906
# 1.120 15-Aug-2018 skrll

KNF


# 1.119 15-Aug-2018 skrll

Fix includes (sys/cdefs.h then sys/param.h)


# 1.118 15-Aug-2018 skrll

Sprinkle #include "opt_cputypes.h"


# 1.117 10-Aug-2018 maxv

Retire CPU_ARM2, CPU_ARM250 and CPU_ARM3, they are all leftovers of
acorn26.

ok jmcneill@ skrll@


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202
# 1.116 16-Sep-2017 matt

branches: 1.116.2; 1.116.4;
Add Cortex-A35 CPU ID.


Revision tags: netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base
# 1.115 01-Jun-2017 chs

branches: 1.115.6;
remove checks for failure after memory allocation calls that cannot fail:

kmem_alloc() with KM_SLEEP
kmem_zalloc() with KM_SLEEP
percpu_alloc()
pserialize_create()
psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.114 11-Jul-2016 kiyohara

Add Cortex-A9 r1.


Revision tags: nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.113 03-Mar-2016 skrll

Get the RPI3 working (in aarch32 mode) by recognising Cortex A53 CPUs.
While I'm here add some A57/A72 info as well.

My RPI3 works with FB console - the uart needs some help with its clocks.


# 1.112 23-Jan-2016 christos

Rename the cpu_id() define to cpu_idnum() so that it does not conflict with
dtrace and friends.


Revision tags: nick-nhusb-base-20151226
# 1.111 12-Nov-2015 jmcneill

change some register dumps from aprint_verbose to aprint_debug


Revision tags: nick-nhusb-base-20150921
# 1.110 08-Jul-2015 skrll

aprint_verbose [sa]ctlr


Revision tags: nick-nhusb-base-20150606
# 1.109 05-Jun-2015 skrll

Print the Revision ID regster (verbose)


# 1.108 17-May-2015 matt

Print out mpidr on MP systems (verbose print)


Revision tags: nick-nhusb-base-20150406
# 1.107 03-Mar-2015 jmcneill

cache type 12 is "write-back", from matt


Revision tags: nick-nhusb-base
# 1.106 27-Nov-2014 matt

branches: 1.106.2;
Add entry for Cortex-A17 r1


# 1.105 01-Sep-2014 reinoud

Increase the `freqbuf' buffer that holds the result of humanize_number(). Now
it prints 1600 Mhz instead of 1 Ghz.
Pitty enough humanize_number(9) doesn't do 1.6 Ghz type output.


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.104 28-Mar-2014 matt

branches: 1.104.4;
Various MP changes.


# 1.103 24-Mar-2014 christos

use cpu_{g,s}etmodel


# 1.102 20-Mar-2014 matt

Define cache type 13


Revision tags: riastradh-drm2-base3
# 1.101 03-Mar-2014 matt

Add most of the cpu_* variables to <arm/locore.h>
Add and initialize cpu_synchprim_present


# 1.100 20-Feb-2014 matt

Keep track of what each cache is (VIVT/VIPT/PIPT).

cpu0: 32KB/32B 2-way L1 VIPT Instruction cache
cpu0: 32KB/64B 4-way write-back-locking-C L1 PIPT Data cache
cpu0: 256KB/64B 8-way write-through L2 PIPT Unified cache


# 1.99 07-Sep-2013 matt

Add a machdep.hwdiv_present sysctl (cortex A7 and A15 have hwdiv instructions)


# 1.98 07-Sep-2013 matt

Add CPU_ID_CORTEXA7R0 entry


# 1.97 18-Aug-2013 matt

Move parts of cpu.h that are not needed by MI code in <arm/locore.h>
Don't include <machine/cpu.h> or <machine/frame.h>, use <arm/locore.h>
Use <arm/asm.h> instead of <machine/arm.h>


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.96 12-Jun-2013 matt

branches: 1.96.2;
Nuke cpu_pfr, just use the armreg_pfr?_read inlines


# 1.95 12-Jun-2013 matt

Use the armreg_pfr?_read inlines.


# 1.94 19-May-2013 rkujawa

Plug support for PJ4B into our ARM CPU infrastructure.

Obtained from Marvell, Semihalf.


Revision tags: agc-symver-base
# 1.93 03-Feb-2013 matt

Add a machdep.cpu_arch sysctl


# 1.92 31-Jan-2013 matt

Add simple sysctls for cpu_id, fpu_id, neon_present, simd_present,
simdex_present.
Add struct sysctls to return the isar, mmfr, pfr, and mvfr sets.


Revision tags: yamt-pagecache-base8 yamt-pagecache-base7
# 1.91 05-Dec-2012 matt

ARMFPE hasn't compiled since NetBSD 4. Remove it.
Complete support for FPU_VFP.
fpregs now contains vfpreg.
XXX vfpreg only has space for 16 64-bit FP registers though VFPv3 and later
have 32 64-bit FP registers.


# 1.90 30-Nov-2012 msaitoh

Use snprintf() instead of sprintf().


# 1.89 30-Nov-2012 msaitoh

s/,/;/


# 1.88 12-Nov-2012 skrll

C99 types


Revision tags: yamt-pagecache-base6
# 1.87 22-Sep-2012 matt

Don't use an asm in pmap_activate to update the TTBR, use cpu_setttb instead
but add a second argument to it to indicate whether the TLB/caches need to be
flushed. Default cortex to pmap_needs_fixup = 1. But check the MMFR3 field
to see if the fixed can be skipped.
Use a cf_flag bit 0 to indicate whether the A9 L2 cache should disable (bit 0 = 1)
or enabeld (bit = 0).

With these changes, the A9 MMU can use traverse caches to do MMU tablewalks
Also, make sure all memory has the shareable bit for the A9.


# 1.86 07-Sep-2012 matt

branches: 1.86.2;
Switch cortex_a9 back to need_ptesync = 1
Add code to disable the L2 cache on cortex-a9 (for now).
Add evcnt for all the fault types.
Move cache info in a structure and have one for the pcache and one for scache.
Probe L1/L2 caches properly for ARMv7


# 1.85 29-Aug-2012 matt

Use new armv7 CP15 register to print out cache types.
If the cpu_cc_freq is set, report it.
Add macros to make inlines for reading/writing co-processor registers.


# 1.84 14-Aug-2012 matt

Use device_t


# 1.83 12-Aug-2012 matt

Rework VFP support to use PCU.
Add emulation of instruction which save/restore the VFP FPSCR.
Add a sysarch hook to VFP FPSCR manipulation.

[The emulation will be used by libc to store/fetch exception modes and
rounding mode on a per-thread basis.]


# 1.82 14-Jul-2012 matt

Refresh cortex cpus


Revision tags: jmcneill-usbmp-base10 yamt-pagecache-base5
# 1.81 20-May-2012 skrll

Remove the ARM1156T2 bloat - it only has an MPU. Prompted by matt@


# 1.80 20-May-2012 skrll

Add the ARM1156T2-S


# 1.79 20-May-2012 skrll

Add the 'Z' to the 1176 cpu product name.

ok matt@


Revision tags: jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base jym-xensuspend-nbase rmind-uvmplock-base jym-xensuspend-base
# 1.78 10-Mar-2011 bsh

branches: 1.78.4; 1.78.8; 1.78.10;
add MPCore to CPU-ID table
add branch predict bit to arm11_options


Revision tags: uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11
# 1.77 02-Oct-2010 kiyohara

branches: 1.77.2;
Add support Marvell Sheeva Core and SoC. (Orion/Kirkwood)
Discovery Innovation not yet.


Revision tags: uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.76 19-Jun-2010 matt

Fix cache probing on Cortex. Add missing CORTEX dependency in cpu.c


# 1.75 19-Jun-2010 matt

Fix c&p error.


# 1.74 19-Jun-2010 matt

Cleanup the armv7 changes. Add ARM_ARCH_7. Use CPU_CORTEX instead of
CPU_CORTEXA8 everywhere since there more types of Cortex than just the A8.
CPU_CORTEXA8 still exists but causes CPU_CORTEX to be defined.
Add CPU_CORTEXA9 as well. Use .arch armv7a to get us the isb/dsb
instructions.

Test booted to root device prompt on a Beagleboard.
All ARM kernels successfully test built.


# 1.73 16-Jun-2010 jmcneill

PR port-arm/43299: Support added for igepv2/cortexa8/omap3530

Apply patch from PR, with build fixes. ok skrll, matt


Revision tags: uebayasi-xip-base1 yamt-nfs-mp-base9 uebayasi-xip-base
# 1.72 23-Jan-2010 mrg

branches: 1.72.2; 1.72.4;
rename a local cpu_name structure member to avoid potential conflict
with <sys/cpu.h>'s.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-premerge-20091211 yamt-nfs-mp-base8 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 yamt-nfs-mp-base7 netbsd-5-0-1-RELEASE jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base nick-hppapmap-base haad-dm-base mjf-devfs2-base
# 1.71 25-Oct-2008 matt

branches: 1.71.4; 1.71.12;
Fix some missing things for CPU_ID_FA526.


Revision tags: matt-mips64-base2
# 1.70 24-Oct-2008 matt

Add entry for FA526.


# 1.69 21-Oct-2008 matt

Add Cortex cpus


Revision tags: haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base
# 1.68 27-Apr-2008 matt

branches: 1.68.6;
Merge kernel changes in matt-armv6 to HEAD.


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 chris-arm-intr-rework-base7 keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.67 15-Mar-2008 rearnsha

branches: 1.67.2; 1.67.4;
VFP support.


Revision tags: nick-net80211-sync-base chris-arm-intr-rework-base6 chris-arm-intr-rework-base5 chris-arm-intr-rework-base4 bouyer-xeni386-merge1 chris-arm-intr-rework-base3 vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 jmcneill-base mjf-devfs-base bouyer-xenamd64-base2 vmlocking-nbase yamt-x86pmap-base4 bouyer-xenamd64-base matt-armv6-base jmcneill-pm-base hpcarm-cleanup-base reinoud-bufcleanup-base
# 1.66 17-Oct-2007 garbled

branches: 1.66.12; 1.66.16;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base chris-arm-intr-rework-base2 chris-arm-intr-rework-base nick-csl-alignment-base matt-mips64-base ppcoea-renovation-base mjf-ufs-trans-base vmlocking-base
# 1.65 17-May-2007 yamt

branches: 1.65.10; 1.65.12;
merge yamt-idlelwp branch. asked by core@. some ports still needs work.

from doc/BRANCHES:

idle lwp, and some changes depending on it.

1. separate context switching and thread scheduling.
(cf. gmcgarry_ctxsw)
2. implement idle lwp.
3. clean up related MD/MI interfaces.
4. make scheduler(s) modular.


Revision tags: yamt-idlelwp-base8 thorpej-atomic-base ad-audiomp-base post-newlock2-merge newlock2-nbase newlock2-base
# 1.64 06-Jan-2007 christos

branches: 1.64.2; 1.64.6; 1.64.8; 1.64.14;
Scott Allan in http://mail-index.netbsd.org/port-arm/2006/07/31/0000.html
Patch to add support for ARM9E


# 1.63 06-Jan-2007 christos

From Scott Alan in http://mail-index.netbsd.org/port-arm/2006/07/26/0000.html
identify_arm_cpu() prints out a helpful message when it detects that you're
trying to run on a CPU that you didn't configure for. Unfortunately, the
check for class_option being NULL is backward, so it either won't print the
class_option, or it will try to dereference a NULL. The patch just flips the
!= NULL to be == NULL.


Revision tags: yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 abandoned-netbsd-4-base yamt-splraiseipl-base2 yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 netbsd-4-base yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base elad-kernelauth-base simonb-timecounters-base rpaulo-netinet-merge-pcb-base
# 1.62 15-Mar-2006 drochner

branches: 1.62.10; 1.62.14;
use km_alloc to get wired kernel memory for kernel stacks
of idle processes for secondary CPUs
(affects the MULTIPROCESSOR case only - does this exist?)
(untested)


Revision tags: yamt-pdpolicy-base2 yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.61 11-Dec-2005 christos

branches: 1.61.4; 1.61.6; 1.61.8; 1.61.10;
merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.60 20-Jul-2005 nonaka

Added i80219.


# 1.59 04-Jul-2005 bsh

branches: 1.59.2;
The first step to support Intel PXA270.

kernel config option CPU_XSCALE_PXA2X0 is now obsoleted by
CPU_XSCALE_PXA250 and CPU_XSCALE_PXA270. If both of them are defined,
CPU is determined run-time.


# 1.58 03-Jun-2005 rearnsha

Very basic support for the ARM1136.

This code takes no advantage of any 'new' features provided by
architecture 6 devices (such as physically tagged caches or new
MMU features), and basically runs the chip in a 'legacy v5' mode.


# 1.57 10-May-2005 rearnsha

Add support for arm1026ej-s.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 yamt-km-base4 yamt-km-base3 netbsd-3-base yamt-km-base2 yamt-km-base kent-audio2-base kent-audio1-beforemerge kent-audio1-base
# 1.56 14-Apr-2004 bsh

distinguish PXA255/26x from PXA2[15]0 in CPU attach message


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.55 13-Feb-2004 wiz

Uppercase CPU, plural is CPUs.


# 1.54 26-Oct-2003 chris

Fix up some unitialised variables.


# 1.53 06-Sep-2003 rearnsha

Support for ARM10E class devices.


# 1.52 03-Sep-2003 mycroft

Recognize some TI processors -- not that you'd want to use them.


# 1.51 23-Jun-2003 martin

branches: 1.51.2;
Make sure to include opt_foo.h if a defflag option FOO is used.


# 1.50 23-May-2003 ichiro

support IXP425 Intel Network Processor
running on BigEndian


# 1.49 29-Apr-2003 thorpej

Use aprint*().


# 1.48 14-Feb-2003 rjs

Add CPU IDs for PXA B2 and C0 steppings.


Revision tags: nathanw_sa_before_merge nathanw_sa_base
# 1.47 06-Jan-2003 wiz

specified, not specifed.


Revision tags: fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base
# 1.46 17-Nov-2002 chs

change uvm_uarea_alloc() to indicate whether the returned uarea is already
backed by physical pages (ie. because it reused a previously-freed one),
so that we can skip a bunch of useless work in that case.
this fixes the underlying problem behind PR 18543, and also speeds up fork()
quite a bit (eg. 7% on my pc, 1% on my ultra2) when we get a cache hit.


Revision tags: kqueue-aftermerge kqueue-beforemerge bjh21-hydra-base
# 1.45 13-Oct-2002 chris

branches: 1.45.2;
Fix arm kernel build breaks for non multiprocessor systems.


# 1.44 13-Oct-2002 bjh21

It appears that MI code requires ci_cpuid to be the CPU number of the CPU
in question, whereas the ARM code was using it to hold the model
identification. To fix this, rename:

ci_cpuid -> ci_arm_cpuid
ci_cputype -> ci_arm_cputype (for consistency)
ci_cpurev -> ci_arm_cpurev (ditto)
ci_cpunum -> ci_cpuid

This makes top(1) give correct CPU numbers in its "STATE" column (all 0 for
now).


# 1.43 12-Oct-2002 bjh21

Remember the location of each CPU's idle PCB in struct cpu_info.
Move allocation of the idle PCB from hydra.c to cpu.c and add some
extra initialisation from cpu_fork().


Revision tags: kqueue-base
# 1.42 01-Oct-2002 bjh21

constify various string tables.


# 1.41 06-Sep-2002 gehenna

Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.


Revision tags: gehenna-devsw-base
# 1.40 22-Jul-2002 briggs

Handle i80200 step D0 and i80321 step B0


# 1.39 10-Jul-2002 ichiro

add cpu id for "PXA250/210 3rd version CPUcore".

for using many PDA/xscale-core.


# 1.38 07-Jun-2002 thorpej

Add the CPU ID for the 600MHz i80321 part.


Revision tags: netbsd-1-6-base
# 1.37 12-May-2002 ichiro

branches: 1.37.2; 1.37.4;
change ICP12x0 steppings.
define CPU_IXP12X0


# 1.36 10-May-2002 thorpej

Add IXP1200 steppings.


# 1.35 03-May-2002 thorpej

Add support for the Intel PXA210 and PXA250. From Hiroyuki Bessho, PR 16617.


# 1.34 02-May-2002 rjs

Enable CPU_CLASS_SA1 for SA1100 and SA1110.


# 1.33 12-Apr-2002 thorpej

Centralize ARM CPU configuration information by adding a new header
file, <arm/cpuconf.h>, which pulls in "opt_cputypes.h" and then defines
the following:
* CPU_NTYPES -- now many CPU types are configured into the kernel. What
you really want to know is "== 1" or "> 1".
* Defines ARM_ARCH_2, ARM_ARCH_3, ARM_ARCH_4, ARM_ARCH_5, depending
on which ARM architecture versions are configured (based on CPU_*
options). Also defines ARM_NARCH to determins how many architecture
versions are configured.
* Defines ARM_MMU_MEMC, ARM_MMU_GENERIC, ARM_MMU_XSCALE depending on
which classes of ARM MMUs are configured into the kernel, and ARM_NMMUS
to determine how many MMU classes are configured.

Remove the needless inclusion of "opt_cputypes.h" in several places.
Convert remaining users to <arm/cpuconf.h>.


# 1.32 27-Mar-2002 thorpej

The 80321 manual lies; it does have a CPU ID distinct from the 80200.
Add that CPU ID, and add a case for it.


# 1.31 26-Mar-2002 thorpej

Restructure a few things in order to support other XScale core
I/O processors:
* The i80200 and the i80321 have the same CPU ID, so split the
CPU_XSCALE option into CPU_XSCALE_80200 and CPU_XSCALE_80321
options, and don't let them both be defined at the same time.
XXX May want to revisit this in the future.
* Split some registers common between the i80200 and i80321 into
<arm/xscale/xscalereg.h>.
* Rename a few existing functions.


# 1.30 24-Mar-2002 thorpej

Cache the cpu type and cpu revision in cpu_info.


Revision tags: eeh-devprop-base
# 1.29 16-Mar-2002 bjh21

Only put the CPU type into cpu_model, not the state of the control register.
Instead, print the control register state on the next line at startup.


# 1.28 16-Mar-2002 bjh21

Add CPU ID for the ARM1022ES.
Also add a CPU class for ARM10E processors in general.


# 1.27 11-Mar-2002 reinoud

When ARMFPE wasn't enabled the `usearmfpe' flag was statically initialised
but not used resulting in a compiler error. By splitting the declaration
and the initialisation this is solved.

Better would be to not even declare the flag when ARMFPE isnt enabled but
that would just add to the #ifdef jungle.


# 1.26 10-Mar-2002 bjh21

__RCSID -> __KERNEL_RCSID


# 1.25 10-Mar-2002 bjh21

Re-work the way that FPAs are handled. If ARMFPE isn't configured, don't
even bother probing for an FPA. If ARMFPE is configured, always use it,
even if there's an FPA (since it provides the FPA support code). Move all
printfs about FPAs into armfpe_init.c.

This means I can delete the last two elements from struct _cpu, so that the
structure, and the whole of <arm/cpus.h> is redundant and can be deleted.


# 1.24 10-Mar-2002 bjh21

Remove fpu_model from struct _cpu. Instead, have initialise_arm_fpe()
printf() the FPE version number itself.


# 1.23 10-Mar-2002 bjh21

Add a ci_dev element to struct cpu_info, pointing to the device that
corresponds to the CPU.


Revision tags: newlock-base
# 1.22 10-Mar-2002 bjh21

Kill the fpu_flags element from struct _cpu. It was only ever set to 0
anyway.


# 1.21 10-Mar-2002 bjh21

Clean up inline assembler. Rather than saving R0, copying FPSR to R0,
copying it to the output register and then restoring R0, just copy the
FPSR straight to the output.


# 1.20 09-Mar-2002 bjh21

Remove the cpu_model member from struct _cpu, and just use the cpu_model
variable directly. While we're at it, make cpu_model rather larger.


# 1.19 09-Mar-2002 bjh21

Remove the cpu_class element from struct _cpu, and make it a local variable
in identify_arm_cpu(), since it's almost unused elsewhere.

Change the detection of bugged StrongARMs to use the cpu ID rather than the
class. This turns "almost" into "entirely".


# 1.18 09-Mar-2002 bjh21

Replace cpu_id and cpu_ctrl in struct _cpu with ci_cpuid and ci_ctrl in
struct cpu_info. Also kill the cpuctrl global while we're here, and make
identify_arm_cpu() take a struct cpu_info * as an argument alongside the CPU
number.


# 1.17 09-Mar-2002 bjh21

Move arm700bugcount into stuct cpu_info, and attach it in
identify_master_cpu().


Revision tags: ifpoll-base
# 1.16 17-Feb-2002 bjh21

Our assembler handles FPA instructions fine, so don't use .word for them.


# 1.15 17-Feb-2002 bjh21

ANSIfy, and othe KNF cleanup.


# 1.14 27-Jan-2002 bjh21

Add revision->stepping maps for the SA-110, SA-1100 and SA-1110.
Those for the SA-1100 and SA-1110 are from Intel's documentation.
The mapping for the SA-110 is from various sources on the net, since Intel
don't seem to document it.

Also, change the layout of the maps to have four steppings per line,
so they aren't quite so unwieldy.


# 1.13 24-Jan-2002 thorpej

Use a table to look up stepping names. Add a generic stepping
table ("rev 0", "rev 1", etc.) and an i80200 stepping table that
has the stepping names that appear in the i80200 manuals/errata..


# 1.12 29-Nov-2001 thorpej

Fetch cache info from the Cache Type register on ARM7TDMI and "greater"
processors. Report this when the processor is attached.


# 1.11 24-Nov-2001 thorpej

Move the ARM, Ltd. floating point emulator to arch/arm.


# 1.10 23-Nov-2001 thorpej

Use <arm/undefined.h> instead of <machine/undefined.h>.


Revision tags: thorpej-mips-cache-base
# 1.9 06-Nov-2001 thorpej

branches: 1.9.2;
Const poisoning of cpu/class names.


# 1.8 06-Nov-2001 thorpej

"i80200", not "80200".


# 1.7 06-Nov-2001 thorpej

"XScale", not "Xscale".


# 1.6 18-Oct-2001 rearnsha

branches: 1.6.2;
Support for ARM9.


Revision tags: thorpej-devvp-base3 thorpej-devvp-base2
# 1.5 28-Sep-2001 chris

Add extra arg to fpa_test as it should have 4 args. Also add prototypes for fpa_test and fpa_handler.


Revision tags: post-chs-ubcperf pre-chs-ubcperf thorpej-devvp-base
# 1.4 05-Sep-2001 matt

branches: 1.4.2;
Flesh XSCALE support.


# 1.3 03-Jun-2001 chris

branches: 1.3.2; 1.3.4;
Add support for ARM7TDMI, as provided in a patch from John Fremlin to port-arm32.

Shouldn't effect any currently in tree ports.


# 1.2 13-May-2001 bjh21

Use get_bootconf_option() to find boot options, rather than home-grown
strstr()-based hacks.


Revision tags: thorpej_scsipi_beforemerge thorpej_scsipi_base thorpej_scsipi_nbase
# 1.1 20-Apr-2001 matt

branches: 1.1.2;
Split cpu from mainbus so that cpu can attached to other buses (like ofbus).


# 1.132 29-Sep-2019 skrll

aprint_debug_dev output alignment


# 1.131 08-Sep-2019 tnn

report A12 as A17 to the user. A12 is retcon'ed by ARM.


# 1.130 07-Sep-2019 tnn

Cortex A12 is marketed as A17 but has a distinct part number

observed on Rockchip RK3288


Revision tags: netbsd-9-base phil-wifi-20190609 isaki-audio2-base
# 1.129 17-Mar-2019 skrll

Wrap arm_cpu_marker if #ifdef MPDEBUG.

One day a9_mpsubr.S will die


# 1.128 27-Jan-2019 pgoyette

Merge the [pgoyette-compat] branch


Revision tags: pgoyette-compat-20190127
# 1.127 25-Jan-2019 skrll

Make sure ci_{smt,core,package}_id are all filled in appropriately.

Previously the BP was missed and __SHIFTOUT wasn't used.


Revision tags: pgoyette-compat-20190118
# 1.126 03-Jan-2019 jmcneill

Read mpidr and cpuid from the secondary processor itself instead of the
boot processor. While here, add Cortex-A15 r4p0 to supported list.


# 1.125 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.124 02-Jan-2019 skrll

Don't overwrite the setting of cpu_core_id from mpidr


Revision tags: pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020
# 1.123 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.122 08-Oct-2018 skrll

Trialing whitespace


# 1.121 06-Oct-2018 skrll

Use __BIT. NFC.


Revision tags: pgoyette-compat-0930 pgoyette-compat-0906
# 1.120 15-Aug-2018 skrll

KNF


# 1.119 15-Aug-2018 skrll

Fix includes (sys/cdefs.h then sys/param.h)


# 1.118 15-Aug-2018 skrll

Sprinkle #include "opt_cputypes.h"


# 1.117 10-Aug-2018 maxv

Retire CPU_ARM2, CPU_ARM250 and CPU_ARM3, they are all leftovers of
acorn26.

ok jmcneill@ skrll@


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202
# 1.116 16-Sep-2017 matt

branches: 1.116.2; 1.116.4;
Add Cortex-A35 CPU ID.


Revision tags: netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base
# 1.115 01-Jun-2017 chs

branches: 1.115.6;
remove checks for failure after memory allocation calls that cannot fail:

kmem_alloc() with KM_SLEEP
kmem_zalloc() with KM_SLEEP
percpu_alloc()
pserialize_create()
psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.114 11-Jul-2016 kiyohara

Add Cortex-A9 r1.


Revision tags: nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.113 03-Mar-2016 skrll

Get the RPI3 working (in aarch32 mode) by recognising Cortex A53 CPUs.
While I'm here add some A57/A72 info as well.

My RPI3 works with FB console - the uart needs some help with its clocks.


# 1.112 23-Jan-2016 christos

Rename the cpu_id() define to cpu_idnum() so that it does not conflict with
dtrace and friends.


Revision tags: nick-nhusb-base-20151226
# 1.111 12-Nov-2015 jmcneill

change some register dumps from aprint_verbose to aprint_debug


Revision tags: nick-nhusb-base-20150921
# 1.110 08-Jul-2015 skrll

aprint_verbose [sa]ctlr


Revision tags: nick-nhusb-base-20150606
# 1.109 05-Jun-2015 skrll

Print the Revision ID regster (verbose)


# 1.108 17-May-2015 matt

Print out mpidr on MP systems (verbose print)


Revision tags: nick-nhusb-base-20150406
# 1.107 03-Mar-2015 jmcneill

cache type 12 is "write-back", from matt


Revision tags: nick-nhusb-base
# 1.106 27-Nov-2014 matt

branches: 1.106.2;
Add entry for Cortex-A17 r1


# 1.105 01-Sep-2014 reinoud

Increase the `freqbuf' buffer that holds the result of humanize_number(). Now
it prints 1600 Mhz instead of 1 Ghz.
Pitty enough humanize_number(9) doesn't do 1.6 Ghz type output.


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.104 28-Mar-2014 matt

branches: 1.104.4;
Various MP changes.


# 1.103 24-Mar-2014 christos

use cpu_{g,s}etmodel


# 1.102 20-Mar-2014 matt

Define cache type 13


Revision tags: riastradh-drm2-base3
# 1.101 03-Mar-2014 matt

Add most of the cpu_* variables to <arm/locore.h>
Add and initialize cpu_synchprim_present


# 1.100 20-Feb-2014 matt

Keep track of what each cache is (VIVT/VIPT/PIPT).

cpu0: 32KB/32B 2-way L1 VIPT Instruction cache
cpu0: 32KB/64B 4-way write-back-locking-C L1 PIPT Data cache
cpu0: 256KB/64B 8-way write-through L2 PIPT Unified cache


# 1.99 07-Sep-2013 matt

Add a machdep.hwdiv_present sysctl (cortex A7 and A15 have hwdiv instructions)


# 1.98 07-Sep-2013 matt

Add CPU_ID_CORTEXA7R0 entry


# 1.97 18-Aug-2013 matt

Move parts of cpu.h that are not needed by MI code in <arm/locore.h>
Don't include <machine/cpu.h> or <machine/frame.h>, use <arm/locore.h>
Use <arm/asm.h> instead of <machine/arm.h>


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.96 12-Jun-2013 matt

branches: 1.96.2;
Nuke cpu_pfr, just use the armreg_pfr?_read inlines


# 1.95 12-Jun-2013 matt

Use the armreg_pfr?_read inlines.


# 1.94 19-May-2013 rkujawa

Plug support for PJ4B into our ARM CPU infrastructure.

Obtained from Marvell, Semihalf.


Revision tags: agc-symver-base
# 1.93 03-Feb-2013 matt

Add a machdep.cpu_arch sysctl


# 1.92 31-Jan-2013 matt

Add simple sysctls for cpu_id, fpu_id, neon_present, simd_present,
simdex_present.
Add struct sysctls to return the isar, mmfr, pfr, and mvfr sets.


Revision tags: yamt-pagecache-base8 yamt-pagecache-base7
# 1.91 05-Dec-2012 matt

ARMFPE hasn't compiled since NetBSD 4. Remove it.
Complete support for FPU_VFP.
fpregs now contains vfpreg.
XXX vfpreg only has space for 16 64-bit FP registers though VFPv3 and later
have 32 64-bit FP registers.


# 1.90 30-Nov-2012 msaitoh

Use snprintf() instead of sprintf().


# 1.89 30-Nov-2012 msaitoh

s/,/;/


# 1.88 12-Nov-2012 skrll

C99 types


Revision tags: yamt-pagecache-base6
# 1.87 22-Sep-2012 matt

Don't use an asm in pmap_activate to update the TTBR, use cpu_setttb instead
but add a second argument to it to indicate whether the TLB/caches need to be
flushed. Default cortex to pmap_needs_fixup = 1. But check the MMFR3 field
to see if the fixed can be skipped.
Use a cf_flag bit 0 to indicate whether the A9 L2 cache should disable (bit 0 = 1)
or enabeld (bit = 0).

With these changes, the A9 MMU can use traverse caches to do MMU tablewalks
Also, make sure all memory has the shareable bit for the A9.


# 1.86 07-Sep-2012 matt

branches: 1.86.2;
Switch cortex_a9 back to need_ptesync = 1
Add code to disable the L2 cache on cortex-a9 (for now).
Add evcnt for all the fault types.
Move cache info in a structure and have one for the pcache and one for scache.
Probe L1/L2 caches properly for ARMv7


# 1.85 29-Aug-2012 matt

Use new armv7 CP15 register to print out cache types.
If the cpu_cc_freq is set, report it.
Add macros to make inlines for reading/writing co-processor registers.


# 1.84 14-Aug-2012 matt

Use device_t


# 1.83 12-Aug-2012 matt

Rework VFP support to use PCU.
Add emulation of instruction which save/restore the VFP FPSCR.
Add a sysarch hook to VFP FPSCR manipulation.

[The emulation will be used by libc to store/fetch exception modes and
rounding mode on a per-thread basis.]


# 1.82 14-Jul-2012 matt

Refresh cortex cpus


Revision tags: jmcneill-usbmp-base10 yamt-pagecache-base5
# 1.81 20-May-2012 skrll

Remove the ARM1156T2 bloat - it only has an MPU. Prompted by matt@


# 1.80 20-May-2012 skrll

Add the ARM1156T2-S


# 1.79 20-May-2012 skrll

Add the 'Z' to the 1176 cpu product name.

ok matt@


Revision tags: jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base jym-xensuspend-nbase rmind-uvmplock-base jym-xensuspend-base
# 1.78 10-Mar-2011 bsh

branches: 1.78.4; 1.78.8; 1.78.10;
add MPCore to CPU-ID table
add branch predict bit to arm11_options


Revision tags: uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11
# 1.77 02-Oct-2010 kiyohara

branches: 1.77.2;
Add support Marvell Sheeva Core and SoC. (Orion/Kirkwood)
Discovery Innovation not yet.


Revision tags: uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.76 19-Jun-2010 matt

Fix cache probing on Cortex. Add missing CORTEX dependency in cpu.c


# 1.75 19-Jun-2010 matt

Fix c&p error.


# 1.74 19-Jun-2010 matt

Cleanup the armv7 changes. Add ARM_ARCH_7. Use CPU_CORTEX instead of
CPU_CORTEXA8 everywhere since there more types of Cortex than just the A8.
CPU_CORTEXA8 still exists but causes CPU_CORTEX to be defined.
Add CPU_CORTEXA9 as well. Use .arch armv7a to get us the isb/dsb
instructions.

Test booted to root device prompt on a Beagleboard.
All ARM kernels successfully test built.


# 1.73 16-Jun-2010 jmcneill

PR port-arm/43299: Support added for igepv2/cortexa8/omap3530

Apply patch from PR, with build fixes. ok skrll, matt


Revision tags: uebayasi-xip-base1 yamt-nfs-mp-base9 uebayasi-xip-base
# 1.72 23-Jan-2010 mrg

branches: 1.72.2; 1.72.4;
rename a local cpu_name structure member to avoid potential conflict
with <sys/cpu.h>'s.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-premerge-20091211 yamt-nfs-mp-base8 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 yamt-nfs-mp-base7 netbsd-5-0-1-RELEASE jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base nick-hppapmap-base haad-dm-base mjf-devfs2-base
# 1.71 25-Oct-2008 matt

branches: 1.71.4; 1.71.12;
Fix some missing things for CPU_ID_FA526.


Revision tags: matt-mips64-base2
# 1.70 24-Oct-2008 matt

Add entry for FA526.


# 1.69 21-Oct-2008 matt

Add Cortex cpus


Revision tags: haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base
# 1.68 27-Apr-2008 matt

branches: 1.68.6;
Merge kernel changes in matt-armv6 to HEAD.


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 chris-arm-intr-rework-base7 keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.67 15-Mar-2008 rearnsha

branches: 1.67.2; 1.67.4;
VFP support.


Revision tags: nick-net80211-sync-base chris-arm-intr-rework-base6 chris-arm-intr-rework-base5 chris-arm-intr-rework-base4 bouyer-xeni386-merge1 chris-arm-intr-rework-base3 vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 jmcneill-base mjf-devfs-base bouyer-xenamd64-base2 vmlocking-nbase yamt-x86pmap-base4 bouyer-xenamd64-base matt-armv6-base jmcneill-pm-base hpcarm-cleanup-base reinoud-bufcleanup-base
# 1.66 17-Oct-2007 garbled

branches: 1.66.12; 1.66.16;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base chris-arm-intr-rework-base2 chris-arm-intr-rework-base nick-csl-alignment-base matt-mips64-base ppcoea-renovation-base mjf-ufs-trans-base vmlocking-base
# 1.65 17-May-2007 yamt

branches: 1.65.10; 1.65.12;
merge yamt-idlelwp branch. asked by core@. some ports still needs work.

from doc/BRANCHES:

idle lwp, and some changes depending on it.

1. separate context switching and thread scheduling.
(cf. gmcgarry_ctxsw)
2. implement idle lwp.
3. clean up related MD/MI interfaces.
4. make scheduler(s) modular.


Revision tags: yamt-idlelwp-base8 thorpej-atomic-base ad-audiomp-base post-newlock2-merge newlock2-nbase newlock2-base
# 1.64 06-Jan-2007 christos

branches: 1.64.2; 1.64.6; 1.64.8; 1.64.14;
Scott Allan in http://mail-index.netbsd.org/port-arm/2006/07/31/0000.html
Patch to add support for ARM9E


# 1.63 06-Jan-2007 christos

From Scott Alan in http://mail-index.netbsd.org/port-arm/2006/07/26/0000.html
identify_arm_cpu() prints out a helpful message when it detects that you're
trying to run on a CPU that you didn't configure for. Unfortunately, the
check for class_option being NULL is backward, so it either won't print the
class_option, or it will try to dereference a NULL. The patch just flips the
!= NULL to be == NULL.


Revision tags: yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 abandoned-netbsd-4-base yamt-splraiseipl-base2 yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 netbsd-4-base yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base elad-kernelauth-base simonb-timecounters-base rpaulo-netinet-merge-pcb-base
# 1.62 15-Mar-2006 drochner

branches: 1.62.10; 1.62.14;
use km_alloc to get wired kernel memory for kernel stacks
of idle processes for secondary CPUs
(affects the MULTIPROCESSOR case only - does this exist?)
(untested)


Revision tags: yamt-pdpolicy-base2 yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.61 11-Dec-2005 christos

branches: 1.61.4; 1.61.6; 1.61.8; 1.61.10;
merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.60 20-Jul-2005 nonaka

Added i80219.


# 1.59 04-Jul-2005 bsh

branches: 1.59.2;
The first step to support Intel PXA270.

kernel config option CPU_XSCALE_PXA2X0 is now obsoleted by
CPU_XSCALE_PXA250 and CPU_XSCALE_PXA270. If both of them are defined,
CPU is determined run-time.


# 1.58 03-Jun-2005 rearnsha

Very basic support for the ARM1136.

This code takes no advantage of any 'new' features provided by
architecture 6 devices (such as physically tagged caches or new
MMU features), and basically runs the chip in a 'legacy v5' mode.


# 1.57 10-May-2005 rearnsha

Add support for arm1026ej-s.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 yamt-km-base4 yamt-km-base3 netbsd-3-base yamt-km-base2 yamt-km-base kent-audio2-base kent-audio1-beforemerge kent-audio1-base
# 1.56 14-Apr-2004 bsh

distinguish PXA255/26x from PXA2[15]0 in CPU attach message


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.55 13-Feb-2004 wiz

Uppercase CPU, plural is CPUs.


# 1.54 26-Oct-2003 chris

Fix up some unitialised variables.


# 1.53 06-Sep-2003 rearnsha

Support for ARM10E class devices.


# 1.52 03-Sep-2003 mycroft

Recognize some TI processors -- not that you'd want to use them.


# 1.51 23-Jun-2003 martin

branches: 1.51.2;
Make sure to include opt_foo.h if a defflag option FOO is used.


# 1.50 23-May-2003 ichiro

support IXP425 Intel Network Processor
running on BigEndian


# 1.49 29-Apr-2003 thorpej

Use aprint*().


# 1.48 14-Feb-2003 rjs

Add CPU IDs for PXA B2 and C0 steppings.


Revision tags: nathanw_sa_before_merge nathanw_sa_base
# 1.47 06-Jan-2003 wiz

specified, not specifed.


Revision tags: fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base
# 1.46 17-Nov-2002 chs

change uvm_uarea_alloc() to indicate whether the returned uarea is already
backed by physical pages (ie. because it reused a previously-freed one),
so that we can skip a bunch of useless work in that case.
this fixes the underlying problem behind PR 18543, and also speeds up fork()
quite a bit (eg. 7% on my pc, 1% on my ultra2) when we get a cache hit.


Revision tags: kqueue-aftermerge kqueue-beforemerge bjh21-hydra-base
# 1.45 13-Oct-2002 chris

branches: 1.45.2;
Fix arm kernel build breaks for non multiprocessor systems.


# 1.44 13-Oct-2002 bjh21

It appears that MI code requires ci_cpuid to be the CPU number of the CPU
in question, whereas the ARM code was using it to hold the model
identification. To fix this, rename:

ci_cpuid -> ci_arm_cpuid
ci_cputype -> ci_arm_cputype (for consistency)
ci_cpurev -> ci_arm_cpurev (ditto)
ci_cpunum -> ci_cpuid

This makes top(1) give correct CPU numbers in its "STATE" column (all 0 for
now).


# 1.43 12-Oct-2002 bjh21

Remember the location of each CPU's idle PCB in struct cpu_info.
Move allocation of the idle PCB from hydra.c to cpu.c and add some
extra initialisation from cpu_fork().


Revision tags: kqueue-base
# 1.42 01-Oct-2002 bjh21

constify various string tables.


# 1.41 06-Sep-2002 gehenna

Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.


Revision tags: gehenna-devsw-base
# 1.40 22-Jul-2002 briggs

Handle i80200 step D0 and i80321 step B0


# 1.39 10-Jul-2002 ichiro

add cpu id for "PXA250/210 3rd version CPUcore".

for using many PDA/xscale-core.


# 1.38 07-Jun-2002 thorpej

Add the CPU ID for the 600MHz i80321 part.


Revision tags: netbsd-1-6-base
# 1.37 12-May-2002 ichiro

branches: 1.37.2; 1.37.4;
change ICP12x0 steppings.
define CPU_IXP12X0


# 1.36 10-May-2002 thorpej

Add IXP1200 steppings.


# 1.35 03-May-2002 thorpej

Add support for the Intel PXA210 and PXA250. From Hiroyuki Bessho, PR 16617.


# 1.34 02-May-2002 rjs

Enable CPU_CLASS_SA1 for SA1100 and SA1110.


# 1.33 12-Apr-2002 thorpej

Centralize ARM CPU configuration information by adding a new header
file, <arm/cpuconf.h>, which pulls in "opt_cputypes.h" and then defines
the following:
* CPU_NTYPES -- now many CPU types are configured into the kernel. What
you really want to know is "== 1" or "> 1".
* Defines ARM_ARCH_2, ARM_ARCH_3, ARM_ARCH_4, ARM_ARCH_5, depending
on which ARM architecture versions are configured (based on CPU_*
options). Also defines ARM_NARCH to determins how many architecture
versions are configured.
* Defines ARM_MMU_MEMC, ARM_MMU_GENERIC, ARM_MMU_XSCALE depending on
which classes of ARM MMUs are configured into the kernel, and ARM_NMMUS
to determine how many MMU classes are configured.

Remove the needless inclusion of "opt_cputypes.h" in several places.
Convert remaining users to <arm/cpuconf.h>.


# 1.32 27-Mar-2002 thorpej

The 80321 manual lies; it does have a CPU ID distinct from the 80200.
Add that CPU ID, and add a case for it.


# 1.31 26-Mar-2002 thorpej

Restructure a few things in order to support other XScale core
I/O processors:
* The i80200 and the i80321 have the same CPU ID, so split the
CPU_XSCALE option into CPU_XSCALE_80200 and CPU_XSCALE_80321
options, and don't let them both be defined at the same time.
XXX May want to revisit this in the future.
* Split some registers common between the i80200 and i80321 into
<arm/xscale/xscalereg.h>.
* Rename a few existing functions.


# 1.30 24-Mar-2002 thorpej

Cache the cpu type and cpu revision in cpu_info.


Revision tags: eeh-devprop-base
# 1.29 16-Mar-2002 bjh21

Only put the CPU type into cpu_model, not the state of the control register.
Instead, print the control register state on the next line at startup.


# 1.28 16-Mar-2002 bjh21

Add CPU ID for the ARM1022ES.
Also add a CPU class for ARM10E processors in general.


# 1.27 11-Mar-2002 reinoud

When ARMFPE wasn't enabled the `usearmfpe' flag was statically initialised
but not used resulting in a compiler error. By splitting the declaration
and the initialisation this is solved.

Better would be to not even declare the flag when ARMFPE isnt enabled but
that would just add to the #ifdef jungle.


# 1.26 10-Mar-2002 bjh21

__RCSID -> __KERNEL_RCSID


# 1.25 10-Mar-2002 bjh21

Re-work the way that FPAs are handled. If ARMFPE isn't configured, don't
even bother probing for an FPA. If ARMFPE is configured, always use it,
even if there's an FPA (since it provides the FPA support code). Move all
printfs about FPAs into armfpe_init.c.

This means I can delete the last two elements from struct _cpu, so that the
structure, and the whole of <arm/cpus.h> is redundant and can be deleted.


# 1.24 10-Mar-2002 bjh21

Remove fpu_model from struct _cpu. Instead, have initialise_arm_fpe()
printf() the FPE version number itself.


# 1.23 10-Mar-2002 bjh21

Add a ci_dev element to struct cpu_info, pointing to the device that
corresponds to the CPU.


Revision tags: newlock-base
# 1.22 10-Mar-2002 bjh21

Kill the fpu_flags element from struct _cpu. It was only ever set to 0
anyway.


# 1.21 10-Mar-2002 bjh21

Clean up inline assembler. Rather than saving R0, copying FPSR to R0,
copying it to the output register and then restoring R0, just copy the
FPSR straight to the output.


# 1.20 09-Mar-2002 bjh21

Remove the cpu_model member from struct _cpu, and just use the cpu_model
variable directly. While we're at it, make cpu_model rather larger.


# 1.19 09-Mar-2002 bjh21

Remove the cpu_class element from struct _cpu, and make it a local variable
in identify_arm_cpu(), since it's almost unused elsewhere.

Change the detection of bugged StrongARMs to use the cpu ID rather than the
class. This turns "almost" into "entirely".


# 1.18 09-Mar-2002 bjh21

Replace cpu_id and cpu_ctrl in struct _cpu with ci_cpuid and ci_ctrl in
struct cpu_info. Also kill the cpuctrl global while we're here, and make
identify_arm_cpu() take a struct cpu_info * as an argument alongside the CPU
number.


# 1.17 09-Mar-2002 bjh21

Move arm700bugcount into stuct cpu_info, and attach it in
identify_master_cpu().


Revision tags: ifpoll-base
# 1.16 17-Feb-2002 bjh21

Our assembler handles FPA instructions fine, so don't use .word for them.


# 1.15 17-Feb-2002 bjh21

ANSIfy, and othe KNF cleanup.


# 1.14 27-Jan-2002 bjh21

Add revision->stepping maps for the SA-110, SA-1100 and SA-1110.
Those for the SA-1100 and SA-1110 are from Intel's documentation.
The mapping for the SA-110 is from various sources on the net, since Intel
don't seem to document it.

Also, change the layout of the maps to have four steppings per line,
so they aren't quite so unwieldy.


# 1.13 24-Jan-2002 thorpej

Use a table to look up stepping names. Add a generic stepping
table ("rev 0", "rev 1", etc.) and an i80200 stepping table that
has the stepping names that appear in the i80200 manuals/errata..


# 1.12 29-Nov-2001 thorpej

Fetch cache info from the Cache Type register on ARM7TDMI and "greater"
processors. Report this when the processor is attached.


# 1.11 24-Nov-2001 thorpej

Move the ARM, Ltd. floating point emulator to arch/arm.


# 1.10 23-Nov-2001 thorpej

Use <arm/undefined.h> instead of <machine/undefined.h>.


Revision tags: thorpej-mips-cache-base
# 1.9 06-Nov-2001 thorpej

branches: 1.9.2;
Const poisoning of cpu/class names.


# 1.8 06-Nov-2001 thorpej

"i80200", not "80200".


# 1.7 06-Nov-2001 thorpej

"XScale", not "Xscale".


# 1.6 18-Oct-2001 rearnsha

branches: 1.6.2;
Support for ARM9.


Revision tags: thorpej-devvp-base3 thorpej-devvp-base2
# 1.5 28-Sep-2001 chris

Add extra arg to fpa_test as it should have 4 args. Also add prototypes for fpa_test and fpa_handler.


Revision tags: post-chs-ubcperf pre-chs-ubcperf thorpej-devvp-base
# 1.4 05-Sep-2001 matt

branches: 1.4.2;
Flesh XSCALE support.


# 1.3 03-Jun-2001 chris

branches: 1.3.2; 1.3.4;
Add support for ARM7TDMI, as provided in a patch from John Fremlin to port-arm32.

Shouldn't effect any currently in tree ports.


# 1.2 13-May-2001 bjh21

Use get_bootconf_option() to find boot options, rather than home-grown
strstr()-based hacks.


Revision tags: thorpej_scsipi_beforemerge thorpej_scsipi_base thorpej_scsipi_nbase
# 1.1 20-Apr-2001 matt

branches: 1.1.2;
Split cpu from mainbus so that cpu can attached to other buses (like ofbus).


# 1.131 08-Sep-2019 tnn

report A12 as A17 to the user. A12 is retcon'ed by ARM.


# 1.130 07-Sep-2019 tnn

Cortex A12 is marketed as A17 but has a distinct part number

observed on Rockchip RK3288


Revision tags: netbsd-9-base phil-wifi-20190609 isaki-audio2-base
# 1.129 17-Mar-2019 skrll

Wrap arm_cpu_marker if #ifdef MPDEBUG.

One day a9_mpsubr.S will die


# 1.128 27-Jan-2019 pgoyette

Merge the [pgoyette-compat] branch


Revision tags: pgoyette-compat-20190127
# 1.127 25-Jan-2019 skrll

Make sure ci_{smt,core,package}_id are all filled in appropriately.

Previously the BP was missed and __SHIFTOUT wasn't used.


Revision tags: pgoyette-compat-20190118
# 1.126 03-Jan-2019 jmcneill

Read mpidr and cpuid from the secondary processor itself instead of the
boot processor. While here, add Cortex-A15 r4p0 to supported list.


# 1.125 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.124 02-Jan-2019 skrll

Don't overwrite the setting of cpu_core_id from mpidr


Revision tags: pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020
# 1.123 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.122 08-Oct-2018 skrll

Trialing whitespace


# 1.121 06-Oct-2018 skrll

Use __BIT. NFC.


Revision tags: pgoyette-compat-0930 pgoyette-compat-0906
# 1.120 15-Aug-2018 skrll

KNF


# 1.119 15-Aug-2018 skrll

Fix includes (sys/cdefs.h then sys/param.h)


# 1.118 15-Aug-2018 skrll

Sprinkle #include "opt_cputypes.h"


# 1.117 10-Aug-2018 maxv

Retire CPU_ARM2, CPU_ARM250 and CPU_ARM3, they are all leftovers of
acorn26.

ok jmcneill@ skrll@


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202
# 1.116 16-Sep-2017 matt

branches: 1.116.2; 1.116.4;
Add Cortex-A35 CPU ID.


Revision tags: netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base
# 1.115 01-Jun-2017 chs

branches: 1.115.6;
remove checks for failure after memory allocation calls that cannot fail:

kmem_alloc() with KM_SLEEP
kmem_zalloc() with KM_SLEEP
percpu_alloc()
pserialize_create()
psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.114 11-Jul-2016 kiyohara

Add Cortex-A9 r1.


Revision tags: nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.113 03-Mar-2016 skrll

Get the RPI3 working (in aarch32 mode) by recognising Cortex A53 CPUs.
While I'm here add some A57/A72 info as well.

My RPI3 works with FB console - the uart needs some help with its clocks.


# 1.112 23-Jan-2016 christos

Rename the cpu_id() define to cpu_idnum() so that it does not conflict with
dtrace and friends.


Revision tags: nick-nhusb-base-20151226
# 1.111 12-Nov-2015 jmcneill

change some register dumps from aprint_verbose to aprint_debug


Revision tags: nick-nhusb-base-20150921
# 1.110 08-Jul-2015 skrll

aprint_verbose [sa]ctlr


Revision tags: nick-nhusb-base-20150606
# 1.109 05-Jun-2015 skrll

Print the Revision ID regster (verbose)


# 1.108 17-May-2015 matt

Print out mpidr on MP systems (verbose print)


Revision tags: nick-nhusb-base-20150406
# 1.107 03-Mar-2015 jmcneill

cache type 12 is "write-back", from matt


Revision tags: nick-nhusb-base
# 1.106 27-Nov-2014 matt

branches: 1.106.2;
Add entry for Cortex-A17 r1


# 1.105 01-Sep-2014 reinoud

Increase the `freqbuf' buffer that holds the result of humanize_number(). Now
it prints 1600 Mhz instead of 1 Ghz.
Pitty enough humanize_number(9) doesn't do 1.6 Ghz type output.


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.104 28-Mar-2014 matt

branches: 1.104.4;
Various MP changes.


# 1.103 24-Mar-2014 christos

use cpu_{g,s}etmodel


# 1.102 20-Mar-2014 matt

Define cache type 13


Revision tags: riastradh-drm2-base3
# 1.101 03-Mar-2014 matt

Add most of the cpu_* variables to <arm/locore.h>
Add and initialize cpu_synchprim_present


# 1.100 20-Feb-2014 matt

Keep track of what each cache is (VIVT/VIPT/PIPT).

cpu0: 32KB/32B 2-way L1 VIPT Instruction cache
cpu0: 32KB/64B 4-way write-back-locking-C L1 PIPT Data cache
cpu0: 256KB/64B 8-way write-through L2 PIPT Unified cache


# 1.99 07-Sep-2013 matt

Add a machdep.hwdiv_present sysctl (cortex A7 and A15 have hwdiv instructions)


# 1.98 07-Sep-2013 matt

Add CPU_ID_CORTEXA7R0 entry


# 1.97 18-Aug-2013 matt

Move parts of cpu.h that are not needed by MI code in <arm/locore.h>
Don't include <machine/cpu.h> or <machine/frame.h>, use <arm/locore.h>
Use <arm/asm.h> instead of <machine/arm.h>


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.96 12-Jun-2013 matt

branches: 1.96.2;
Nuke cpu_pfr, just use the armreg_pfr?_read inlines


# 1.95 12-Jun-2013 matt

Use the armreg_pfr?_read inlines.


# 1.94 19-May-2013 rkujawa

Plug support for PJ4B into our ARM CPU infrastructure.

Obtained from Marvell, Semihalf.


Revision tags: agc-symver-base
# 1.93 03-Feb-2013 matt

Add a machdep.cpu_arch sysctl


# 1.92 31-Jan-2013 matt

Add simple sysctls for cpu_id, fpu_id, neon_present, simd_present,
simdex_present.
Add struct sysctls to return the isar, mmfr, pfr, and mvfr sets.


Revision tags: yamt-pagecache-base8 yamt-pagecache-base7
# 1.91 05-Dec-2012 matt

ARMFPE hasn't compiled since NetBSD 4. Remove it.
Complete support for FPU_VFP.
fpregs now contains vfpreg.
XXX vfpreg only has space for 16 64-bit FP registers though VFPv3 and later
have 32 64-bit FP registers.


# 1.90 30-Nov-2012 msaitoh

Use snprintf() instead of sprintf().


# 1.89 30-Nov-2012 msaitoh

s/,/;/


# 1.88 12-Nov-2012 skrll

C99 types


Revision tags: yamt-pagecache-base6
# 1.87 22-Sep-2012 matt

Don't use an asm in pmap_activate to update the TTBR, use cpu_setttb instead
but add a second argument to it to indicate whether the TLB/caches need to be
flushed. Default cortex to pmap_needs_fixup = 1. But check the MMFR3 field
to see if the fixed can be skipped.
Use a cf_flag bit 0 to indicate whether the A9 L2 cache should disable (bit 0 = 1)
or enabeld (bit = 0).

With these changes, the A9 MMU can use traverse caches to do MMU tablewalks
Also, make sure all memory has the shareable bit for the A9.


# 1.86 07-Sep-2012 matt

branches: 1.86.2;
Switch cortex_a9 back to need_ptesync = 1
Add code to disable the L2 cache on cortex-a9 (for now).
Add evcnt for all the fault types.
Move cache info in a structure and have one for the pcache and one for scache.
Probe L1/L2 caches properly for ARMv7


# 1.85 29-Aug-2012 matt

Use new armv7 CP15 register to print out cache types.
If the cpu_cc_freq is set, report it.
Add macros to make inlines for reading/writing co-processor registers.


# 1.84 14-Aug-2012 matt

Use device_t


# 1.83 12-Aug-2012 matt

Rework VFP support to use PCU.
Add emulation of instruction which save/restore the VFP FPSCR.
Add a sysarch hook to VFP FPSCR manipulation.

[The emulation will be used by libc to store/fetch exception modes and
rounding mode on a per-thread basis.]


# 1.82 14-Jul-2012 matt

Refresh cortex cpus


Revision tags: jmcneill-usbmp-base10 yamt-pagecache-base5
# 1.81 20-May-2012 skrll

Remove the ARM1156T2 bloat - it only has an MPU. Prompted by matt@


# 1.80 20-May-2012 skrll

Add the ARM1156T2-S


# 1.79 20-May-2012 skrll

Add the 'Z' to the 1176 cpu product name.

ok matt@


Revision tags: jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base jym-xensuspend-nbase rmind-uvmplock-base jym-xensuspend-base
# 1.78 10-Mar-2011 bsh

branches: 1.78.4; 1.78.8; 1.78.10;
add MPCore to CPU-ID table
add branch predict bit to arm11_options


Revision tags: uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11
# 1.77 02-Oct-2010 kiyohara

branches: 1.77.2;
Add support Marvell Sheeva Core and SoC. (Orion/Kirkwood)
Discovery Innovation not yet.


Revision tags: uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.76 19-Jun-2010 matt

Fix cache probing on Cortex. Add missing CORTEX dependency in cpu.c


# 1.75 19-Jun-2010 matt

Fix c&p error.


# 1.74 19-Jun-2010 matt

Cleanup the armv7 changes. Add ARM_ARCH_7. Use CPU_CORTEX instead of
CPU_CORTEXA8 everywhere since there more types of Cortex than just the A8.
CPU_CORTEXA8 still exists but causes CPU_CORTEX to be defined.
Add CPU_CORTEXA9 as well. Use .arch armv7a to get us the isb/dsb
instructions.

Test booted to root device prompt on a Beagleboard.
All ARM kernels successfully test built.


# 1.73 16-Jun-2010 jmcneill

PR port-arm/43299: Support added for igepv2/cortexa8/omap3530

Apply patch from PR, with build fixes. ok skrll, matt


Revision tags: uebayasi-xip-base1 yamt-nfs-mp-base9 uebayasi-xip-base
# 1.72 23-Jan-2010 mrg

branches: 1.72.2; 1.72.4;
rename a local cpu_name structure member to avoid potential conflict
with <sys/cpu.h>'s.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-premerge-20091211 yamt-nfs-mp-base8 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 yamt-nfs-mp-base7 netbsd-5-0-1-RELEASE jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base nick-hppapmap-base haad-dm-base mjf-devfs2-base
# 1.71 25-Oct-2008 matt

branches: 1.71.4; 1.71.12;
Fix some missing things for CPU_ID_FA526.


Revision tags: matt-mips64-base2
# 1.70 24-Oct-2008 matt

Add entry for FA526.


# 1.69 21-Oct-2008 matt

Add Cortex cpus


Revision tags: haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base
# 1.68 27-Apr-2008 matt

branches: 1.68.6;
Merge kernel changes in matt-armv6 to HEAD.


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 chris-arm-intr-rework-base7 keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.67 15-Mar-2008 rearnsha

branches: 1.67.2; 1.67.4;
VFP support.


Revision tags: nick-net80211-sync-base chris-arm-intr-rework-base6 chris-arm-intr-rework-base5 chris-arm-intr-rework-base4 bouyer-xeni386-merge1 chris-arm-intr-rework-base3 vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 jmcneill-base mjf-devfs-base bouyer-xenamd64-base2 vmlocking-nbase yamt-x86pmap-base4 bouyer-xenamd64-base matt-armv6-base jmcneill-pm-base hpcarm-cleanup-base reinoud-bufcleanup-base
# 1.66 17-Oct-2007 garbled

branches: 1.66.12; 1.66.16;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base chris-arm-intr-rework-base2 chris-arm-intr-rework-base nick-csl-alignment-base matt-mips64-base ppcoea-renovation-base mjf-ufs-trans-base vmlocking-base
# 1.65 17-May-2007 yamt

branches: 1.65.10; 1.65.12;
merge yamt-idlelwp branch. asked by core@. some ports still needs work.

from doc/BRANCHES:

idle lwp, and some changes depending on it.

1. separate context switching and thread scheduling.
(cf. gmcgarry_ctxsw)
2. implement idle lwp.
3. clean up related MD/MI interfaces.
4. make scheduler(s) modular.


Revision tags: yamt-idlelwp-base8 thorpej-atomic-base ad-audiomp-base post-newlock2-merge newlock2-nbase newlock2-base
# 1.64 06-Jan-2007 christos

branches: 1.64.2; 1.64.6; 1.64.8; 1.64.14;
Scott Allan in http://mail-index.netbsd.org/port-arm/2006/07/31/0000.html
Patch to add support for ARM9E


# 1.63 06-Jan-2007 christos

From Scott Alan in http://mail-index.netbsd.org/port-arm/2006/07/26/0000.html
identify_arm_cpu() prints out a helpful message when it detects that you're
trying to run on a CPU that you didn't configure for. Unfortunately, the
check for class_option being NULL is backward, so it either won't print the
class_option, or it will try to dereference a NULL. The patch just flips the
!= NULL to be == NULL.


Revision tags: yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 abandoned-netbsd-4-base yamt-splraiseipl-base2 yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 netbsd-4-base yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base elad-kernelauth-base simonb-timecounters-base rpaulo-netinet-merge-pcb-base
# 1.62 15-Mar-2006 drochner

branches: 1.62.10; 1.62.14;
use km_alloc to get wired kernel memory for kernel stacks
of idle processes for secondary CPUs
(affects the MULTIPROCESSOR case only - does this exist?)
(untested)


Revision tags: yamt-pdpolicy-base2 yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.61 11-Dec-2005 christos

branches: 1.61.4; 1.61.6; 1.61.8; 1.61.10;
merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.60 20-Jul-2005 nonaka

Added i80219.


# 1.59 04-Jul-2005 bsh

branches: 1.59.2;
The first step to support Intel PXA270.

kernel config option CPU_XSCALE_PXA2X0 is now obsoleted by
CPU_XSCALE_PXA250 and CPU_XSCALE_PXA270. If both of them are defined,
CPU is determined run-time.


# 1.58 03-Jun-2005 rearnsha

Very basic support for the ARM1136.

This code takes no advantage of any 'new' features provided by
architecture 6 devices (such as physically tagged caches or new
MMU features), and basically runs the chip in a 'legacy v5' mode.


# 1.57 10-May-2005 rearnsha

Add support for arm1026ej-s.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 yamt-km-base4 yamt-km-base3 netbsd-3-base yamt-km-base2 yamt-km-base kent-audio2-base kent-audio1-beforemerge kent-audio1-base
# 1.56 14-Apr-2004 bsh

distinguish PXA255/26x from PXA2[15]0 in CPU attach message


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.55 13-Feb-2004 wiz

Uppercase CPU, plural is CPUs.


# 1.54 26-Oct-2003 chris

Fix up some unitialised variables.


# 1.53 06-Sep-2003 rearnsha

Support for ARM10E class devices.


# 1.52 03-Sep-2003 mycroft

Recognize some TI processors -- not that you'd want to use them.


# 1.51 23-Jun-2003 martin

branches: 1.51.2;
Make sure to include opt_foo.h if a defflag option FOO is used.


# 1.50 23-May-2003 ichiro

support IXP425 Intel Network Processor
running on BigEndian


# 1.49 29-Apr-2003 thorpej

Use aprint*().


# 1.48 14-Feb-2003 rjs

Add CPU IDs for PXA B2 and C0 steppings.


Revision tags: nathanw_sa_before_merge nathanw_sa_base
# 1.47 06-Jan-2003 wiz

specified, not specifed.


Revision tags: fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base
# 1.46 17-Nov-2002 chs

change uvm_uarea_alloc() to indicate whether the returned uarea is already
backed by physical pages (ie. because it reused a previously-freed one),
so that we can skip a bunch of useless work in that case.
this fixes the underlying problem behind PR 18543, and also speeds up fork()
quite a bit (eg. 7% on my pc, 1% on my ultra2) when we get a cache hit.


Revision tags: kqueue-aftermerge kqueue-beforemerge bjh21-hydra-base
# 1.45 13-Oct-2002 chris

branches: 1.45.2;
Fix arm kernel build breaks for non multiprocessor systems.


# 1.44 13-Oct-2002 bjh21

It appears that MI code requires ci_cpuid to be the CPU number of the CPU
in question, whereas the ARM code was using it to hold the model
identification. To fix this, rename:

ci_cpuid -> ci_arm_cpuid
ci_cputype -> ci_arm_cputype (for consistency)
ci_cpurev -> ci_arm_cpurev (ditto)
ci_cpunum -> ci_cpuid

This makes top(1) give correct CPU numbers in its "STATE" column (all 0 for
now).


# 1.43 12-Oct-2002 bjh21

Remember the location of each CPU's idle PCB in struct cpu_info.
Move allocation of the idle PCB from hydra.c to cpu.c and add some
extra initialisation from cpu_fork().


Revision tags: kqueue-base
# 1.42 01-Oct-2002 bjh21

constify various string tables.


# 1.41 06-Sep-2002 gehenna

Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.


Revision tags: gehenna-devsw-base
# 1.40 22-Jul-2002 briggs

Handle i80200 step D0 and i80321 step B0


# 1.39 10-Jul-2002 ichiro

add cpu id for "PXA250/210 3rd version CPUcore".

for using many PDA/xscale-core.


# 1.38 07-Jun-2002 thorpej

Add the CPU ID for the 600MHz i80321 part.


Revision tags: netbsd-1-6-base
# 1.37 12-May-2002 ichiro

branches: 1.37.2; 1.37.4;
change ICP12x0 steppings.
define CPU_IXP12X0


# 1.36 10-May-2002 thorpej

Add IXP1200 steppings.


# 1.35 03-May-2002 thorpej

Add support for the Intel PXA210 and PXA250. From Hiroyuki Bessho, PR 16617.


# 1.34 02-May-2002 rjs

Enable CPU_CLASS_SA1 for SA1100 and SA1110.


# 1.33 12-Apr-2002 thorpej

Centralize ARM CPU configuration information by adding a new header
file, <arm/cpuconf.h>, which pulls in "opt_cputypes.h" and then defines
the following:
* CPU_NTYPES -- now many CPU types are configured into the kernel. What
you really want to know is "== 1" or "> 1".
* Defines ARM_ARCH_2, ARM_ARCH_3, ARM_ARCH_4, ARM_ARCH_5, depending
on which ARM architecture versions are configured (based on CPU_*
options). Also defines ARM_NARCH to determins how many architecture
versions are configured.
* Defines ARM_MMU_MEMC, ARM_MMU_GENERIC, ARM_MMU_XSCALE depending on
which classes of ARM MMUs are configured into the kernel, and ARM_NMMUS
to determine how many MMU classes are configured.

Remove the needless inclusion of "opt_cputypes.h" in several places.
Convert remaining users to <arm/cpuconf.h>.


# 1.32 27-Mar-2002 thorpej

The 80321 manual lies; it does have a CPU ID distinct from the 80200.
Add that CPU ID, and add a case for it.


# 1.31 26-Mar-2002 thorpej

Restructure a few things in order to support other XScale core
I/O processors:
* The i80200 and the i80321 have the same CPU ID, so split the
CPU_XSCALE option into CPU_XSCALE_80200 and CPU_XSCALE_80321
options, and don't let them both be defined at the same time.
XXX May want to revisit this in the future.
* Split some registers common between the i80200 and i80321 into
<arm/xscale/xscalereg.h>.
* Rename a few existing functions.


# 1.30 24-Mar-2002 thorpej

Cache the cpu type and cpu revision in cpu_info.


Revision tags: eeh-devprop-base
# 1.29 16-Mar-2002 bjh21

Only put the CPU type into cpu_model, not the state of the control register.
Instead, print the control register state on the next line at startup.


# 1.28 16-Mar-2002 bjh21

Add CPU ID for the ARM1022ES.
Also add a CPU class for ARM10E processors in general.


# 1.27 11-Mar-2002 reinoud

When ARMFPE wasn't enabled the `usearmfpe' flag was statically initialised
but not used resulting in a compiler error. By splitting the declaration
and the initialisation this is solved.

Better would be to not even declare the flag when ARMFPE isnt enabled but
that would just add to the #ifdef jungle.


# 1.26 10-Mar-2002 bjh21

__RCSID -> __KERNEL_RCSID


# 1.25 10-Mar-2002 bjh21

Re-work the way that FPAs are handled. If ARMFPE isn't configured, don't
even bother probing for an FPA. If ARMFPE is configured, always use it,
even if there's an FPA (since it provides the FPA support code). Move all
printfs about FPAs into armfpe_init.c.

This means I can delete the last two elements from struct _cpu, so that the
structure, and the whole of <arm/cpus.h> is redundant and can be deleted.


# 1.24 10-Mar-2002 bjh21

Remove fpu_model from struct _cpu. Instead, have initialise_arm_fpe()
printf() the FPE version number itself.


# 1.23 10-Mar-2002 bjh21

Add a ci_dev element to struct cpu_info, pointing to the device that
corresponds to the CPU.


Revision tags: newlock-base
# 1.22 10-Mar-2002 bjh21

Kill the fpu_flags element from struct _cpu. It was only ever set to 0
anyway.


# 1.21 10-Mar-2002 bjh21

Clean up inline assembler. Rather than saving R0, copying FPSR to R0,
copying it to the output register and then restoring R0, just copy the
FPSR straight to the output.


# 1.20 09-Mar-2002 bjh21

Remove the cpu_model member from struct _cpu, and just use the cpu_model
variable directly. While we're at it, make cpu_model rather larger.


# 1.19 09-Mar-2002 bjh21

Remove the cpu_class element from struct _cpu, and make it a local variable
in identify_arm_cpu(), since it's almost unused elsewhere.

Change the detection of bugged StrongARMs to use the cpu ID rather than the
class. This turns "almost" into "entirely".


# 1.18 09-Mar-2002 bjh21

Replace cpu_id and cpu_ctrl in struct _cpu with ci_cpuid and ci_ctrl in
struct cpu_info. Also kill the cpuctrl global while we're here, and make
identify_arm_cpu() take a struct cpu_info * as an argument alongside the CPU
number.


# 1.17 09-Mar-2002 bjh21

Move arm700bugcount into stuct cpu_info, and attach it in
identify_master_cpu().


Revision tags: ifpoll-base
# 1.16 17-Feb-2002 bjh21

Our assembler handles FPA instructions fine, so don't use .word for them.


# 1.15 17-Feb-2002 bjh21

ANSIfy, and othe KNF cleanup.


# 1.14 27-Jan-2002 bjh21

Add revision->stepping maps for the SA-110, SA-1100 and SA-1110.
Those for the SA-1100 and SA-1110 are from Intel's documentation.
The mapping for the SA-110 is from various sources on the net, since Intel
don't seem to document it.

Also, change the layout of the maps to have four steppings per line,
so they aren't quite so unwieldy.


# 1.13 24-Jan-2002 thorpej

Use a table to look up stepping names. Add a generic stepping
table ("rev 0", "rev 1", etc.) and an i80200 stepping table that
has the stepping names that appear in the i80200 manuals/errata..


# 1.12 29-Nov-2001 thorpej

Fetch cache info from the Cache Type register on ARM7TDMI and "greater"
processors. Report this when the processor is attached.


# 1.11 24-Nov-2001 thorpej

Move the ARM, Ltd. floating point emulator to arch/arm.


# 1.10 23-Nov-2001 thorpej

Use <arm/undefined.h> instead of <machine/undefined.h>.


Revision tags: thorpej-mips-cache-base
# 1.9 06-Nov-2001 thorpej

branches: 1.9.2;
Const poisoning of cpu/class names.


# 1.8 06-Nov-2001 thorpej

"i80200", not "80200".


# 1.7 06-Nov-2001 thorpej

"XScale", not "Xscale".


# 1.6 18-Oct-2001 rearnsha

branches: 1.6.2;
Support for ARM9.


Revision tags: thorpej-devvp-base3 thorpej-devvp-base2
# 1.5 28-Sep-2001 chris

Add extra arg to fpa_test as it should have 4 args. Also add prototypes for fpa_test and fpa_handler.


Revision tags: post-chs-ubcperf pre-chs-ubcperf thorpej-devvp-base
# 1.4 05-Sep-2001 matt

branches: 1.4.2;
Flesh XSCALE support.


# 1.3 03-Jun-2001 chris

branches: 1.3.2; 1.3.4;
Add support for ARM7TDMI, as provided in a patch from John Fremlin to port-arm32.

Shouldn't effect any currently in tree ports.


# 1.2 13-May-2001 bjh21

Use get_bootconf_option() to find boot options, rather than home-grown
strstr()-based hacks.


Revision tags: thorpej_scsipi_beforemerge thorpej_scsipi_base thorpej_scsipi_nbase
# 1.1 20-Apr-2001 matt

branches: 1.1.2;
Split cpu from mainbus so that cpu can attached to other buses (like ofbus).


Revision tags: isaki-audio2-base
# 1.129 17-Mar-2019 skrll

Wrap arm_cpu_marker if #ifdef MPDEBUG.

One day a9_mpsubr.S will die


# 1.128 27-Jan-2019 pgoyette

Merge the [pgoyette-compat] branch


Revision tags: pgoyette-compat-20190127
# 1.127 25-Jan-2019 skrll

Make sure ci_{smt,core,package}_id are all filled in appropriately.

Previously the BP was missed and __SHIFTOUT wasn't used.


Revision tags: pgoyette-compat-20190118
# 1.126 03-Jan-2019 jmcneill

Read mpidr and cpuid from the secondary processor itself instead of the
boot processor. While here, add Cortex-A15 r4p0 to supported list.


# 1.125 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.124 02-Jan-2019 skrll

Don't overwrite the setting of cpu_core_id from mpidr


Revision tags: pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020
# 1.123 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.122 08-Oct-2018 skrll

Trialing whitespace


# 1.121 06-Oct-2018 skrll

Use __BIT. NFC.


Revision tags: pgoyette-compat-0930 pgoyette-compat-0906
# 1.120 15-Aug-2018 skrll

KNF


# 1.119 15-Aug-2018 skrll

Fix includes (sys/cdefs.h then sys/param.h)


# 1.118 15-Aug-2018 skrll

Sprinkle #include "opt_cputypes.h"


# 1.117 10-Aug-2018 maxv

Retire CPU_ARM2, CPU_ARM250 and CPU_ARM3, they are all leftovers of
acorn26.

ok jmcneill@ skrll@


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202
# 1.116 16-Sep-2017 matt

branches: 1.116.2;
Add Cortex-A35 CPU ID.


Revision tags: netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base
# 1.115 01-Jun-2017 chs

branches: 1.115.6;
remove checks for failure after memory allocation calls that cannot fail:

kmem_alloc() with KM_SLEEP
kmem_zalloc() with KM_SLEEP
percpu_alloc()
pserialize_create()
psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.114 11-Jul-2016 kiyohara

Add Cortex-A9 r1.


Revision tags: nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.113 03-Mar-2016 skrll

Get the RPI3 working (in aarch32 mode) by recognising Cortex A53 CPUs.
While I'm here add some A57/A72 info as well.

My RPI3 works with FB console - the uart needs some help with its clocks.


# 1.112 23-Jan-2016 christos

Rename the cpu_id() define to cpu_idnum() so that it does not conflict with
dtrace and friends.


Revision tags: nick-nhusb-base-20151226
# 1.111 12-Nov-2015 jmcneill

change some register dumps from aprint_verbose to aprint_debug


Revision tags: nick-nhusb-base-20150921
# 1.110 08-Jul-2015 skrll

aprint_verbose [sa]ctlr


Revision tags: nick-nhusb-base-20150606
# 1.109 05-Jun-2015 skrll

Print the Revision ID regster (verbose)


# 1.108 17-May-2015 matt

Print out mpidr on MP systems (verbose print)


Revision tags: nick-nhusb-base-20150406
# 1.107 03-Mar-2015 jmcneill

cache type 12 is "write-back", from matt


Revision tags: nick-nhusb-base
# 1.106 27-Nov-2014 matt

branches: 1.106.2;
Add entry for Cortex-A17 r1


# 1.105 01-Sep-2014 reinoud

Increase the `freqbuf' buffer that holds the result of humanize_number(). Now
it prints 1600 Mhz instead of 1 Ghz.
Pitty enough humanize_number(9) doesn't do 1.6 Ghz type output.


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.104 28-Mar-2014 matt

branches: 1.104.4;
Various MP changes.


# 1.103 24-Mar-2014 christos

use cpu_{g,s}etmodel


# 1.102 20-Mar-2014 matt

Define cache type 13


Revision tags: riastradh-drm2-base3
# 1.101 03-Mar-2014 matt

Add most of the cpu_* variables to <arm/locore.h>
Add and initialize cpu_synchprim_present


# 1.100 20-Feb-2014 matt

Keep track of what each cache is (VIVT/VIPT/PIPT).

cpu0: 32KB/32B 2-way L1 VIPT Instruction cache
cpu0: 32KB/64B 4-way write-back-locking-C L1 PIPT Data cache
cpu0: 256KB/64B 8-way write-through L2 PIPT Unified cache


# 1.99 07-Sep-2013 matt

Add a machdep.hwdiv_present sysctl (cortex A7 and A15 have hwdiv instructions)


# 1.98 07-Sep-2013 matt

Add CPU_ID_CORTEXA7R0 entry


# 1.97 18-Aug-2013 matt

Move parts of cpu.h that are not needed by MI code in <arm/locore.h>
Don't include <machine/cpu.h> or <machine/frame.h>, use <arm/locore.h>
Use <arm/asm.h> instead of <machine/arm.h>


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.96 12-Jun-2013 matt

branches: 1.96.2;
Nuke cpu_pfr, just use the armreg_pfr?_read inlines


# 1.95 12-Jun-2013 matt

Use the armreg_pfr?_read inlines.


# 1.94 19-May-2013 rkujawa

Plug support for PJ4B into our ARM CPU infrastructure.

Obtained from Marvell, Semihalf.


Revision tags: agc-symver-base
# 1.93 03-Feb-2013 matt

Add a machdep.cpu_arch sysctl


# 1.92 31-Jan-2013 matt

Add simple sysctls for cpu_id, fpu_id, neon_present, simd_present,
simdex_present.
Add struct sysctls to return the isar, mmfr, pfr, and mvfr sets.


Revision tags: yamt-pagecache-base8 yamt-pagecache-base7
# 1.91 05-Dec-2012 matt

ARMFPE hasn't compiled since NetBSD 4. Remove it.
Complete support for FPU_VFP.
fpregs now contains vfpreg.
XXX vfpreg only has space for 16 64-bit FP registers though VFPv3 and later
have 32 64-bit FP registers.


# 1.90 30-Nov-2012 msaitoh

Use snprintf() instead of sprintf().


# 1.89 30-Nov-2012 msaitoh

s/,/;/


# 1.88 12-Nov-2012 skrll

C99 types


Revision tags: yamt-pagecache-base6
# 1.87 22-Sep-2012 matt

Don't use an asm in pmap_activate to update the TTBR, use cpu_setttb instead
but add a second argument to it to indicate whether the TLB/caches need to be
flushed. Default cortex to pmap_needs_fixup = 1. But check the MMFR3 field
to see if the fixed can be skipped.
Use a cf_flag bit 0 to indicate whether the A9 L2 cache should disable (bit 0 = 1)
or enabeld (bit = 0).

With these changes, the A9 MMU can use traverse caches to do MMU tablewalks
Also, make sure all memory has the shareable bit for the A9.


# 1.86 07-Sep-2012 matt

branches: 1.86.2;
Switch cortex_a9 back to need_ptesync = 1
Add code to disable the L2 cache on cortex-a9 (for now).
Add evcnt for all the fault types.
Move cache info in a structure and have one for the pcache and one for scache.
Probe L1/L2 caches properly for ARMv7


# 1.85 29-Aug-2012 matt

Use new armv7 CP15 register to print out cache types.
If the cpu_cc_freq is set, report it.
Add macros to make inlines for reading/writing co-processor registers.


# 1.84 14-Aug-2012 matt

Use device_t


# 1.83 12-Aug-2012 matt

Rework VFP support to use PCU.
Add emulation of instruction which save/restore the VFP FPSCR.
Add a sysarch hook to VFP FPSCR manipulation.

[The emulation will be used by libc to store/fetch exception modes and
rounding mode on a per-thread basis.]


# 1.82 14-Jul-2012 matt

Refresh cortex cpus


Revision tags: jmcneill-usbmp-base10 yamt-pagecache-base5
# 1.81 20-May-2012 skrll

Remove the ARM1156T2 bloat - it only has an MPU. Prompted by matt@


# 1.80 20-May-2012 skrll

Add the ARM1156T2-S


# 1.79 20-May-2012 skrll

Add the 'Z' to the 1176 cpu product name.

ok matt@


Revision tags: jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base jym-xensuspend-nbase rmind-uvmplock-base jym-xensuspend-base
# 1.78 10-Mar-2011 bsh

branches: 1.78.4; 1.78.8; 1.78.10;
add MPCore to CPU-ID table
add branch predict bit to arm11_options


Revision tags: uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11
# 1.77 02-Oct-2010 kiyohara

branches: 1.77.2;
Add support Marvell Sheeva Core and SoC. (Orion/Kirkwood)
Discovery Innovation not yet.


Revision tags: uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.76 19-Jun-2010 matt

Fix cache probing on Cortex. Add missing CORTEX dependency in cpu.c


# 1.75 19-Jun-2010 matt

Fix c&p error.


# 1.74 19-Jun-2010 matt

Cleanup the armv7 changes. Add ARM_ARCH_7. Use CPU_CORTEX instead of
CPU_CORTEXA8 everywhere since there more types of Cortex than just the A8.
CPU_CORTEXA8 still exists but causes CPU_CORTEX to be defined.
Add CPU_CORTEXA9 as well. Use .arch armv7a to get us the isb/dsb
instructions.

Test booted to root device prompt on a Beagleboard.
All ARM kernels successfully test built.


# 1.73 16-Jun-2010 jmcneill

PR port-arm/43299: Support added for igepv2/cortexa8/omap3530

Apply patch from PR, with build fixes. ok skrll, matt


Revision tags: uebayasi-xip-base1 yamt-nfs-mp-base9 uebayasi-xip-base
# 1.72 23-Jan-2010 mrg

branches: 1.72.2; 1.72.4;
rename a local cpu_name structure member to avoid potential conflict
with <sys/cpu.h>'s.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-premerge-20091211 yamt-nfs-mp-base8 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 yamt-nfs-mp-base7 netbsd-5-0-1-RELEASE jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base nick-hppapmap-base haad-dm-base mjf-devfs2-base
# 1.71 25-Oct-2008 matt

branches: 1.71.4; 1.71.12;
Fix some missing things for CPU_ID_FA526.


Revision tags: matt-mips64-base2
# 1.70 24-Oct-2008 matt

Add entry for FA526.


# 1.69 21-Oct-2008 matt

Add Cortex cpus


Revision tags: haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base
# 1.68 27-Apr-2008 matt

branches: 1.68.6;
Merge kernel changes in matt-armv6 to HEAD.


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 chris-arm-intr-rework-base7 keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.67 15-Mar-2008 rearnsha

branches: 1.67.2; 1.67.4;
VFP support.


Revision tags: nick-net80211-sync-base chris-arm-intr-rework-base6 chris-arm-intr-rework-base5 chris-arm-intr-rework-base4 bouyer-xeni386-merge1 chris-arm-intr-rework-base3 vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 jmcneill-base mjf-devfs-base bouyer-xenamd64-base2 vmlocking-nbase yamt-x86pmap-base4 bouyer-xenamd64-base matt-armv6-base jmcneill-pm-base hpcarm-cleanup-base reinoud-bufcleanup-base
# 1.66 17-Oct-2007 garbled

branches: 1.66.12; 1.66.16;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base chris-arm-intr-rework-base2 chris-arm-intr-rework-base nick-csl-alignment-base matt-mips64-base ppcoea-renovation-base mjf-ufs-trans-base vmlocking-base
# 1.65 17-May-2007 yamt

branches: 1.65.10; 1.65.12;
merge yamt-idlelwp branch. asked by core@. some ports still needs work.

from doc/BRANCHES:

idle lwp, and some changes depending on it.

1. separate context switching and thread scheduling.
(cf. gmcgarry_ctxsw)
2. implement idle lwp.
3. clean up related MD/MI interfaces.
4. make scheduler(s) modular.


Revision tags: yamt-idlelwp-base8 thorpej-atomic-base ad-audiomp-base post-newlock2-merge newlock2-nbase newlock2-base
# 1.64 06-Jan-2007 christos

branches: 1.64.2; 1.64.6; 1.64.8; 1.64.14;
Scott Allan in http://mail-index.netbsd.org/port-arm/2006/07/31/0000.html
Patch to add support for ARM9E


# 1.63 06-Jan-2007 christos

From Scott Alan in http://mail-index.netbsd.org/port-arm/2006/07/26/0000.html
identify_arm_cpu() prints out a helpful message when it detects that you're
trying to run on a CPU that you didn't configure for. Unfortunately, the
check for class_option being NULL is backward, so it either won't print the
class_option, or it will try to dereference a NULL. The patch just flips the
!= NULL to be == NULL.


Revision tags: yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 abandoned-netbsd-4-base yamt-splraiseipl-base2 yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 netbsd-4-base yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base elad-kernelauth-base simonb-timecounters-base rpaulo-netinet-merge-pcb-base
# 1.62 15-Mar-2006 drochner

branches: 1.62.10; 1.62.14;
use km_alloc to get wired kernel memory for kernel stacks
of idle processes for secondary CPUs
(affects the MULTIPROCESSOR case only - does this exist?)
(untested)


Revision tags: yamt-pdpolicy-base2 yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.61 11-Dec-2005 christos

branches: 1.61.4; 1.61.6; 1.61.8; 1.61.10;
merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.60 20-Jul-2005 nonaka

Added i80219.


# 1.59 04-Jul-2005 bsh

branches: 1.59.2;
The first step to support Intel PXA270.

kernel config option CPU_XSCALE_PXA2X0 is now obsoleted by
CPU_XSCALE_PXA250 and CPU_XSCALE_PXA270. If both of them are defined,
CPU is determined run-time.


# 1.58 03-Jun-2005 rearnsha

Very basic support for the ARM1136.

This code takes no advantage of any 'new' features provided by
architecture 6 devices (such as physically tagged caches or new
MMU features), and basically runs the chip in a 'legacy v5' mode.


# 1.57 10-May-2005 rearnsha

Add support for arm1026ej-s.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 yamt-km-base4 yamt-km-base3 netbsd-3-base yamt-km-base2 yamt-km-base kent-audio2-base kent-audio1-beforemerge kent-audio1-base
# 1.56 14-Apr-2004 bsh

distinguish PXA255/26x from PXA2[15]0 in CPU attach message


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.55 13-Feb-2004 wiz

Uppercase CPU, plural is CPUs.


# 1.54 26-Oct-2003 chris

Fix up some unitialised variables.


# 1.53 06-Sep-2003 rearnsha

Support for ARM10E class devices.


# 1.52 03-Sep-2003 mycroft

Recognize some TI processors -- not that you'd want to use them.


# 1.51 23-Jun-2003 martin

branches: 1.51.2;
Make sure to include opt_foo.h if a defflag option FOO is used.


# 1.50 23-May-2003 ichiro

support IXP425 Intel Network Processor
running on BigEndian


# 1.49 29-Apr-2003 thorpej

Use aprint*().


# 1.48 14-Feb-2003 rjs

Add CPU IDs for PXA B2 and C0 steppings.


Revision tags: nathanw_sa_before_merge nathanw_sa_base
# 1.47 06-Jan-2003 wiz

specified, not specifed.


Revision tags: fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base
# 1.46 17-Nov-2002 chs

change uvm_uarea_alloc() to indicate whether the returned uarea is already
backed by physical pages (ie. because it reused a previously-freed one),
so that we can skip a bunch of useless work in that case.
this fixes the underlying problem behind PR 18543, and also speeds up fork()
quite a bit (eg. 7% on my pc, 1% on my ultra2) when we get a cache hit.


Revision tags: kqueue-aftermerge kqueue-beforemerge bjh21-hydra-base
# 1.45 13-Oct-2002 chris

branches: 1.45.2;
Fix arm kernel build breaks for non multiprocessor systems.


# 1.44 13-Oct-2002 bjh21

It appears that MI code requires ci_cpuid to be the CPU number of the CPU
in question, whereas the ARM code was using it to hold the model
identification. To fix this, rename:

ci_cpuid -> ci_arm_cpuid
ci_cputype -> ci_arm_cputype (for consistency)
ci_cpurev -> ci_arm_cpurev (ditto)
ci_cpunum -> ci_cpuid

This makes top(1) give correct CPU numbers in its "STATE" column (all 0 for
now).


# 1.43 12-Oct-2002 bjh21

Remember the location of each CPU's idle PCB in struct cpu_info.
Move allocation of the idle PCB from hydra.c to cpu.c and add some
extra initialisation from cpu_fork().


Revision tags: kqueue-base
# 1.42 01-Oct-2002 bjh21

constify various string tables.


# 1.41 06-Sep-2002 gehenna

Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.


Revision tags: gehenna-devsw-base
# 1.40 22-Jul-2002 briggs

Handle i80200 step D0 and i80321 step B0


# 1.39 10-Jul-2002 ichiro

add cpu id for "PXA250/210 3rd version CPUcore".

for using many PDA/xscale-core.


# 1.38 07-Jun-2002 thorpej

Add the CPU ID for the 600MHz i80321 part.


Revision tags: netbsd-1-6-base
# 1.37 12-May-2002 ichiro

branches: 1.37.2; 1.37.4;
change ICP12x0 steppings.
define CPU_IXP12X0


# 1.36 10-May-2002 thorpej

Add IXP1200 steppings.


# 1.35 03-May-2002 thorpej

Add support for the Intel PXA210 and PXA250. From Hiroyuki Bessho, PR 16617.


# 1.34 02-May-2002 rjs

Enable CPU_CLASS_SA1 for SA1100 and SA1110.


# 1.33 12-Apr-2002 thorpej

Centralize ARM CPU configuration information by adding a new header
file, <arm/cpuconf.h>, which pulls in "opt_cputypes.h" and then defines
the following:
* CPU_NTYPES -- now many CPU types are configured into the kernel. What
you really want to know is "== 1" or "> 1".
* Defines ARM_ARCH_2, ARM_ARCH_3, ARM_ARCH_4, ARM_ARCH_5, depending
on which ARM architecture versions are configured (based on CPU_*
options). Also defines ARM_NARCH to determins how many architecture
versions are configured.
* Defines ARM_MMU_MEMC, ARM_MMU_GENERIC, ARM_MMU_XSCALE depending on
which classes of ARM MMUs are configured into the kernel, and ARM_NMMUS
to determine how many MMU classes are configured.

Remove the needless inclusion of "opt_cputypes.h" in several places.
Convert remaining users to <arm/cpuconf.h>.


# 1.32 27-Mar-2002 thorpej

The 80321 manual lies; it does have a CPU ID distinct from the 80200.
Add that CPU ID, and add a case for it.


# 1.31 26-Mar-2002 thorpej

Restructure a few things in order to support other XScale core
I/O processors:
* The i80200 and the i80321 have the same CPU ID, so split the
CPU_XSCALE option into CPU_XSCALE_80200 and CPU_XSCALE_80321
options, and don't let them both be defined at the same time.
XXX May want to revisit this in the future.
* Split some registers common between the i80200 and i80321 into
<arm/xscale/xscalereg.h>.
* Rename a few existing functions.


# 1.30 24-Mar-2002 thorpej

Cache the cpu type and cpu revision in cpu_info.


Revision tags: eeh-devprop-base
# 1.29 16-Mar-2002 bjh21

Only put the CPU type into cpu_model, not the state of the control register.
Instead, print the control register state on the next line at startup.


# 1.28 16-Mar-2002 bjh21

Add CPU ID for the ARM1022ES.
Also add a CPU class for ARM10E processors in general.


# 1.27 11-Mar-2002 reinoud

When ARMFPE wasn't enabled the `usearmfpe' flag was statically initialised
but not used resulting in a compiler error. By splitting the declaration
and the initialisation this is solved.

Better would be to not even declare the flag when ARMFPE isnt enabled but
that would just add to the #ifdef jungle.


# 1.26 10-Mar-2002 bjh21

__RCSID -> __KERNEL_RCSID


# 1.25 10-Mar-2002 bjh21

Re-work the way that FPAs are handled. If ARMFPE isn't configured, don't
even bother probing for an FPA. If ARMFPE is configured, always use it,
even if there's an FPA (since it provides the FPA support code). Move all
printfs about FPAs into armfpe_init.c.

This means I can delete the last two elements from struct _cpu, so that the
structure, and the whole of <arm/cpus.h> is redundant and can be deleted.


# 1.24 10-Mar-2002 bjh21

Remove fpu_model from struct _cpu. Instead, have initialise_arm_fpe()
printf() the FPE version number itself.


# 1.23 10-Mar-2002 bjh21

Add a ci_dev element to struct cpu_info, pointing to the device that
corresponds to the CPU.


Revision tags: newlock-base
# 1.22 10-Mar-2002 bjh21

Kill the fpu_flags element from struct _cpu. It was only ever set to 0
anyway.


# 1.21 10-Mar-2002 bjh21

Clean up inline assembler. Rather than saving R0, copying FPSR to R0,
copying it to the output register and then restoring R0, just copy the
FPSR straight to the output.


# 1.20 09-Mar-2002 bjh21

Remove the cpu_model member from struct _cpu, and just use the cpu_model
variable directly. While we're at it, make cpu_model rather larger.


# 1.19 09-Mar-2002 bjh21

Remove the cpu_class element from struct _cpu, and make it a local variable
in identify_arm_cpu(), since it's almost unused elsewhere.

Change the detection of bugged StrongARMs to use the cpu ID rather than the
class. This turns "almost" into "entirely".


# 1.18 09-Mar-2002 bjh21

Replace cpu_id and cpu_ctrl in struct _cpu with ci_cpuid and ci_ctrl in
struct cpu_info. Also kill the cpuctrl global while we're here, and make
identify_arm_cpu() take a struct cpu_info * as an argument alongside the CPU
number.


# 1.17 09-Mar-2002 bjh21

Move arm700bugcount into stuct cpu_info, and attach it in
identify_master_cpu().


Revision tags: ifpoll-base
# 1.16 17-Feb-2002 bjh21

Our assembler handles FPA instructions fine, so don't use .word for them.


# 1.15 17-Feb-2002 bjh21

ANSIfy, and othe KNF cleanup.


# 1.14 27-Jan-2002 bjh21

Add revision->stepping maps for the SA-110, SA-1100 and SA-1110.
Those for the SA-1100 and SA-1110 are from Intel's documentation.
The mapping for the SA-110 is from various sources on the net, since Intel
don't seem to document it.

Also, change the layout of the maps to have four steppings per line,
so they aren't quite so unwieldy.


# 1.13 24-Jan-2002 thorpej

Use a table to look up stepping names. Add a generic stepping
table ("rev 0", "rev 1", etc.) and an i80200 stepping table that
has the stepping names that appear in the i80200 manuals/errata..


# 1.12 29-Nov-2001 thorpej

Fetch cache info from the Cache Type register on ARM7TDMI and "greater"
processors. Report this when the processor is attached.


# 1.11 24-Nov-2001 thorpej

Move the ARM, Ltd. floating point emulator to arch/arm.


# 1.10 23-Nov-2001 thorpej

Use <arm/undefined.h> instead of <machine/undefined.h>.


Revision tags: thorpej-mips-cache-base
# 1.9 06-Nov-2001 thorpej

branches: 1.9.2;
Const poisoning of cpu/class names.


# 1.8 06-Nov-2001 thorpej

"i80200", not "80200".


# 1.7 06-Nov-2001 thorpej

"XScale", not "Xscale".


# 1.6 18-Oct-2001 rearnsha

branches: 1.6.2;
Support for ARM9.


Revision tags: thorpej-devvp-base3 thorpej-devvp-base2
# 1.5 28-Sep-2001 chris

Add extra arg to fpa_test as it should have 4 args. Also add prototypes for fpa_test and fpa_handler.


Revision tags: post-chs-ubcperf pre-chs-ubcperf thorpej-devvp-base
# 1.4 05-Sep-2001 matt

branches: 1.4.2;
Flesh XSCALE support.


# 1.3 03-Jun-2001 chris

branches: 1.3.2; 1.3.4;
Add support for ARM7TDMI, as provided in a patch from John Fremlin to port-arm32.

Shouldn't effect any currently in tree ports.


# 1.2 13-May-2001 bjh21

Use get_bootconf_option() to find boot options, rather than home-grown
strstr()-based hacks.


Revision tags: thorpej_scsipi_beforemerge thorpej_scsipi_base thorpej_scsipi_nbase
# 1.1 20-Apr-2001 matt

branches: 1.1.2;
Split cpu from mainbus so that cpu can attached to other buses (like ofbus).


# 1.116 16-Sep-2017 matt

Add Cortex-A35 CPU ID.


Revision tags: nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base
# 1.115 01-Jun-2017 chs

remove checks for failure after memory allocation calls that cannot fail:

kmem_alloc() with KM_SLEEP
kmem_zalloc() with KM_SLEEP
percpu_alloc()
pserialize_create()
psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.114 11-Jul-2016 kiyohara

Add Cortex-A9 r1.


Revision tags: nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.113 03-Mar-2016 skrll

Get the RPI3 working (in aarch32 mode) by recognising Cortex A53 CPUs.
While I'm here add some A57/A72 info as well.

My RPI3 works with FB console - the uart needs some help with its clocks.


# 1.112 23-Jan-2016 christos

Rename the cpu_id() define to cpu_idnum() so that it does not conflict with
dtrace and friends.


Revision tags: nick-nhusb-base-20151226
# 1.111 12-Nov-2015 jmcneill

change some register dumps from aprint_verbose to aprint_debug


Revision tags: nick-nhusb-base-20150921
# 1.110 08-Jul-2015 skrll

aprint_verbose [sa]ctlr


Revision tags: nick-nhusb-base-20150606
# 1.109 05-Jun-2015 skrll

Print the Revision ID regster (verbose)


# 1.108 17-May-2015 matt

Print out mpidr on MP systems (verbose print)


Revision tags: nick-nhusb-base-20150406
# 1.107 03-Mar-2015 jmcneill

cache type 12 is "write-back", from matt


Revision tags: nick-nhusb-base
# 1.106 27-Nov-2014 matt

branches: 1.106.2;
Add entry for Cortex-A17 r1


# 1.105 01-Sep-2014 reinoud

Increase the `freqbuf' buffer that holds the result of humanize_number(). Now
it prints 1600 Mhz instead of 1 Ghz.
Pitty enough humanize_number(9) doesn't do 1.6 Ghz type output.


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.104 28-Mar-2014 matt

branches: 1.104.4;
Various MP changes.


# 1.103 24-Mar-2014 christos

use cpu_{g,s}etmodel


# 1.102 20-Mar-2014 matt

Define cache type 13


Revision tags: riastradh-drm2-base3
# 1.101 03-Mar-2014 matt

Add most of the cpu_* variables to <arm/locore.h>
Add and initialize cpu_synchprim_present


# 1.100 20-Feb-2014 matt

Keep track of what each cache is (VIVT/VIPT/PIPT).

cpu0: 32KB/32B 2-way L1 VIPT Instruction cache
cpu0: 32KB/64B 4-way write-back-locking-C L1 PIPT Data cache
cpu0: 256KB/64B 8-way write-through L2 PIPT Unified cache


# 1.99 07-Sep-2013 matt

Add a machdep.hwdiv_present sysctl (cortex A7 and A15 have hwdiv instructions)


# 1.98 07-Sep-2013 matt

Add CPU_ID_CORTEXA7R0 entry


# 1.97 18-Aug-2013 matt

Move parts of cpu.h that are not needed by MI code in <arm/locore.h>
Don't include <machine/cpu.h> or <machine/frame.h>, use <arm/locore.h>
Use <arm/asm.h> instead of <machine/arm.h>


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.96 12-Jun-2013 matt

branches: 1.96.2;
Nuke cpu_pfr, just use the armreg_pfr?_read inlines


# 1.95 12-Jun-2013 matt

Use the armreg_pfr?_read inlines.


# 1.94 19-May-2013 rkujawa

Plug support for PJ4B into our ARM CPU infrastructure.

Obtained from Marvell, Semihalf.


Revision tags: agc-symver-base
# 1.93 03-Feb-2013 matt

Add a machdep.cpu_arch sysctl


# 1.92 31-Jan-2013 matt

Add simple sysctls for cpu_id, fpu_id, neon_present, simd_present,
simdex_present.
Add struct sysctls to return the isar, mmfr, pfr, and mvfr sets.


Revision tags: yamt-pagecache-base8 yamt-pagecache-base7
# 1.91 05-Dec-2012 matt

ARMFPE hasn't compiled since NetBSD 4. Remove it.
Complete support for FPU_VFP.
fpregs now contains vfpreg.
XXX vfpreg only has space for 16 64-bit FP registers though VFPv3 and later
have 32 64-bit FP registers.


# 1.90 30-Nov-2012 msaitoh

Use snprintf() instead of sprintf().


# 1.89 30-Nov-2012 msaitoh

s/,/;/


# 1.88 12-Nov-2012 skrll

C99 types


Revision tags: yamt-pagecache-base6
# 1.87 22-Sep-2012 matt

Don't use an asm in pmap_activate to update the TTBR, use cpu_setttb instead
but add a second argument to it to indicate whether the TLB/caches need to be
flushed. Default cortex to pmap_needs_fixup = 1. But check the MMFR3 field
to see if the fixed can be skipped.
Use a cf_flag bit 0 to indicate whether the A9 L2 cache should disable (bit 0 = 1)
or enabeld (bit = 0).

With these changes, the A9 MMU can use traverse caches to do MMU tablewalks
Also, make sure all memory has the shareable bit for the A9.


# 1.86 07-Sep-2012 matt

branches: 1.86.2;
Switch cortex_a9 back to need_ptesync = 1
Add code to disable the L2 cache on cortex-a9 (for now).
Add evcnt for all the fault types.
Move cache info in a structure and have one for the pcache and one for scache.
Probe L1/L2 caches properly for ARMv7


# 1.85 29-Aug-2012 matt

Use new armv7 CP15 register to print out cache types.
If the cpu_cc_freq is set, report it.
Add macros to make inlines for reading/writing co-processor registers.


# 1.84 14-Aug-2012 matt

Use device_t


# 1.83 12-Aug-2012 matt

Rework VFP support to use PCU.
Add emulation of instruction which save/restore the VFP FPSCR.
Add a sysarch hook to VFP FPSCR manipulation.

[The emulation will be used by libc to store/fetch exception modes and
rounding mode on a per-thread basis.]


# 1.82 14-Jul-2012 matt

Refresh cortex cpus


Revision tags: jmcneill-usbmp-base10 yamt-pagecache-base5
# 1.81 20-May-2012 skrll

Remove the ARM1156T2 bloat - it only has an MPU. Prompted by matt@


# 1.80 20-May-2012 skrll

Add the ARM1156T2-S


# 1.79 20-May-2012 skrll

Add the 'Z' to the 1176 cpu product name.

ok matt@


Revision tags: jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base jym-xensuspend-nbase rmind-uvmplock-base jym-xensuspend-base
# 1.78 10-Mar-2011 bsh

branches: 1.78.4; 1.78.8; 1.78.10;
add MPCore to CPU-ID table
add branch predict bit to arm11_options


Revision tags: uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11
# 1.77 02-Oct-2010 kiyohara

branches: 1.77.2;
Add support Marvell Sheeva Core and SoC. (Orion/Kirkwood)
Discovery Innovation not yet.


Revision tags: uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.76 19-Jun-2010 matt

Fix cache probing on Cortex. Add missing CORTEX dependency in cpu.c


# 1.75 19-Jun-2010 matt

Fix c&p error.


# 1.74 19-Jun-2010 matt

Cleanup the armv7 changes. Add ARM_ARCH_7. Use CPU_CORTEX instead of
CPU_CORTEXA8 everywhere since there more types of Cortex than just the A8.
CPU_CORTEXA8 still exists but causes CPU_CORTEX to be defined.
Add CPU_CORTEXA9 as well. Use .arch armv7a to get us the isb/dsb
instructions.

Test booted to root device prompt on a Beagleboard.
All ARM kernels successfully test built.


# 1.73 16-Jun-2010 jmcneill

PR port-arm/43299: Support added for igepv2/cortexa8/omap3530

Apply patch from PR, with build fixes. ok skrll, matt


Revision tags: uebayasi-xip-base1 yamt-nfs-mp-base9 uebayasi-xip-base
# 1.72 23-Jan-2010 mrg

branches: 1.72.2; 1.72.4;
rename a local cpu_name structure member to avoid potential conflict
with <sys/cpu.h>'s.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-premerge-20091211 yamt-nfs-mp-base8 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 yamt-nfs-mp-base7 netbsd-5-0-1-RELEASE jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base nick-hppapmap-base haad-dm-base mjf-devfs2-base
# 1.71 25-Oct-2008 matt

branches: 1.71.4; 1.71.12;
Fix some missing things for CPU_ID_FA526.


Revision tags: matt-mips64-base2
# 1.70 24-Oct-2008 matt

Add entry for FA526.


# 1.69 21-Oct-2008 matt

Add Cortex cpus


Revision tags: haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base
# 1.68 27-Apr-2008 matt

branches: 1.68.6;
Merge kernel changes in matt-armv6 to HEAD.


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 chris-arm-intr-rework-base7 keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.67 15-Mar-2008 rearnsha

branches: 1.67.2; 1.67.4;
VFP support.


Revision tags: nick-net80211-sync-base chris-arm-intr-rework-base6 chris-arm-intr-rework-base5 chris-arm-intr-rework-base4 bouyer-xeni386-merge1 chris-arm-intr-rework-base3 vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 jmcneill-base mjf-devfs-base bouyer-xenamd64-base2 vmlocking-nbase yamt-x86pmap-base4 bouyer-xenamd64-base matt-armv6-base jmcneill-pm-base hpcarm-cleanup-base reinoud-bufcleanup-base
# 1.66 17-Oct-2007 garbled

branches: 1.66.12; 1.66.16;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base chris-arm-intr-rework-base2 chris-arm-intr-rework-base nick-csl-alignment-base matt-mips64-base ppcoea-renovation-base mjf-ufs-trans-base vmlocking-base
# 1.65 17-May-2007 yamt

branches: 1.65.10; 1.65.12;
merge yamt-idlelwp branch. asked by core@. some ports still needs work.

from doc/BRANCHES:

idle lwp, and some changes depending on it.

1. separate context switching and thread scheduling.
(cf. gmcgarry_ctxsw)
2. implement idle lwp.
3. clean up related MD/MI interfaces.
4. make scheduler(s) modular.


Revision tags: yamt-idlelwp-base8 thorpej-atomic-base ad-audiomp-base post-newlock2-merge newlock2-nbase newlock2-base
# 1.64 06-Jan-2007 christos

branches: 1.64.2; 1.64.6; 1.64.8; 1.64.14;
Scott Allan in http://mail-index.netbsd.org/port-arm/2006/07/31/0000.html
Patch to add support for ARM9E


# 1.63 06-Jan-2007 christos

From Scott Alan in http://mail-index.netbsd.org/port-arm/2006/07/26/0000.html
identify_arm_cpu() prints out a helpful message when it detects that you're
trying to run on a CPU that you didn't configure for. Unfortunately, the
check for class_option being NULL is backward, so it either won't print the
class_option, or it will try to dereference a NULL. The patch just flips the
!= NULL to be == NULL.


Revision tags: yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 abandoned-netbsd-4-base yamt-splraiseipl-base2 yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 netbsd-4-base yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base elad-kernelauth-base simonb-timecounters-base rpaulo-netinet-merge-pcb-base
# 1.62 15-Mar-2006 drochner

branches: 1.62.10; 1.62.14;
use km_alloc to get wired kernel memory for kernel stacks
of idle processes for secondary CPUs
(affects the MULTIPROCESSOR case only - does this exist?)
(untested)


Revision tags: yamt-pdpolicy-base2 yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.61 11-Dec-2005 christos

branches: 1.61.4; 1.61.6; 1.61.8; 1.61.10;
merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.60 20-Jul-2005 nonaka

Added i80219.


# 1.59 04-Jul-2005 bsh

branches: 1.59.2;
The first step to support Intel PXA270.

kernel config option CPU_XSCALE_PXA2X0 is now obsoleted by
CPU_XSCALE_PXA250 and CPU_XSCALE_PXA270. If both of them are defined,
CPU is determined run-time.


# 1.58 03-Jun-2005 rearnsha

Very basic support for the ARM1136.

This code takes no advantage of any 'new' features provided by
architecture 6 devices (such as physically tagged caches or new
MMU features), and basically runs the chip in a 'legacy v5' mode.


# 1.57 10-May-2005 rearnsha

Add support for arm1026ej-s.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 yamt-km-base4 yamt-km-base3 netbsd-3-base yamt-km-base2 yamt-km-base kent-audio2-base kent-audio1-beforemerge kent-audio1-base
# 1.56 14-Apr-2004 bsh

distinguish PXA255/26x from PXA2[15]0 in CPU attach message


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.55 13-Feb-2004 wiz

Uppercase CPU, plural is CPUs.


# 1.54 26-Oct-2003 chris

Fix up some unitialised variables.


# 1.53 06-Sep-2003 rearnsha

Support for ARM10E class devices.


# 1.52 03-Sep-2003 mycroft

Recognize some TI processors -- not that you'd want to use them.


# 1.51 23-Jun-2003 martin

branches: 1.51.2;
Make sure to include opt_foo.h if a defflag option FOO is used.


# 1.50 23-May-2003 ichiro

support IXP425 Intel Network Processor
running on BigEndian


# 1.49 29-Apr-2003 thorpej

Use aprint*().


# 1.48 14-Feb-2003 rjs

Add CPU IDs for PXA B2 and C0 steppings.


Revision tags: nathanw_sa_before_merge nathanw_sa_base
# 1.47 06-Jan-2003 wiz

specified, not specifed.


Revision tags: fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base
# 1.46 17-Nov-2002 chs

change uvm_uarea_alloc() to indicate whether the returned uarea is already
backed by physical pages (ie. because it reused a previously-freed one),
so that we can skip a bunch of useless work in that case.
this fixes the underlying problem behind PR 18543, and also speeds up fork()
quite a bit (eg. 7% on my pc, 1% on my ultra2) when we get a cache hit.


Revision tags: kqueue-aftermerge kqueue-beforemerge bjh21-hydra-base
# 1.45 13-Oct-2002 chris

branches: 1.45.2;
Fix arm kernel build breaks for non multiprocessor systems.


# 1.44 13-Oct-2002 bjh21

It appears that MI code requires ci_cpuid to be the CPU number of the CPU
in question, whereas the ARM code was using it to hold the model
identification. To fix this, rename:

ci_cpuid -> ci_arm_cpuid
ci_cputype -> ci_arm_cputype (for consistency)
ci_cpurev -> ci_arm_cpurev (ditto)
ci_cpunum -> ci_cpuid

This makes top(1) give correct CPU numbers in its "STATE" column (all 0 for
now).


# 1.43 12-Oct-2002 bjh21

Remember the location of each CPU's idle PCB in struct cpu_info.
Move allocation of the idle PCB from hydra.c to cpu.c and add some
extra initialisation from cpu_fork().


Revision tags: kqueue-base
# 1.42 01-Oct-2002 bjh21

constify various string tables.


# 1.41 06-Sep-2002 gehenna

Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.


Revision tags: gehenna-devsw-base
# 1.40 22-Jul-2002 briggs

Handle i80200 step D0 and i80321 step B0


# 1.39 10-Jul-2002 ichiro

add cpu id for "PXA250/210 3rd version CPUcore".

for using many PDA/xscale-core.


# 1.38 07-Jun-2002 thorpej

Add the CPU ID for the 600MHz i80321 part.


Revision tags: netbsd-1-6-base
# 1.37 12-May-2002 ichiro

branches: 1.37.2; 1.37.4;
change ICP12x0 steppings.
define CPU_IXP12X0


# 1.36 10-May-2002 thorpej

Add IXP1200 steppings.


# 1.35 03-May-2002 thorpej

Add support for the Intel PXA210 and PXA250. From Hiroyuki Bessho, PR 16617.


# 1.34 02-May-2002 rjs

Enable CPU_CLASS_SA1 for SA1100 and SA1110.


# 1.33 12-Apr-2002 thorpej

Centralize ARM CPU configuration information by adding a new header
file, <arm/cpuconf.h>, which pulls in "opt_cputypes.h" and then defines
the following:
* CPU_NTYPES -- now many CPU types are configured into the kernel. What
you really want to know is "== 1" or "> 1".
* Defines ARM_ARCH_2, ARM_ARCH_3, ARM_ARCH_4, ARM_ARCH_5, depending
on which ARM architecture versions are configured (based on CPU_*
options). Also defines ARM_NARCH to determins how many architecture
versions are configured.
* Defines ARM_MMU_MEMC, ARM_MMU_GENERIC, ARM_MMU_XSCALE depending on
which classes of ARM MMUs are configured into the kernel, and ARM_NMMUS
to determine how many MMU classes are configured.

Remove the needless inclusion of "opt_cputypes.h" in several places.
Convert remaining users to <arm/cpuconf.h>.


# 1.32 27-Mar-2002 thorpej

The 80321 manual lies; it does have a CPU ID distinct from the 80200.
Add that CPU ID, and add a case for it.


# 1.31 26-Mar-2002 thorpej

Restructure a few things in order to support other XScale core
I/O processors:
* The i80200 and the i80321 have the same CPU ID, so split the
CPU_XSCALE option into CPU_XSCALE_80200 and CPU_XSCALE_80321
options, and don't let them both be defined at the same time.
XXX May want to revisit this in the future.
* Split some registers common between the i80200 and i80321 into
<arm/xscale/xscalereg.h>.
* Rename a few existing functions.


# 1.30 24-Mar-2002 thorpej

Cache the cpu type and cpu revision in cpu_info.


Revision tags: eeh-devprop-base
# 1.29 16-Mar-2002 bjh21

Only put the CPU type into cpu_model, not the state of the control register.
Instead, print the control register state on the next line at startup.


# 1.28 16-Mar-2002 bjh21

Add CPU ID for the ARM1022ES.
Also add a CPU class for ARM10E processors in general.


# 1.27 11-Mar-2002 reinoud

When ARMFPE wasn't enabled the `usearmfpe' flag was statically initialised
but not used resulting in a compiler error. By splitting the declaration
and the initialisation this is solved.

Better would be to not even declare the flag when ARMFPE isnt enabled but
that would just add to the #ifdef jungle.


# 1.26 10-Mar-2002 bjh21

__RCSID -> __KERNEL_RCSID


# 1.25 10-Mar-2002 bjh21

Re-work the way that FPAs are handled. If ARMFPE isn't configured, don't
even bother probing for an FPA. If ARMFPE is configured, always use it,
even if there's an FPA (since it provides the FPA support code). Move all
printfs about FPAs into armfpe_init.c.

This means I can delete the last two elements from struct _cpu, so that the
structure, and the whole of <arm/cpus.h> is redundant and can be deleted.


# 1.24 10-Mar-2002 bjh21

Remove fpu_model from struct _cpu. Instead, have initialise_arm_fpe()
printf() the FPE version number itself.


# 1.23 10-Mar-2002 bjh21

Add a ci_dev element to struct cpu_info, pointing to the device that
corresponds to the CPU.


Revision tags: newlock-base
# 1.22 10-Mar-2002 bjh21

Kill the fpu_flags element from struct _cpu. It was only ever set to 0
anyway.


# 1.21 10-Mar-2002 bjh21

Clean up inline assembler. Rather than saving R0, copying FPSR to R0,
copying it to the output register and then restoring R0, just copy the
FPSR straight to the output.


# 1.20 09-Mar-2002 bjh21

Remove the cpu_model member from struct _cpu, and just use the cpu_model
variable directly. While we're at it, make cpu_model rather larger.


# 1.19 09-Mar-2002 bjh21

Remove the cpu_class element from struct _cpu, and make it a local variable
in identify_arm_cpu(), since it's almost unused elsewhere.

Change the detection of bugged StrongARMs to use the cpu ID rather than the
class. This turns "almost" into "entirely".


# 1.18 09-Mar-2002 bjh21

Replace cpu_id and cpu_ctrl in struct _cpu with ci_cpuid and ci_ctrl in
struct cpu_info. Also kill the cpuctrl global while we're here, and make
identify_arm_cpu() take a struct cpu_info * as an argument alongside the CPU
number.


# 1.17 09-Mar-2002 bjh21

Move arm700bugcount into stuct cpu_info, and attach it in
identify_master_cpu().


Revision tags: ifpoll-base
# 1.16 17-Feb-2002 bjh21

Our assembler handles FPA instructions fine, so don't use .word for them.


# 1.15 17-Feb-2002 bjh21

ANSIfy, and othe KNF cleanup.


# 1.14 27-Jan-2002 bjh21

Add revision->stepping maps for the SA-110, SA-1100 and SA-1110.
Those for the SA-1100 and SA-1110 are from Intel's documentation.
The mapping for the SA-110 is from various sources on the net, since Intel
don't seem to document it.

Also, change the layout of the maps to have four steppings per line,
so they aren't quite so unwieldy.


# 1.13 24-Jan-2002 thorpej

Use a table to look up stepping names. Add a generic stepping
table ("rev 0", "rev 1", etc.) and an i80200 stepping table that
has the stepping names that appear in the i80200 manuals/errata..


# 1.12 29-Nov-2001 thorpej

Fetch cache info from the Cache Type register on ARM7TDMI and "greater"
processors. Report this when the processor is attached.


# 1.11 24-Nov-2001 thorpej

Move the ARM, Ltd. floating point emulator to arch/arm.


# 1.10 23-Nov-2001 thorpej

Use <arm/undefined.h> instead of <machine/undefined.h>.


Revision tags: thorpej-mips-cache-base
# 1.9 06-Nov-2001 thorpej

branches: 1.9.2;
Const poisoning of cpu/class names.


# 1.8 06-Nov-2001 thorpej

"i80200", not "80200".


# 1.7 06-Nov-2001 thorpej

"XScale", not "Xscale".


# 1.6 18-Oct-2001 rearnsha

branches: 1.6.2;
Support for ARM9.


Revision tags: thorpej-devvp-base3 thorpej-devvp-base2
# 1.5 28-Sep-2001 chris

Add extra arg to fpa_test as it should have 4 args. Also add prototypes for fpa_test and fpa_handler.


Revision tags: post-chs-ubcperf pre-chs-ubcperf thorpej-devvp-base
# 1.4 05-Sep-2001 matt

branches: 1.4.2;
Flesh XSCALE support.


# 1.3 03-Jun-2001 chris

branches: 1.3.2; 1.3.4;
Add support for ARM7TDMI, as provided in a patch from John Fremlin to port-arm32.

Shouldn't effect any currently in tree ports.


# 1.2 13-May-2001 bjh21

Use get_bootconf_option() to find boot options, rather than home-grown
strstr()-based hacks.


Revision tags: thorpej_scsipi_beforemerge thorpej_scsipi_base thorpej_scsipi_nbase
# 1.1 20-Apr-2001 matt

branches: 1.1.2;
Split cpu from mainbus so that cpu can attached to other buses (like ofbus).


# 1.115 01-Jun-2017 chs

remove checks for failure after memory allocation calls that cannot fail:

kmem_alloc() with KM_SLEEP
kmem_zalloc() with KM_SLEEP
percpu_alloc()
pserialize_create()
psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.114 11-Jul-2016 kiyohara

Add Cortex-A9 r1.


Revision tags: nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.113 03-Mar-2016 skrll

Get the RPI3 working (in aarch32 mode) by recognising Cortex A53 CPUs.
While I'm here add some A57/A72 info as well.

My RPI3 works with FB console - the uart needs some help with its clocks.


# 1.112 23-Jan-2016 christos

Rename the cpu_id() define to cpu_idnum() so that it does not conflict with
dtrace and friends.


Revision tags: nick-nhusb-base-20151226
# 1.111 12-Nov-2015 jmcneill

change some register dumps from aprint_verbose to aprint_debug


Revision tags: nick-nhusb-base-20150921
# 1.110 08-Jul-2015 skrll

aprint_verbose [sa]ctlr


Revision tags: nick-nhusb-base-20150606
# 1.109 05-Jun-2015 skrll

Print the Revision ID regster (verbose)


# 1.108 17-May-2015 matt

Print out mpidr on MP systems (verbose print)


Revision tags: nick-nhusb-base-20150406
# 1.107 03-Mar-2015 jmcneill

cache type 12 is "write-back", from matt


Revision tags: nick-nhusb-base
# 1.106 27-Nov-2014 matt

branches: 1.106.2;
Add entry for Cortex-A17 r1


# 1.105 01-Sep-2014 reinoud

Increase the `freqbuf' buffer that holds the result of humanize_number(). Now
it prints 1600 Mhz instead of 1 Ghz.
Pitty enough humanize_number(9) doesn't do 1.6 Ghz type output.


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.104 28-Mar-2014 matt

branches: 1.104.4;
Various MP changes.


# 1.103 24-Mar-2014 christos

use cpu_{g,s}etmodel


# 1.102 20-Mar-2014 matt

Define cache type 13


Revision tags: riastradh-drm2-base3
# 1.101 03-Mar-2014 matt

Add most of the cpu_* variables to <arm/locore.h>
Add and initialize cpu_synchprim_present


# 1.100 20-Feb-2014 matt

Keep track of what each cache is (VIVT/VIPT/PIPT).

cpu0: 32KB/32B 2-way L1 VIPT Instruction cache
cpu0: 32KB/64B 4-way write-back-locking-C L1 PIPT Data cache
cpu0: 256KB/64B 8-way write-through L2 PIPT Unified cache


# 1.99 07-Sep-2013 matt

Add a machdep.hwdiv_present sysctl (cortex A7 and A15 have hwdiv instructions)


# 1.98 07-Sep-2013 matt

Add CPU_ID_CORTEXA7R0 entry


# 1.97 18-Aug-2013 matt

Move parts of cpu.h that are not needed by MI code in <arm/locore.h>
Don't include <machine/cpu.h> or <machine/frame.h>, use <arm/locore.h>
Use <arm/asm.h> instead of <machine/arm.h>


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.96 12-Jun-2013 matt

branches: 1.96.2;
Nuke cpu_pfr, just use the armreg_pfr?_read inlines


# 1.95 12-Jun-2013 matt

Use the armreg_pfr?_read inlines.


# 1.94 19-May-2013 rkujawa

Plug support for PJ4B into our ARM CPU infrastructure.

Obtained from Marvell, Semihalf.


Revision tags: agc-symver-base
# 1.93 03-Feb-2013 matt

Add a machdep.cpu_arch sysctl


# 1.92 31-Jan-2013 matt

Add simple sysctls for cpu_id, fpu_id, neon_present, simd_present,
simdex_present.
Add struct sysctls to return the isar, mmfr, pfr, and mvfr sets.


Revision tags: yamt-pagecache-base8 yamt-pagecache-base7
# 1.91 05-Dec-2012 matt

ARMFPE hasn't compiled since NetBSD 4. Remove it.
Complete support for FPU_VFP.
fpregs now contains vfpreg.
XXX vfpreg only has space for 16 64-bit FP registers though VFPv3 and later
have 32 64-bit FP registers.


# 1.90 30-Nov-2012 msaitoh

Use snprintf() instead of sprintf().


# 1.89 30-Nov-2012 msaitoh

s/,/;/


# 1.88 12-Nov-2012 skrll

C99 types


Revision tags: yamt-pagecache-base6
# 1.87 22-Sep-2012 matt

Don't use an asm in pmap_activate to update the TTBR, use cpu_setttb instead
but add a second argument to it to indicate whether the TLB/caches need to be
flushed. Default cortex to pmap_needs_fixup = 1. But check the MMFR3 field
to see if the fixed can be skipped.
Use a cf_flag bit 0 to indicate whether the A9 L2 cache should disable (bit 0 = 1)
or enabeld (bit = 0).

With these changes, the A9 MMU can use traverse caches to do MMU tablewalks
Also, make sure all memory has the shareable bit for the A9.


# 1.86 07-Sep-2012 matt

branches: 1.86.2;
Switch cortex_a9 back to need_ptesync = 1
Add code to disable the L2 cache on cortex-a9 (for now).
Add evcnt for all the fault types.
Move cache info in a structure and have one for the pcache and one for scache.
Probe L1/L2 caches properly for ARMv7


# 1.85 29-Aug-2012 matt

Use new armv7 CP15 register to print out cache types.
If the cpu_cc_freq is set, report it.
Add macros to make inlines for reading/writing co-processor registers.


# 1.84 14-Aug-2012 matt

Use device_t


# 1.83 12-Aug-2012 matt

Rework VFP support to use PCU.
Add emulation of instruction which save/restore the VFP FPSCR.
Add a sysarch hook to VFP FPSCR manipulation.

[The emulation will be used by libc to store/fetch exception modes and
rounding mode on a per-thread basis.]


# 1.82 14-Jul-2012 matt

Refresh cortex cpus


Revision tags: jmcneill-usbmp-base10 yamt-pagecache-base5
# 1.81 20-May-2012 skrll

Remove the ARM1156T2 bloat - it only has an MPU. Prompted by matt@


# 1.80 20-May-2012 skrll

Add the ARM1156T2-S


# 1.79 20-May-2012 skrll

Add the 'Z' to the 1176 cpu product name.

ok matt@


Revision tags: jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base jym-xensuspend-nbase rmind-uvmplock-base jym-xensuspend-base
# 1.78 10-Mar-2011 bsh

branches: 1.78.4; 1.78.8; 1.78.10;
add MPCore to CPU-ID table
add branch predict bit to arm11_options


Revision tags: uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11
# 1.77 02-Oct-2010 kiyohara

branches: 1.77.2;
Add support Marvell Sheeva Core and SoC. (Orion/Kirkwood)
Discovery Innovation not yet.


Revision tags: uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.76 19-Jun-2010 matt

Fix cache probing on Cortex. Add missing CORTEX dependency in cpu.c


# 1.75 19-Jun-2010 matt

Fix c&p error.


# 1.74 19-Jun-2010 matt

Cleanup the armv7 changes. Add ARM_ARCH_7. Use CPU_CORTEX instead of
CPU_CORTEXA8 everywhere since there more types of Cortex than just the A8.
CPU_CORTEXA8 still exists but causes CPU_CORTEX to be defined.
Add CPU_CORTEXA9 as well. Use .arch armv7a to get us the isb/dsb
instructions.

Test booted to root device prompt on a Beagleboard.
All ARM kernels successfully test built.


# 1.73 16-Jun-2010 jmcneill

PR port-arm/43299: Support added for igepv2/cortexa8/omap3530

Apply patch from PR, with build fixes. ok skrll, matt


Revision tags: uebayasi-xip-base1 yamt-nfs-mp-base9 uebayasi-xip-base
# 1.72 23-Jan-2010 mrg

branches: 1.72.2; 1.72.4;
rename a local cpu_name structure member to avoid potential conflict
with <sys/cpu.h>'s.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-premerge-20091211 yamt-nfs-mp-base8 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 yamt-nfs-mp-base7 netbsd-5-0-1-RELEASE jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base nick-hppapmap-base haad-dm-base mjf-devfs2-base
# 1.71 25-Oct-2008 matt

branches: 1.71.4; 1.71.12;
Fix some missing things for CPU_ID_FA526.


Revision tags: matt-mips64-base2
# 1.70 24-Oct-2008 matt

Add entry for FA526.


# 1.69 21-Oct-2008 matt

Add Cortex cpus


Revision tags: haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base
# 1.68 27-Apr-2008 matt

branches: 1.68.6;
Merge kernel changes in matt-armv6 to HEAD.


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 chris-arm-intr-rework-base7 keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.67 15-Mar-2008 rearnsha

branches: 1.67.2; 1.67.4;
VFP support.


Revision tags: nick-net80211-sync-base chris-arm-intr-rework-base6 chris-arm-intr-rework-base5 chris-arm-intr-rework-base4 bouyer-xeni386-merge1 chris-arm-intr-rework-base3 vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 jmcneill-base mjf-devfs-base bouyer-xenamd64-base2 vmlocking-nbase yamt-x86pmap-base4 bouyer-xenamd64-base matt-armv6-base jmcneill-pm-base hpcarm-cleanup-base reinoud-bufcleanup-base
# 1.66 17-Oct-2007 garbled

branches: 1.66.12; 1.66.16;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base chris-arm-intr-rework-base2 chris-arm-intr-rework-base nick-csl-alignment-base matt-mips64-base ppcoea-renovation-base mjf-ufs-trans-base vmlocking-base
# 1.65 17-May-2007 yamt

branches: 1.65.10; 1.65.12;
merge yamt-idlelwp branch. asked by core@. some ports still needs work.

from doc/BRANCHES:

idle lwp, and some changes depending on it.

1. separate context switching and thread scheduling.
(cf. gmcgarry_ctxsw)
2. implement idle lwp.
3. clean up related MD/MI interfaces.
4. make scheduler(s) modular.


Revision tags: yamt-idlelwp-base8 thorpej-atomic-base ad-audiomp-base post-newlock2-merge newlock2-nbase newlock2-base
# 1.64 06-Jan-2007 christos

branches: 1.64.2; 1.64.6; 1.64.8; 1.64.14;
Scott Allan in http://mail-index.netbsd.org/port-arm/2006/07/31/0000.html
Patch to add support for ARM9E


# 1.63 06-Jan-2007 christos

From Scott Alan in http://mail-index.netbsd.org/port-arm/2006/07/26/0000.html
identify_arm_cpu() prints out a helpful message when it detects that you're
trying to run on a CPU that you didn't configure for. Unfortunately, the
check for class_option being NULL is backward, so it either won't print the
class_option, or it will try to dereference a NULL. The patch just flips the
!= NULL to be == NULL.


Revision tags: yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 abandoned-netbsd-4-base yamt-splraiseipl-base2 yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 netbsd-4-base yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base elad-kernelauth-base simonb-timecounters-base rpaulo-netinet-merge-pcb-base
# 1.62 15-Mar-2006 drochner

branches: 1.62.10; 1.62.14;
use km_alloc to get wired kernel memory for kernel stacks
of idle processes for secondary CPUs
(affects the MULTIPROCESSOR case only - does this exist?)
(untested)


Revision tags: yamt-pdpolicy-base2 yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.61 11-Dec-2005 christos

branches: 1.61.4; 1.61.6; 1.61.8; 1.61.10;
merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.60 20-Jul-2005 nonaka

Added i80219.


# 1.59 04-Jul-2005 bsh

branches: 1.59.2;
The first step to support Intel PXA270.

kernel config option CPU_XSCALE_PXA2X0 is now obsoleted by
CPU_XSCALE_PXA250 and CPU_XSCALE_PXA270. If both of them are defined,
CPU is determined run-time.


# 1.58 03-Jun-2005 rearnsha

Very basic support for the ARM1136.

This code takes no advantage of any 'new' features provided by
architecture 6 devices (such as physically tagged caches or new
MMU features), and basically runs the chip in a 'legacy v5' mode.


# 1.57 10-May-2005 rearnsha

Add support for arm1026ej-s.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 yamt-km-base4 yamt-km-base3 netbsd-3-base yamt-km-base2 yamt-km-base kent-audio2-base kent-audio1-beforemerge kent-audio1-base
# 1.56 14-Apr-2004 bsh

distinguish PXA255/26x from PXA2[15]0 in CPU attach message


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.55 13-Feb-2004 wiz

Uppercase CPU, plural is CPUs.


# 1.54 26-Oct-2003 chris

Fix up some unitialised variables.


# 1.53 06-Sep-2003 rearnsha

Support for ARM10E class devices.


# 1.52 03-Sep-2003 mycroft

Recognize some TI processors -- not that you'd want to use them.


# 1.51 23-Jun-2003 martin

branches: 1.51.2;
Make sure to include opt_foo.h if a defflag option FOO is used.


# 1.50 23-May-2003 ichiro

support IXP425 Intel Network Processor
running on BigEndian


# 1.49 29-Apr-2003 thorpej

Use aprint*().


# 1.48 14-Feb-2003 rjs

Add CPU IDs for PXA B2 and C0 steppings.


Revision tags: nathanw_sa_before_merge nathanw_sa_base
# 1.47 06-Jan-2003 wiz

specified, not specifed.


Revision tags: fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base
# 1.46 17-Nov-2002 chs

change uvm_uarea_alloc() to indicate whether the returned uarea is already
backed by physical pages (ie. because it reused a previously-freed one),
so that we can skip a bunch of useless work in that case.
this fixes the underlying problem behind PR 18543, and also speeds up fork()
quite a bit (eg. 7% on my pc, 1% on my ultra2) when we get a cache hit.


Revision tags: kqueue-aftermerge kqueue-beforemerge bjh21-hydra-base
# 1.45 13-Oct-2002 chris

branches: 1.45.2;
Fix arm kernel build breaks for non multiprocessor systems.


# 1.44 13-Oct-2002 bjh21

It appears that MI code requires ci_cpuid to be the CPU number of the CPU
in question, whereas the ARM code was using it to hold the model
identification. To fix this, rename:

ci_cpuid -> ci_arm_cpuid
ci_cputype -> ci_arm_cputype (for consistency)
ci_cpurev -> ci_arm_cpurev (ditto)
ci_cpunum -> ci_cpuid

This makes top(1) give correct CPU numbers in its "STATE" column (all 0 for
now).


# 1.43 12-Oct-2002 bjh21

Remember the location of each CPU's idle PCB in struct cpu_info.
Move allocation of the idle PCB from hydra.c to cpu.c and add some
extra initialisation from cpu_fork().


Revision tags: kqueue-base
# 1.42 01-Oct-2002 bjh21

constify various string tables.


# 1.41 06-Sep-2002 gehenna

Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.


Revision tags: gehenna-devsw-base
# 1.40 22-Jul-2002 briggs

Handle i80200 step D0 and i80321 step B0


# 1.39 10-Jul-2002 ichiro

add cpu id for "PXA250/210 3rd version CPUcore".

for using many PDA/xscale-core.


# 1.38 07-Jun-2002 thorpej

Add the CPU ID for the 600MHz i80321 part.


Revision tags: netbsd-1-6-base
# 1.37 12-May-2002 ichiro

branches: 1.37.2; 1.37.4;
change ICP12x0 steppings.
define CPU_IXP12X0


# 1.36 10-May-2002 thorpej

Add IXP1200 steppings.


# 1.35 03-May-2002 thorpej

Add support for the Intel PXA210 and PXA250. From Hiroyuki Bessho, PR 16617.


# 1.34 02-May-2002 rjs

Enable CPU_CLASS_SA1 for SA1100 and SA1110.


# 1.33 12-Apr-2002 thorpej

Centralize ARM CPU configuration information by adding a new header
file, <arm/cpuconf.h>, which pulls in "opt_cputypes.h" and then defines
the following:
* CPU_NTYPES -- now many CPU types are configured into the kernel. What
you really want to know is "== 1" or "> 1".
* Defines ARM_ARCH_2, ARM_ARCH_3, ARM_ARCH_4, ARM_ARCH_5, depending
on which ARM architecture versions are configured (based on CPU_*
options). Also defines ARM_NARCH to determins how many architecture
versions are configured.
* Defines ARM_MMU_MEMC, ARM_MMU_GENERIC, ARM_MMU_XSCALE depending on
which classes of ARM MMUs are configured into the kernel, and ARM_NMMUS
to determine how many MMU classes are configured.

Remove the needless inclusion of "opt_cputypes.h" in several places.
Convert remaining users to <arm/cpuconf.h>.


# 1.32 27-Mar-2002 thorpej

The 80321 manual lies; it does have a CPU ID distinct from the 80200.
Add that CPU ID, and add a case for it.


# 1.31 26-Mar-2002 thorpej

Restructure a few things in order to support other XScale core
I/O processors:
* The i80200 and the i80321 have the same CPU ID, so split the
CPU_XSCALE option into CPU_XSCALE_80200 and CPU_XSCALE_80321
options, and don't let them both be defined at the same time.
XXX May want to revisit this in the future.
* Split some registers common between the i80200 and i80321 into
<arm/xscale/xscalereg.h>.
* Rename a few existing functions.


# 1.30 24-Mar-2002 thorpej

Cache the cpu type and cpu revision in cpu_info.


Revision tags: eeh-devprop-base
# 1.29 16-Mar-2002 bjh21

Only put the CPU type into cpu_model, not the state of the control register.
Instead, print the control register state on the next line at startup.


# 1.28 16-Mar-2002 bjh21

Add CPU ID for the ARM1022ES.
Also add a CPU class for ARM10E processors in general.


# 1.27 11-Mar-2002 reinoud

When ARMFPE wasn't enabled the `usearmfpe' flag was statically initialised
but not used resulting in a compiler error. By splitting the declaration
and the initialisation this is solved.

Better would be to not even declare the flag when ARMFPE isnt enabled but
that would just add to the #ifdef jungle.


# 1.26 10-Mar-2002 bjh21

__RCSID -> __KERNEL_RCSID


# 1.25 10-Mar-2002 bjh21

Re-work the way that FPAs are handled. If ARMFPE isn't configured, don't
even bother probing for an FPA. If ARMFPE is configured, always use it,
even if there's an FPA (since it provides the FPA support code). Move all
printfs about FPAs into armfpe_init.c.

This means I can delete the last two elements from struct _cpu, so that the
structure, and the whole of <arm/cpus.h> is redundant and can be deleted.


# 1.24 10-Mar-2002 bjh21

Remove fpu_model from struct _cpu. Instead, have initialise_arm_fpe()
printf() the FPE version number itself.


# 1.23 10-Mar-2002 bjh21

Add a ci_dev element to struct cpu_info, pointing to the device that
corresponds to the CPU.


Revision tags: newlock-base
# 1.22 10-Mar-2002 bjh21

Kill the fpu_flags element from struct _cpu. It was only ever set to 0
anyway.


# 1.21 10-Mar-2002 bjh21

Clean up inline assembler. Rather than saving R0, copying FPSR to R0,
copying it to the output register and then restoring R0, just copy the
FPSR straight to the output.


# 1.20 09-Mar-2002 bjh21

Remove the cpu_model member from struct _cpu, and just use the cpu_model
variable directly. While we're at it, make cpu_model rather larger.


# 1.19 09-Mar-2002 bjh21

Remove the cpu_class element from struct _cpu, and make it a local variable
in identify_arm_cpu(), since it's almost unused elsewhere.

Change the detection of bugged StrongARMs to use the cpu ID rather than the
class. This turns "almost" into "entirely".


# 1.18 09-Mar-2002 bjh21

Replace cpu_id and cpu_ctrl in struct _cpu with ci_cpuid and ci_ctrl in
struct cpu_info. Also kill the cpuctrl global while we're here, and make
identify_arm_cpu() take a struct cpu_info * as an argument alongside the CPU
number.


# 1.17 09-Mar-2002 bjh21

Move arm700bugcount into stuct cpu_info, and attach it in
identify_master_cpu().


Revision tags: ifpoll-base
# 1.16 17-Feb-2002 bjh21

Our assembler handles FPA instructions fine, so don't use .word for them.


# 1.15 17-Feb-2002 bjh21

ANSIfy, and othe KNF cleanup.


# 1.14 27-Jan-2002 bjh21

Add revision->stepping maps for the SA-110, SA-1100 and SA-1110.
Those for the SA-1100 and SA-1110 are from Intel's documentation.
The mapping for the SA-110 is from various sources on the net, since Intel
don't seem to document it.

Also, change the layout of the maps to have four steppings per line,
so they aren't quite so unwieldy.


# 1.13 24-Jan-2002 thorpej

Use a table to look up stepping names. Add a generic stepping
table ("rev 0", "rev 1", etc.) and an i80200 stepping table that
has the stepping names that appear in the i80200 manuals/errata..


# 1.12 29-Nov-2001 thorpej

Fetch cache info from the Cache Type register on ARM7TDMI and "greater"
processors. Report this when the processor is attached.


# 1.11 24-Nov-2001 thorpej

Move the ARM, Ltd. floating point emulator to arch/arm.


# 1.10 23-Nov-2001 thorpej

Use <arm/undefined.h> instead of <machine/undefined.h>.


Revision tags: thorpej-mips-cache-base
# 1.9 06-Nov-2001 thorpej

branches: 1.9.2;
Const poisoning of cpu/class names.


# 1.8 06-Nov-2001 thorpej

"i80200", not "80200".


# 1.7 06-Nov-2001 thorpej

"XScale", not "Xscale".


# 1.6 18-Oct-2001 rearnsha

branches: 1.6.2;
Support for ARM9.


Revision tags: thorpej-devvp-base3 thorpej-devvp-base2
# 1.5 28-Sep-2001 chris

Add extra arg to fpa_test as it should have 4 args. Also add prototypes for fpa_test and fpa_handler.


Revision tags: post-chs-ubcperf pre-chs-ubcperf thorpej-devvp-base
# 1.4 05-Sep-2001 matt

branches: 1.4.2;
Flesh XSCALE support.


# 1.3 03-Jun-2001 chris

branches: 1.3.2; 1.3.4;
Add support for ARM7TDMI, as provided in a patch from John Fremlin to port-arm32.

Shouldn't effect any currently in tree ports.


# 1.2 13-May-2001 bjh21

Use get_bootconf_option() to find boot options, rather than home-grown
strstr()-based hacks.


Revision tags: thorpej_scsipi_beforemerge thorpej_scsipi_base thorpej_scsipi_nbase
# 1.1 20-Apr-2001 matt

branches: 1.1.2;
Split cpu from mainbus so that cpu can attached to other buses (like ofbus).


Revision tags: nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.114 11-Jul-2016 kiyohara

Add Cortex-A9 r1.


Revision tags: nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.113 03-Mar-2016 skrll

Get the RPI3 working (in aarch32 mode) by recognising Cortex A53 CPUs.
While I'm here add some A57/A72 info as well.

My RPI3 works with FB console - the uart needs some help with its clocks.


# 1.112 23-Jan-2016 christos

Rename the cpu_id() define to cpu_idnum() so that it does not conflict with
dtrace and friends.


Revision tags: nick-nhusb-base-20151226
# 1.111 12-Nov-2015 jmcneill

change some register dumps from aprint_verbose to aprint_debug


Revision tags: nick-nhusb-base-20150921
# 1.110 08-Jul-2015 skrll

aprint_verbose [sa]ctlr


Revision tags: nick-nhusb-base-20150606
# 1.109 05-Jun-2015 skrll

Print the Revision ID regster (verbose)


# 1.108 17-May-2015 matt

Print out mpidr on MP systems (verbose print)


Revision tags: nick-nhusb-base-20150406
# 1.107 03-Mar-2015 jmcneill

cache type 12 is "write-back", from matt


Revision tags: nick-nhusb-base
# 1.106 27-Nov-2014 matt

branches: 1.106.2;
Add entry for Cortex-A17 r1


# 1.105 01-Sep-2014 reinoud

Increase the `freqbuf' buffer that holds the result of humanize_number(). Now
it prints 1600 Mhz instead of 1 Ghz.
Pitty enough humanize_number(9) doesn't do 1.6 Ghz type output.


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.104 28-Mar-2014 matt

branches: 1.104.4;
Various MP changes.


# 1.103 24-Mar-2014 christos

use cpu_{g,s}etmodel


# 1.102 20-Mar-2014 matt

Define cache type 13


Revision tags: riastradh-drm2-base3
# 1.101 03-Mar-2014 matt

Add most of the cpu_* variables to <arm/locore.h>
Add and initialize cpu_synchprim_present


# 1.100 20-Feb-2014 matt

Keep track of what each cache is (VIVT/VIPT/PIPT).

cpu0: 32KB/32B 2-way L1 VIPT Instruction cache
cpu0: 32KB/64B 4-way write-back-locking-C L1 PIPT Data cache
cpu0: 256KB/64B 8-way write-through L2 PIPT Unified cache


# 1.99 07-Sep-2013 matt

Add a machdep.hwdiv_present sysctl (cortex A7 and A15 have hwdiv instructions)


# 1.98 07-Sep-2013 matt

Add CPU_ID_CORTEXA7R0 entry


# 1.97 18-Aug-2013 matt

Move parts of cpu.h that are not needed by MI code in <arm/locore.h>
Don't include <machine/cpu.h> or <machine/frame.h>, use <arm/locore.h>
Use <arm/asm.h> instead of <machine/arm.h>


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.96 12-Jun-2013 matt

branches: 1.96.2;
Nuke cpu_pfr, just use the armreg_pfr?_read inlines


# 1.95 12-Jun-2013 matt

Use the armreg_pfr?_read inlines.


# 1.94 19-May-2013 rkujawa

Plug support for PJ4B into our ARM CPU infrastructure.

Obtained from Marvell, Semihalf.


Revision tags: agc-symver-base
# 1.93 03-Feb-2013 matt

Add a machdep.cpu_arch sysctl


# 1.92 31-Jan-2013 matt

Add simple sysctls for cpu_id, fpu_id, neon_present, simd_present,
simdex_present.
Add struct sysctls to return the isar, mmfr, pfr, and mvfr sets.


Revision tags: yamt-pagecache-base8 yamt-pagecache-base7
# 1.91 05-Dec-2012 matt

ARMFPE hasn't compiled since NetBSD 4. Remove it.
Complete support for FPU_VFP.
fpregs now contains vfpreg.
XXX vfpreg only has space for 16 64-bit FP registers though VFPv3 and later
have 32 64-bit FP registers.


# 1.90 30-Nov-2012 msaitoh

Use snprintf() instead of sprintf().


# 1.89 30-Nov-2012 msaitoh

s/,/;/


# 1.88 12-Nov-2012 skrll

C99 types


Revision tags: yamt-pagecache-base6
# 1.87 22-Sep-2012 matt

Don't use an asm in pmap_activate to update the TTBR, use cpu_setttb instead
but add a second argument to it to indicate whether the TLB/caches need to be
flushed. Default cortex to pmap_needs_fixup = 1. But check the MMFR3 field
to see if the fixed can be skipped.
Use a cf_flag bit 0 to indicate whether the A9 L2 cache should disable (bit 0 = 1)
or enabeld (bit = 0).

With these changes, the A9 MMU can use traverse caches to do MMU tablewalks
Also, make sure all memory has the shareable bit for the A9.


# 1.86 07-Sep-2012 matt

branches: 1.86.2;
Switch cortex_a9 back to need_ptesync = 1
Add code to disable the L2 cache on cortex-a9 (for now).
Add evcnt for all the fault types.
Move cache info in a structure and have one for the pcache and one for scache.
Probe L1/L2 caches properly for ARMv7


# 1.85 29-Aug-2012 matt

Use new armv7 CP15 register to print out cache types.
If the cpu_cc_freq is set, report it.
Add macros to make inlines for reading/writing co-processor registers.


# 1.84 14-Aug-2012 matt

Use device_t


# 1.83 12-Aug-2012 matt

Rework VFP support to use PCU.
Add emulation of instruction which save/restore the VFP FPSCR.
Add a sysarch hook to VFP FPSCR manipulation.

[The emulation will be used by libc to store/fetch exception modes and
rounding mode on a per-thread basis.]


# 1.82 14-Jul-2012 matt

Refresh cortex cpus


Revision tags: jmcneill-usbmp-base10 yamt-pagecache-base5
# 1.81 20-May-2012 skrll

Remove the ARM1156T2 bloat - it only has an MPU. Prompted by matt@


# 1.80 20-May-2012 skrll

Add the ARM1156T2-S


# 1.79 20-May-2012 skrll

Add the 'Z' to the 1176 cpu product name.

ok matt@


Revision tags: jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base jym-xensuspend-nbase rmind-uvmplock-base jym-xensuspend-base
# 1.78 10-Mar-2011 bsh

branches: 1.78.4; 1.78.8; 1.78.10;
add MPCore to CPU-ID table
add branch predict bit to arm11_options


Revision tags: uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11
# 1.77 02-Oct-2010 kiyohara

branches: 1.77.2;
Add support Marvell Sheeva Core and SoC. (Orion/Kirkwood)
Discovery Innovation not yet.


Revision tags: uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.76 19-Jun-2010 matt

Fix cache probing on Cortex. Add missing CORTEX dependency in cpu.c


# 1.75 19-Jun-2010 matt

Fix c&p error.


# 1.74 19-Jun-2010 matt

Cleanup the armv7 changes. Add ARM_ARCH_7. Use CPU_CORTEX instead of
CPU_CORTEXA8 everywhere since there more types of Cortex than just the A8.
CPU_CORTEXA8 still exists but causes CPU_CORTEX to be defined.
Add CPU_CORTEXA9 as well. Use .arch armv7a to get us the isb/dsb
instructions.

Test booted to root device prompt on a Beagleboard.
All ARM kernels successfully test built.


# 1.73 16-Jun-2010 jmcneill

PR port-arm/43299: Support added for igepv2/cortexa8/omap3530

Apply patch from PR, with build fixes. ok skrll, matt


Revision tags: uebayasi-xip-base1 yamt-nfs-mp-base9 uebayasi-xip-base
# 1.72 23-Jan-2010 mrg

branches: 1.72.2; 1.72.4;
rename a local cpu_name structure member to avoid potential conflict
with <sys/cpu.h>'s.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-premerge-20091211 yamt-nfs-mp-base8 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 yamt-nfs-mp-base7 netbsd-5-0-1-RELEASE jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base nick-hppapmap-base haad-dm-base mjf-devfs2-base
# 1.71 25-Oct-2008 matt

branches: 1.71.4; 1.71.12;
Fix some missing things for CPU_ID_FA526.


Revision tags: matt-mips64-base2
# 1.70 24-Oct-2008 matt

Add entry for FA526.


# 1.69 21-Oct-2008 matt

Add Cortex cpus


Revision tags: haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 wrstuden-revivesa-base
# 1.68 27-Apr-2008 matt

branches: 1.68.6;
Merge kernel changes in matt-armv6 to HEAD.


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 chris-arm-intr-rework-base7 keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.67 15-Mar-2008 rearnsha

branches: 1.67.2; 1.67.4;
VFP support.


Revision tags: nick-net80211-sync-base chris-arm-intr-rework-base6 chris-arm-intr-rework-base5 chris-arm-intr-rework-base4 bouyer-xeni386-merge1 chris-arm-intr-rework-base3 vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 jmcneill-base mjf-devfs-base bouyer-xenamd64-base2 vmlocking-nbase yamt-x86pmap-base4 bouyer-xenamd64-base matt-armv6-base jmcneill-pm-base hpcarm-cleanup-base reinoud-bufcleanup-base
# 1.66 17-Oct-2007 garbled

branches: 1.66.12; 1.66.16;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base chris-arm-intr-rework-base2 chris-arm-intr-rework-base nick-csl-alignment-base matt-mips64-base ppcoea-renovation-base mjf-ufs-trans-base vmlocking-base
# 1.65 17-May-2007 yamt

branches: 1.65.10; 1.65.12;
merge yamt-idlelwp branch. asked by core@. some ports still needs work.

from doc/BRANCHES:

idle lwp, and some changes depending on it.

1. separate context switching and thread scheduling.
(cf. gmcgarry_ctxsw)
2. implement idle lwp.
3. clean up related MD/MI interfaces.
4. make scheduler(s) modular.


Revision tags: yamt-idlelwp-base8 thorpej-atomic-base ad-audiomp-base post-newlock2-merge newlock2-nbase newlock2-base
# 1.64 06-Jan-2007 christos

branches: 1.64.2; 1.64.6; 1.64.8; 1.64.14;
Scott Allan in http://mail-index.netbsd.org/port-arm/2006/07/31/0000.html
Patch to add support for ARM9E


# 1.63 06-Jan-2007 christos

From Scott Alan in http://mail-index.netbsd.org/port-arm/2006/07/26/0000.html
identify_arm_cpu() prints out a helpful message when it detects that you're
trying to run on a CPU that you didn't configure for. Unfortunately, the
check for class_option being NULL is backward, so it either won't print the
class_option, or it will try to dereference a NULL. The patch just flips the
!= NULL to be == NULL.


Revision tags: yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 abandoned-netbsd-4-base yamt-splraiseipl-base2 yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 yamt-pdpolicy-base7 netbsd-4-base yamt-pdpolicy-base6 chap-midi-nbase gdamore-uart-base yamt-pdpolicy-base5 chap-midi-base yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base elad-kernelauth-base simonb-timecounters-base rpaulo-netinet-merge-pcb-base
# 1.62 15-Mar-2006 drochner

branches: 1.62.10; 1.62.14;
use km_alloc to get wired kernel memory for kernel stacks
of idle processes for secondary CPUs
(affects the MULTIPROCESSOR case only - does this exist?)
(untested)


Revision tags: yamt-pdpolicy-base2 yamt-pdpolicy-base yamt-uio_vmspace-base5
# 1.61 11-Dec-2005 christos

branches: 1.61.4; 1.61.6; 1.61.8; 1.61.10;
merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base ktrace-lwp-base
# 1.60 20-Jul-2005 nonaka

Added i80219.


# 1.59 04-Jul-2005 bsh

branches: 1.59.2;
The first step to support Intel PXA270.

kernel config option CPU_XSCALE_PXA2X0 is now obsoleted by
CPU_XSCALE_PXA250 and CPU_XSCALE_PXA270. If both of them are defined,
CPU is determined run-time.


# 1.58 03-Jun-2005 rearnsha

Very basic support for the ARM1136.

This code takes no advantage of any 'new' features provided by
architecture 6 devices (such as physically tagged caches or new
MMU features), and basically runs the chip in a 'legacy v5' mode.


# 1.57 10-May-2005 rearnsha

Add support for arm1026ej-s.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 yamt-km-base4 yamt-km-base3 netbsd-3-base yamt-km-base2 yamt-km-base kent-audio2-base kent-audio1-beforemerge kent-audio1-base
# 1.56 14-Apr-2004 bsh

distinguish PXA255/26x from PXA2[15]0 in CPU attach message


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.55 13-Feb-2004 wiz

Uppercase CPU, plural is CPUs.


# 1.54 26-Oct-2003 chris

Fix up some unitialised variables.


# 1.53 06-Sep-2003 rearnsha

Support for ARM10E class devices.


# 1.52 03-Sep-2003 mycroft

Recognize some TI processors -- not that you'd want to use them.


# 1.51 23-Jun-2003 martin

branches: 1.51.2;
Make sure to include opt_foo.h if a defflag option FOO is used.


# 1.50 23-May-2003 ichiro

support IXP425 Intel Network Processor
running on BigEndian


# 1.49 29-Apr-2003 thorpej

Use aprint*().


# 1.48 14-Feb-2003 rjs

Add CPU IDs for PXA B2 and C0 steppings.


Revision tags: nathanw_sa_before_merge nathanw_sa_base
# 1.47 06-Jan-2003 wiz

specified, not specifed.


Revision tags: fvdl_fs64_base gmcgarry_ctxsw_base gmcgarry_ucred_base
# 1.46 17-Nov-2002 chs

change uvm_uarea_alloc() to indicate whether the returned uarea is already
backed by physical pages (ie. because it reused a previously-freed one),
so that we can skip a bunch of useless work in that case.
this fixes the underlying problem behind PR 18543, and also speeds up fork()
quite a bit (eg. 7% on my pc, 1% on my ultra2) when we get a cache hit.


Revision tags: kqueue-aftermerge kqueue-beforemerge bjh21-hydra-base
# 1.45 13-Oct-2002 chris

branches: 1.45.2;
Fix arm kernel build breaks for non multiprocessor systems.


# 1.44 13-Oct-2002 bjh21

It appears that MI code requires ci_cpuid to be the CPU number of the CPU
in question, whereas the ARM code was using it to hold the model
identification. To fix this, rename:

ci_cpuid -> ci_arm_cpuid
ci_cputype -> ci_arm_cputype (for consistency)
ci_cpurev -> ci_arm_cpurev (ditto)
ci_cpunum -> ci_cpuid

This makes top(1) give correct CPU numbers in its "STATE" column (all 0 for
now).


# 1.43 12-Oct-2002 bjh21

Remember the location of each CPU's idle PCB in struct cpu_info.
Move allocation of the idle PCB from hydra.c to cpu.c and add some
extra initialisation from cpu_fork().


Revision tags: kqueue-base
# 1.42 01-Oct-2002 bjh21

constify various string tables.


# 1.41 06-Sep-2002 gehenna

Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.


Revision tags: gehenna-devsw-base
# 1.40 22-Jul-2002 briggs

Handle i80200 step D0 and i80321 step B0


# 1.39 10-Jul-2002 ichiro

add cpu id for "PXA250/210 3rd version CPUcore".

for using many PDA/xscale-core.


# 1.38 07-Jun-2002 thorpej

Add the CPU ID for the 600MHz i80321 part.


Revision tags: netbsd-1-6-base
# 1.37 12-May-2002 ichiro

branches: 1.37.2; 1.37.4;
change ICP12x0 steppings.
define CPU_IXP12X0


# 1.36 10-May-2002 thorpej

Add IXP1200 steppings.


# 1.35 03-May-2002 thorpej

Add support for the Intel PXA210 and PXA250. From Hiroyuki Bessho, PR 16617.


# 1.34 02-May-2002 rjs

Enable CPU_CLASS_SA1 for SA1100 and SA1110.


# 1.33 12-Apr-2002 thorpej

Centralize ARM CPU configuration information by adding a new header
file, <arm/cpuconf.h>, which pulls in "opt_cputypes.h" and then defines
the following:
* CPU_NTYPES -- now many CPU types are configured into the kernel. What
you really want to know is "== 1" or "> 1".
* Defines ARM_ARCH_2, ARM_ARCH_3, ARM_ARCH_4, ARM_ARCH_5, depending
on which ARM architecture versions are configured (based on CPU_*
options). Also defines ARM_NARCH to determins how many architecture
versions are configured.
* Defines ARM_MMU_MEMC, ARM_MMU_GENERIC, ARM_MMU_XSCALE depending on
which classes of ARM MMUs are configured into the kernel, and ARM_NMMUS
to determine how many MMU classes are configured.

Remove the needless inclusion of "opt_cputypes.h" in several places.
Convert remaining users to <arm/cpuconf.h>.


# 1.32 27-Mar-2002 thorpej

The 80321 manual lies; it does have a CPU ID distinct from the 80200.
Add that CPU ID, and add a case for it.


# 1.31 26-Mar-2002 thorpej

Restructure a few things in order to support other XScale core
I/O processors:
* The i80200 and the i80321 have the same CPU ID, so split the
CPU_XSCALE option into CPU_XSCALE_80200 and CPU_XSCALE_80321
options, and don't let them both be defined at the same time.
XXX May want to revisit this in the future.
* Split some registers common between the i80200 and i80321 into
<arm/xscale/xscalereg.h>.
* Rename a few existing functions.


# 1.30 24-Mar-2002 thorpej

Cache the cpu type and cpu revision in cpu_info.


Revision tags: eeh-devprop-base
# 1.29 16-Mar-2002 bjh21

Only put the CPU type into cpu_model, not the state of the control register.
Instead, print the control register state on the next line at startup.


# 1.28 16-Mar-2002 bjh21

Add CPU ID for the ARM1022ES.
Also add a CPU class for ARM10E processors in general.


# 1.27 11-Mar-2002 reinoud

When ARMFPE wasn't enabled the `usearmfpe' flag was statically initialised
but not used resulting in a compiler error. By splitting the declaration
and the initialisation this is solved.

Better would be to not even declare the flag when ARMFPE isnt enabled but
that would just add to the #ifdef jungle.


# 1.26 10-Mar-2002 bjh21

__RCSID -> __KERNEL_RCSID


# 1.25 10-Mar-2002 bjh21

Re-work the way that FPAs are handled. If ARMFPE isn't configured, don't
even bother probing for an FPA. If ARMFPE is configured, always use it,
even if there's an FPA (since it provides the FPA support code). Move all
printfs about FPAs into armfpe_init.c.

This means I can delete the last two elements from struct _cpu, so that the
structure, and the whole of <arm/cpus.h> is redundant and can be deleted.


# 1.24 10-Mar-2002 bjh21

Remove fpu_model from struct _cpu. Instead, have initialise_arm_fpe()
printf() the FPE version number itself.


# 1.23 10-Mar-2002 bjh21

Add a ci_dev element to struct cpu_info, pointing to the device that
corresponds to the CPU.


Revision tags: newlock-base
# 1.22 10-Mar-2002 bjh21

Kill the fpu_flags element from struct _cpu. It was only ever set to 0
anyway.


# 1.21 10-Mar-2002 bjh21

Clean up inline assembler. Rather than saving R0, copying FPSR to R0,
copying it to the output register and then restoring R0, just copy the
FPSR straight to the output.


# 1.20 09-Mar-2002 bjh21

Remove the cpu_model member from struct _cpu, and just use the cpu_model
variable directly. While we're at it, make cpu_model rather larger.


# 1.19 09-Mar-2002 bjh21

Remove the cpu_class element from struct _cpu, and make it a local variable
in identify_arm_cpu(), since it's almost unused elsewhere.

Change the detection of bugged StrongARMs to use the cpu ID rather than the
class. This turns "almost" into "entirely".


# 1.18 09-Mar-2002 bjh21

Replace cpu_id and cpu_ctrl in struct _cpu with ci_cpuid and ci_ctrl in
struct cpu_info. Also kill the cpuctrl global while we're here, and make
identify_arm_cpu() take a struct cpu_info * as an argument alongside the CPU
number.


# 1.17 09-Mar-2002 bjh21

Move arm700bugcount into stuct cpu_info, and attach it in
identify_master_cpu().


Revision tags: ifpoll-base
# 1.16 17-Feb-2002 bjh21

Our assembler handles FPA instructions fine, so don't use .word for them.


# 1.15 17-Feb-2002 bjh21

ANSIfy, and othe KNF cleanup.


# 1.14 27-Jan-2002 bjh21

Add revision->stepping maps for the SA-110, SA-1100 and SA-1110.
Those for the SA-1100 and SA-1110 are from Intel's documentation.
The mapping for the SA-110 is from various sources on the net, since Intel
don't seem to document it.

Also, change the layout of the maps to have four steppings per line,
so they aren't quite so unwieldy.


# 1.13 24-Jan-2002 thorpej

Use a table to look up stepping names. Add a generic stepping
table ("rev 0", "rev 1", etc.) and an i80200 stepping table that
has the stepping names that appear in the i80200 manuals/errata..


# 1.12 29-Nov-2001 thorpej

Fetch cache info from the Cache Type register on ARM7TDMI and "greater"
processors. Report this when the processor is attached.


# 1.11 24-Nov-2001 thorpej

Move the ARM, Ltd. floating point emulator to arch/arm.


# 1.10 23-Nov-2001 thorpej

Use <arm/undefined.h> instead of <machine/undefined.h>.


Revision tags: thorpej-mips-cache-base
# 1.9 06-Nov-2001 thorpej

branches: 1.9.2;
Const poisoning of cpu/class names.


# 1.8 06-Nov-2001 thorpej

"i80200", not "80200".


# 1.7 06-Nov-2001 thorpej

"XScale", not "Xscale".


# 1.6 18-Oct-2001 rearnsha

branches: 1.6.2;
Support for ARM9.


Revision tags: thorpej-devvp-base3 thorpej-devvp-base2
# 1.5 28-Sep-2001 chris

Add extra arg to fpa_test as it should have 4 args. Also add prototypes for fpa_test and fpa_handler.


Revision tags: post-chs-ubcperf pre-chs-ubcperf thorpej-devvp-base
# 1.4 05-Sep-2001 matt

branches: 1.4.2;
Flesh XSCALE support.


# 1.3 03-Jun-2001 chris

branches: 1.3.2; 1.3.4;
Add support for ARM7TDMI, as provided in a patch from John Fremlin to port-arm32.

Shouldn't effect any currently in tree ports.


# 1.2 13-May-2001 bjh21

Use get_bootconf_option() to find boot options, rather than home-grown
strstr()-based hacks.


Revision tags: thorpej_scsipi_beforemerge thorpej_scsipi_base thorpej_scsipi_nbase
# 1.1 20-Apr-2001 matt

branches: 1.1.2;
Split cpu from mainbus so that cpu can attached to other buses (like ofbus).