Home | History | Annotate | only in /src/sys/arch/arm/marvell
History log of /src/sys/arch/arm/marvell
RevisionDateAuthorComments
 1.26 25-Jun-2022  jmcneill pic: Update ci_cpl in pic_set_priority callback.

Not all ICs need interrupts disabled to update the priority. DAIF accesses
are not cheap, so push the update of ci_cpl from pic_set_priority to the
IC's pic_set_priority callback, and let the IC driver determine whether
or not it needs interrupts disabled.
 1.25 31-May-2022  andvar s/disbale/disable/ and s/enbale/enable/ in comments. also one more typo fix.
 1.24 30-Aug-2021  rin Add ARMEB support to {evb,}arm/marvell.

Combined with upcoming commit to dev/marvell, all peripheral devices
seem to work just fine for KUROBOX_PRO in big-endian mode.
 1.23 30-Oct-2020  skrll Retire arm_[di]sb in favour of the isb() and dsb(sy) macro invocations.
 1.22 14-May-2020  msaitoh Remove extra semicolon.
 1.21 26-Feb-2017  skrll Trailing whitespace
 1.20 26-Feb-2017  skrll Use PEX numbers consistently. No functional change.
 1.19 23-Feb-2017  skrll Typo in comment
 1.18 11-Jan-2017  maya branches: 1.18.2;
also fix this other off by one.
 1.17 11-Jan-2017  maya fix off by one.

ok riastradh
 1.16 07-Jan-2017  kiyohara Add support Marvell Dove.
Also <SoC>_intr_bootstrap() rename to <SoC>_bootstrap(). And SoC init func, getclk into that.
 1.15 03-Jun-2015  hsuenaga branches: 1.15.2;
add ARMADA XP's Soc internal bus(Mbus) address decoder initialization function.
some versions of u-boot initializes the address decoder incorrectly(probably
these values are come from Kirkwood SoC or older.) the codes generates
SoC's default address spaces and some modifications for NetBSD's assumption.

add error interrupt definitions, interrupt name strings for 'vmstat -e',
verbose output of Mbus settings for such low-level debugging of SoC.
 1.14 19-May-2015  hsuenaga fix Marvell Coherency Barrier register address.
configure coherency bus maintance broadcast using MPIDR. we need to configure
this regardless of 'options MULTIPROCESSOR.'
 1.13 14-May-2015  hsuenaga add synchronization barrier for AURORA_IO_CACHE_COHERENCY.
cleanup MARVELL L2 cache code.
 1.12 03-May-2015  hsuenaga write back unaligned boundary of L2 cache even if invalidate operation
is requested.
 1.11 17-Apr-2015  hsuenaga sync L2 cache on the tail of region.
 1.10 15-Apr-2015  hsuenaga add L2 cache write eviction buffer sync barrier
 1.9 15-Apr-2015  hsuenaga implement L2 cache maintenance operations of ARMADA XP.
the L2 cahce maintenance operations are defined on SoC internal registers.
 1.8 05-Apr-2014  matt branches: 1.8.2; 1.8.6;
Initialize cpu_cc_freq with our CPU speed.
 1.7 15-Mar-2014  kiyohara branches: 1.7.2;
Add armada370_getclks().
Remove some white spaces.
 1.6 23-Dec-2013  kiyohara Support to check the clock gating for Armada XP in armadaxp.c.
Also move the checking for clock gate of Kirkwood into kirkwood.c.
 1.5 23-Dec-2013  kiyohara Move Misc Registers from mvsocreg.h to armadaxpreg.h. These registers only
Armada XP. The misc_base initializes in initarm() instead of mvsoc_bootstrap().
 1.4 20-Nov-2013  kiyohara Support __HAVE_PIC_SET_PRIORITY for Armada XP.
 1.3 30-Sep-2013  kiyohara Change argument for some functions.
 1.2 29-May-2013  rkujawa branches: 1.2.2; 1.2.4;
Add CVS IDs where appropriate.
 1.1 29-May-2013  rkujawa Add support for Armada XP PIC.

Obtained from Marvell, Semihalf.
 1.2.4.1 18-May-2014  rmind sync with head
 1.2.2.4 03-Dec-2017  jdolecek update from HEAD
 1.2.2.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.2.2 23-Jun-2013  tls resync from head
 1.2.2.1 29-May-2013  tls file armadaxp.c was added on branch tls-maxphys on 2013-06-23 06:20:00 +0000
 1.7.2.1 10-Aug-2014  tls Rebase.
 1.8.6.3 28-Aug-2017  skrll Sync with HEAD
 1.8.6.2 05-Feb-2017  skrll Sync with HEAD
 1.8.6.1 06-Jun-2015  skrll Sync with HEAD
 1.8.2.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.8.2.1 05-Apr-2014  yamt file armadaxp.c was added on branch yamt-pagecache on 2014-05-22 11:39:33 +0000
 1.15.2.1 20-Mar-2017  pgoyette Sync with HEAD
 1.18.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.10 13-Aug-2023  andvar fix typos in comments.
 1.9 04-Apr-2022  andvar fix various typos, mainly in comments.
 1.8 10-Mar-2017  skrll Initialise the windows and allow access to PCI Express port 1 first lane.

Allows xhci(4) to attach in the MV78230 based Lenovo ix4-300d

mvpex1 at mvsoc0 unit 4 offset 0x80000-0x81fff irq 62: Marvell PCI Express Interface
pci1 at mvpex1
xhci0 at pci1 dev 1 function 0: vendor 1033 product 0194 (rev. 0x04)
xhci0: interrupting at interrupt pin INTA#
usb3 at xhci0: USB revision 3.0
usb4 at xhci0: USB revision 2.0
 1.7 07-Jan-2017  kiyohara branches: 1.7.2;
Add register macros.
And reorder registers.
Also remove white-spaces.
 1.6 06-Nov-2015  kiyohara branches: 1.6.2;
Add mvsocts to mvsoc_periph for Armada XP.
 1.5 03-Jun-2015  hsuenaga add ARMADA XP's Soc internal bus(Mbus) address decoder initialization function.
some versions of u-boot initializes the address decoder incorrectly(probably
these values are come from Kirkwood SoC or older.) the codes generates
SoC's default address spaces and some modifications for NetBSD's assumption.

add error interrupt definitions, interrupt name strings for 'vmstat -e',
verbose output of Mbus settings for such low-level debugging of SoC.
 1.4 14-May-2015  hsuenaga add synchronization barrier for AURORA_IO_CACHE_COHERENCY.
cleanup MARVELL L2 cache code.
 1.3 15-Apr-2015  hsuenaga implement L2 cache maintenance operations of ARMADA XP.
the L2 cahce maintenance operations are defined on SoC internal registers.
 1.2 23-Dec-2013  kiyohara branches: 1.2.4; 1.2.6; 1.2.10; 1.2.12;
Move Misc Registers from mvsocreg.h to armadaxpreg.h. These registers only
Armada XP. The misc_base initializes in initarm() instead of mvsoc_bootstrap().
 1.1 30-Sep-2013  kiyohara Move armadaxpreg.h into arm/marvell.
And add some defines and reorder.
 1.2.12.4 28-Aug-2017  skrll Sync with HEAD
 1.2.12.3 05-Feb-2017  skrll Sync with HEAD
 1.2.12.2 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.2.12.1 06-Jun-2015  skrll Sync with HEAD
 1.2.10.3 03-Dec-2017  jdolecek update from HEAD
 1.2.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.10.1 23-Dec-2013  tls file armadaxpreg.h was added on branch tls-maxphys on 2014-08-20 00:02:47 +0000
 1.2.6.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.2.6.1 23-Dec-2013  yamt file armadaxpreg.h was added on branch yamt-pagecache on 2014-05-22 11:39:33 +0000
 1.2.4.2 18-May-2014  rmind sync with head
 1.2.4.1 23-Dec-2013  rmind file armadaxpreg.h was added on branch rmind-smpnet on 2014-05-18 17:44:58 +0000
 1.6.2.1 20-Mar-2017  pgoyette Sync with HEAD
 1.7.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.4 27-Feb-2025  andvar Fix various typos in comments.
 1.3 07-Jan-2017  kiyohara branches: 1.3.14; 1.3.54;
Add support Marvell Dove.
Also <SoC>_intr_bootstrap() rename to <SoC>_bootstrap(). And SoC init func, getclk into that.
 1.2 03-Jun-2015  hsuenaga branches: 1.2.2; 1.2.4;
add ARMADA XP's Soc internal bus(Mbus) address decoder initialization function.
some versions of u-boot initializes the address decoder incorrectly(probably
these values are come from Kirkwood SoC or older.) the codes generates
SoC's default address spaces and some modifications for NetBSD's assumption.

add error interrupt definitions, interrupt name strings for 'vmstat -e',
verbose output of Mbus settings for such low-level debugging of SoC.
 1.1 15-Apr-2015  hsuenaga implement L2 cache maintenance operations of ARMADA XP.
the L2 cahce maintenance operations are defined on SoC internal registers.
 1.2.4.1 20-Mar-2017  pgoyette Sync with HEAD
 1.2.2.3 05-Feb-2017  skrll Sync with HEAD
 1.2.2.2 06-Jun-2015  skrll Sync with HEAD
 1.2.2.1 03-Jun-2015  skrll file armadaxpvar.h was added on branch nick-nhusb on 2015-06-06 14:39:56 +0000
 1.3.54.1 02-Aug-2025  perseant Sync with HEAD
 1.3.14.2 03-Dec-2017  jdolecek update from HEAD
 1.3.14.1 07-Jan-2017  jdolecek file armadaxpvar.h was added on branch tls-maxphys on 2017-12-03 11:35:54 +0000
 1.4 14-Sep-2025  andvar Fix various typos in comments and log message.
 1.3 30-Sep-2021  skrll Drive-by KNF
 1.2 30-Aug-2021  rin Add ARMEB support to {evb,}arm/marvell.

Combined with upcoming commit to dev/marvell, all peripheral devices
seem to work just fine for KUROBOX_PRO in big-endian mode.
 1.1 07-Jan-2017  kiyohara branches: 1.1.4; 1.1.6; 1.1.18;
Add support Marvell Dove.
Also <SoC>_intr_bootstrap() rename to <SoC>_bootstrap(). And SoC init func, getclk into that.
 1.1.18.2 03-Dec-2017  jdolecek update from HEAD
 1.1.18.1 07-Jan-2017  jdolecek file dove.c was added on branch tls-maxphys on 2017-12-03 11:35:54 +0000
 1.1.6.2 20-Mar-2017  pgoyette Sync with HEAD
 1.1.6.1 07-Jan-2017  pgoyette file dove.c was added on branch pgoyette-localcount on 2017-03-20 06:57:11 +0000
 1.1.4.2 05-Feb-2017  skrll Sync with HEAD
 1.1.4.1 07-Jan-2017  skrll file dove.c was added on branch nick-nhusb on 2017-02-05 13:40:04 +0000
 1.2 31-Oct-2022  andvar s/interrut/interrupt/ and s/accelelerator/accelerator/ in comments.
 1.1 07-Jan-2017  kiyohara branches: 1.1.4; 1.1.6; 1.1.18;
Add support Marvell Dove.
Also <SoC>_intr_bootstrap() rename to <SoC>_bootstrap(). And SoC init func, getclk into that.
 1.1.18.2 03-Dec-2017  jdolecek update from HEAD
 1.1.18.1 07-Jan-2017  jdolecek file dovereg.h was added on branch tls-maxphys on 2017-12-03 11:35:54 +0000
 1.1.6.2 20-Mar-2017  pgoyette Sync with HEAD
 1.1.6.1 07-Jan-2017  pgoyette file dovereg.h was added on branch pgoyette-localcount on 2017-03-20 06:57:11 +0000
 1.1.4.2 05-Feb-2017  skrll Sync with HEAD
 1.1.4.1 07-Jan-2017  skrll file dovereg.h was added on branch nick-nhusb on 2017-02-05 13:40:04 +0000
 1.18 07-Jan-2017  kiyohara Add support Marvell Dove.
Also <SoC>_intr_bootstrap() rename to <SoC>_bootstrap(). And SoC init func, getclk into that.
 1.17 03-Jun-2015  hsuenaga branches: 1.17.2;
add new cryptographic accelerator driver 'mvxpsec.'

this driver controls CESA unit as same as mvcesa, but uses DMA engines and
does CBC operations, HMAC operations by hardware. about 2 kbytes of data
are processed at one. supported algorithms are:

- DES-CBC, 3DES-CBC, AES-CBC
- HMAC-SHA1, HMAC-MD5

non-CBC algorithm such as AES-GCM is not supported by CESA's acceleration
engine. mvcesa is still useful to implement such algorithms as combination of
accelerated block cipher and software chaining.
 1.16 03-Jun-2015  hsuenaga separate buffer management codes 'mvxpbm.c' from if_mvxpe.c.

the buffer management(ex. fill the rx descriptors/buffers) is done by H/W in
ARMADA XP/380, and is done by S/W in ARMADA 370. the H/W BM support is not yet
implemented, so all devices use the S/W management mode at this time.
 1.15 03-Jun-2015  hsuenaga move Marvell ARMADA SoC's device driver definitions from arm/marvell
to dev/marvell.
 1.14 03-May-2015  hsuenaga add new ethernet driver mvxpe for recent MARVELL's SoC after ARMADA/XP.
this driver supports 'counter mode', and is disabled by default.

ARMADA SoC family has new ethernet controller acceleration mode called
'enhanced mode' or 'counter mode.' it seems that backward compatibility mode
used by if_mvgbe is still working, but the specification of the old mode
is completely disappeared from SoC's reference manual.

I tested the driver using MIRABOX(ARMADA/370).
 1.13 18-Mar-2014  matt branches: 1.13.6;
defflag MVSOC_CONSOLE_EARLY
 1.12 18-Mar-2014  matt Add MEMSIZE to opt_mvsoc.h
 1.11 18-Mar-2014  matt Move defparam opt_mvsoc.h to more appropriate place.
 1.10 30-Sep-2013  kiyohara Add ARMADAXP into opt_mvsoc.h.
And add mv78xx0.c. However not test long time.
 1.9 29-Aug-2013  kiyohara Fix build failed with ofppc.
Move 'attach mvspi at mvsoc' to arch/arm/marvell/files.marvell.
 1.8 29-May-2013  rkujawa branches: 1.8.2;
Add support for Armada XP PIC.

Obtained from Marvell, Semihalf.
 1.7 01-Aug-2012  kiyohara branches: 1.7.2;
Add mvsocts.
 1.6 27-Jul-2012  kiyohara Add mvcesa.
 1.5 19-Jun-2012  hans Add support for the watchdog timer in mvsoctmr.
Tested on DreamPlug system.
 1.4 12-Mar-2011  nonaka branches: 1.4.4; 1.4.10;
mvsoc needs pic_splfuncs.
 1.3 05-Mar-2011  matt branches: 1.3.2;
Add contributed Marvell Kirkwood RTC driver from Brett Slager
Fixes PR 44004
 1.2 06-Oct-2010  kiyohara branches: 1.2.2; 1.2.4; 1.2.6;
Comment-out mvcesa. It not exists now.
 1.1 03-Oct-2010  kiyohara Add support Marvell Sheeva Core and SoC. (Orion/Kirkwood)
Discovery Innovation not yet.
 1.2.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.2.4.2 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.2.4.1 06-Oct-2010  uebayasi file files.marvell was added on branch uebayasi-xip on 2010-10-22 09:23:11 +0000
 1.2.2.2 09-Oct-2010  yamt sync with head
 1.2.2.1 06-Oct-2010  yamt file files.marvell was added on branch yamt-nfs-mp on 2010-10-09 03:31:39 +0000
 1.3.2.4 21-Apr-2011  rmind sync with head
 1.3.2.3 06-Mar-2011  rmind sync with head (and fix few botches with this)
 1.3.2.2 05-Mar-2011  rmind sync with head
 1.3.2.1 05-Mar-2011  rmind file files.marvell was added on branch rmind-uvmplock on 2011-03-05 20:49:37 +0000
 1.4.10.1 13-Jan-2013  bouyer Pull up following revision(s) (requested by riz in ticket #770):
sys/arch/arm/marvell/files.marvell: revision 1.5
sys/arch/arm/marvell/mvsoctmr.c: revision 1.4
sys/arch/arm/marvell/mvsoctmr.c: revision 1.5
sys/arch/arm/marvell/mvsoctmr.c: revision 1.6
sys/arch/arm/marvell/mvsoctmr.c: revision 1.7
Add support for the watchdog timer in mvsoctmr.
Tested on DreamPlug system.
When disabling watchdog timer, do not set the counter to 0.
Having the watchdog counter at 0 and having WDRstOutEn set to 1 causes
immediate watchdog reset on my 88F5182 A2.
Remove duplicate global variable.
The maximum watchdog period is dependant on mvTclk; calculate at runtime.
This gets the maximum period up to 25 seconds at 166⅔MHz mvTclk.
 1.4.4.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.4.4.1 30-Oct-2012  yamt sync with head
 1.7.2.3 03-Dec-2017  jdolecek update from HEAD
 1.7.2.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.7.2.1 23-Jun-2013  tls resync from head
 1.8.2.1 18-May-2014  rmind sync with head
 1.13.6.2 05-Feb-2017  skrll Sync with HEAD
 1.13.6.1 06-Jun-2015  skrll Sync with HEAD
 1.17.2.1 20-Mar-2017  pgoyette Sync with HEAD
 1.11 30-Aug-2021  rin Add ARMEB support to {evb,}arm/marvell.

Combined with upcoming commit to dev/marvell, all peripheral devices
seem to work just fine for KUROBOX_PRO in big-endian mode.
 1.10 07-Jan-2017  kiyohara Add support Marvell Dove.
Also <SoC>_intr_bootstrap() rename to <SoC>_bootstrap(). And SoC init func, getclk into that.
 1.9 11-Mar-2014  martin branches: 1.9.6; 1.9.10;
Mark a diagnostic only variable
 1.8 23-Dec-2013  kiyohara Support to check the clock gating for Armada XP in armadaxp.c.
Also move the checking for clock gate of Kirkwood into kirkwood.c.
 1.7 06-Sep-2012  msaitoh branches: 1.7.2; 1.7.4;
Add missing ','
It will fix a bug that "vmstat -e" shows the incorrect counts in wrong entries.
 1.6 18-Jul-2012  kiyohara Add 88F6282.
Also fix/add some clock parameters.
 1.5 18-Jul-2012  kiyohara Fix always check high. macro KIRKWOOD_IRQ_* means bit number. HIGH is bit0.
 1.4 24-May-2011  matt branches: 1.4.4; 1.4.10;
Merge in the patch in PR/44965 with some improvements (removing ifs when
possible).
 1.3 22-May-2011  mellon Add support for Dreamplug CPU clock speed detection.
 1.2 30-Oct-2010  kiyohara branches: 1.2.2; 1.2.6;
Fix mvPclk. Need 'break' each 'case'.
 1.1 03-Oct-2010  kiyohara branches: 1.1.2; 1.1.4;
Add support Marvell Sheeva Core and SoC. (Orion/Kirkwood)
Discovery Innovation not yet.
 1.1.4.3 06-Nov-2010  uebayasi Sync with HEAD.
 1.1.4.2 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.1.4.1 03-Oct-2010  uebayasi file kirkwood.c was added on branch uebayasi-xip on 2010-10-22 09:23:11 +0000
 1.1.2.2 09-Oct-2010  yamt sync with head
 1.1.2.1 03-Oct-2010  yamt file kirkwood.c was added on branch yamt-nfs-mp on 2010-10-09 03:31:40 +0000
 1.2.6.3 31-May-2011  rmind sync with head
 1.2.6.2 05-Mar-2011  rmind sync with head
 1.2.6.1 30-Oct-2010  rmind file kirkwood.c was added on branch rmind-uvmplock on 2011-03-05 20:49:37 +0000
 1.2.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.4.10.2 23-Oct-2012  riz Pull up following revision(s) (requested by msaitoh in ticket #620):
sys/arch/arm/marvell/kirkwood.c: revision 1.7
Add missing ','
It will fix a bug that "vmstat -e" shows the incorrect counts in wrong
entries.
 1.4.10.1 20-Oct-2012  riz Pull up following revision(s) (requested by msaitoh in ticket #609):
sys/arch/arm/marvell/kirkwood.c: revision 1.5
Fix always check high. macro KIRKWOOD_IRQ_* means bit number. HIGH is
bit0.
 1.4.4.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.4.4.1 30-Oct-2012  yamt sync with head
 1.7.4.1 18-May-2014  rmind sync with head
 1.7.2.2 03-Dec-2017  jdolecek update from HEAD
 1.7.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.9.10.1 20-Mar-2017  pgoyette Sync with HEAD
 1.9.6.1 05-Feb-2017  skrll Sync with HEAD
 1.7 31-Oct-2022  andvar s/interrut/interrupt/ and s/accelelerator/accelerator/ in comments.
 1.6 23-Dec-2013  kiyohara Fixup model value for Kirkwood 88F6192.
Thanks for lwazidub at gmail com.
Add some KIRKWOOD_MISC_* Registers.
s/AUDIOSDIO/AUDIO/.
 1.5 28-Sep-2013  kiyohara Change address/size of CESA Registers.
 1.4 01-Aug-2012  kiyohara branches: 1.4.2; 1.4.4;
Add Thermal Sensor for Kirkwood(88F6282). tested only OpenBlockS A6.
 1.3 21-Jul-2012  kiyohara Add some comments of 88F6282 and TWSI column.
Add IRQ and BASE for TWSI1.
 1.2 18-Jul-2012  kiyohara Add attributes, irqs and base-address for PEX1.
 1.1 03-Oct-2010  kiyohara branches: 1.1.2; 1.1.4; 1.1.10; 1.1.14;
Add support Marvell Sheeva Core and SoC. (Orion/Kirkwood)
Discovery Innovation not yet.
 1.1.14.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1.14.1 30-Oct-2012  yamt sync with head
 1.1.10.2 05-Mar-2011  rmind sync with head
 1.1.10.1 03-Oct-2010  rmind file kirkwoodreg.h was added on branch rmind-uvmplock on 2011-03-05 20:49:37 +0000
 1.1.4.2 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.1.4.1 03-Oct-2010  uebayasi file kirkwoodreg.h was added on branch uebayasi-xip on 2010-10-22 09:23:11 +0000
 1.1.2.2 09-Oct-2010  yamt sync with head
 1.1.2.1 03-Oct-2010  yamt file kirkwoodreg.h was added on branch yamt-nfs-mp on 2010-10-09 03:31:40 +0000
 1.4.4.1 18-May-2014  rmind sync with head
 1.4.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3 30-Aug-2021  rin Add ARMEB support to {evb,}arm/marvell.

Combined with upcoming commit to dev/marvell, all peripheral devices
seem to work just fine for KUROBOX_PRO in big-endian mode.
 1.2 07-Jan-2017  kiyohara Add support Marvell Dove.
Also <SoC>_intr_bootstrap() rename to <SoC>_bootstrap(). And SoC init func, getclk into that.
 1.1 30-Sep-2013  kiyohara branches: 1.1.4; 1.1.6; 1.1.10; 1.1.12; 1.1.16;
Add mv78xx0 support. However not test long time.
 1.1.16.1 20-Mar-2017  pgoyette Sync with HEAD
 1.1.12.1 05-Feb-2017  skrll Sync with HEAD
 1.1.10.3 03-Dec-2017  jdolecek update from HEAD
 1.1.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.10.1 30-Sep-2013  tls file mv78xx0.c was added on branch tls-maxphys on 2014-08-20 00:02:47 +0000
 1.1.6.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1.6.1 30-Sep-2013  yamt file mv78xx0.c was added on branch yamt-pagecache on 2014-05-22 11:39:33 +0000
 1.1.4.2 18-May-2014  rmind sync with head
 1.1.4.1 30-Sep-2013  rmind file mv78xx0.c was added on branch rmind-smpnet on 2014-05-18 17:44:58 +0000
 1.3 31-Oct-2022  andvar s/interrut/interrupt/ and s/accelelerator/accelerator/ in comments.
 1.2 30-Sep-2013  kiyohara Change some defines.
 1.1 03-Oct-2010  kiyohara branches: 1.1.2; 1.1.4; 1.1.10; 1.1.14; 1.1.24; 1.1.28;
Add support Marvell Sheeva Core and SoC. (Orion/Kirkwood)
Discovery Innovation not yet.
 1.1.28.1 18-May-2014  rmind sync with head
 1.1.24.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.14.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1.10.2 05-Mar-2011  rmind sync with head
 1.1.10.1 03-Oct-2010  rmind file mv78xx0reg.h was added on branch rmind-uvmplock on 2011-03-05 20:49:37 +0000
 1.1.4.2 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.1.4.1 03-Oct-2010  uebayasi file mv78xx0reg.h was added on branch uebayasi-xip on 2010-10-22 09:23:11 +0000
 1.1.2.2 09-Oct-2010  yamt sync with head
 1.1.2.1 03-Oct-2010  yamt file mv78xx0reg.h was added on branch yamt-nfs-mp on 2010-10-09 03:31:40 +0000
 1.33 19-Jun-2023  msaitoh Fix typo. unknwon -> unknown
 1.32 30-Aug-2021  rin Add ARMEB support to {evb,}arm/marvell.

Combined with upcoming commit to dev/marvell, all peripheral devices
seem to work just fine for KUROBOX_PRO in big-endian mode.
 1.31 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.30 24-Apr-2021  thorpej branches: 1.30.8;
Merge thorpej-cfargs branch:

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

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

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

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

...and a sentinel value CFARG_EOL.

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

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.29 10-Mar-2017  skrll branches: 1.29.28;
Initialise the windows and allow access to PCI Express port 1 first lane.

Allows xhci(4) to attach in the MV78230 based Lenovo ix4-300d

mvpex1 at mvsoc0 unit 4 offset 0x80000-0x81fff irq 62: Marvell PCI Express Interface
pci1 at mvpex1
xhci0 at pci1 dev 1 function 0: vendor 1033 product 0194 (rev. 0x04)
xhci0: interrupting at interrupt pin INTA#
usb3 at xhci0: USB revision 3.0
usb4 at xhci0: USB revision 2.0
 1.28 24-Feb-2017  skrll Typo in a model string
 1.27 09-Jan-2017  kiyohara branches: 1.27.2;
Remove no-need #ifdef MARVELL_ATTR_AXI_DDR. It has defined.
 1.26 07-Jan-2017  christos make this compile (but not work) XXX
 1.25 07-Jan-2017  kiyohara Add support Marvell Dove.
Also <SoC>_intr_bootstrap() rename to <SoC>_bootstrap(). And SoC init func, getclk into that.
 1.24 06-Nov-2015  kiyohara branches: 1.24.2;
Add mvsocts to mvsoc_periph for Armada XP.
 1.23 03-Jun-2015  hsuenaga add new cryptographic accelerator driver 'mvxpsec.'

this driver controls CESA unit as same as mvcesa, but uses DMA engines and
does CBC operations, HMAC operations by hardware. about 2 kbytes of data
are processed at one. supported algorithms are:

- DES-CBC, 3DES-CBC, AES-CBC
- HMAC-SHA1, HMAC-MD5

non-CBC algorithm such as AES-GCM is not supported by CESA's acceleration
engine. mvcesa is still useful to implement such algorithms as combination of
accelerated block cipher and software chaining.
 1.22 03-Jun-2015  hsuenaga separate buffer management codes 'mvxpbm.c' from if_mvxpe.c.

the buffer management(ex. fill the rx descriptors/buffers) is done by H/W in
ARMADA XP/380, and is done by S/W in ARMADA 370. the H/W BM support is not yet
implemented, so all devices use the S/W management mode at this time.
 1.21 03-Jun-2015  hsuenaga dump Mbus settins on boot if AV_VERBOSE or AV_DEBUG is enabled.
 1.20 11-May-2015  hsuenaga add MARVELL Armada XP MV78260 B0(rev.2)
recent OpenBlocks AX3 uses it.
 1.19 03-May-2015  hsuenaga add new ethernet driver mvxpe for recent MARVELL's SoC after ARMADA/XP.
this driver supports 'counter mode', and is disabled by default.

ARMADA SoC family has new ethernet controller acceleration mode called
'enhanced mode' or 'counter mode.' it seems that backward compatibility mode
used by if_mvgbe is still working, but the specification of the old mode
is completely disappeared from SoC's reference manual.

I tested the driver using MIRABOX(ARMADA/370).
 1.18 15-Mar-2014  kiyohara branches: 1.18.6;
Support Armada 370.
 1.17 17-Feb-2014  kiyohara Support MARVELL_TAG_DDR3_CS[0-3].
 1.16 23-Dec-2013  kiyohara Support to check the clock gating for Armada XP in armadaxp.c.
Also move the checking for clock gate of Kirkwood into kirkwood.c.
 1.15 23-Dec-2013  kiyohara Move Misc Registers from mvsocreg.h to armadaxpreg.h. These registers only
Armada XP. The misc_base initializes in initarm() instead of mvsoc_bootstrap().
 1.14 23-Dec-2013  kiyohara Fixup model value for Kirkwood 88F6192.
Thanks for lwazidub at gmail com.
Add some KIRKWOOD_MISC_* Registers.
s/AUDIOSDIO/AUDIO/.
 1.13 30-Sep-2013  kiyohara Remove #ifdef ARMADAXP. It is OK !ARMADAXP.
Add some ARMADAXP devices to peripheral list.
And sort and reorder list.
 1.12 03-Jun-2013  rkujawa branches: 1.12.2;
Add support for SDIO on Armada XP.
 1.11 29-May-2013  rkujawa Add support for mvsoc-based Armada XP peripherals.

Obtained from Marvell, Semihalf.
 1.10 19-Oct-2012  msaitoh Add CLKGATING_BIT for some devices. This change prevent some boards
that a device's clock is stopped from hangup.
 1.9 10-Aug-2012  matt branches: 1.9.2;
Add MVSOC_CONSOLE_EARLY option to get a com console as soon as initarm
is entered.
 1.8 01-Aug-2012  kiyohara Add Thermal Sensor for Kirkwood(88F6282). tested only OpenBlockS A6.
 1.7 23-Jul-2012  kiyohara Enable idmac.
 1.6 21-Jul-2012  kiyohara Add 88F6282 parameters.
Use MVSOC_UNITID_PEX instead of {ORION,KIRKWOOD}_UNITID_PEX. This PEX UNITID is generic UNITID for MVSoC maybe.
 1.5 12-Feb-2012  matt branches: 1.5.2;
Change old-style function defintions to C89 prototypes.

Approved by releng.
 1.4 21-Sep-2011  reinoud branches: 1.4.2; 1.4.6;
Add revision 3/A1 of the KIRKWOOD

{ KIRKWOOD(88F6192), 3, "88F619x", "A1", "Kirkwood" },
 1.3 30-Jul-2011  jakllsch Add interrupt info for 88F5182 gtidmac(4) and uncomment.
 1.2 05-Mar-2011  matt branches: 1.2.2;
Add contributed Marvell Kirkwood RTC driver from Brett Slager
Fixes PR 44004
 1.1 03-Oct-2010  kiyohara branches: 1.1.2; 1.1.4; 1.1.6;
Add support Marvell Sheeva Core and SoC. (Orion/Kirkwood)
Discovery Innovation not yet.
 1.1.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.1.4.2 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.1.4.1 03-Oct-2010  uebayasi file mvsoc.c was added on branch uebayasi-xip on 2010-10-22 09:23:11 +0000
 1.1.2.2 09-Oct-2010  yamt sync with head
 1.1.2.1 03-Oct-2010  yamt file mvsoc.c was added on branch yamt-nfs-mp on 2010-10-09 03:31:40 +0000
 1.2.2.3 06-Mar-2011  rmind sync with head (and fix few botches with this)
 1.2.2.2 05-Mar-2011  rmind sync with head
 1.2.2.1 05-Mar-2011  rmind file mvsoc.c was added on branch rmind-uvmplock on 2011-03-05 20:49:37 +0000
 1.4.6.1 18-Feb-2012  mrg merge to -current.
 1.4.2.3 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.4.2.2 30-Oct-2012  yamt sync with head
 1.4.2.1 17-Apr-2012  yamt sync with head
 1.5.2.1 11-Dec-2012  riz sys/arch/arm/marvell/mvsoc.c patch
sys/arch/arm/marvell/mvsocreg.h patch

Add CLKGATING_BIT, enable it for some 88F6281 devices, and don't
configure devices if their clock is disabled.
[msaitoh, ticket #737]
 1.9.2.4 03-Dec-2017  jdolecek update from HEAD
 1.9.2.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.9.2.2 23-Jun-2013  tls resync from head
 1.9.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.12.2.1 18-May-2014  rmind sync with head
 1.18.6.4 28-Aug-2017  skrll Sync with HEAD
 1.18.6.3 05-Feb-2017  skrll Sync with HEAD
 1.18.6.2 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.18.6.1 06-Jun-2015  skrll Sync with HEAD
 1.24.2.1 20-Mar-2017  pgoyette Sync with HEAD
 1.27.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.29.28.2 22-Mar-2021  thorpej Audit CFARG_IATTR in config_found() calls, and remove it in situations
where the interface attribute is not ambiguous.
 1.29.28.1 22-Mar-2021  thorpej Mechanical conversion of config_found_sm_loc() -> config_found().
CFARG_IATTR usage needs to be audited.
 1.30.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.3 18-Sep-2012  matt Add bounce buffer support for ARM bus_dma(9). Add macros to help initialize
bus_dma_tag structures.
 1.2 01-Jul-2011  dyoung branches: 1.2.2; 1.2.12;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.1 03-Oct-2010  kiyohara branches: 1.1.2; 1.1.4; 1.1.10;
Add support Marvell Sheeva Core and SoC. (Orion/Kirkwood)
Discovery Innovation not yet.
 1.1.10.2 05-Mar-2011  rmind sync with head
 1.1.10.1 03-Oct-2010  rmind file mvsoc_dma.c was added on branch rmind-uvmplock on 2011-03-05 20:49:37 +0000
 1.1.4.2 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.1.4.1 03-Oct-2010  uebayasi file mvsoc_dma.c was added on branch uebayasi-xip on 2010-10-22 09:23:11 +0000
 1.1.2.2 09-Oct-2010  yamt sync with head
 1.1.2.1 03-Oct-2010  yamt file mvsoc_dma.c was added on branch yamt-nfs-mp on 2010-10-09 03:31:40 +0000
 1.2.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.2.2.1 30-Oct-2012  yamt sync with head
 1.9 22-Feb-2014  martin Explicitly include armreg.h (for the interrupt enable bit)
 1.8 20-Nov-2013  kiyohara Support __HAVE_PIC_SET_PRIORITY for Armada XP.
 1.7 30-Sep-2013  kiyohara Reorder include opt_mvsoc.h.
 1.6 29-May-2013  rkujawa branches: 1.6.2;
Add support for mvsoc-based Armada XP peripherals.

Obtained from Marvell, Semihalf.
 1.5 29-Jul-2012  matt branches: 1.5.2;
Fix more -fno-common fallout.
Move more variables to common locations.
 1.4 22-Jul-2012  jakllsch Use IST_LEVEL_HIGH for the ist argument to intr_establish() (as is done in
marvell_intr_establish() and other relevant places) instead of 0 in
mvsoc_bridge_intr_establish(). This IST argument isn't used anywhere,
but it looks better this way.
 1.3 13-Aug-2011  jakllsch branches: 1.3.2;
In *find_pending_irqs() return the value of pic_mark_pending_sources() instead
of 1. Changed to match other ARM PIC code.
 1.2 20-Dec-2010  matt branches: 1.2.6;
Move counting of faults, traps, intrs, soft[intr]s, syscalls, and nswtch
from uvmexp to per-cpu cpu_data and move them to 64bits. Remove unneeded
includes of <uvm/uvm_extern.h> and/or <uvm/uvm.h>.
 1.1 03-Oct-2010  kiyohara branches: 1.1.2; 1.1.4;
Add support Marvell Sheeva Core and SoC. (Orion/Kirkwood)
Discovery Innovation not yet.
 1.1.4.2 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.1.4.1 03-Oct-2010  uebayasi file mvsoc_intr.c was added on branch uebayasi-xip on 2010-10-22 09:23:11 +0000
 1.1.2.2 09-Oct-2010  yamt sync with head
 1.1.2.1 03-Oct-2010  yamt file mvsoc_intr.c was added on branch yamt-nfs-mp on 2010-10-09 03:31:40 +0000
 1.2.6.2 05-Mar-2011  rmind sync with head
 1.2.6.1 20-Dec-2010  rmind file mvsoc_intr.c was added on branch rmind-uvmplock on 2011-03-05 20:49:37 +0000
 1.3.2.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.3.2.1 30-Oct-2012  yamt sync with head
 1.5.2.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.5.2.1 23-Jun-2013  tls resync from head
 1.6.2.1 18-May-2014  rmind sync with head
 1.9 13-Jul-2023  riastradh marvell: Reconcile arm vs powerpc marvell_intr_establish.

If there's a better way to do this without #ifdef __powerpc__, please
have at it!
 1.8 25-Jun-2022  jmcneill branches: 1.8.4;
Remove GIC_SPLFUNCS.
 1.7 24-Sep-2021  skrll Catch up with spl changes.

It's 2021 and ugly is in (with apologies to PWEI)
 1.6 03-Jun-2015  hsuenaga dump Mbus settins on boot if AV_VERBOSE or AV_DEBUG is enabled.
 1.5 08-Apr-2015  matt Add __HAVE_PIC_HAVE_PENDING_INTRS and define it if __HAVE_PIC_SET_PRIORITY
is undefined (also define in mvsoc_intr.h since their use of the latter is
peculiar). This new define controls whether the pending interrupt logic is
compiled. The GIC doesn't use pending interrupts since it uses the priority
level on the GIC to control delivery of interrupts, thus there can never
be a pending interrupt. The kernel shrinks about 4KB with the removal of
the pending interupt support,
 1.4 18-Mar-2014  matt branches: 1.4.4; 1.4.6;
Only include "opt_mvsoc.h" if _INTR_PRIVATE is defined.
 1.3 20-Nov-2013  kiyohara Support __HAVE_PIC_SET_PRIORITY for Armada XP.
 1.2 29-Jul-2012  matt branches: 1.2.2; 1.2.4;
Fix more -fno-common fallout.
Move more variables to common locations.
 1.1 03-Oct-2010  kiyohara branches: 1.1.2; 1.1.4; 1.1.10; 1.1.14;
Add support Marvell Sheeva Core and SoC. (Orion/Kirkwood)
Discovery Innovation not yet.
 1.1.14.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1.14.1 30-Oct-2012  yamt sync with head
 1.1.10.2 05-Mar-2011  rmind sync with head
 1.1.10.1 03-Oct-2010  rmind file mvsoc_intr.h was added on branch rmind-uvmplock on 2011-03-05 20:49:37 +0000
 1.1.4.2 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.1.4.1 03-Oct-2010  uebayasi file mvsoc_intr.h was added on branch uebayasi-xip on 2010-10-22 09:23:11 +0000
 1.1.2.2 09-Oct-2010  yamt sync with head
 1.1.2.1 03-Oct-2010  yamt file mvsoc_intr.h was added on branch yamt-nfs-mp on 2010-10-09 03:31:40 +0000
 1.2.4.1 18-May-2014  rmind sync with head
 1.2.2.2 03-Dec-2017  jdolecek update from HEAD
 1.2.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.6.1 06-Jun-2015  skrll Sync with HEAD
 1.4.4.1 30-Jul-2015  martin Pull up following revision(s) (requested by skrll in ticket #890):
sys/arch/arm/pic/pic.c: revision 1.27-1.32
sys/arch/arm/omap/omap5430_intr.h: revision 1.3
sys/arch/arm/broadcom/bcm2835_obio.c: revision 1.25
sys/arch/arm/cortex/gic.c: revision 1.18
sys/arch/arm/broadcom/bcm2835reg.h: revision 1.15
sys/arch/evbarm/rpi/rpi_machdep.c: revision 1.61
sys/arch/arm/broadcom/bcm2835_intr.h: revision 1.2
sys/arch/arm/marvell/mvsoc_intr.h: revision 1.5
sys/arch/arm/broadcom/bcm2835_intr.c: revision 1.8-1.10
sys/arch/arm/pic/picvar.h: revision 1.12-1.14
sys/arch/arm/omap/omap4430_intr.h: revision 1.3

Don't clear CI_ASTPENDING in exception return, do it in ast() instead.
Add basic support for __HAVE_PREEMPTION.
Use atomic ops for ci_astpending if __HAVE_PREEMPTION is defined.
Use kpreempt_disable/kpreempt_enable
Add __HAVE_PIC_HAVE_PENDING_INTRS and define it if __HAVE_PIC_SET_PRIORITY
is undefined (also define in mvsoc_intr.h since their use of the latter is
peculiar). This new define controls whether the pending interrupt logic is
compiled. The GIC doesn't use pending interrupts since it uses the priority
level on the GIC to control delivery of interrupts, thus there can never
be a pending interrupt. The kernel shrinks about 4KB with the removal of
the pending interupt support,
Only if we __HAVE_PIC_PENDING_INTRS do we need the variables to track them.
Add #define __HAVE_PIC_PENDING_INTRS for the non-GIC PICs.
Add a pic_cpus to the softc which specifies which cpus the pic can send
IPIs to. For GIC, initialize pic_cpus to kcpuset_running since it can handle
all the cpus.
Adapt pic to deal with the BCM2836 interrupts.
Move pic_pending_pics, pic_pending_ipls, and pic_blocked_irqs into a
structure and make then per-cpu. There is no global interrupt state anymore.
Use right kcpuset call.
Don't need pic_ipi_sender anymore.
Don't send IPIs to ourselves if sending to everyone.
RPI2 MP support.
Thanks to Matt Thomas for making this possible with his changes to pic.c
Use a bit per IPI type in local mailbox 0 registers. Ok matt@
IPIs should be IPL_HIGH according to rmind@
Fix bcm2836mp_pic_{un,}block_irqs to handle timer AND mailbox interrupts
if they're both passed. Thanks to nat@ for finding this.
Sprinkle some KASSERTs
 1.8.4.1 11-Aug-2023  martin Additionall pull up following revision(s) (requested by riastradh in ticket #316):

sys/dev/marvell/marvellvar.h: revision 1.7
sys/arch/arm/marvell/mvsoc_intr.h: revision 1.9

marvell: Reconcile arm vs powerpc marvell_intr_establish.

If there's a better way to do this without #ifdef __powerpc__, please
have at it!
 1.2 20-Nov-2020  thorpej malloc(9) -> kmem(9)
 1.1 07-Jan-2017  kiyohara branches: 1.1.4; 1.1.6; 1.1.18; 1.1.34;
Add support Marvell Dove.
Also <SoC>_intr_bootstrap() rename to <SoC>_bootstrap(). And SoC init func, getclk into that.
 1.1.34.1 14-Dec-2020  thorpej Sync w/ HEAD.
 1.1.18.2 03-Dec-2017  jdolecek update from HEAD
 1.1.18.1 07-Jan-2017  jdolecek file mvsoc_sdhc.c was added on branch tls-maxphys on 2017-12-03 11:35:54 +0000
 1.1.6.2 20-Mar-2017  pgoyette Sync with HEAD
 1.1.6.1 07-Jan-2017  pgoyette file mvsoc_sdhc.c was added on branch pgoyette-localcount on 2017-03-20 06:57:11 +0000
 1.1.4.2 05-Feb-2017  skrll Sync with HEAD
 1.1.4.1 07-Jan-2017  skrll file mvsoc_sdhc.c was added on branch nick-nhusb on 2017-02-05 13:40:04 +0000
 1.12 23-May-2022  andvar s/controll/control/ in comments.
 1.11 30-Aug-2021  rin Add ARMEB support to {evb,}arm/marvell.

Combined with upcoming commit to dev/marvell, all peripheral devices
seem to work just fine for KUROBOX_PRO in big-endian mode.
 1.10 16-Mar-2018  ryo use designated initializer to make adaptability and flexibility for changing struct bus_space.
no functional change.
 1.9 10-Mar-2017  skrll branches: 1.9.12;
Initialise the windows and allow access to PCI Express port 1 first lane.

Allows xhci(4) to attach in the MV78230 based Lenovo ix4-300d

mvpex1 at mvsoc0 unit 4 offset 0x80000-0x81fff irq 62: Marvell PCI Express Interface
pci1 at mvpex1
xhci0 at pci1 dev 1 function 0: vendor 1033 product 0194 (rev. 0x04)
xhci0: interrupting at interrupt pin INTA#
usb3 at xhci0: USB revision 3.0
usb4 at xhci0: USB revision 2.0
 1.8 07-Jan-2017  kiyohara branches: 1.8.2;
Add support Marvell Dove.
Also <SoC>_intr_bootstrap() rename to <SoC>_bootstrap(). And SoC init func, getclk into that.
 1.7 22-Feb-2014  matt branches: 1.7.6; 1.7.10;
Don't manipulate the pte to get uncached memory, use PMAP_NOCACHE instead.
Convert footbring to kenter_pa/kremove
 1.6 29-May-2013  rkujawa branches: 1.6.2;
Add support for mvsoc-based Armada XP peripherals.

Obtained from Marvell, Semihalf.
 1.5 28-Jul-2012  matt branches: 1.5.2;
Add a few missing commas.
 1.4 18-Jul-2012  kiyohara Add bus-space-tags for PEX1 of Kirkwood. But not test.
 1.3 15-Jul-2012  matt Add stream methods
 1.2 01-Jul-2011  dyoung branches: 1.2.2;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.1 03-Oct-2010  kiyohara branches: 1.1.2; 1.1.4; 1.1.10;
Add support Marvell Sheeva Core and SoC. (Orion/Kirkwood)
Discovery Innovation not yet.
 1.1.10.2 05-Mar-2011  rmind sync with head
 1.1.10.1 03-Oct-2010  rmind file mvsoc_space.c was added on branch rmind-uvmplock on 2011-03-05 20:49:37 +0000
 1.1.4.2 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.1.4.1 03-Oct-2010  uebayasi file mvsoc_space.c was added on branch uebayasi-xip on 2010-10-22 09:23:12 +0000
 1.1.2.2 09-Oct-2010  yamt sync with head
 1.1.2.1 03-Oct-2010  yamt file mvsoc_space.c was added on branch yamt-nfs-mp on 2010-10-09 03:31:40 +0000
 1.2.2.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.2.2.1 30-Oct-2012  yamt sync with head
 1.5.2.3 03-Dec-2017  jdolecek update from HEAD
 1.5.2.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.5.2.1 23-Jun-2013  tls resync from head
 1.6.2.1 18-May-2014  rmind sync with head
 1.7.10.1 20-Mar-2017  pgoyette Sync with HEAD
 1.7.6.2 28-Aug-2017  skrll Sync with HEAD
 1.7.6.1 05-Feb-2017  skrll Sync with HEAD
 1.8.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.9.12.1 22-Mar-2018  pgoyette Synch with HEAD, resolve conflicts
 1.9 19-Jun-2023  msaitoh Fix typo. unknwon -> unknown
 1.8 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.7 24-Apr-2021  thorpej branches: 1.7.8;
Merge thorpej-cfargs branch:

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

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

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

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

...and a sentinel value CFARG_EOL.

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

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.6 28-Jan-2014  martin branches: 1.6.44;
Remove an unused variable
 1.5 21-Nov-2012  msaitoh branches: 1.5.2;
Fix a uvm_fault panic that memory is not allocated for the last few GPIO bits.
 1.4 10-Sep-2012  msaitoh branches: 1.4.2;
Fix a bug that the irq_masks of GPIO are incorrectly set on Marvell SoCs.
 1.3 13-Aug-2011  jakllsch branches: 1.3.2; 1.3.8;
In *find_pending_irqs() return the value of pic_mark_pending_sources() instead
of 1. Changed to match other ARM PIC code.
 1.2 24-Jan-2011  jakllsch branches: 1.2.2;
Capture more initial GPIO state.
Also, fix behaviour if the number of GPIOs exceed 32.
 1.1 03-Oct-2010  kiyohara branches: 1.1.2; 1.1.4; 1.1.6; 1.1.8;
Add support Marvell Sheeva Core and SoC. (Orion/Kirkwood)
Discovery Innovation not yet.
 1.1.8.1 08-Feb-2011  bouyer Sync with HEAD
 1.1.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.1.4.2 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.1.4.1 03-Oct-2010  uebayasi file mvsocgpp.c was added on branch uebayasi-xip on 2010-10-22 09:23:12 +0000
 1.1.2.2 09-Oct-2010  yamt sync with head
 1.1.2.1 03-Oct-2010  yamt file mvsocgpp.c was added on branch yamt-nfs-mp on 2010-10-09 03:31:40 +0000
 1.2.2.2 05-Mar-2011  rmind sync with head
 1.2.2.1 24-Jan-2011  rmind file mvsocgpp.c was added on branch rmind-uvmplock on 2011-03-05 20:49:37 +0000
 1.3.8.2 24-Nov-2012  jdc Pull up revision 1.5 (requested by msaitoh in ticket #713).

Fix a uvm_fault panic that memory is not allocated for the last few GPIO bits.
 1.3.8.1 23-Oct-2012  riz Pull up following revision(s) (requested by msaitoh in ticket #623):
sys/arch/arm/marvell/mvsocgpp.c: revision 1.4
Fix a bug that the irq_masks of GPIO are set on Marvell SoCs.
 1.3.2.3 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.3.2.2 16-Jan-2013  yamt sync with (a bit old) head
 1.3.2.1 30-Oct-2012  yamt sync with head
 1.4.2.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.2.1 25-Feb-2013  tls resync with head
 1.5.2.1 18-May-2014  rmind sync with head
 1.6.44.1 23-Mar-2021  thorpej Convert config_found_ia() call sites where the device only carries
a single interface attribute to bare config_found() calls.
 1.7.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.1 03-Oct-2010  kiyohara branches: 1.1.2; 1.1.4; 1.1.10;
Add support Marvell Sheeva Core and SoC. (Orion/Kirkwood)
Discovery Innovation not yet.
 1.1.10.2 05-Mar-2011  rmind sync with head
 1.1.10.1 03-Oct-2010  rmind file mvsocgppreg.h was added on branch rmind-uvmplock on 2011-03-05 20:49:37 +0000
 1.1.4.2 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.1.4.1 03-Oct-2010  uebayasi file mvsocgppreg.h was added on branch uebayasi-xip on 2010-10-22 09:23:12 +0000
 1.1.2.2 09-Oct-2010  yamt sync with head
 1.1.2.1 03-Oct-2010  yamt file mvsocgppreg.h was added on branch yamt-nfs-mp on 2010-10-09 03:31:40 +0000
 1.1 03-Oct-2010  kiyohara branches: 1.1.2; 1.1.4; 1.1.10;
Add support Marvell Sheeva Core and SoC. (Orion/Kirkwood)
Discovery Innovation not yet.
 1.1.10.2 05-Mar-2011  rmind sync with head
 1.1.10.1 03-Oct-2010  rmind file mvsocgppvar.h was added on branch rmind-uvmplock on 2011-03-05 20:49:37 +0000
 1.1.4.2 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.1.4.1 03-Oct-2010  uebayasi file mvsocgppvar.h was added on branch uebayasi-xip on 2010-10-22 09:23:12 +0000
 1.1.2.2 09-Oct-2010  yamt sync with head
 1.1.2.1 03-Oct-2010  yamt file mvsocgppvar.h was added on branch yamt-nfs-mp on 2010-10-09 03:31:40 +0000
 1.1 07-Jan-2017  kiyohara branches: 1.1.4; 1.1.6; 1.1.18;
Add support Marvell Dove.
Also <SoC>_intr_bootstrap() rename to <SoC>_bootstrap(). And SoC init func, getclk into that.
 1.1.18.2 03-Dec-2017  jdolecek update from HEAD
 1.1.18.1 07-Jan-2017  jdolecek file mvsocpmu.c was added on branch tls-maxphys on 2017-12-03 11:35:54 +0000
 1.1.6.2 20-Mar-2017  pgoyette Sync with HEAD
 1.1.6.1 07-Jan-2017  pgoyette file mvsocpmu.c was added on branch pgoyette-localcount on 2017-03-20 06:57:11 +0000
 1.1.4.2 05-Feb-2017  skrll Sync with HEAD
 1.1.4.1 07-Jan-2017  skrll file mvsocpmu.c was added on branch nick-nhusb on 2017-02-05 13:40:04 +0000
 1.1 07-Jan-2017  kiyohara branches: 1.1.4; 1.1.6; 1.1.18;
Add support Marvell Dove.
Also <SoC>_intr_bootstrap() rename to <SoC>_bootstrap(). And SoC init func, getclk into that.
 1.1.18.2 03-Dec-2017  jdolecek update from HEAD
 1.1.18.1 07-Jan-2017  jdolecek file mvsocpmuvar.h was added on branch tls-maxphys on 2017-12-03 11:35:54 +0000
 1.1.6.2 20-Mar-2017  pgoyette Sync with HEAD
 1.1.6.1 07-Jan-2017  pgoyette file mvsocpmuvar.h was added on branch pgoyette-localcount on 2017-03-20 06:57:11 +0000
 1.1.4.2 05-Feb-2017  skrll Sync with HEAD
 1.1.4.1 07-Jan-2017  skrll file mvsocpmuvar.h was added on branch nick-nhusb on 2017-02-05 13:40:04 +0000
 1.14 07-Jan-2025  andvar Fix typos in the word 'Control' in comments.
 1.13 07-Jan-2017  kiyohara branches: 1.13.52;
Add support Marvell Dove.
Also <SoC>_intr_bootstrap() rename to <SoC>_bootstrap(). And SoC init func, getclk into that.
 1.12 03-Jun-2015  hsuenaga branches: 1.12.2;
dump Mbus settins on boot if AV_VERBOSE or AV_DEBUG is enabled.
 1.11 19-May-2015  hsuenaga fix Marvell Coherency Barrier register address.
configure coherency bus maintance broadcast using MPIDR. we need to configure
this regardless of 'options MULTIPROCESSOR.'
 1.10 14-May-2015  hsuenaga add synchronization barrier for AURORA_IO_CACHE_COHERENCY.
cleanup MARVELL L2 cache code.
 1.9 17-Feb-2014  kiyohara branches: 1.9.6;
Add some MVSOC_MLMB_ definitions for supporting DDR3.
 1.8 23-Dec-2013  kiyohara Support to check the clock gating for Armada XP in armadaxp.c.
Also move the checking for clock gate of Kirkwood into kirkwood.c.
 1.7 23-Dec-2013  kiyohara Move Misc Registers from mvsocreg.h to armadaxpreg.h. These registers only
Armada XP. The misc_base initializes in initarm() instead of mvsoc_bootstrap().
 1.6 20-Nov-2013  kiyohara Add defines for MISC registers.
 1.5 30-Sep-2013  kiyohara Remove #ifdef ARMADAXP. It is OK !ARMADAXP.
 1.4 29-May-2013  rkujawa branches: 1.4.2;
Add support for mvsoc-based Armada XP peripherals.

Obtained from Marvell, Semihalf.
 1.3 19-Oct-2012  msaitoh Add CLKGATING_BIT for some devices. This change prevent some boards
that a device's clock is stopped from hangup.
 1.2 01-Feb-2011  jakllsch branches: 1.2.2; 1.2.6; 1.2.12; 1.2.16;
Address 3rd issue in PR#43990.
Different implementation but same method as suggested.
 1.1 03-Oct-2010  kiyohara branches: 1.1.2; 1.1.4; 1.1.6; 1.1.8;
Add support Marvell Sheeva Core and SoC. (Orion/Kirkwood)
Discovery Innovation not yet.
 1.1.8.1 08-Feb-2011  bouyer Sync with HEAD
 1.1.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.1.4.2 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.1.4.1 03-Oct-2010  uebayasi file mvsocreg.h was added on branch uebayasi-xip on 2010-10-22 09:23:12 +0000
 1.1.2.2 09-Oct-2010  yamt sync with head
 1.1.2.1 03-Oct-2010  yamt file mvsocreg.h was added on branch yamt-nfs-mp on 2010-10-09 03:31:40 +0000
 1.2.16.4 03-Dec-2017  jdolecek update from HEAD
 1.2.16.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.16.2 23-Jun-2013  tls resync from head
 1.2.16.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.2.12.1 11-Dec-2012  riz sys/arch/arm/marvell/mvsoc.c patch
sys/arch/arm/marvell/mvsocreg.h patch

Add CLKGATING_BIT, enable it for some 88F6281 devices, and don't
configure devices if their clock is disabled.
[msaitoh, ticket #737]
 1.2.6.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.2.6.1 30-Oct-2012  yamt sync with head
 1.2.2.2 05-Mar-2011  rmind sync with head
 1.2.2.1 01-Feb-2011  rmind file mvsocreg.h was added on branch rmind-uvmplock on 2011-03-05 20:49:37 +0000
 1.4.2.1 18-May-2014  rmind sync with head
 1.9.6.2 05-Feb-2017  skrll Sync with HEAD
 1.9.6.1 06-Jun-2015  skrll Sync with HEAD
 1.12.2.1 20-Mar-2017  pgoyette Sync with HEAD
 1.13.52.1 02-Aug-2025  perseant Sync with HEAD
 1.5 07-Sep-2025  thorpej Change todr_chip_handle::cookie -> todr_chip_handle::todr_dev, and
make it a device_t. Upcoming functional changes will require the
device_t associated with a TODR device.

Change todr_chip_handle::bus_cookie -> todr_chip_handle::todr_devaux.
Nothing was using the old field, but I decided to keep it around just
in cause something needs it in the future.

And with these largely mechanical yet semantically meaningful changes,
thus spake the Oracle: "Welcome to NetBSD 11.99.2."
 1.4 07-Sep-2025  thorpej Remove unnecessary NULL-initialization of TODR handle fields.
 1.3 20-Nov-2014  christos use the inline bcdtobin and bintobcd directly instead through a macro.
 1.2 01-Jul-2011  dyoung branches: 1.2.12;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.1 05-Mar-2011  matt branches: 1.1.2; 1.1.6;
Add contributed Marvell Kirkwood RTC driver from Brett Slager
Fixes PR 44004
 1.1.6.2 06-Jun-2011  jruoho Sync with HEAD.
 1.1.6.1 05-Mar-2011  jruoho file mvsocrtc.c was added on branch jruoho-x86intr on 2011-06-06 09:05:04 +0000
 1.1.2.2 06-Mar-2011  rmind sync with head (and fix few botches with this)
 1.1.2.1 05-Mar-2011  rmind file mvsocrtc.c was added on branch rmind-uvmplock on 2011-03-06 00:26:57 +0000
 1.2.12.1 03-Dec-2017  jdolecek update from HEAD
 1.1 05-Mar-2011  matt branches: 1.1.2; 1.1.6;
Add contributed Marvell Kirkwood RTC driver from Brett Slager
Fixes PR 44004
 1.1.6.2 06-Jun-2011  jruoho Sync with HEAD.
 1.1.6.1 05-Mar-2011  jruoho file mvsocrtcreg.h was added on branch jruoho-x86intr on 2011-06-06 09:05:04 +0000
 1.1.2.2 06-Mar-2011  rmind sync with head (and fix few botches with this)
 1.1.2.1 05-Mar-2011  rmind file mvsocrtcreg.h was added on branch rmind-uvmplock on 2011-03-06 00:26:57 +0000
 1.15 29-May-2020  rin For struct timecounter, use C99 initializers.
Compile tested. No functional changes intended.
 1.14 07-Jan-2017  kiyohara Change to a tab from white-spaces.
 1.13 15-Mar-2014  kiyohara branches: 1.13.6; 1.13.10;
Support Armada 370. tested on MiraBox.
 1.12 26-Feb-2014  martin Initialize mvsoctmr_freq earlier (in mvsoctmr_attach) to avoid division
by zero in calculation of the watchdog parameters.
 1.11 17-Feb-2014  kiyohara Remove TMR_FLAGS_ARMADAXP and Add flags NOBRIDGE, 25MHZ, SYSCLK.
- NOBRIDGE does not go via a bridge.
- 25MHZ is always counted with the cycle of 25 MHz.
- SYSCLK is counted with the cycle of sysClk. This is used in a few days
for Armada 370.
And please use not mvTclk but variable mvsoctmr_freq for calculation of a clock.
(e.g. in delay())
 1.10 14-Oct-2013  kiyohara Remove some #ifdef ARMADAXP. We can enable simultaneously both ARMADAXP and
other SoC options.
 1.9 01-May-2013  rkujawa branches: 1.9.4;
Add support for timers on Armada XP.

Obtained from Marvell, Semihalf.
 1.8 22-Jul-2012  jakllsch branches: 1.8.2;
Actually, the WDT-expired bit in the ICR needs to be cleared before enabling
watchdog reset.
 1.7 22-Jul-2012  jakllsch The maximum watchdog period is dependant on mvTclk; calculate at runtime.
This gets the maximum period up to 25 seconds at 166⅔MHz mvTclk.
 1.6 22-Jul-2012  jakllsch Remove duplicate global variable.
 1.5 22-Jul-2012  jakllsch When disabling watchdog timer, do not set the counter to 0.
Having the watchdog counter at 0 and having WDRstOutEn set to 1 causes
immediate watchdog reset on my 88F5182 A2.
 1.4 19-Jun-2012  hans Add support for the watchdog timer in mvsoctmr.
Tested on DreamPlug system.
 1.3 12-Feb-2012  matt branches: 1.3.2;
Change old-style function defintions to C89 prototypes.

Approved by releng.
 1.2 09-Jun-2011  jakllsch branches: 1.2.2; 1.2.6;
Rework mvsoctmr(4), improving timekeeping accuracy

Inconveniently the Marvell hardware only counts down.
We need to reverse this for timecounter(9), and we need
to do it in a very lightweight way.

- use Timer0 for the clock interrupt
- use Timer1 for timecounter(9) and delay(9)
- drop statclock due to lack of timers (does anyone actually use this?)
 1.1 03-Oct-2010  kiyohara branches: 1.1.2; 1.1.4; 1.1.10; 1.1.12;
Add support Marvell Sheeva Core and SoC. (Orion/Kirkwood)
Discovery Innovation not yet.
 1.1.12.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.1.10.3 12-Jun-2011  rmind sync with head
 1.1.10.2 05-Mar-2011  rmind sync with head
 1.1.10.1 03-Oct-2010  rmind file mvsoctmr.c was added on branch rmind-uvmplock on 2011-03-05 20:49:37 +0000
 1.1.4.2 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.1.4.1 03-Oct-2010  uebayasi file mvsoctmr.c was added on branch uebayasi-xip on 2010-10-22 09:23:12 +0000
 1.1.2.2 09-Oct-2010  yamt sync with head
 1.1.2.1 03-Oct-2010  yamt file mvsoctmr.c was added on branch yamt-nfs-mp on 2010-10-09 03:31:40 +0000
 1.2.6.1 18-Feb-2012  mrg merge to -current.
 1.2.2.3 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.2.2.2 30-Oct-2012  yamt sync with head
 1.2.2.1 17-Apr-2012  yamt sync with head
 1.3.2.1 13-Jan-2013  bouyer Pull up following revision(s) (requested by riz in ticket #770):
sys/arch/arm/marvell/files.marvell: revision 1.5
sys/arch/arm/marvell/mvsoctmr.c: revision 1.4
sys/arch/arm/marvell/mvsoctmr.c: revision 1.5
sys/arch/arm/marvell/mvsoctmr.c: revision 1.6
sys/arch/arm/marvell/mvsoctmr.c: revision 1.7
Add support for the watchdog timer in mvsoctmr.
Tested on DreamPlug system.
When disabling watchdog timer, do not set the counter to 0.
Having the watchdog counter at 0 and having WDRstOutEn set to 1 causes
immediate watchdog reset on my 88F5182 A2.
Remove duplicate global variable.
The maximum watchdog period is dependant on mvTclk; calculate at runtime.
This gets the maximum period up to 25 seconds at 166⅔MHz mvTclk.
 1.8.2.3 03-Dec-2017  jdolecek update from HEAD
 1.8.2.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.8.2.1 23-Jun-2013  tls resync from head
 1.9.4.1 18-May-2014  rmind sync with head
 1.13.10.1 20-Mar-2017  pgoyette Sync with HEAD
 1.13.6.1 05-Feb-2017  skrll Sync with HEAD
 1.4 17-Feb-2014  kiyohara Add comment 'Armada XP only' to 25MHz bit. Also it is documented to errata?
 1.3 14-Oct-2013  kiyohara Add timer 2 and 3 for Discovery Innovation.
 1.2 01-May-2013  rkujawa branches: 1.2.4;
Add support for timers on Armada XP.

Obtained from Marvell, Semihalf.
 1.1 03-Oct-2010  kiyohara branches: 1.1.2; 1.1.4; 1.1.10; 1.1.14; 1.1.24;
Add support Marvell Sheeva Core and SoC. (Orion/Kirkwood)
Discovery Innovation not yet.
 1.1.24.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.24.1 23-Jun-2013  tls resync from head
 1.1.14.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1.10.2 05-Mar-2011  rmind sync with head
 1.1.10.1 03-Oct-2010  rmind file mvsoctmrreg.h was added on branch rmind-uvmplock on 2011-03-05 20:49:37 +0000
 1.1.4.2 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.1.4.1 03-Oct-2010  uebayasi file mvsoctmrreg.h was added on branch uebayasi-xip on 2010-10-22 09:23:12 +0000
 1.1.2.2 09-Oct-2010  yamt sync with head
 1.1.2.1 03-Oct-2010  yamt file mvsoctmrreg.h was added on branch yamt-nfs-mp on 2010-10-09 03:31:40 +0000
 1.2.4.1 18-May-2014  rmind sync with head
 1.3 19-Jun-2023  msaitoh Fix typo. unknwon -> unknown
 1.2 06-Nov-2015  kiyohara Support Armada XP.
 1.1 01-Aug-2012  kiyohara branches: 1.1.2; 1.1.4; 1.1.18;
Add Thermal Sensor for Kirkwood(88F6282). tested only OpenBlockS A6.
 1.1.18.1 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.1.4.2 30-Oct-2012  yamt sync with head
 1.1.4.1 01-Aug-2012  yamt file mvsocts.c was added on branch yamt-pagecache on 2012-10-30 17:19:06 +0000
 1.1.2.1 03-Dec-2017  jdolecek update from HEAD
 1.13 30-Aug-2021  rin Add ARMEB support to {evb,}arm/marvell.

Combined with upcoming commit to dev/marvell, all peripheral devices
seem to work just fine for KUROBOX_PRO in big-endian mode.
 1.12 10-Mar-2017  skrll Initialise the windows and allow access to PCI Express port 1 first lane.

Allows xhci(4) to attach in the MV78230 based Lenovo ix4-300d

mvpex1 at mvsoc0 unit 4 offset 0x80000-0x81fff irq 62: Marvell PCI Express Interface
pci1 at mvpex1
xhci0 at pci1 dev 1 function 0: vendor 1033 product 0194 (rev. 0x04)
xhci0: interrupting at interrupt pin INTA#
usb3 at xhci0: USB revision 3.0
usb4 at xhci0: USB revision 2.0
 1.11 07-Jan-2017  kiyohara branches: 1.11.2;
Add support Marvell Dove.
Also <SoC>_intr_bootstrap() rename to <SoC>_bootstrap(). And SoC init func, getclk into that.
 1.10 03-Jun-2015  hsuenaga branches: 1.10.2;
add new cryptographic accelerator driver 'mvxpsec.'

this driver controls CESA unit as same as mvcesa, but uses DMA engines and
does CBC operations, HMAC operations by hardware. about 2 kbytes of data
are processed at one. supported algorithms are:

- DES-CBC, 3DES-CBC, AES-CBC
- HMAC-SHA1, HMAC-MD5

non-CBC algorithm such as AES-GCM is not supported by CESA's acceleration
engine. mvcesa is still useful to implement such algorithms as combination of
accelerated block cipher and software chaining.
 1.9 03-Jun-2015  hsuenaga dump Mbus settins on boot if AV_VERBOSE or AV_DEBUG is enabled.
 1.8 15-Mar-2014  kiyohara branches: 1.8.6;
Add armada370_getclks().
Remove some white spaces.
 1.7 23-Dec-2013  kiyohara Support to check the clock gating for Armada XP in armadaxp.c.
Also move the checking for clock gate of Kirkwood into kirkwood.c.
 1.6 23-Dec-2013  kiyohara Move Misc Registers from mvsocreg.h to armadaxpreg.h. These registers only
Armada XP. The misc_base initializes in initarm() instead of mvsoc_bootstrap().
 1.5 30-Sep-2013  kiyohara Remove #ifdef ARMADAXP. It is OK !ARMADAXP.
Change argument for armadaxp functions.
Add some MV78xx0 definitions.
Add mv78xx0 functions.
 1.4 29-May-2013  rkujawa branches: 1.4.2;
Add support for mvsoc-based Armada XP peripherals.

Obtained from Marvell, Semihalf.
 1.3 18-Jul-2012  kiyohara branches: 1.3.2;
Add tags for PEX1 of Kirkwood.
Remove unneccesary white-space.
Reorder function prototypes.
 1.2 01-Jul-2011  dyoung branches: 1.2.2;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.1 03-Oct-2010  kiyohara branches: 1.1.2; 1.1.4; 1.1.10;
Add support Marvell Sheeva Core and SoC. (Orion/Kirkwood)
Discovery Innovation not yet.
 1.1.10.2 05-Mar-2011  rmind sync with head
 1.1.10.1 03-Oct-2010  rmind file mvsocvar.h was added on branch rmind-uvmplock on 2011-03-05 20:49:37 +0000
 1.1.4.2 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.1.4.1 03-Oct-2010  uebayasi file mvsocvar.h was added on branch uebayasi-xip on 2010-10-22 09:23:12 +0000
 1.1.2.2 09-Oct-2010  yamt sync with head
 1.1.2.1 03-Oct-2010  yamt file mvsocvar.h was added on branch yamt-nfs-mp on 2010-10-09 03:31:40 +0000
 1.2.2.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.2.2.1 30-Oct-2012  yamt sync with head
 1.3.2.3 03-Dec-2017  jdolecek update from HEAD
 1.3.2.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.2.1 23-Jun-2013  tls resync from head
 1.4.2.1 18-May-2014  rmind sync with head
 1.8.6.3 28-Aug-2017  skrll Sync with HEAD
 1.8.6.2 05-Feb-2017  skrll Sync with HEAD
 1.8.6.1 06-Jun-2015  skrll Sync with HEAD
 1.10.2.1 20-Mar-2017  pgoyette Sync with HEAD
 1.11.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.7 30-Aug-2021  rin Add ARMEB support to {evb,}arm/marvell.

Combined with upcoming commit to dev/marvell, all peripheral devices
seem to work just fine for KUROBOX_PRO in big-endian mode.
 1.6 07-Jan-2017  kiyohara Add support Marvell Dove.
Also <SoC>_intr_bootstrap() rename to <SoC>_bootstrap(). And SoC init func, getclk into that.
 1.5 28-Jan-2014  martin branches: 1.5.6; 1.5.10;
Mark a diagnostic-only variable
 1.4 12-Feb-2012  matt branches: 1.4.6; 1.4.10;
Change old-style function defintions to C89 prototypes.

Approved by releng.
 1.3 28-Jan-2012  jakllsch I have a feeling 133333334 was off-by-one.
 1.2 28-Jan-2012  jakllsch Constify sysclktbl and use __arraycount thereon.
 1.1 03-Oct-2010  kiyohara branches: 1.1.2; 1.1.4; 1.1.10; 1.1.14; 1.1.18;
Add support Marvell Sheeva Core and SoC. (Orion/Kirkwood)
Discovery Innovation not yet.
 1.1.18.1 18-Feb-2012  mrg merge to -current.
 1.1.14.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1.14.1 17-Apr-2012  yamt sync with head
 1.1.10.2 05-Mar-2011  rmind sync with head
 1.1.10.1 03-Oct-2010  rmind file orion.c was added on branch rmind-uvmplock on 2011-03-05 20:49:37 +0000
 1.1.4.2 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.1.4.1 03-Oct-2010  uebayasi file orion.c was added on branch uebayasi-xip on 2010-10-22 09:23:12 +0000
 1.1.2.2 09-Oct-2010  yamt sync with head
 1.1.2.1 03-Oct-2010  yamt file orion.c was added on branch yamt-nfs-mp on 2010-10-09 03:31:40 +0000
 1.4.10.1 18-May-2014  rmind sync with head
 1.4.6.2 03-Dec-2017  jdolecek update from HEAD
 1.4.6.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.5.10.1 20-Mar-2017  pgoyette Sync with HEAD
 1.5.6.1 05-Feb-2017  skrll Sync with HEAD
 1.2 28-Sep-2013  kiyohara Change address/size of CESA Registers.
 1.1 03-Oct-2010  kiyohara branches: 1.1.2; 1.1.4; 1.1.10; 1.1.14; 1.1.24; 1.1.28;
Add support Marvell Sheeva Core and SoC. (Orion/Kirkwood)
Discovery Innovation not yet.
 1.1.28.1 18-May-2014  rmind sync with head
 1.1.24.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.14.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1.10.2 05-Mar-2011  rmind sync with head
 1.1.10.1 03-Oct-2010  rmind file orionreg.h was added on branch rmind-uvmplock on 2011-03-05 20:49:37 +0000
 1.1.4.2 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.1.4.1 03-Oct-2010  uebayasi file orionreg.h was added on branch uebayasi-xip on 2010-10-22 09:23:12 +0000
 1.1.2.2 09-Oct-2010  yamt sync with head
 1.1.2.1 03-Oct-2010  yamt file orionreg.h was added on branch yamt-nfs-mp on 2010-10-09 03:31:40 +0000
 1.16 14-May-2020  msaitoh Remove extra semicolon.
 1.15 26-Nov-2018  jmcneill Switch to designated initializers
 1.14 16-Nov-2018  jmcneill Add intr_establish_xname support to arm and expose it to intrctl
 1.13 03-Nov-2018  jmcneill Fix build
 1.12 19-Apr-2017  jmcneill branches: 1.12.10; 1.12.12;
Initialize intr_setattr of arm32_pci_chipset
 1.11 10-Mar-2017  skrll Initialise the windows and allow access to PCI Express port 1 first lane.

Allows xhci(4) to attach in the MV78230 based Lenovo ix4-300d

mvpex1 at mvsoc0 unit 4 offset 0x80000-0x81fff irq 62: Marvell PCI Express Interface
pci1 at mvpex1
xhci0 at pci1 dev 1 function 0: vendor 1033 product 0194 (rev. 0x04)
xhci0: interrupting at interrupt pin INTA#
usb3 at xhci0: USB revision 3.0
usb4 at xhci0: USB revision 2.0
 1.10 12-Jul-2016  kiyohara branches: 1.10.2; 1.10.4;
Fix intr_establish. PCI interrupt is LEVEL LOW.
 1.9 02-Oct-2015  msaitoh PCI Extended Configuration stuff written by nonaka@:
- Add PCI Extended Configuration Space support into x86.
- Check register offset of pci_conf_read() in MD part. It returns (pcireg_t)-1
if it isn't accessible.
- Decode Extended Capability in PCI Extended Configuration Space.
Currently the following extended capabilities are decoded:
- Advanced Error Reporting
- Virtual Channel
- Device Serial Number
- Power Budgeting
- Root Complex Link Declaration
- Root Complex Event Collector Association
- Access Control Services
- Alternative Routing-ID Interpretation
- Address Translation Services
- Single Root IO Virtualization
- Page Request
- TPH Requester
- Latency Tolerance Reporting
- Secondary PCI Express
- Process Address Space ID
- LN Requester
- L1 PM Substates
The following extended capabilities are not decoded yet:
- Root Complex Internal Link Control
- Multi-Function Virtual Channel
- RCRB Header
- Vendor Unique
- Configuration Access Correction
- Multiple Root IO Virtualization
- Multicast
- Resizable BAR
- Dynamic Power Allocation
- Protocol Multiplexing
- Downstream Port Containment
- Precision Time Management
- M-PCIe
- Function Reading Status Queueing
- Readiness Time Reporting
- Designated Vendor-Specific
 1.8 30-Mar-2014  christos branches: 1.8.6;
wrap a few lines
 1.7 29-Mar-2014  christos make pci_intr_string and eisa_intr_string take a buffer and a length
instead of relying in local static storage.
 1.6 26-Mar-2014  christos kill sprintf
 1.5 01-May-2013  rkujawa branches: 1.5.4;
Handle situations where we can have more pexes, like Armada XP.

Obtained from Marvell, Semihalf.
 1.4 07-Sep-2012  matt branches: 1.4.2;
Fix pci_conf_hook/interrupt for ARM.
 1.3 07-Sep-2012  matt Fix more pci_conf_interrupt/pci_conf_hook problems
 1.2 04-Apr-2011  dyoung branches: 1.2.4;
Neither pci_dma64_available(), pci_probe_device(), pci_mapreg_map(9),
pci_find_rom(), pci_intr_map(9), pci_enumerate_bus(), nor the match
predicate passed to pciide_compat_intr_establish() should ever modify
their pci_attach_args argument, so make their pci_attach_args arguments
const and deal with the fallout throughout the kernel.

For the most part, these changes add a 'const' where there was no
'const' before, however, some drivers and MD code used to modify
pci_attach_args. Now those drivers either copy their pci_attach_args
and modify the copy, or refrain from modifying pci_attach_args:

Xen: according to Manuel Bouyer, writing to pci_attach_args in
pci_intr_map() was a leftover from Xen 2. Probably a bug. I
stopped writing it. I have not tested this change.

siside(4): sis_hostbr_match() needlessly wrote to pci_attach_args.
Probably a bug. I use a temporary variable. I have not tested this
change.

slide(4): sl82c105_chip_map() overwrote the caller's pci_attach_args.
Probably a bug. Use a local pci_attach_args. I have not tested
this change.

viaide(4): via_sata_chip_map() and via_sata_chip_map_new() overwrote the
caller's pci_attach_args. Probably a bug. Make a local copy of the
caller's pci_attach_args and modify the copy. I have not tested
this change.

While I'm here, make pci_mapreg_submap() static.

With these changes in place, I have tested the compilation of these
kernels:

alpha GENERIC
amd64 GENERIC XEN3_DOM0
arc GENERIC
atari HADES MILAN-PCIIDE
bebox GENERIC
cats GENERIC
cobalt GENERIC
evbarm-eb NSLU2
evbarm-el ADI_BRH ARMADILLO9 CP3100 GEMINI GEMINI_MASTER GEMINI_SLAVE GUMSTIX
HDL_G IMX31LITE INTEGRATOR IQ31244 IQ80310 IQ80321 IXDP425 IXM1200
KUROBOX_PRO LUBBOCK MARVELL_NAS NAPPI SHEEVAPLUG SMDK2800 TEAMASA_NPWR
TEAMASA_NPWR_FC TS7200 TWINTAIL ZAO425
evbmips-el AP30 DBAU1500 DBAU1550 MALTA MERAKI MTX-1 OMSAL400 RB153 WGT624V3
evbmips64-el XLSATX
evbppc EV64260 MPC8536DS MPC8548CDS OPENBLOCKS200 OPENBLOCKS266
OPENBLOCKS266_OPT P2020RDB PMPPC RB800 WALNUT
hp700 GENERIC
i386 ALL XEN3_DOM0 XEN3_DOMU
ibmnws GENERIC
macppc GENERIC
mvmeppc GENERIC
netwinder GENERIC
ofppc GENERIC
prep GENERIC
sandpoint GENERIC
sgimips GENERIC32_IP2x
sparc GENERIC_SUN4U KRUPS
sparc64 GENERIC

As of Sun Apr 3 15:26:26 CDT 2011, I could not compile these kernels
with or without my patches in place:

### evbmips-el GDIUM

nbmake: nbmake: don't know how to make /home/dyoung/pristine-nbsd/src/sys/arch/mips/mips/softintr.c. Stop

### evbarm-el MPCSA_GENERIC
src/sys/arch/evbarm/conf/MPCSA_GENERIC:318: ds1672rtc*: unknown device `ds1672rtc'

### ia64 GENERIC

/tmp/genassym.28085/assym.c: In function 'f111':
/tmp/genassym.28085/assym.c:67: error: invalid application of 'sizeof' to incomplete type 'struct pcb'
/tmp/genassym.28085/assym.c:76: error: dereferencing pointer to incomplete type

### sgimips GENERIC32_IP3x

crmfb.o: In function `crmfb_attach':
crmfb.c:(.text+0x2304): undefined reference to `ddc_read_edid'
crmfb.c:(.text+0x2304): relocation truncated to fit: R_MIPS_26 against `ddc_read_edid'
crmfb.c:(.text+0x234c): undefined reference to `edid_parse'
crmfb.c:(.text+0x234c): relocation truncated to fit: R_MIPS_26 against `edid_parse'
crmfb.c:(.text+0x2354): undefined reference to `edid_print'
crmfb.c:(.text+0x2354): relocation truncated to fit: R_MIPS_26 against `edid_print'
 1.1 03-Oct-2010  kiyohara branches: 1.1.2; 1.1.4; 1.1.6; 1.1.10;
Add support Marvell Sheeva Core and SoC. (Orion/Kirkwood)
Discovery Innovation not yet.
 1.1.10.3 21-Apr-2011  rmind sync with head
 1.1.10.2 05-Mar-2011  rmind sync with head
 1.1.10.1 03-Oct-2010  rmind file pci_machdep.c was added on branch rmind-uvmplock on 2011-03-05 20:49:37 +0000
 1.1.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.1.4.2 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.1.4.1 03-Oct-2010  uebayasi file pci_machdep.c was added on branch uebayasi-xip on 2010-10-22 09:23:12 +0000
 1.1.2.2 09-Oct-2010  yamt sync with head
 1.1.2.1 03-Oct-2010  yamt file pci_machdep.c was added on branch yamt-nfs-mp on 2010-10-09 03:31:40 +0000
 1.2.4.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.2.4.1 30-Oct-2012  yamt sync with head
 1.4.2.3 03-Dec-2017  jdolecek update from HEAD
 1.4.2.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.2.1 23-Jun-2013  tls resync from head
 1.5.4.1 18-May-2014  rmind sync with head
 1.8.6.3 28-Aug-2017  skrll Sync with HEAD
 1.8.6.2 05-Oct-2016  skrll Sync with HEAD
 1.8.6.1 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.10.4.1 21-Apr-2017  bouyer Sync with HEAD
 1.10.2.2 26-Apr-2017  pgoyette Sync with HEAD
 1.10.2.1 20-Mar-2017  pgoyette Sync with HEAD
 1.12.12.1 10-Jun-2019  christos Sync with HEAD
 1.12.10.2 26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.12.10.1 26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts

RSS XML Feed