Skip to content

Commit

Permalink
Platform/RK3588: Add Firefly ITX-3588J board support (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
shimmyshai00 authored Dec 17, 2023
1 parent 05bc33b commit a6c7ca1
Show file tree
Hide file tree
Showing 18 changed files with 1,860 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
- orangepi-5plus
- indiedroid-nova
- roc-rk3588s-pc
- itx-3588j
- station-m3
- r58x
- r58-mini
Expand Down
3 changes: 3 additions & 0 deletions configs/itx-3588j.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DSC_FILE=edk2-rockchip/Platform/Firefly/ITX-3588J/ITX-3588J.dsc
PLATFORM_NAME=ITX-3588J
SOC=RK3588
4 changes: 4 additions & 0 deletions edk2-rockchip-non-osi/Platform/Rockchip/DeviceTree/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,9 @@

* roc-rk3588s-pc: <https://gitlab.com/firefly-linux/kernel/-/tree/b8646da2122f45a2c02082d949427b80d2e89b1f/arch/arm64/boot/dts/rockchip>

* itx-3588j: <https://gitlab.com/firefly-linux/kernel/-/tree/e14c28295dd7ee8f807899e9b0b7da5f79742e4f/arch/arm64/boot/dts/rockchip>
(note: in the dtb given here, the builtin bootargs in the source above were commented out
before building. Not sure if that was a necessary step - SS)

## License
SPDX-License-Identifier: GPL-2.0-only
Binary file not shown.
61 changes: 61 additions & 0 deletions edk2-rockchip/Platform/Firefly/ITX-3588J/AcpiTables/AcpiTables.inf
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#/** @file
#
# ACPI table data and ASL sources required to boot the platform.
#
# Copyright (c) 2019-2021, ARM Limited. All rights reserved.
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
#**/

[Defines]
INF_VERSION = 0x0001001A
BASE_NAME = AcpiTables
FILE_GUID = 7E374E25-8E01-4FEE-87F2-390C23C606CD
MODULE_TYPE = USER_DEFINED
VERSION_STRING = 1.0
RK_COMMON_ACPI_DIR = Silicon/Rockchip/RK3588/AcpiTables

#
# The following information is for reference only and not required by the build tools.
#
# VALID_ARCHITECTURES = AARCH64
#

[Sources]
Dsdt.asl
$(RK_COMMON_ACPI_DIR)/Madt.aslc
$(RK_COMMON_ACPI_DIR)/Fadt.aslc
$(RK_COMMON_ACPI_DIR)/Gtdt.aslc
$(RK_COMMON_ACPI_DIR)/Spcr.aslc
$(RK_COMMON_ACPI_DIR)/Mcfg.aslc
$(RK_COMMON_ACPI_DIR)/Dbg2.aslc
$(RK_COMMON_ACPI_DIR)/Pptt.aslc
$(RK_COMMON_ACPI_DIR)/Pcie3x4.asl
$(RK_COMMON_ACPI_DIR)/Pcie3x2.asl
$(RK_COMMON_ACPI_DIR)/Pcie2x1l0.asl
$(RK_COMMON_ACPI_DIR)/Pcie2x1l1.asl
$(RK_COMMON_ACPI_DIR)/Pcie2x1l2.asl
$(RK_COMMON_ACPI_DIR)/Sata0.asl
$(RK_COMMON_ACPI_DIR)/Sata1.asl
$(RK_COMMON_ACPI_DIR)/Sata2.asl
$(RK_COMMON_ACPI_DIR)/Usb2Host.asl

[Packages]
ArmPkg/ArmPkg.dec
ArmPlatformPkg/ArmPlatformPkg.dec
EmbeddedPkg/EmbeddedPkg.dec
MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec
Silicon/Rockchip/RockchipPkg.dec

[FixedPcd]
gArmTokenSpaceGuid.PcdArmArchTimerIntrNum
gArmTokenSpaceGuid.PcdArmArchTimerHypIntrNum
gArmTokenSpaceGuid.PcdArmArchTimerSecIntrNum
gArmTokenSpaceGuid.PcdArmArchTimerVirtIntrNum
gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase
gArmTokenSpaceGuid.PcdGicDistributorBase
gArmTokenSpaceGuid.PcdGicRedistributorsBase
gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase
37 changes: 37 additions & 0 deletions edk2-rockchip/Platform/Firefly/ITX-3588J/AcpiTables/Dsdt.asl
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/** @file
*
* Differentiated System Definition Table (DSDT)
*
* Copyright (c) 2020, Pete Batard <[email protected]>
* Copyright (c) 2018-2020, Andrey Warkentin <[email protected]>
* Copyright (c) Microsoft Corporation. All rights reserved.
* Copyright (c) 2021, ARM Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*
**/

#include "AcpiTables.h"

DefinitionBlock ("Dsdt.aml", "DSDT", 2, "RKCP ", "RK3588 ", 2)
{
Scope (\_SB_)
{
include ("Cpu.asl")

include ("Emmc.asl")
include ("Sdhc.asl")
include ("Dma.asl")
include ("Gmac0.asl")
include ("Gmac1.asl")
include ("Gpio.asl")
include ("I2c.asl")
include ("Uart.asl")
// include ("Spi.asl")

include ("Usb1Host.asl")
include ("Usb3Host0.asl")
include ("Usb3Host1.asl")
include ("Usb3Host2.asl")
}
}
19 changes: 19 additions & 0 deletions edk2-rockchip/Platform/Firefly/ITX-3588J/ITX-3588J.Modules.fdf.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## @file
#
# Copyright (c) 2023, Mario Bălănică <mariobalanica02@gmail.com>
# Copyright (c) 2023, Shimrra Shai <shimmyshai00@gmail.com>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##

# ACPI Support
INF RuleOverride = ACPITABLE Platform/Firefly/ITX-3588J/AcpiTables/AcpiTables.inf

# Device Tree Support
FILE FREEFORM = gDtPlatformDefaultDtbFileGuid {
SECTION RAW = Platform/Rockchip/DeviceTree/itx-3588j.dtb
}

# Splash screen logo
INF $(VENDOR_DIRECTORY)/Drivers/LogoDxe/LogoDxe.inf
34 changes: 34 additions & 0 deletions edk2-rockchip/Platform/Firefly/ITX-3588J/ITX-3588J.dsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
## @file
#
# Copyright (c) 2014-2018, Linaro Limited. All rights reserved.
# Copyright (c) 2023, Mario Bălănică <[email protected]>
# Copyright (c) 2023, Shimrra Shai <[email protected]>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##

################################################################################
#
# Defines Section - statements that will be processed to create a Makefile.
#
################################################################################
[Defines]
PLATFORM_NAME = ITX-3588J
PLATFORM_VENDOR = Firefly
PLATFORM_GUID = db88a604-ec99-4d39-84d4-af4fa5b5e757
PLATFORM_VERSION = 0.2
DSC_SPECIFICATION = 0x00010019
OUTPUT_DIRECTORY = Build/$(PLATFORM_NAME)
VENDOR_DIRECTORY = Platform/$(PLATFORM_VENDOR)
PLATFORM_DIRECTORY = $(VENDOR_DIRECTORY)/$(PLATFORM_NAME)
SUPPORTED_ARCHITECTURES = AARCH64
BUILD_TARGETS = DEBUG|RELEASE
SKUID_IDENTIFIER = DEFAULT

#
# Platform based on ITX-3588J board
#
!include Platform/Firefly/ITX-3588J/ITX-3588J.dsc.inc


120 changes: 120 additions & 0 deletions edk2-rockchip/Platform/Firefly/ITX-3588J/ITX-3588J.dsc.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
## @file
#
# Copyright (c) 2014-2018, Linaro Limited. All rights reserved.
# Copyright (c) 2023, Mario Bălănică <mariobalanica02@gmail.com>
# Copyright (c) 2023, Shimrra Shai <shimmyshai00@gmail.com>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##

################################################################################
#
# Defines Section - statements that will be processed to create a Makefile.
#
################################################################################
[Defines]
FLASH_DEFINITION = Silicon/Rockchip/RK3588/RK3588.fdf
RK_PLATFORM_FVMAIN_MODULES = Platform/Firefly/ITX-3588J/ITX-3588J.Modules.fdf.inc

#
# HYM8563 RTC support
# I2C location configured by PCDs below.
#
DEFINE RK_RTC8563_ENABLE = TRUE

#
# PCA9555 GPIO extender support
# I2C location configured by PCDs below.
#
DEFINE RK_PCA9555_ENABLE = TRUE

#
# RK3588-based platform
#
!include Silicon/Rockchip/RK3588/RK3588Platform.dsc.inc

################################################################################
#
# Library Class section - list of all Library Classes needed by this Platform.
#
################################################################################

[LibraryClasses.common]
RockchipPlatformLib|Platform/Firefly/ITX-3588J/Library/RockchipPlatformLib/RockchipPlatformLib.inf

################################################################################
#
# Pcd Section - list of all EDK II PCD Entries defined by this Platform.
#
################################################################################

[PcdsFixedAtBuild.common]
# SMBIOS platform config
gRockchipTokenSpaceGuid.PcdPlatformName|"ITX-3588J"
gRockchipTokenSpaceGuid.PcdPlatformVendorName|"Firefly"
gRockchipTokenSpaceGuid.PcdFamilyName|"ITX"
gRockchipTokenSpaceGuid.PcdProductUrl|"https://en.t-firefly.com/product/industry/itx3588j"
gRockchipTokenSpaceGuid.PcdDeviceTreeName|"itx-3588j"

# I2C
gRockchipTokenSpaceGuid.PcdI2cSlaveAddresses|{ 0x42, 0x43, 0x51, 0x21, 0x22 }
gRockchipTokenSpaceGuid.PcdI2cSlaveBuses|{ 0x0, 0x0, 0x6, 0x6, 0x6 }
gRockchipTokenSpaceGuid.PcdI2cSlaveBusesRuntimeSupport|{ FALSE, FALSE, TRUE, FALSE, FALSE }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorAddresses|{ 0x42, 0x43 }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorBuses|{ 0x0, 0x0 }
gRockchipTokenSpaceGuid.PcdRk860xRegulatorTags|{ $(SCMI_CLK_CPUB01), $(SCMI_CLK_CPUB23) }
gPcf8563RealTimeClockLibTokenSpaceGuid.PcdI2cSlaveAddress|0x51
gRockchipTokenSpaceGuid.PcdRtc8563Bus|0x6
gRockchipTokenSpaceGuid.PcdPca9555Address|0x21
gRockchipTokenSpaceGuid.PcdPca9555Bus|0x6

#
# CPU Performance default values
#
gRK3588TokenSpaceGuid.PcdCPULClusterClockPresetDefault|$(CPU_PERF_CLUSTER_CLOCK_PRESET_BOOTDEFAULT)
gRK3588TokenSpaceGuid.PcdCPUB01ClusterClockPresetDefault|$(CPU_PERF_CLUSTER_CLOCK_PRESET_BOOTDEFAULT)
gRK3588TokenSpaceGuid.PcdCPUB23ClusterClockPresetDefault|$(CPU_PERF_CLUSTER_CLOCK_PRESET_BOOTDEFAULT)

#
# PCIe/SATA/USB Combo PIPE PHY support flags and default values
#
gRK3588TokenSpaceGuid.PcdComboPhy0Switchable|TRUE
gRK3588TokenSpaceGuid.PcdComboPhy1Switchable|TRUE
gRK3588TokenSpaceGuid.PcdComboPhy2Switchable|TRUE
gRK3588TokenSpaceGuid.PcdComboPhy0ModeDefault|$(COMBO_PHY_MODE_SATA)
gRK3588TokenSpaceGuid.PcdComboPhy1ModeDefault|$(COMBO_PHY_MODE_PCIE)
gRK3588TokenSpaceGuid.PcdComboPhy2ModeDefault|$(COMBO_PHY_MODE_USB3)

#
# USB/DP Combo PHY support flags and default values
#
gRK3588TokenSpaceGuid.PcdUsbDpPhy0Supported|TRUE
gRK3588TokenSpaceGuid.PcdUsbDpPhy1Supported|TRUE
gRK3588TokenSpaceGuid.PcdDp1LaneMux|{ 0x2, 0x3 }

#
# GMAC
#
gRK3588TokenSpaceGuid.PcdGmac0Supported|TRUE
gRK3588TokenSpaceGuid.PcdGmac0TxDelay|0x45
gRK3588TokenSpaceGuid.PcdGmac1Supported|TRUE
gRK3588TokenSpaceGuid.PcdGmac1TxDelay|0x42

#
# On-Board fan output
#
gRK3588TokenSpaceGuid.PcdHasOnBoardFanOutput|TRUE

################################################################################
#
# Components Section - list of all EDK II Modules needed by this Platform.
#
################################################################################
[Components.common]
# ACPI Support
Platform/Firefly/ITX-3588J/AcpiTables/AcpiTables.inf

# Splash screen logo
$(VENDOR_DIRECTORY)/Drivers/LogoDxe/LogoDxe.inf

Loading

0 comments on commit a6c7ca1

Please sign in to comment.