Commit Graph

28 Commits

Author SHA1 Message Date
Marcin Wojtas
e9e2a7c1d3 Enable cesa driver to work with Linux DT binding
Linux device tree binding, whose usage is obligatory,
comprises faulty representation of Marvell cryptographic
engine (CESA) - two engines are artificially gathered into
single DT node, in order to avoid certain SW limitation.

This patch improves the cesa driver to support above binding,
depending on compatible string, which helps to ensure
backward compatibility.

Submitted by: Patryk Duda
Obtained from: Semihalf
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D14760
2018-04-09 23:36:52 +00:00
Marcin Wojtas
091cd2f18d Make mv_common.c generic for Marvell Armada38X and ArmadaXP
Preparation for adding Armada38X and ArmadaXP SoC to GENERIC config.
Supported platform are listed in soc_family enum.
struct decode_win_spec contains platform specific functions and constants.
Function mv_check_soc_family checks SoC type and chooses proper structure
in runtime, as well as platform-dependent functions.
Unnecessary dummy functions are removed.
Because of changing registers name to more generic new definition of
FDT_DEVMAP_MAX in mv_machdep is added.

Submitted by: Rafal Kozik <rk@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D14738
2018-04-03 21:54:36 +00:00
Marcin Wojtas
fefc2cf777 Make Marvell mv_pci.c driver generic
PCI ports differ between Marvell SoCs, but have the same compatible in FDT.
Identification is made based on parent compatible during attach.
For ArmadaXP skipping enable procedure is necessary. To achieve it
sc_skip_enable_procedure flag is used.
For Armada38x find root procedure is necessary. For other SoCs root link is
always at slot 0. sc_enable_find_root_slot flag is used to select proper
behaviour.
Marvell armv5 platforms does not support msi.

Submitted by: Rafal Kozik <rk@semihalf.com>
Reviewed by: andrew
Obtained from: Semihalf
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D14735
2018-04-03 21:25:15 +00:00
Pedro F. Giffuni
51369649b0 sys: further adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 3-Clause license.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.
2017-11-20 19:43:44 +00:00
Zbigniew Bodek
a8d7fc4ac1 Introduce Armada 38x/XP network controller support
This patch contains a new driver for the network unit of Marvell
Armada 38x/XP SoCs, called NETA. This support was thoroughly tested
and optimised in terms of stability and performance. Additional
hardware features, like Buffer Management (BM) or Parser and Classifier
(PnC) will be progressively supported as needed.

Submitted by: Fabien Thomas <fabien.thomas@stormshield.eu>
	      Arnaud Ysmal <arnaud.ysmal@stormshield.eu>
	      Zbigniew Bodek <zbb@semihalf.com>
	      Michal Mazur <mkm@semihalf.com>
	      Bartosz Szczepanek <bsz@semihalf.com>
	      Marcin Wojtas <mw@semihalf.com>

Obtained from:	Semihalf
Sponsored by:	Stormshield (main development)
		Netgate (cleanup and upstreaming)
Differential revision: https://reviews.freebsd.org/D10706
2017-06-13 18:46:29 +00:00
Wojciech Macek
fcb93d7493 Enable proper configuration of CESA MBUS windows
For all Marvell devices, MBUS windows configuration is done
in a common place. Only CESA was an exception, so move its
related code from driver to mv_common.c. This way it uses
same proper DRAM information, same as  all other interfaces
instead of parsing DT /memory node directly.

Submitted by: Marcin Wojtas <mw@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield
Reviewed by: loos
Differential revision: https://reviews.freebsd.org/D10723
2017-05-19 08:19:39 +00:00
Zbigniew Bodek
abafc55b96 Fix USB3.0 decoding windows on Armada38x
Set correct offset for MBUS windows configuration in
USB3.0 interface.

Submitted by: Marcin Wojtas <mw@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield
Reviewed by: loos
Differential revision: https://reviews.freebsd.org/D10721
2017-05-17 15:52:04 +00:00
Luiz Otavio O Souza
a564364892 Move the IO Window Control Register defines out of the ARMADA38X ifdef.
Fixes the build of Marvell kernels (other than ARMADA38X) after r318336.

Reported by:	mmel
2017-05-17 15:13:01 +00:00
Luiz Otavio O Souza
98a2d78daf Add the SDHCI Address Decoder registers and routines for ARMADA 38X.
Tested on:	ClearFog Pro
Reviewed by:	Marcin Wojtas <mw at semihalf.com>
Sponsored by:	Rubicon Communications, LLC (Netgate)
Differential Revision:	https://reviews.freebsd.org/D10601
2017-05-16 04:47:50 +00:00
Andrew Turner
1eff4c0c37 Remove code for Marvell SoCs that lack a kernel config.
It seems to be old code from the armv6 project branch that never had a
kernel config.

Reviewed by:	mmel
Sponsored by:	ABT Systems Lrd
Differential Revision:	https://reviews.freebsd.org/D7166
2017-03-17 12:59:16 +00:00
Wojciech Macek
ccd5b1b023 Setup decoding windows for ARMADA38X
It is necesarry to open memory windows on internal bus for
AHCI driver to work correctly.

Submitted by:          Konrad Adamczyk <ka@semihalf.com>
Obtained from:         Semihalf
Sponsored by:          Stormshield
Reviewed by:           zbb
Differential revision: https://reviews.freebsd.org/D9220
2017-01-25 10:31:16 +00:00
Zbigniew Bodek
5d7cb9a803 Configure CPU window to second CESA SRAM
Check if there is a second CESA SRAM node in FDT and add a CPU window
for it. Define A38X specific macro for setting device attribute for
each node.

Submitted by:	Michal Stanek <mst@semihalf.com>
Obtained from:	Semihalf
Sponsored by:	Stormshield
Differential revision:	https://reviews.freebsd.org/D6216
2016-06-02 18:33:26 +00:00
Wojciech Macek
34a3d2c6e7 Add support for USB3.0 on Armada38x
This commit provides attachment of xhci-platform for A38X boards, making
it possible to mount FreeBSD world from USB3.0 flash. 'xhci' device was
added to files.mv (as optional) and kernconf of Armada38x was enhanced.

It was also necessary to open programmable memory windows of USB3.0.
fdt_win_setup needed improvement so it's able to traverse through
children of internal-regs node.

Submitted by:          Bartosz Szczepanek <bsz@semihalf.com>
Obtained from:         Semihalf
Sponsored by:          Stormshield
Reviewed by:           hselasky
Approved by:           cognet (mentor)
Differential Revision: https://reviews.freebsd.org/D5031
2016-03-14 07:14:34 +00:00
Zbigniew Bodek
46c9254b05 Open window to bootROM memory on Armada38x to allow CPU1 to boot
CPU1 is halted in bootROM code while it is waiting to be released.
Memory window to bootROM must be opened before booting the core.

Obtained from:  Semihalf
Sponsored by:   Stormshield
Submitted by:   Michal Stanek <mst@semihalf.com>
Differential revision:  https://reviews.freebsd.org/D4425
2016-01-20 14:30:17 +00:00
Zbigniew Bodek
e34c3bf23b Correct MV_DDR_CADR_BASE definiton in mvwin.h
SOC_MV_ARMADAXP ifdef was enhanced with SOC_MV_ARMADA38X,
correcting MV_DDR_CADR_BASE definition. It fixes PCIe hangs issue.

Reviewed by:    andrew
Obtained from:  Semihalf
Sponsored by:   Stormshield
Submitted by:   Bartosz Szczepanek <bsz@semihalf.com>
Differential revision:  https://reviews.freebsd.org/D4380
2016-01-20 14:16:13 +00:00
Zbigniew Bodek
5afccf3680 Improve definitions of CPU/PCIe windows for Armada38x
Enhance existing ARMADAXP defines and introduce new MV_WIN_PCIE_
definitions.

Reviewed by:    andrew
Obtained from:  Semihalf
Sponsored by:   Stormshield
Submitted by:   Bartosz Szczepanek <bsz@semihalf.com>
Differential revision:  https://reviews.freebsd.org/D4378
2016-01-20 14:10:00 +00:00
Zbigniew Bodek
5b683b6fc5 Set IO Sync Barrier flags for all Mbus devices on Armada38x
IO Sync Barrier setting is required for I/O coherency.

Reviewed by:   andrew, ian, imp
Obtained from: Semihalf
Sponsored by:  Stormshield
Submitted by:  Michal Stanek <mst@semihalf.com>
Differential revision:  https://reviews.freebsd.org/D4219
2016-01-20 13:53:33 +00:00
Zbigniew Bodek
f8742b0da3 Introduce initial support for Marvell Armada38x
This commit introduces initial support for Marvell Armada38x platform.
Changes:
- Add common DTS files for Armada38x SoCs and DTS file for A388-GP
- Add ARMADA38X kernel configuration
- Add option SOC_MV_ARMADA38X and set MV_PCI_PORTS
- Add list of files to compile
- Implement get_tclk(), get_sar_value(), cpu_reset() functions
- Add CPU ID and SoC numbers
- Correct ifdefs in arm/mv/timer.c

Reviewed by:    ian, imp
Obtained from:  Semihalf
Sponsored by:   Stormshield
Submitted by:   Michal Stanek <mst@semihalf.com>
Differential revision:  https://reviews.freebsd.org/D4210
2016-01-20 13:14:36 +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
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
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
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
Warner Losh
c358d6a2b0 Trim trailing whitespace... 2012-06-13 04:59:00 +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
db5ef4fc77 Convert Marvell ARM platforms to FDT convention.
The following systems are involved:

  - DB-88F5182
  - DB-88F5281
  - DB-88F6281
  - DB-78100
  - SheevaPlug

This overhaul covers the following major changes:

  - All integrated peripherals drivers for Marvell ARM SoC, which are
    currently in the FreeBSD source tree are reworked and adjusted so they
    derive config data out of the device tree blob (instead of hard coded /
    tabelarized values).

  - Since the common FDT infrastrucutre (fdtbus, simplebus) is used we say
    good by to obio / mbus drivers and numerous hard-coded config data.

Note that world needs to be built WITH_FDT for the affected platforms.

Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation.
2010-06-13 13:28:53 +00:00
Rafal Jaworowski
ebeaf70342 Enable all populated TWSI (I2C) controllers on Marvell SOCs.
Obtained from:	Semihalf
2009-06-25 10:03:51 +00:00
Marcel Moolenaar
85fc5c3b93 Move the memory layout definitions and logic from mvreg.h to mvwin.h
so that it isn't exposured unless needed. In particular this means
that it's easier to tune the memory layout based on board details.
While here, remove inclusion of <machine/intr.h> from mvreg.h. This
also contains exposure to SoC specifics in MI drivers, because NIRQ
depends on the SoC.
2009-06-12 20:00:38 +00:00