Commit Graph

108 Commits

Author SHA1 Message Date
Grzegorz Bernacki
046b51bfdd Fix the passing of time on Armada XP.
In order to become independent of Coherency Fabric frequency, configure
Timer and Watchdog to operate in 25MHz mode.

Submitted by:	Zbigniew Bodek <zbb@semihalf.com>
2013-06-04 09:33:03 +00:00
Grzegorz Bernacki
7e13391d97 decode_win_sdram_fixup() function should be declared, defined and used
only by Armada XP

Obtained from:	Semihalf
2013-05-07 06:42:07 +00:00
Grzegorz Bernacki
cfdb2eed92 Disable decoding windows with no FDT entry.
- On ARMADAXP B0 (GP development board) we are not able to use PCI due to
   whole 32-bit address space used by 4GB of RAM memory.
- Change is required to destroy unnecessary window to free address space
   for PCI and other devices
- Fix offset value for SDRAM decoding windows

Obtained from:	Semihalf
2013-05-06 14:54:17 +00:00
Grzegorz Bernacki
5c39c3ffa2 Properly initialize Armada XP MP subsystem.
- correct setting of Auxiliary Control Register for MP mode
- correct setting of Auxiliarty Debug registers
- cleanup management of memory contains bootup code
- early initialization of Coherency Fabric (MP and not-MP mode)
- enable Snoop Filtering

Obtained from:	Semihalf
2013-05-06 14:12:36 +00:00
Grzegorz Bernacki
3a1f2172c0 Initialize L2 cache for Armada XP.
Obtained from:	Semihalf
2013-05-06 13:52:49 +00:00
Grzegorz Bernacki
99eef68204 Move initialization of CESA decoding windows from common section
to driver specific files.

- window initialization is done during device attach
- CESA TDMA decoding windows values are set based on DTS,
 not copied from CPU registers
- remove unnecessary virtual mapping
- update dts file

Obtained from: Semihalf
2013-05-06 13:34:36 +00:00
Alexander Motin
fdc5dd2d2f MFcalloutng:
Switch eventtimers(9) from using struct bintime to sbintime_t.
Even before this not a single driver really supported full dynamic range of
struct bintime even in theory, not speaking about practical inexpediency.
This change legitimates the status quo and cleans up the code.
2013-02-28 13:46:03 +00:00
Ian Lepore
427dadb03c Add a default do-nothing implementation of fdt_pci_devmap() using a weak alias,
so that we don't need an empty implementation of it for every Marvell platform
that has no PCI.  This allows the removal of the SheevaPlug-specific stub and
config files, and eliminates the need to add similar stubs for future models.

Marvell platforms that do expose PCI are compiled with 'device pci' which
causes the real (non-weak) implementation in dev/fdt/fdt_pci.c to be used.

Approved by:	cognet (mentor)
2013-01-27 00:39:02 +00:00
Marcel Moolenaar
3fa9510afa Allow building LINT by defining both SAMPLE_AT_RESET on the one hand
and SAMPLE_AT_RESET_{LO|HI} on the other. It doesn't matter which
values they take, as long as they are defined.
2012-11-27 01:10:58 +00:00
Andrew Turner
7bf9ab5331 Merge the FDT versions of initarm.
The copies of initarm used on platforms with FDT support were almost
identical. The differences were pulled out into separate functions that
were called by initarm.

This change merges the, now identical, copies of initarm and a few of it's
support functions. This is a step towards a common kernel on ARMv6.
2012-11-03 22:39:07 +00:00
Olivier Houchard
9e9b17fba7 Fix build for SMP.
Submitted by:	Giovanni Trematerra <gianni at freebsd DOT org>
2012-11-01 12:26:31 +00:00
Andrew Turner
ef8abaaebf Merge r242125 into the other ARMv6 copies of initarm. 2012-10-31 08:25:45 +00:00
Andrew Turner
1f008b99cc Pull out the SoC specific parts of initarm into separate functions 2012-09-23 03:46:03 +00:00
Andrew Turner
d98d8a1e83 Reduce the diff between the FDT implementations of initarm.
This only touches whitespace and comments.
2012-09-22 22:41:38 +00:00
Andrew Turner
1161298251 Create a common set_stackptrs in sys/arm/machdep.c.
On single core devices set_stackptrs is only ever called with cpu = 0 in
initarm and will be identical to the existing function. On SMP this needs
to be implemented for sys/arm/mp_machdep.c, but the implementations are
identical for each SoC.
2012-09-22 06:41:56 +00:00
Grzegorz Bernacki
64dc1cf395 Implement MSI support.
MSI are implemented via Inbound Shared Doorbell 1 interrupts. Interrupts
are triggered by writing to Software Triggered Interrupt registeri (PCIe
card using physical address of this register in BAR0 space). There are 32
interrupts available. It can be increased by using Doorbell 2 and
Doorbell 3 registers to 96 interrupts.

Obtained from:	Marvell, Semihalf
2012-09-14 10:06:56 +00:00
Grzegorz Bernacki
aa0ea9d07a Add support for MSI in interrupt controlller.
MSI are implemented via software interrupt. PCIe cards will write
into software interrupt register which will cause inbound shared
interrupt which will be interpreted as a MSI.

Obtained from:	Marvell, Semihalf
2012-09-14 10:05:01 +00:00
Grzegorz Bernacki
373bc54ab1 Remove unused structure fields
Obtained from:	Semihalf
2012-09-14 10:01:52 +00:00
Grzegorz Bernacki
4c641b9a6a Enable PCI for Armada XP
Obtained from:	Semihalf
2012-09-14 09:59:27 +00:00
Grzegorz Bernacki
e3ac97538c pci: Implement new memory and io space allocator for PCI.
Cleanup code and move initializing bridge into separate function.
Add checking of PCI mode (RC or endpoint).

Obtained from:	Semihalf
2012-09-14 09:57:41 +00:00
Grzegorz Bernacki
d65cdf4b9d Add support for Armada XP A0.
- Add functions to calculate clocks instead using hardcoded values
- Update reset and timers functions
- Update number of interrupts
- Change name of platform from db88f78100 to db78460
- Correct DRAM size and PCI IRQ routing in dts file.

Obtained from:	Semihalf
2012-09-14 09:55:19 +00:00
Hiroki Sato
8bfdf49b97 - Calculate the I2C baud rate to keep them <100 kHz under different TCLK
frequencies.  The maximum freqency is 100 kHz according to the datasheet.

- Add child device probing support based on the device tree.  It now tries to
  find i2c-address property in the tree and attach the device with given slave
  address to iicbus.
2012-08-21 17:49:20 +00:00
Hiroki Sato
e664505cb9 Add mvts(4) driver for internal thermal sensor found on 88F6282 and 88F6283.
The temperature value will be exported via sysctl like this:

dev.mvts.0.temperature: 52.1C
2012-08-18 12:37:07 +00:00
Hiroki Sato
8f2853bf65 Sort IDs. 2012-08-18 12:20:51 +00:00
Hiroki Sato
959bd21bec - MV_DEV_88F6282 has 256KB 4-way L2 cache.
- Sort IDs in win_cpu_can_remap() and remove MV_DEV_MV78100 because it is
  included in MV_DEV_DISCOVERY.
- Add MV_DEV_MV78XXX to xor_max_eng().
2012-08-18 11:40:55 +00:00
Hiroki Sato
d542454787 Fix a bug that could fail to initialize GPIO pins specified in "gpios" because
"gpio-controller" property at the controller node was always ignored.
2012-08-18 11:33:21 +00:00
Andrew Turner
19a0f7f9cb Set machine correctly on ARM. This allows universe to use the correct world
when building each kernel.

Reviewed by:	imp
2012-08-18 05:48:19 +00:00
Oleksandr Tymoshenko
16694521fe Merging of projects/armv6, part 7
Add Marvell ARMADA XP support

Obtained from:	Marvell, Semihalf
2012-08-15 05:15:49 +00:00
Hiroki Sato
c8953e1273 Add support for Marvell 88F6282.
Sponsored by:	Plat'Home, Co.,Ltd.
2012-07-28 21:56:24 +00:00
Warner Losh
378d88b3dc Remove some unused variables/externs that have been copied too many times... 2012-07-10 01:49:50 +00:00
Marcel Moolenaar
252f780672 Fix LINT.
Obtained from:	Juniper Networks, Inc.
2012-07-05 15:23:45 +00:00
Warner Losh
3590dad094 More Linux boot support. Create arm_dump_avail_init() to initialize
this array either from Linux boot data, when enabled, or in the
typical way that most ports do it.  arm_pyhs_avail_init is coming
soon since it must be a separate function.
2012-06-14 04:18:56 +00:00
Warner Losh
0bb13a26f0 Create default_parse_boot_param which, if FreeBSD /boot/loader support
is enabled, sets values based on the metadata passed in.  Otherwise
fake_preload_metadata is called.  Change the default parse_boot_param
to default_parse_boot_param.  Enable this functionality only on the mv
platform, which is where most of the code is from.

Reviewed by:	cognet, Ian Lapore
2012-06-14 04:09:20 +00:00
Warner Losh
d39655d7a4 Modify all the arm platform files to call parse_boot_param passing in
the boot parameters from initarm first thing.  parse_boot_param parses
the boot arguments and converts them to the /boot/loader metadata the
rest of the kernel uses.  parse_boot_param is a weak alias to
fake_preload_metadata, which all the platforms use now, but may become
more extensive in the future.

Since it is a weak symbol, specific boards may define their own
parse_boot_param to interface to custom boot loaders.

Reviewed by:	cognet@, Ian Lapore
2012-06-14 04:00:30 +00:00
Warner Losh
c358d6a2b0 Trim trailing whitespace... 2012-06-13 04:59:00 +00:00
Andrew Turner
4ea15b8776 Pull out the common code to initialise proc0 & thread0 from initarm to a
common function.

Reviewed by:	imp
2012-06-10 01:13:04 +00:00
Warner Losh
4623180919 Minor rearrangement of the locore <-> initarm interface. Pass in a
structure with the first 4 registers to allow a wider range of boot
loaders to work.  Future commits will make use of this to centralize
support for the different loaders.
2012-06-03 18:34:32 +00:00
Marcel Moolenaar
db31c8e31f Unbreak LINT for ARM: DEBUG is a kernel configuration option. 2012-05-19 18:16:49 +00:00
Grzegorz Bernacki
ff3dd71982 Add localbus driver for Marvell's platforms.
Obtained from: Semihalf
Supported by:  FreeBSD Foundation, Juniper Networks
2012-05-18 15:25:43 +00:00
Grzegorz Bernacki
b91fab4255 Add architecture dependent code to support NAND Framework on Marvell SoCs.
Obtained from: Semihalf
Supported by:  FreeBSD Foundation, Juniper Networks
2012-05-18 14:41:14 +00:00
Rafal Jaworowski
fd62dcff8a Fix error check.
Submitted by:	Lukasz Plachno
Obtained from:	Semihalf
2012-03-15 21:48:27 +00:00
Rafal Jaworowski
f05c7d9044 Remove unused #defines. All this is now retrieved from the device tree.
MFC after:	1 week
2012-03-04 18:13:45 +00:00
Olivier Houchard
0d43a18d50 Make sure we do not provide the page 0 to the VM. It can't handle it properly,
because pmap_extract() returns 0 when there's no mapping.

PR:		arm/154227
MFC after:	1 week
2012-02-29 12:44:34 +00:00
Jayachandran C.
07042bef45 Fix OF_finddevice error return value in case of FDT.
According to the open firmware standard, finddevice call has to return
a phandle with value of -1 in case of error.

This commit is to:
- Fix the FDT implementation of this interface (ofw_fdt_finddevice) to
  return (phandle_t)-1 in case of error, instead of 0 as it does now.
- Fix up the callers of OF_finddevice() to compare the return value with
  -1 instead of 0 to check for errors.
- Since phandle_t is unsigned, the return value of OF_finddevice should
  be checked with '== -1' rather than '<= 0' or '> 0', fix up these cases
  as well.

Reported by:	nwhitehorn

Reviewed by:	raj
Approved by:	raj, nwhitehorn
2011-12-02 15:24:39 +00:00
Marius Strobl
4b7ec27007 - There's no need to overwrite the default device method with the default
one. Interestingly, these are actually the default for quite some time
  (bus_generic_driver_added(9) since r52045 and bus_generic_print_child(9)
  since r52045) but even recently added device drivers do this unnecessarily.
  Discussed with: jhb, marcel
- While at it, use DEVMETHOD_END.
  Discussed with: jhb
- Also while at it, use __FBSDID.
2011-11-22 21:28:20 +00:00
Rafal Jaworowski
8817e1bffe Initial version of cesa(4) driver for Marvell crypto engine and security
accelerator.

The following algorithms and schemes are supported:
 - 3DES, AES, DES
 - MD5, SHA1

Obtained from:	Semihalf
Written by:	Piotr Ziecik
2011-11-19 16:30:06 +00:00
Marcel Moolenaar
7274b125c9 Fix build when DEBUG is defined in the kernel configuration file (e.g.
LINT).
2011-10-04 16:58:20 +00:00
Marcel Moolenaar
cb06595948 Do not call platform_gpio_init() early. It doesn't work because we do
not have enough information to reliably setup GPIO pins. Do it when
we attach the gpio driver. This prevents hangs and the need to fake
up a softc.
2011-07-15 02:29:10 +00:00
Marcel Moolenaar
178b27373a Set preload_addr_relocate accordingly so that preloaded modules and
images are properly relocated.
2011-07-15 02:16:13 +00:00
Kevin Lo
e6cf436883 Typo
Submitted by:	Damjan Marion <damjan dot marion at gmail dot com>
MFC after:	3 days
2011-06-29 09:35:40 +00:00