summaryrefslogtreecommitdiff
path: root/Silicon/Socionext/SynQuacer/Drivers
AgeCommit message (Collapse)Author
2018-04-26Silicon/Socionext/SynQuacer: update PHY reference clock rateArd Biesheuvel
As reported by Kojima-san, the PHY reference clock value we use in our ACPI and DT descriptions is out of sync with the hardware. Replace 125 MHz with 250 MHz throughout. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2018-04-19Silicon/SynQuacer/NetsecDxe: fix buffer allocation bugArd Biesheuvel
The receive buffers of the NETSEC driver are owned by the driver itself (as opposed to the protocol client in the case of the transmit path), and so the descriptors and the buffers (which are of a fixed size) are allocated in one go. The idea is that the 'buffer' member of the descriptor should point to a DMA aligned offset into the same allocation, but the code in pfdep_alloc_pkt_buf() calculates the value incorrectly, resulting in corruption of the descriptor metadata if the pool allocation happens to be DMA aligned. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2018-03-15Silicon/SynQuacer/PlatformDxe: add ACPI description of eMMCArd Biesheuvel
Expose a separate ACPI description of the SynQuacer eMMC controller when both ACPI and eMMC support have been enabled in the HII menu. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Graeme Gregory <graeme.gregory@linaro.org>
2018-03-15Silicon/SynQuacer/PlatformDxe: add option to enable ACPI modeArd Biesheuvel
Create a HII menu option to choose between device tree and ACPI platform descriptions. Note that the option is only active if PCIe compatibility mode is enabled. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2018-03-15Silicon/SynQuacer: tweak PCI I/O windows for ACPI/Linux supportArd Biesheuvel
The ACPI/Linux code does not cope very well with I/O BAR windows that involve type translation and address translation. In particular, the secondary I/O window we implement on SynQuacer: I/O 0x10000 ... 0x1ffff -> 0x77f00000 is misinterpreted by Linux, and results in the MMIO range starting at 0x77f10000 to be mapped for I/O port access to this range. This can be mitigated by using the same bus range for I/O port access on both RCs., i.e., [0x0 ... 0xffff]. This configuration can be represented using both DT and ACPI, and will work as expected in Linux. Now that the generic PCI host bridge driver has gained support for address translation, we can actually support this configuration seamlessly in UEFI as well, by applying an offset to the second I/O window to make it appear adjacent to the first one in the CPU view of the I/O space. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2018-02-27Silicon/SynQuacerI2cDxe: remove special runtime treatment of DEBUG()sArd Biesheuvel
It is no longer necessary to inhibit DEBUG() calls at runtime, due to the fact that we switched to a DebugLib implementation that takes care of this. Since a platform could theoretically wire up DXE_RUNTIME_DRIVER modules to a DebugLib/SerialPortLib implementation combo that does remap the UART MMIO region for runtime and produces UEFI debug output on a UART that is not owned by the OS, it is better not to handle this in the driver directly. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2018-02-23Platform/Socionext/DeveloperBox: add 96Boards mezzanine supportArd Biesheuvel
Wire up the various drivers for the 96Boards LS connector and the optional Secure96 mezzanine board. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2018-02-21Silicon/Socionext/SynQuacerI2cDxe: fix TPL handling bugArd Biesheuvel
Currently, SynQuacerI2cStartRequest() increases the TPL to TPL_HIGH_LEVEL while accessing the I2C controller hardware, but fails to restore the TPL to the original level if the call to SynQuacerI2cMasterStart() fails, and returns right away. Given the TPL_HIGH_LEVEL implies that interrupts are disabled, this results in a complete system hang. So instead, break out of the loop, so that the TPL restore will occur before leaving the function. Note that this will result in the bus control bits to be de-asserted in case of a failure to send the START condition, which is an appropriate cleanup action to take after SynQuacerI2cMasterStart() fails. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2018-02-08Silicon/SynQuacer/PlatformDxe: disable eMMC DDR50 supportArd Biesheuvel
We already disable SDR104 support on the SynQuacer eMMC controller to work around the need for a special tuning quirk that is difficult to implement without modifying the generic driver, even in the presence of a SD/MMC override protocol designed to carry such quirks. Unfortunately, as it turns out, DDR50 does not work either with the particular 8 GB Kingston part that has been fitted on the rev0.2/0.3 96board samples. Since the mode UEFI drives the eMMC in is independent from what the OS chooses, and the fact that you would not use eMMC in the first place if performance was a major concern, let's just disable DDR50 as well, and fall back to SDR50 mode. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2018-01-30Silicon/Socionext/SynQuacer: add configurable eMMC supportArd Biesheuvel
Implement support for the SynQuacer eMMC controller. This involves an implementation of the SD/MMC override protocol to handle a couple of quirks that would otherwise prevent this IP from being driven by the generic SDHCI driver. Also, add a HII page to the PlatformDxe driver that allows eMMC support to be enabled, and wire it up for both DeveloperBox and EVB. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2018-01-29Silicon/SynQuacer: set CNTFRQ field of MMIO timer frameArd Biesheuvel
Even though the ARM ARM quite clearly states that the CNTFRQ field of each MMIO timer frame should be a read-only alias of the CNTFRQ field of the base frame, the SynQuacer SoC implements it as a register that is programmable separately. So let's program it from the hardware rather than overriding the frequency using a DT property. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2018-01-25Silicon/Socionext/SynQuacer: implement menu option to set max PCIe speedArd Biesheuvel
Add menu options to the SynQuacer Platform menu screen to limit the maximum PCIe link speed for each slot individually. This may be useful to work around potential PCIe issues. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2018-01-25Silicon/SynQuacer: load I2C driver before platform DXE driverArd Biesheuvel
To ensure that the I2C master protocol is installed immediately onto the handles created by PlatformDxe in its entry point, force the SynQuacerI2cDxe driver to be loaded before PlatformDxe. These handles are recursively connected by the DXE core as soon as they appear, and so ensuring that the I2C master protocol driver is available at this time will ensure that these handles will be connected to it right away. This is useful when implementations of architectural protocols such as RTC or the EFI variable store, which should become available long before the ordinary dispatch of UEFI driver model drivers is started at the end of DXE, are based on I2C. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2018-01-25Silicon/SynQuacerI2cDxe: remove spurious format specifierArd Biesheuvel
Remove a %r without an associated parameter. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2018-01-25Silicon: fix typo in gPcf8563RealTimeClockLibI2cMasterProtocolGuidArd Biesheuvel
Do a global replace of gPcf8563RealTimeClockLibI2cMasterProtolGuid with gPcf8563RealTimeClockLibI2cMasterProtocolGuid. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2018-01-25Silicon/SynQuacer/PlatformDxe: enable spread spectrum mode for ASM1061 SATAArd Biesheuvel
The ASM1061 SATA controller integrated into the DeveloperBox board emits too much electromagnetic radiation, so it needs spread spectrum mode enabled. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2017-12-12Silicon/SynQuacer/PlatformDxe: retrain PCIe switch links to Gen2 speedArd Biesheuvel
For some reason, the Asmedia 118x PCIe switch needs a little help to make sure that the downstream links train at Gen2 speed. So add a PCI I/O protocol notifier that implements this for each PCIe downstream port that is present on the system. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2017-12-08Silicon/Socionext/SynQuacer/PlatformDxe: add missing IoLib includeArd Biesheuvel
Commit ce95ec196da0 ("Silicon/SynQuacer: enable coherent DMA for NETSEC and eMMC") introduced a call to MmioOr32 into PlatformDxe without adding the appropriate #include and LibraryClass references, resulting in build failures when attempting to build the SynQuacer platforms. So add them. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> Tested-by: Leif Lindholm <leif.lindholm@linaro.org>
2017-12-07Silicon/SynQuacer: enable coherent DMA for NETSEC and eMMCArd Biesheuvel
As it turns out, it is surprisingly easy to configure both the NETSEC and eMMC devices as cache coherent for DMA, given that they are both behind the same SMMU which is already configured in passthrough mode by the firmware running on the SCP. So update the static SMMU configuration to make memory accesses performed by these devices inner shareable inner/outer writeback cacheable, which makes them cache coherent with the CPUs. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2017-12-04Silicon/SynQuacerI2CDxe: add missing __FUNCTION__ argument to %a specifierArd Biesheuvel
The I2C driver prints a warning under DEBUG when a I2C transaction times out. This will occur on the rev 0.1 DeveloperBox boards due to a board level error in the I2C routing (unless the MCU has been lifted off the bus). Currently, this will trigger a crash due to a missing __FUNCTION__ argument to a %a specifier in a DEBUG string, because instead, the code will attempt to dereference a EFI_STATUS variable as a char pointer. So add the missing __FUNCTION__ argument. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2017-12-01Silicon/Fip006Dxe: map NOR_FLASH_INFO FSR flag with instance flagPipat Methavanitpong
Now that we incorporated NorFlashInfoLib into the Fip006Dxe driver, replace the code that explicitly enables flag status register polling for Micron NOR flash with a test of the flags field provided by NorFlashInfoLib, which carries the same information. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Pipat Methavanitpong <methavanitpong.pipat@socionext.com> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2017-11-25Platform/DeveloperBox: wire up RTC supportArd Biesheuvel
Add the drivers, library resolutions and PCD settings to enable RTC support on DeveloperBox. Also, update PlatformDxe to register the non-discoverable device handles for both I2C controllers. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2017-11-25Silicon/Socionext: implement I2C master protocol for SynQuacer I2CArd Biesheuvel
Add a driver that produces the I2C master protocol on top of the I2C controllers that are implemented in the SynQuacer Socionext SoC. Note that this supports two modes simultaneously: I2C controllers that are only usable at boot time, and usable via the I2C protocol stack, and I2C controllers that are dedicated for the RTC or other runtime components. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2017-11-17Silicon/SynQuacer: implement PEIM that exposes GPIO PPIArd Biesheuvel
In order to be able to sample the state of the DIP switches at early boot on the Developer Box platform, implement the GPIO PPI based on the GPIO block that is implemented in the SynQuacer SoC. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2017-11-17Silicon/Socionext: add driver for SPI NOR flashPipat Methavanitpong
This imports the driver sources provided by Socionext for the FIP006 SPI NOR flash device found on SynQuacer SoCs. It has been slightly tweaked to bring it up to date with the changes made on the EDK2 side since it was forked. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Pipat Methavanitpong <methavanitpong.pipat@socionext.com> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Acked-by: Leif Lindholm <leif.lindholm@linaro.org>
2017-11-17Silicon/SynQuacer: implement EFI_CPU_IO2_PROTOCOLArd Biesheuvel
The SynQuacer SOC has two separate PCIe RCs, which means there is no single value for the translation offset between I/O port accesses and MMIO accesses. So add a special implementation of EFI_CPU_IO2_PROTOCOL that takes the two disjoint I/O windows into account. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2017-11-16Silicon/SynQuacer: implement a platform DXE driverArd Biesheuvel
This implements a driver that will take care of platform specific initialization, such as declaring non-discoverable devices, and installing the device tree blob as a configuration table. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2017-11-16Silicon/Socionext: add driver for NETSEC network controllerArd Biesheuvel
This adds the NetSecDxe driver provided by Socionext, but reworked extensively to improve compliance with the SimpleNetworkProtocol API, and to avoid uncached allocations for streaming DMA. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Tested-by: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>