mirror of
https://github.com/andreili/SBC_builder.git
synced 2025-08-23 19:04:06 +02:00
Compare commits
6 Commits
1383d18ecc
...
55d84e71f0
Author | SHA1 | Date | |
---|---|---|---|
|
55d84e71f0 | ||
|
b2f118ebf2 | ||
|
94ed8d5f0c | ||
|
66365d91a8 | ||
|
f5089c2269 | ||
|
ee2dc421bc |
@ -1,10 +1,10 @@
|
||||
#
|
||||
# Automatically generated file; DO NOT EDIT.
|
||||
# U-Boot 2025.07-rc5 Configuration
|
||||
# U-Boot 2025.10-rc2 Configuration
|
||||
#
|
||||
|
||||
#
|
||||
# Compiler: aarch64-linux-gnu-gcc (Gentoo 15.1.0 p1) 15.1.0
|
||||
# Compiler: aarch64-linux-gnu-gcc (Gentoo 15.1.1_p20250705-r1 p2) 15.1.1 20250705
|
||||
#
|
||||
CONFIG_CREATE_ARCH_SYMLINK=y
|
||||
CONFIG_HAVE_SETJMP=y
|
||||
@ -14,6 +14,7 @@ CONFIG_SYS_CACHE_SHIFT_6=y
|
||||
CONFIG_64BIT=y
|
||||
CONFIG_SPL_64BIT=y
|
||||
CONFIG_SYS_CACHELINE_SIZE=64
|
||||
CONFIG_SYS_DTC_PAD_BYTES=4096
|
||||
CONFIG_LINKER_LIST_ALIGN=8
|
||||
# CONFIG_ARC is not set
|
||||
CONFIG_ARM=y
|
||||
@ -56,6 +57,7 @@ CONFIG_COUNTER_FREQUENCY=24000000
|
||||
# CONFIG_POSITION_INDEPENDENT is not set
|
||||
# CONFIG_INIT_SP_RELATIVE is not set
|
||||
CONFIG_LNX_KRNL_IMG_TEXT_OFFSET_BASE=0x00a00000
|
||||
# CONFIG_KVM_VIRT_INS is not set
|
||||
# CONFIG_DRIVER_GICV2 is not set
|
||||
# CONFIG_GIC_V3_ITS is not set
|
||||
# CONFIG_GICV3_SUPPORT_GIC600 is not set
|
||||
@ -113,7 +115,6 @@ CONFIG_ARM64_SUPPORT_AARCH32=y
|
||||
# CONFIG_ARCH_IMXRT is not set
|
||||
# CONFIG_ARCH_MX23 is not set
|
||||
# CONFIG_ARCH_MX28 is not set
|
||||
# CONFIG_ARCH_MX31 is not set
|
||||
# CONFIG_ARCH_MX7ULP is not set
|
||||
# CONFIG_ARCH_MX7 is not set
|
||||
# CONFIG_ARCH_MX6 is not set
|
||||
@ -322,11 +323,12 @@ CONFIG_SYS_LITTLE_ENDIAN=y
|
||||
#
|
||||
# General setup
|
||||
#
|
||||
# CONFIG_COMPILE_TEST is not set
|
||||
# CONFIG_WERROR is not set
|
||||
CONFIG_LOCALVERSION=""
|
||||
CONFIG_LOCALVERSION_AUTO=y
|
||||
CONFIG_CC_IS_GCC=y
|
||||
CONFIG_GCC_VERSION=150100
|
||||
CONFIG_GCC_VERSION=150101
|
||||
CONFIG_CLANG_VERSION=0
|
||||
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
|
||||
# CONFIG_CC_OPTIMIZE_FOR_SPEED is not set
|
||||
@ -376,6 +378,7 @@ CONFIG_SYS_UBOOT_START=0x00a00000
|
||||
# Boot images
|
||||
#
|
||||
# CONFIG_ANDROID_BOOT_IMAGE is not set
|
||||
# CONFIG_ANDROID_BOOT_IMAGE_IGNORE_BLOB_ADDR is not set
|
||||
# CONFIG_TIMESTAMP is not set
|
||||
CONFIG_FIT=y
|
||||
CONFIG_FIT_EXTERNAL_OFFSET=0x0
|
||||
@ -420,6 +423,7 @@ CONFIG_BOOTMETH_VBE_SIMPLE=y
|
||||
# CONFIG_BOOTMETH_VBE_ABREC is not set
|
||||
CONFIG_BOOTMETH_VBE_SIMPLE_OS=y
|
||||
# CONFIG_SPL_BOOTMETH_VBE_SIMPLE is not set
|
||||
# CONFIG_BOOTMETH_RAUC is not set
|
||||
CONFIG_BOOTMETH_SCRIPT=y
|
||||
# CONFIG_UPL is not set
|
||||
CONFIG_LEGACY_IMAGE_FORMAT=y
|
||||
@ -466,6 +470,7 @@ CONFIG_BOOTDELAY=2
|
||||
#
|
||||
# CONFIG_OF_ENV_SETUP is not set
|
||||
# CONFIG_OF_BOARD_SETUP is not set
|
||||
# CONFIG_OF_BOARD_SETUP_EXTENDED is not set
|
||||
# CONFIG_OF_SYSTEM_SETUP is not set
|
||||
# CONFIG_OF_STDOUT_VIA_ALIAS is not set
|
||||
# CONFIG_FDT_FIXUP_PARTITIONS is not set
|
||||
@ -526,9 +531,9 @@ CONFIG_DISPLAY_BOARDINFO_LATE=y
|
||||
# CONFIG_CYCLIC is not set
|
||||
CONFIG_EVENT=y
|
||||
# CONFIG_EVENT_DEBUG is not set
|
||||
# CONFIG_ARCH_MISC_INIT is not set
|
||||
# CONFIG_BOARD_EARLY_INIT_F is not set
|
||||
# CONFIG_BOARD_EARLY_INIT_R is not set
|
||||
CONFIG_BOARD_INIT=y
|
||||
# CONFIG_BOARD_POSTCLK_INIT is not set
|
||||
CONFIG_BOARD_LATE_INIT=y
|
||||
# CONFIG_CLOCKS is not set
|
||||
@ -614,7 +619,7 @@ CONFIG_SYS_MMCSD_FS_BOOT_PARTITION=1
|
||||
# CONFIG_SPL_MMC_TINY is not set
|
||||
# CONFIG_SPL_MMC_WRITE is not set
|
||||
# CONFIG_SPL_MPC8XXX_INIT_DDR is not set
|
||||
# CONFIG_SPL_MTD is not set
|
||||
CONFIG_SPL_MTD=y
|
||||
# CONFIG_SPL_MUSB_NEW is not set
|
||||
# CONFIG_SPL_NAND_SUPPORT is not set
|
||||
# CONFIG_SPL_NAND_DRIVERS is not set
|
||||
@ -640,7 +645,7 @@ CONFIG_SPL_DM_SPI_FLASH=y
|
||||
# CONFIG_SPL_SATA is not set
|
||||
# CONFIG_SPL_NVME is not set
|
||||
CONFIG_SPL_SPI_FLASH_TINY=y
|
||||
# CONFIG_SPL_SPI_FLASH_MTD is not set
|
||||
CONFIG_SPL_SPI_FLASH_MTD=y
|
||||
CONFIG_SPL_SPI_LOAD=y
|
||||
CONFIG_SYS_SPI_U_BOOT_OFFS=0x60000
|
||||
# CONFIG_SPL_THERMAL is not set
|
||||
@ -683,6 +688,7 @@ CONFIG_CMD_BDI=y
|
||||
# CONFIG_CMD_CONFIG is not set
|
||||
CONFIG_CMD_CONSOLE=y
|
||||
# CONFIG_CMD_UFETCH is not set
|
||||
CONFIG_CMD_HELP=y
|
||||
# CONFIG_CMD_HISTORY is not set
|
||||
# CONFIG_CMD_LICENSE is not set
|
||||
# CONFIG_CMD_PMC is not set
|
||||
@ -875,7 +881,6 @@ CONFIG_CMD_REGULATOR=y
|
||||
# Security commands
|
||||
#
|
||||
# CONFIG_CMD_AES is not set
|
||||
# CONFIG_CMD_BLOB is not set
|
||||
# CONFIG_CMD_HASH is not set
|
||||
# CONFIG_CMD_HVC is not set
|
||||
# CONFIG_CMD_SMC is not set
|
||||
@ -970,7 +975,7 @@ CONFIG_ENV_SUPPORT=y
|
||||
CONFIG_ENV_CALLBACK_LIST_STATIC=""
|
||||
CONFIG_SAVEENV=y
|
||||
# CONFIG_ENV_OVERWRITE is not set
|
||||
# CONFIG_OVERWRITE_ETHADDR_ONCE is not set
|
||||
# CONFIG_ENV_OVERWRITE_ETHADDR_ONCE is not set
|
||||
CONFIG_ENV_MIN_ENTRIES=64
|
||||
CONFIG_ENV_MAX_ENTRIES=512
|
||||
CONFIG_ENV_IS_DEFAULT=y
|
||||
@ -981,13 +986,14 @@ CONFIG_ENV_IS_NOWHERE=y
|
||||
# CONFIG_ENV_IS_IN_FLASH is not set
|
||||
# CONFIG_ENV_IS_IN_MMC is not set
|
||||
# CONFIG_ENV_IS_IN_NAND is not set
|
||||
# CONFIG_ENV_IS_IN_SCSI is not set
|
||||
# CONFIG_ENV_IS_IN_NVRAM is not set
|
||||
# CONFIG_ENV_IS_IN_REMOTE is not set
|
||||
# CONFIG_ENV_IS_IN_SPI_FLASH is not set
|
||||
# CONFIG_ENV_IS_IN_MTD is not set
|
||||
# CONFIG_SYS_REDUNDAND_ENVIRONMENT is not set
|
||||
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
|
||||
# CONFIG_USE_DEFAULT_ENV_FILE is not set
|
||||
# CONFIG_ENV_REDUNDANT is not set
|
||||
CONFIG_ENV_RELOC_GD_ENV_ADDR=y
|
||||
# CONFIG_ENV_USE_DEFAULT_ENV_TEXT_FILE is not set
|
||||
# CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG is not set
|
||||
# CONFIG_ENV_IMPORT_FDT is not set
|
||||
# CONFIG_ENV_APPEND is not set
|
||||
@ -1043,7 +1049,6 @@ CONFIG_OFNODE_MULTI_TREE_MAX=4
|
||||
CONFIG_BOUNCE_BUFFER=y
|
||||
CONFIG_ADC=y
|
||||
# CONFIG_SPL_ADC is not set
|
||||
# CONFIG_ADC_EXYNOS is not set
|
||||
# CONFIG_ADC_SANDBOX is not set
|
||||
# CONFIG_SARADC_MESON is not set
|
||||
CONFIG_SARADC_ROCKCHIP=y
|
||||
@ -1082,7 +1087,6 @@ CONFIG_BLOCK_CACHE=y
|
||||
#
|
||||
# CONFIG_CACHE is not set
|
||||
# CONFIG_L2X0_CACHE is not set
|
||||
# CONFIG_ANDES_L2_CACHE is not set
|
||||
# CONFIG_NCORE_CACHE is not set
|
||||
# CONFIG_SIFIVE_CCACHE is not set
|
||||
# CONFIG_SIFIVE_PL2 is not set
|
||||
@ -1091,6 +1095,7 @@ CONFIG_BLOCK_CACHE=y
|
||||
# Clock
|
||||
#
|
||||
CONFIG_CLK=y
|
||||
# CONFIG_CLK_AUTO_ID is not set
|
||||
CONFIG_SPL_CLK=y
|
||||
# CONFIG_SPL_CLK_CCF is not set
|
||||
# CONFIG_CLK_CCF is not set
|
||||
@ -1120,12 +1125,12 @@ CONFIG_SPL_CLK=y
|
||||
# Hardware crypto devices
|
||||
#
|
||||
# CONFIG_DM_HASH is not set
|
||||
# CONFIG_DM_AES is not set
|
||||
# CONFIG_FSL_CAAM is not set
|
||||
CONFIG_CAAM_64BIT=y
|
||||
# CONFIG_SYS_FSL_SEC_BE is not set
|
||||
# CONFIG_SYS_FSL_SEC_LE is not set
|
||||
# CONFIG_FSL_DCP_RNG is not set
|
||||
# CONFIG_NPCM_AES is not set
|
||||
# CONFIG_NPCM_SHA is not set
|
||||
# CONFIG_DDR_SPD is not set
|
||||
# CONFIG_IMX_SNPS_DDR_PHY is not set
|
||||
@ -1143,8 +1148,6 @@ CONFIG_CAAM_64BIT=y
|
||||
# DMA Support
|
||||
#
|
||||
# CONFIG_DMA is not set
|
||||
# CONFIG_DMA_LPC32XX is not set
|
||||
# CONFIG_TI_EDMA3 is not set
|
||||
# CONFIG_DMA_LEGACY is not set
|
||||
|
||||
#
|
||||
@ -1158,7 +1161,6 @@ CONFIG_CAAM_64BIT=y
|
||||
CONFIG_FIRMWARE=y
|
||||
# CONFIG_SPL_FIRMWARE is not set
|
||||
CONFIG_ARM_PSCI_FW=y
|
||||
# CONFIG_ZYNQMP_FIRMWARE is not set
|
||||
# CONFIG_ARM_SMCCC_FEATURES is not set
|
||||
# CONFIG_ARM_FFA_TRANSPORT is not set
|
||||
# CONFIG_SCMI_FIRMWARE is not set
|
||||
@ -1168,7 +1170,6 @@ CONFIG_ARM_PSCI_FW=y
|
||||
# FPGA support
|
||||
#
|
||||
# CONFIG_FPGA_ALTERA is not set
|
||||
# CONFIG_FPGA_SOCFPGA is not set
|
||||
# CONFIG_FPGA_LATTICE is not set
|
||||
# CONFIG_FPGA_XILINX is not set
|
||||
# CONFIG_DM_FPGA is not set
|
||||
@ -1180,53 +1181,32 @@ CONFIG_SPL_DM_GPIO=y
|
||||
# CONFIG_DM_GPIO_LOOKUP_LABEL is not set
|
||||
# CONFIG_SPL_DM_GPIO_LOOKUP_LABEL is not set
|
||||
# CONFIG_ALTERA_PIO is not set
|
||||
# CONFIG_BCM2835_GPIO is not set
|
||||
# CONFIG_DWAPB_GPIO is not set
|
||||
# CONFIG_AT91_GPIO is not set
|
||||
# CONFIG_ATMEL_PIO4 is not set
|
||||
# CONFIG_ASPEED_GPIO is not set
|
||||
# CONFIG_ASPEED_SGPIO is not set
|
||||
# CONFIG_ASPEED_G7_GPIO is not set
|
||||
# CONFIG_DA8XX_GPIO is not set
|
||||
# CONFIG_FXL6408_GPIO is not set
|
||||
# CONFIG_HIKEY_GPIO is not set
|
||||
# CONFIG_INTEL_BROADWELL_GPIO is not set
|
||||
# CONFIG_INTEL_GPIO is not set
|
||||
# CONFIG_INTEL_ICH6_GPIO is not set
|
||||
# CONFIG_IMX_RGPIO2P is not set
|
||||
# CONFIG_IPROC_GPIO is not set
|
||||
# CONFIG_HSDK_CREG_GPIO is not set
|
||||
# CONFIG_KIRKWOOD_GPIO is not set
|
||||
# CONFIG_LPC32XX_GPIO is not set
|
||||
# CONFIG_MAX7320_GPIO is not set
|
||||
# CONFIG_MCP230XX_GPIO is not set
|
||||
# CONFIG_MSM_GPIO is not set
|
||||
# CONFIG_MXC_GPIO is not set
|
||||
# CONFIG_MXS_GPIO is not set
|
||||
# CONFIG_NPCM_GPIO is not set
|
||||
# CONFIG_NPCM_SGPIO is not set
|
||||
# CONFIG_CMD_PCA953X is not set
|
||||
# CONFIG_PCF8575_GPIO is not set
|
||||
CONFIG_ROCKCHIP_GPIO=y
|
||||
# CONFIG_XILINX_GPIO is not set
|
||||
# CONFIG_TCA642X is not set
|
||||
# CONFIG_TEGRA_GPIO is not set
|
||||
# CONFIG_TEGRA186_GPIO is not set
|
||||
# CONFIG_VYBRID_GPIO is not set
|
||||
# CONFIG_SIFIVE_GPIO is not set
|
||||
# CONFIG_ZYNQ_GPIO is not set
|
||||
# CONFIG_DM_74X164 is not set
|
||||
# CONFIG_DM_PCA953X is not set
|
||||
# CONFIG_ADP5588_GPIO is not set
|
||||
# CONFIG_SPL_DM_PCA953X is not set
|
||||
# CONFIG_PCA953X is not set
|
||||
# CONFIG_MPC8XXX_GPIO is not set
|
||||
# CONFIG_MPC8XX_GPIO is not set
|
||||
# CONFIG_NX_GPIO is not set
|
||||
# CONFIG_NOMADIK_GPIO is not set
|
||||
# CONFIG_SLG7XL45106_I2C_GPO is not set
|
||||
# CONFIG_FTGPIO010 is not set
|
||||
# CONFIG_ADP5585_GPIO is not set
|
||||
# CONFIG_MPFS_GPIO is not set
|
||||
|
||||
#
|
||||
# Hardware Spinlock Support
|
||||
@ -1238,31 +1218,26 @@ CONFIG_SPL_DM_I2C=y
|
||||
# CONFIG_I2C_SET_DEFAULT_BUS_NUM is not set
|
||||
# CONFIG_DM_I2C_GPIO is not set
|
||||
# CONFIG_SYS_I2C_IPROC is not set
|
||||
# CONFIG_SYS_I2C_FSL is not set
|
||||
# CONFIG_SYS_I2C_CADENCE is not set
|
||||
# CONFIG_SYS_I2C_DW is not set
|
||||
# CONFIG_SYS_I2C_INTEL is not set
|
||||
# CONFIG_SYS_I2C_IMX_LPI2C is not set
|
||||
# CONFIG_SYS_I2C_MTK is not set
|
||||
# CONFIG_SYS_I2C_MICROCHIP is not set
|
||||
# CONFIG_SYS_I2C_MXC is not set
|
||||
# CONFIG_SYS_I2C_NEXELL is not set
|
||||
# CONFIG_SYS_I2C_NPCM is not set
|
||||
# CONFIG_SYS_I2C_OCORES is not set
|
||||
CONFIG_SYS_I2C_ROCKCHIP=y
|
||||
# CONFIG_SYS_I2C_SOFT is not set
|
||||
# CONFIG_SYS_I2C_S3C24X0 is not set
|
||||
# CONFIG_SYS_I2C_MV is not set
|
||||
# CONFIG_SYS_I2C_MVTWSI is not set
|
||||
# CONFIG_SYS_I2C_XILINX_XIIC is not set
|
||||
# CONFIG_SYS_I2C_IHS is not set
|
||||
# CONFIG_I2C_MUX is not set
|
||||
# CONFIG_I3C is not set
|
||||
# CONFIG_I3C_SANDBOX is not set
|
||||
CONFIG_INPUT=y
|
||||
# CONFIG_SPL_INPUT is not set
|
||||
# CONFIG_DM_KEYBOARD is not set
|
||||
# CONFIG_SPL_DM_KEYBOARD is not set
|
||||
# CONFIG_CROS_EC_KEYB is not set
|
||||
# CONFIG_TEGRA_KEYBOARD is not set
|
||||
# CONFIG_TWL4030_INPUT is not set
|
||||
|
||||
#
|
||||
@ -1315,13 +1290,10 @@ CONFIG_ROCKCHIP_IODOMAIN=y
|
||||
# CONFIG_VEXPRESS_CONFIG is not set
|
||||
# CONFIG_CROS_EC is not set
|
||||
# CONFIG_SPL_CROS_EC is not set
|
||||
# CONFIG_DS4510 is not set
|
||||
# CONFIG_FSL_SEC_MON is not set
|
||||
# CONFIG_IRQ is not set
|
||||
# CONFIG_NPCM_HOST is not set
|
||||
# CONFIG_NUVOTON_NCT6102D is not set
|
||||
# CONFIG_PWRSEQ is not set
|
||||
# CONFIG_PCA9551_LED is not set
|
||||
# CONFIG_TEST_DRV is not set
|
||||
# CONFIG_TURRIS_OMNIA_MCU is not set
|
||||
# CONFIG_USB_HUB_USB251XB is not set
|
||||
@ -1335,7 +1307,6 @@ CONFIG_ROCKCHIP_IODOMAIN=y
|
||||
# CONFIG_FS_LOADER is not set
|
||||
# CONFIG_SPL_FS_LOADER is not set
|
||||
# CONFIG_GDSYS_SOC is not set
|
||||
# CONFIG_IHS_FPGA is not set
|
||||
# CONFIG_MICROCHIP_FLEXCOM is not set
|
||||
# CONFIG_ESM_PMIC is not set
|
||||
# CONFIG_SL28CPLD is not set
|
||||
@ -1373,34 +1344,23 @@ CONFIG_MMC_DW=y
|
||||
# CONFIG_MMC_DW_K3 is not set
|
||||
CONFIG_MMC_DW_ROCKCHIP=y
|
||||
# CONFIG_MMC_DW_SNPS is not set
|
||||
# CONFIG_MMC_MXC is not set
|
||||
# CONFIG_MMC_PCI is not set
|
||||
# CONFIG_MMC_OMAP_HS is not set
|
||||
CONFIG_MMC_SDHCI=y
|
||||
CONFIG_MMC_SDHCI_SDMA=y
|
||||
CONFIG_SPL_MMC_SDHCI_SDMA=y
|
||||
# CONFIG_MMC_SDHCI_ADMA is not set
|
||||
# CONFIG_SPL_MMC_SDHCI_ADMA is not set
|
||||
# CONFIG_MMC_SDHCI_BCMSTB is not set
|
||||
CONFIG_MMC_SDHCI_CADENCE=y
|
||||
CONFIG_MMC_SDHCI_CV1800B=y
|
||||
# CONFIG_MMC_SDHCI_IPROC is not set
|
||||
# CONFIG_MMC_SDHCI_F_SDH30 is not set
|
||||
# CONFIG_MMC_SDHCI_KONA is not set
|
||||
# CONFIG_MMC_SDHCI_MSM is not set
|
||||
# CONFIG_MMC_SDHCI_NPCM is not set
|
||||
CONFIG_MMC_SDHCI_ROCKCHIP=y
|
||||
# CONFIG_MMC_SDHCI_S5P is not set
|
||||
# CONFIG_MMC_SDHCI_SNPS is not set
|
||||
# CONFIG_MMC_SDHCI_STI is not set
|
||||
# CONFIG_MMC_SDHCI_XENON is not set
|
||||
# CONFIG_MMC_SDHCI_TANGIER is not set
|
||||
# CONFIG_MMC_SDHCI_ZYNQ is not set
|
||||
# CONFIG_MMC_PITON is not set
|
||||
# CONFIG_STM32_SDMMC2 is not set
|
||||
# CONFIG_FTSDC010 is not set
|
||||
# CONFIG_FSL_ESDHC is not set
|
||||
# CONFIG_FSL_ESDHC_IMX is not set
|
||||
|
||||
#
|
||||
# MTD Support
|
||||
@ -1465,7 +1425,6 @@ CONFIG_SPI_FLASH_MTD=y
|
||||
# CONFIG_MV88E6352_SWITCH is not set
|
||||
# CONFIG_FSL_MEMAC is not set
|
||||
CONFIG_PHY_RESET_DELAY=0
|
||||
# CONFIG_FSL_PFE is not set
|
||||
CONFIG_ETH=y
|
||||
CONFIG_DM_ETH_PHY=y
|
||||
CONFIG_NVME=y
|
||||
@ -1502,6 +1461,7 @@ CONFIG_PCIE_DW_ROCKCHIP=y
|
||||
# PCI Endpoint
|
||||
#
|
||||
# CONFIG_PCI_ENDPOINT is not set
|
||||
# CONFIG_PCIE_CDNS_TI_EP is not set
|
||||
# CONFIG_X86_PCH7 is not set
|
||||
# CONFIG_X86_PCH9 is not set
|
||||
|
||||
@ -1557,10 +1517,13 @@ CONFIG_SPL_PINCONF_RECURSIVE=y
|
||||
# CONFIG_PINCTRL_INTEL is not set
|
||||
# CONFIG_PINCTRL_QE is not set
|
||||
# CONFIG_PINCTRL_ROCKCHIP_RV1108 is not set
|
||||
# CONFIG_PINCTRL_SX150X is not set
|
||||
# CONFIG_SPL_PINCTRL_SX150X is not set
|
||||
# CONFIG_PINCTRL_SINGLE is not set
|
||||
# CONFIG_PINCTRL_STM32 is not set
|
||||
# CONFIG_PINCTRL_STMFX is not set
|
||||
# CONFIG_SPL_PINCTRL_STMFX is not set
|
||||
# CONFIG_PINCTRL_TH1520 is not set
|
||||
# CONFIG_PINCTRL_K210 is not set
|
||||
CONFIG_PINCTRL_ROCKCHIP=y
|
||||
CONFIG_SPL_PINCTRL_ROCKCHIP=y
|
||||
@ -1657,7 +1620,10 @@ CONFIG_DM_PWM=y
|
||||
# CONFIG_PWM_SIFIVE is not set
|
||||
# CONFIG_PWM_TEGRA is not set
|
||||
# CONFIG_PWM_SUNXI is not set
|
||||
# CONFIG_U_QE is not set
|
||||
|
||||
#
|
||||
# RAM drivers using Driver Model
|
||||
#
|
||||
CONFIG_RAM=y
|
||||
CONFIG_SPL_RAM=y
|
||||
# CONFIG_STM32_SDRAM is not set
|
||||
@ -1808,7 +1774,6 @@ CONFIG_SPI_MEM=y
|
||||
# CONFIG_MTK_SNOR is not set
|
||||
# CONFIG_MTK_SNFI_SPI is not set
|
||||
# CONFIG_MTK_SPIM is not set
|
||||
# CONFIG_MVEBU_A3700_SPI is not set
|
||||
# CONFIG_SPI_MXIC is not set
|
||||
# CONFIG_NPCM_FIU_SPI is not set
|
||||
# CONFIG_NPCM_PSPI is not set
|
||||
@ -1948,6 +1913,7 @@ CONFIG_STRTO=y
|
||||
CONFIG_SPL_STRTO=y
|
||||
CONFIG_SYS_HZ=1000
|
||||
CONFIG_SPL_USE_TINY_PRINTF=y
|
||||
# CONFIG_SPL_USE_TINY_PRINTF_POINTER_SUPPORT is not set
|
||||
# CONFIG_PANIC_HANG is not set
|
||||
CONFIG_REGEX=y
|
||||
CONFIG_LIB_RAND=y
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -49,6 +49,10 @@
|
||||
"store_type": "dd",
|
||||
"block_size": "512b",
|
||||
"img_offset": 16384
|
||||
},
|
||||
{
|
||||
"file": "u-boot-rockchip-spi.bin",
|
||||
"store_type": "temp"
|
||||
}
|
||||
],
|
||||
"target": [ "" ],
|
||||
@ -56,9 +60,9 @@
|
||||
},
|
||||
{
|
||||
"parent": "kernel",
|
||||
"version": "v6.14-rc7",
|
||||
"version": "v6.16-rc2",
|
||||
"version_type": "tag",
|
||||
"patch_dir": [ "kernel", "kernel/sunxi-6.14", "kernel/rockchip64-6.14" ],
|
||||
"patch_dir": [ "kernel", "kernel/rockchip64-6.16" ],
|
||||
"config_def": "printer_defconfig",
|
||||
"target": [ "clean", "Image", "modules", "dtbs", "modules_install" ],
|
||||
"artifacts":
|
||||
@ -71,11 +75,6 @@
|
||||
"file": "arch/arm64/boot/dts/%{DTB_FILE}%",
|
||||
"store_type": "boot",
|
||||
"subdir": "dtb/rockchip"
|
||||
},
|
||||
{
|
||||
"file": "",
|
||||
"store_type": "boot",
|
||||
"kmods": true
|
||||
}
|
||||
],
|
||||
"makeopts": "CROSS_COMPILE=%{CROSS_C}% ARCH=arm64 INSTALL_MOD_PATH=%{out_dir}%/kmods/usr"
|
||||
@ -90,12 +89,12 @@
|
||||
[
|
||||
{
|
||||
"name": "boot",
|
||||
"size": "1g",
|
||||
"size": "1G",
|
||||
"first_sector": "32768"
|
||||
},
|
||||
{
|
||||
"name": "rw",
|
||||
"size": "2g"
|
||||
"size": "2G"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -259,6 +259,7 @@
|
||||
{ "copy": [ "%{ROOT_DIR}%/files/firmware/usr", "."] },
|
||||
{ "sudo": "chmod u+s ./usr/bin/Xorg" },
|
||||
{ "sudo": "ln -sf /usr/share/zoneinfo/%{TIME_ZONE}% ./etc/localtime" },
|
||||
{ "chroot": "groupadd -g %{USER_ID}% %{USER_LOGIN}%" },
|
||||
{ "chroot": "useradd -m -G wheel,video,audio,disk,usb -g %{USER_ID}% -u %{USER_ID}% %{USER_LOGIN}% --password %{USER_LOGIN}%" },
|
||||
{ "chroot": "echo '%{USER_LOGIN}%:%{USER_LOGIN}%' | chpasswd" },
|
||||
{ "chroot": "echo 'root:root' | chpasswd" },
|
||||
|
@ -1,12 +1,5 @@
|
||||
#home/biqu/*
|
||||
boot/*
|
||||
media/*
|
||||
usr/lib/python3.13/test*
|
||||
usr/lib64/perl5*
|
||||
#usr/src/*
|
||||
var/cache/binpkgs/*
|
||||
var/cache/distfiles/*
|
||||
#var/cache/edb/*
|
||||
var/cache/eix/*
|
||||
var/log/*.log
|
||||
#var/db/repos/*
|
||||
|
@ -3,6 +3,9 @@
|
||||
. /etc/init.def
|
||||
. /etc/init.script
|
||||
|
||||
CONSOLE="/dev/$(get_active_console)"
|
||||
exec 0<>${CONSOLE} 1<>${CONSOLE} 2<>${CONSOLE}
|
||||
|
||||
run mount -t sysfs sysfs /sys -o noexec,nosuid,nodev >/dev/null
|
||||
run mount -t devtmpfs -o exec,nosuid,mode=0755,size=10M udev /dev
|
||||
run mkdir -m 0755 /dev/pts
|
||||
|
@ -130,6 +130,21 @@ determine_fs() {
|
||||
echo "${_fs}"
|
||||
}
|
||||
|
||||
get_active_console() {
|
||||
local active_console=console
|
||||
|
||||
while [ -f /sys/class/tty/${active_console}/active ]
|
||||
do
|
||||
active_console=$(cat /sys/class/tty/${active_console}/active)
|
||||
|
||||
# last console will be the active one,
|
||||
# see https://www.kernel.org/doc/html/latest/admin-guide/serial-console.html
|
||||
active_console=${active_console##* }
|
||||
done
|
||||
|
||||
echo ${active_console}
|
||||
}
|
||||
|
||||
findmediamount() {
|
||||
# $1 = mount dir name / media name
|
||||
# $2 = recognition file
|
||||
|
78
patch/kernel/h616_old
Normal file
78
patch/kernel/h616_old
Normal file
@ -0,0 +1,78 @@
|
||||
|
||||
+
|
||||
+#H616, SoC-specific
|
||||
+CONFIG_SUN50I_A64_CCU=n
|
||||
+CONFIG_SUN50I_A100_CCU=n
|
||||
+CONFIG_SUN50I_A100_R_CCU=n
|
||||
+CONFIG_SUN50I_H6_CCU=n
|
||||
+CONFIG_SUN8I_H3_CCU=n
|
||||
+CONFIG_ARCH_SUNXI=y
|
||||
+CONFIG_DWMAC_DWC_QOS_ETH=y
|
||||
+CONFIG_SUNXI_CCU=y
|
||||
+CONFIG_NET_VENDOR_ALLWINNER=y
|
||||
+CONFIG_AC200_PHY=y
|
||||
+CONFIG_AC200_PHY_SUNXI=y
|
||||
+CONFIG_PHY_SUN4I_USB=y
|
||||
+CONFIG_STAGING=y
|
||||
+CONFIG_STAGING_MEDIA=y
|
||||
+CONFIG_VIDEO_SUNXI=y
|
||||
+CONFIG_NOP_USB_XCEIV=y
|
||||
+CONFIG_MFD_AC200_SUNXI=y
|
||||
+CONFIG_SUN50I_H616_CCU=y
|
||||
+CONFIG_SND_SUN4I_CODEC=y
|
||||
+CONFIG_CRYPTO_DEV_SUN8I_CE_HASH=y
|
||||
+CONFIG_CRYPTO_DEV_SUN8I_CE_PRNG=y
|
||||
+CONFIG_CRYPTO_DEV_SUN8I_CE_TRNG=y
|
||||
+CONFIG_CRYPTO_DEV_SUN8I_CE=y
|
||||
+CONFIG_SUN50I_DE2_BUS=y
|
||||
+CONFIG_SUN8I_DE2_CCU=y
|
||||
+CONFIG_DRM_SUN8I_MIXER=y
|
||||
+CONFIG_DMA_SUN6I=y
|
||||
+CONFIG_DWMAC_SUNXI=y
|
||||
+CONFIG_DWMAC_SUN8I=y
|
||||
+CONFIG_MMC_SUNXI=y
|
||||
+CONFIG_SUN20I_GPADC=y
|
||||
+CONFIG_DRM_SUN8I_DW_HDMI=y
|
||||
+CONFIG_I2C_MV64XXX=y
|
||||
+CONFIG_SUN50I_IOMMU=y
|
||||
+##CONFIG_IR_SUNXI=y
|
||||
+CONFIG_KEYBOARD_SUN4I_LRADC=y
|
||||
+CONFIG_SUNXI_NMI_INTC=y
|
||||
+CONFIG_ARM_ALLWINNER_SUN50I_CPUFREQ_NVMEM=y
|
||||
+CONFIG_PINCTRL_SUN50I_H616=y
|
||||
+CONFIG_SUN50I_H6_PRCM_PPU=y
|
||||
+CONFIG_PWM_SUNXI_ENHANCE=y
|
||||
+CONFIG_SUN50I_H6_R_CCU=y
|
||||
+CONFIG_PINCTRL_SUN50I_H616_R=y
|
||||
+CONFIG_SUNXI_RSB=y
|
||||
+CONFIG_SUN6I_RTC_CCU=y
|
||||
+CONFIG_RTC_DRV_SUN6I=y
|
||||
+CONFIG_NVMEM_SUNXI_SID=y
|
||||
+CONFIG_SND_SUN4I_SPDIF=y
|
||||
+CONFIG_SPI_SUN6I=y
|
||||
+CONFIG_SUNXI_SYS_INFO=y
|
||||
+CONFIG_SUNXI_SRAM=y
|
||||
+CONFIG_SUN8I_THERMAL=y
|
||||
+CONFIG_VIDEO_SUNXI_CEDRUS=y
|
||||
+CONFIG_SUNXI_WATCHDOG=y
|
||||
+CONFIG_DRM_SUN4I=y
|
||||
+CONFIG_DRM_SUN8I_TCON_TOP=y
|
||||
+CONFIG_SUNXI_ADDR_MGT=y
|
||||
+CONFIG_SUNXI_GMAC=y
|
||||
+##CONFIG_CAN_MCP251X=y
|
||||
+##CONFIG_FB_TFT_ST7796S=y
|
||||
+CONFIG_REGULATOR_FAN53555=y
|
||||
+CONFIG_MFD_AXP20X_I2C=y
|
||||
+CONFIG_REGULATOR_AXP20X=y
|
||||
+#minimize
|
||||
+CONFIG_PINCTRL_SUN8I_H3_R=n
|
||||
+CONFIG_PINCTRL_SUN50I_A64=n
|
||||
+CONFIG_PINCTRL_SUN50I_A64_R=n
|
||||
+CONFIG_PINCTRL_SUN50I_A100=n
|
||||
+CONFIG_PINCTRL_SUN50I_A100_R=n
|
||||
+CONFIG_PINCTRL_SUN50I_H5=n
|
||||
+CONFIG_PINCTRL_SUN50I_H6=n
|
||||
+CONFIG_PINCTRL_SUN50I_H6_R=n
|
||||
+#sound
|
||||
+CONFIG_SND_SOC_SUNXI_AHUB=y
|
||||
+CONFIG_SND_SOC_SUNXI_AHUB_DAM=y
|
@ -3,7 +3,7 @@ new file mode 100644
|
||||
index 000000000000..51de9e95b7d2
|
||||
--- a/arch/arm64/configs/printer_defconfig
|
||||
+++ b/arch/arm64/configs/printer_defconfig
|
||||
@@ -0,4 +202,206 @@
|
||||
@@ -0,4 +124,128 @@
|
||||
CONFIG_MTD_BLKDEVS=y
|
||||
CONFIG_MTD_BLOCK=y
|
||||
CONFIG_MTD_SPI_NOR=y
|
||||
@ -14,83 +14,6 @@ index 000000000000..51de9e95b7d2
|
||||
+CONFIG_DRM_PANFROST=y
|
||||
+CONFIG_STMMAC_PLATFORM=y
|
||||
+
|
||||
+#H616, SoC-specific
|
||||
+CONFIG_SUN50I_A64_CCU=n
|
||||
+CONFIG_SUN50I_A100_CCU=n
|
||||
+CONFIG_SUN50I_A100_R_CCU=n
|
||||
+CONFIG_SUN50I_H6_CCU=n
|
||||
+CONFIG_SUN8I_H3_CCU=n
|
||||
+CONFIG_ARCH_SUNXI=y
|
||||
+CONFIG_DWMAC_DWC_QOS_ETH=y
|
||||
+CONFIG_SUNXI_CCU=y
|
||||
+CONFIG_NET_VENDOR_ALLWINNER=y
|
||||
+CONFIG_AC200_PHY=y
|
||||
+CONFIG_AC200_PHY_SUNXI=y
|
||||
+CONFIG_PHY_SUN4I_USB=y
|
||||
+CONFIG_STAGING=y
|
||||
+CONFIG_STAGING_MEDIA=y
|
||||
+CONFIG_VIDEO_SUNXI=y
|
||||
+CONFIG_NOP_USB_XCEIV=y
|
||||
+CONFIG_MFD_AC200_SUNXI=y
|
||||
+CONFIG_SUN50I_H616_CCU=y
|
||||
+CONFIG_SND_SUN4I_CODEC=y
|
||||
+CONFIG_CRYPTO_DEV_SUN8I_CE_HASH=y
|
||||
+CONFIG_CRYPTO_DEV_SUN8I_CE_PRNG=y
|
||||
+CONFIG_CRYPTO_DEV_SUN8I_CE_TRNG=y
|
||||
+CONFIG_CRYPTO_DEV_SUN8I_CE=y
|
||||
+CONFIG_SUN50I_DE2_BUS=y
|
||||
+CONFIG_SUN8I_DE2_CCU=y
|
||||
+CONFIG_DRM_SUN8I_MIXER=y
|
||||
+CONFIG_DMA_SUN6I=y
|
||||
+CONFIG_DWMAC_SUNXI=y
|
||||
+CONFIG_DWMAC_SUN8I=y
|
||||
+CONFIG_MMC_SUNXI=y
|
||||
+CONFIG_SUN20I_GPADC=y
|
||||
+CONFIG_DRM_SUN8I_DW_HDMI=y
|
||||
+CONFIG_I2C_MV64XXX=y
|
||||
+CONFIG_SUN50I_IOMMU=y
|
||||
+##CONFIG_IR_SUNXI=y
|
||||
+CONFIG_KEYBOARD_SUN4I_LRADC=y
|
||||
+CONFIG_SUNXI_NMI_INTC=y
|
||||
+CONFIG_ARM_ALLWINNER_SUN50I_CPUFREQ_NVMEM=y
|
||||
+CONFIG_PINCTRL_SUN50I_H616=y
|
||||
+CONFIG_SUN50I_H6_PRCM_PPU=y
|
||||
+CONFIG_PWM_SUNXI_ENHANCE=y
|
||||
+CONFIG_SUN50I_H6_R_CCU=y
|
||||
+CONFIG_PINCTRL_SUN50I_H616_R=y
|
||||
+CONFIG_SUNXI_RSB=y
|
||||
+CONFIG_SUN6I_RTC_CCU=y
|
||||
+CONFIG_RTC_DRV_SUN6I=y
|
||||
+CONFIG_NVMEM_SUNXI_SID=y
|
||||
+CONFIG_SND_SUN4I_SPDIF=y
|
||||
+CONFIG_SPI_SUN6I=y
|
||||
+CONFIG_SUNXI_SYS_INFO=y
|
||||
+CONFIG_SUNXI_SRAM=y
|
||||
+CONFIG_SUN8I_THERMAL=y
|
||||
+CONFIG_VIDEO_SUNXI_CEDRUS=y
|
||||
+CONFIG_SUNXI_WATCHDOG=y
|
||||
+CONFIG_DRM_SUN4I=y
|
||||
+CONFIG_DRM_SUN8I_TCON_TOP=y
|
||||
+CONFIG_SUNXI_ADDR_MGT=y
|
||||
+CONFIG_SUNXI_GMAC=y
|
||||
+##CONFIG_CAN_MCP251X=y
|
||||
+##CONFIG_FB_TFT_ST7796S=y
|
||||
+CONFIG_REGULATOR_FAN53555=y
|
||||
+CONFIG_MFD_AXP20X_I2C=y
|
||||
+CONFIG_REGULATOR_AXP20X=y
|
||||
+#minimize
|
||||
+CONFIG_PINCTRL_SUN8I_H3_R=n
|
||||
+CONFIG_PINCTRL_SUN50I_A64=n
|
||||
+CONFIG_PINCTRL_SUN50I_A64_R=n
|
||||
+CONFIG_PINCTRL_SUN50I_A100=n
|
||||
+CONFIG_PINCTRL_SUN50I_A100_R=n
|
||||
+CONFIG_PINCTRL_SUN50I_H5=n
|
||||
+CONFIG_PINCTRL_SUN50I_H6=n
|
||||
+CONFIG_PINCTRL_SUN50I_H6_R=n
|
||||
+#sound
|
||||
+CONFIG_SND_SOC_SUNXI_AHUB=y
|
||||
+CONFIG_SND_SOC_SUNXI_AHUB_DAM=y
|
||||
+
|
||||
+#rk3566/3568, SoC-specific
|
||||
+CONFIG_CLK_PX30=n
|
||||
+CONFIG_CLK_RK3576=n
|
||||
|
@ -94,7 +94,7 @@ index 0d7bf18e2508..535e84de038e 100644
|
||||
|
||||
+static void edt_ft5x06_ts_irq_poll_timer(struct timer_list *t)
|
||||
+{
|
||||
+ struct edt_ft5x06_ts_data *tsdata = from_timer(tsdata, t, timer);
|
||||
+ struct edt_ft5x06_ts_data *tsdata = timer_container_of(tsdata, t, timer);
|
||||
+
|
||||
+ schedule_work(&tsdata->work_i2c_poll);
|
||||
+ mod_timer(&tsdata->timer, jiffies + msecs_to_jiffies(POLL_INTERVAL_MS));
|
||||
@ -153,7 +153,7 @@ index 0d7bf18e2508..535e84de038e 100644
|
||||
struct edt_ft5x06_ts_data *tsdata = i2c_get_clientdata(client);
|
||||
|
||||
+ if (!client->irq) {
|
||||
+ del_timer(&tsdata->timer);
|
||||
+ timer_delete(&tsdata->timer);
|
||||
+ cancel_work_sync(&tsdata->work_i2c_poll);
|
||||
+ }
|
||||
edt_ft5x06_ts_teardown_debugfs(tsdata);
|
||||
|
@ -0,0 +1,83 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Maxim Medvedev <redrathnure@gmail.com>
|
||||
Date: Mon, 1 Jan 2024 21:50:10 +0000
|
||||
Subject: HDMI EDID records for 800x480 resolution (a MKS IPS50 screen and
|
||||
similar)
|
||||
|
||||
---
|
||||
drivers/gpu/drm/drm_edid.c | 12 +++++++++-
|
||||
drivers/phy/rockchip/phy-rockchip-inno-hdmi.c | 1 +
|
||||
drivers/video/hdmi.c | 2 ++
|
||||
include/linux/hdmi.h | 1 +
|
||||
4 files changed, 15 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/gpu/drm/drm_edid.c
|
||||
+++ b/drivers/gpu/drm/drm_edid.c
|
||||
@@ -1550,6 +1550,16 @@ static const struct drm_display_mode edid_cea_modes_193[] = {
|
||||
4272, 4400, 0, 2160, 2168, 2178, 2250, 0,
|
||||
DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
|
||||
.picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135, },
|
||||
+ /* 220 - 800x480@60Hz 5:3 */
|
||||
+ { DRM_MODE("800x480", DRM_MODE_TYPE_DRIVER, 30240, 800, 850,
|
||||
+ 920, 960, 0, 480, 510, 513, 525, 0,
|
||||
+ DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
|
||||
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_5_3, },
|
||||
+ /* 221 - 800x480@60Hz 5:3, MKS IPS50 */
|
||||
+ { DRM_MODE("800x480", DRM_MODE_TYPE_DRIVER, 30240, 800, 850,
|
||||
+ 950, 960, 0, 480, 510, 513, 525, 0,
|
||||
+ DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
|
||||
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_5_3, },
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -4215,7 +4225,7 @@ static bool drm_edid_has_cta_extension(const struct drm_edid *drm_edid)
|
||||
static __always_inline const struct drm_display_mode *cea_mode_for_vic(u8 vic)
|
||||
{
|
||||
BUILD_BUG_ON(1 + ARRAY_SIZE(edid_cea_modes_1) - 1 != 127);
|
||||
- BUILD_BUG_ON(193 + ARRAY_SIZE(edid_cea_modes_193) - 1 != 219);
|
||||
+ BUILD_BUG_ON(193 + ARRAY_SIZE(edid_cea_modes_193) - 1 != 221);
|
||||
|
||||
if (vic >= 1 && vic < 1 + ARRAY_SIZE(edid_cea_modes_1))
|
||||
return &edid_cea_modes_1[vic - 1];
|
||||
diff --git a/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c b/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c
|
||||
+++ b/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c
|
||||
@@ -295,6 +295,7 @@ static const struct pre_pll_config pre_pll_cfg_table[] = {
|
||||
{ 25175000, 31468750, 1, 41, 0, 3, 3, 1, 3, 3, 4, 0, 0xf5554f},
|
||||
{ 27000000, 27000000, 1, 36, 0, 3, 3, 1, 2, 3, 4, 0, 0x0},
|
||||
{ 27000000, 33750000, 1, 45, 0, 3, 3, 1, 3, 3, 4, 0, 0x0},
|
||||
+ { 30240000, 30240000, 5, 504, 3, 2, 2, 20, 4, 2, 2, 0, 0x0}, // Non standard screens like MKS IPS50
|
||||
{ 31500000, 31500000, 1, 42, 0, 3, 3, 1, 2, 3, 4, 0, 0x0},
|
||||
{ 31500000, 39375000, 1, 105, 1, 3, 3, 10, 0, 3, 4, 0, 0x0},
|
||||
{ 33750000, 33750000, 1, 45, 0, 3, 3, 1, 2, 3, 4, 0, 0x0},
|
||||
diff --git a/drivers/video/hdmi.c b/drivers/video/hdmi.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/video/hdmi.c
|
||||
+++ b/drivers/video/hdmi.c
|
||||
@@ -1087,6 +1087,8 @@ hdmi_picture_aspect_get_name(enum hdmi_picture_aspect picture_aspect)
|
||||
return "64:27";
|
||||
case HDMI_PICTURE_ASPECT_256_135:
|
||||
return "256:135";
|
||||
+ case HDMI_PICTURE_ASPECT_5_3:
|
||||
+ return "5:3";
|
||||
case HDMI_PICTURE_ASPECT_RESERVED:
|
||||
return "Reserved";
|
||||
}
|
||||
diff --git a/include/linux/hdmi.h b/include/linux/hdmi.h
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/include/linux/hdmi.h
|
||||
+++ b/include/linux/hdmi.h
|
||||
@@ -108,6 +108,7 @@ enum hdmi_picture_aspect {
|
||||
HDMI_PICTURE_ASPECT_16_9,
|
||||
HDMI_PICTURE_ASPECT_64_27,
|
||||
HDMI_PICTURE_ASPECT_256_135,
|
||||
+ HDMI_PICTURE_ASPECT_5_3,
|
||||
HDMI_PICTURE_ASPECT_RESERVED,
|
||||
};
|
||||
|
||||
--
|
||||
Armbian
|
||||
|
133
patch/kernel/rockchip64-6.16/general-add-miniDP-dt-doc.patch
Normal file
133
patch/kernel/rockchip64-6.16/general-add-miniDP-dt-doc.patch
Normal file
@ -0,0 +1,133 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Tony <tonymckahan@gmail.com>
|
||||
Date: Wed, 3 Mar 2021 07:59:25 +0100
|
||||
Subject: [ARCHEOLOGY] RK3399 Typec DP (#2676)
|
||||
|
||||
> X-Git-Archeology: > recovered message: > * RK3399 NanoPC-T4 Add Type-C alt mode DP
|
||||
> X-Git-Archeology: > recovered message: > * rk3399 rockpi 4C add mini-DP (WIP)
|
||||
> X-Git-Archeology: > recovered message: > * [ rockchip64 ] revert rockPi 4C DP patch
|
||||
> X-Git-Archeology: > recovered message: > Add an extension to disable it, but leave for future work.
|
||||
> X-Git-Archeology: - Revision 4971535c774a1f49a811baebc083ea028ced0300: https://github.com/armbian/build/commit/4971535c774a1f49a811baebc083ea028ced0300
|
||||
> X-Git-Archeology: Date: Wed, 03 Mar 2021 07:59:25 +0100
|
||||
> X-Git-Archeology: From: Tony <tonymckahan@gmail.com>
|
||||
> X-Git-Archeology: Subject: RK3399 Typec DP (#2676)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 0cdffb29b07305209efb12cf3b5ac6032d3a1153: https://github.com/armbian/build/commit/0cdffb29b07305209efb12cf3b5ac6032d3a1153
|
||||
> X-Git-Archeology: Date: Wed, 24 Mar 2021 19:01:53 +0100
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igorpecovnik@users.noreply.github.com>
|
||||
> X-Git-Archeology: Subject: Renaming DEV branch to EDGE (#2704)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision ac8fc4385594d59257ee9dffd9efa85e3497fa7d: https://github.com/armbian/build/commit/ac8fc4385594d59257ee9dffd9efa85e3497fa7d
|
||||
> X-Git-Archeology: Date: Sat, 26 Feb 2022 07:46:44 +0100
|
||||
> X-Git-Archeology: From: Piotr Szczepanik <piter75@gmail.com>
|
||||
> X-Git-Archeology: Subject: Switch rockchip64 current to linux 5.15.y (#3489)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 897674aa74bce0326ed7fe06f5336bf4709a8a1f: https://github.com/armbian/build/commit/897674aa74bce0326ed7fe06f5336bf4709a8a1f
|
||||
> X-Git-Archeology: Date: Tue, 03 May 2022 08:27:32 +0200
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igorpecovnik@users.noreply.github.com>
|
||||
> X-Git-Archeology: Subject: Bump and freeze kernel at last known working versions (#3736)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 597d2dac11f00d9070a4e49d6bad1b2244e36cb3: https://github.com/armbian/build/commit/597d2dac11f00d9070a4e49d6bad1b2244e36cb3
|
||||
> X-Git-Archeology: Date: Sat, 28 May 2022 07:56:22 +0200
|
||||
> X-Git-Archeology: From: Jianfeng Liu <liujianfeng1994@gmail.com>
|
||||
> X-Git-Archeology: Subject: update rockchip64-edge to 5.18 (#3814)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 8c6641e7b79f0d50acdc306d140e586a4e923cf0: https://github.com/armbian/build/commit/8c6641e7b79f0d50acdc306d140e586a4e923cf0
|
||||
> X-Git-Archeology: Date: Wed, 03 Aug 2022 22:22:55 +0200
|
||||
> X-Git-Archeology: From: Jianfeng Liu <liujianfeng1994@gmail.com>
|
||||
> X-Git-Archeology: Subject: update rockchip64 edge to 5.19 (#4039)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 6765f734cc4a22aeaa9f99a3ad28c8c322de26f6: https://github.com/armbian/build/commit/6765f734cc4a22aeaa9f99a3ad28c8c322de26f6
|
||||
> X-Git-Archeology: Date: Tue, 25 Oct 2022 11:26:51 +0200
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igorpecovnik@users.noreply.github.com>
|
||||
> X-Git-Archeology: Subject: Bump rockchip64 edge to 6.0.y (#4337)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 92f1a22d76b987afa7ba555d5b509adc51d689e7: https://github.com/armbian/build/commit/92f1a22d76b987afa7ba555d5b509adc51d689e7
|
||||
> X-Git-Archeology: Date: Fri, 16 Dec 2022 13:38:13 +0100
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igorpecovnik@users.noreply.github.com>
|
||||
> X-Git-Archeology: Subject: Re-add rockchip64 6.0 patches (#4575)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 34ae84fac5d0b66a1ab2d1e51534b7beb13ef245: https://github.com/armbian/build/commit/34ae84fac5d0b66a1ab2d1e51534b7beb13ef245
|
||||
> X-Git-Archeology: Date: Fri, 05 May 2023 14:22:00 +0200
|
||||
> X-Git-Archeology: From: amazingfate <liujianfeng1994@gmail.com>
|
||||
> X-Git-Archeology: Subject: bump rockchip64 edge to v6.3
|
||||
> X-Git-Archeology:
|
||||
---
|
||||
Documentation/devicetree/bindings/extcon/extcon-usbc-virtual-pd.yaml | 66 ++++++++++
|
||||
1 file changed, 66 insertions(+)
|
||||
|
||||
diff --git a/Documentation/devicetree/bindings/extcon/extcon-usbc-virtual-pd.yaml b/Documentation/devicetree/bindings/extcon/extcon-usbc-virtual-pd.yaml
|
||||
new file mode 100644
|
||||
index 000000000000..111111111111
|
||||
--- /dev/null
|
||||
+++ b/Documentation/devicetree/bindings/extcon/extcon-usbc-virtual-pd.yaml
|
||||
@@ -0,0 +1,66 @@
|
||||
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
+%YAML 1.2
|
||||
+---
|
||||
+$id: http://devicetree.org/schemas/extcon/extcon-usbc-virtual-pd.yaml#
|
||||
+$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
+
|
||||
+title: Type-C Virtual PD extcon
|
||||
+
|
||||
+maintainers:
|
||||
+ - Jagan Teki <jagan@amarulasolutions.com>
|
||||
+
|
||||
+description: |
|
||||
+ USB Type-C protocol supports various modes of operations includes PD,
|
||||
+ USB3, and Altmode. If the platform design supports a Type-C connector
|
||||
+ then configuring these modes can be done via enumeration.
|
||||
+
|
||||
+ However, there are some platforms that design these modes as separate
|
||||
+ protocol connectors like design Display Port from on-chip USB3 controller.
|
||||
+ So we can access Type-C Altmode Display Port via onboard Display Port
|
||||
+ connector instead of a Type-C connector. These kinds of platforms require
|
||||
+ an explicit extcon driver in order to handle Power Delivery and
|
||||
+ Port Detection.
|
||||
+
|
||||
+properties:
|
||||
+ compatible:
|
||||
+ const: linux,extcon-usbc-virtual-pd
|
||||
+
|
||||
+ det-gpios:
|
||||
+ description: Detect GPIO pin. Pin can be Display Port Detect or USB ID.
|
||||
+ maxItems: 1
|
||||
+
|
||||
+ vpd-polarity:
|
||||
+ description: USB Type-C Polarity. false for Normal and true for Flip.
|
||||
+ type: boolean
|
||||
+
|
||||
+ vpd-super-speed:
|
||||
+ description: USB Super Speed. false for USB2 and true for USB3.
|
||||
+ type: boolean
|
||||
+
|
||||
+ vpd-data-role:
|
||||
+ description: USB Data roles for Virtual Type-C.
|
||||
+ $ref: /schemas/types.yaml#definitions/string
|
||||
+
|
||||
+ enum:
|
||||
+ - host
|
||||
+ - device
|
||||
+ - display-port
|
||||
+
|
||||
+required:
|
||||
+ - compatible
|
||||
+ - det-gpios
|
||||
+ - vpd-data-role
|
||||
+
|
||||
+additionalProperties: false
|
||||
+
|
||||
+examples:
|
||||
+ - |
|
||||
+ #include <dt-bindings/gpio/gpio.h>
|
||||
+ #include <dt-bindings/pinctrl/rockchip.h>
|
||||
+
|
||||
+ virtual_pd: virtual-pd {
|
||||
+ compatible = "linux,extcon-usbc-virtual-pd";
|
||||
+ det-gpios = <&gpio4 RK_PD1 GPIO_ACTIVE_LOW>;
|
||||
+ vpd-data-role = "display-port";
|
||||
+ vpd-super-speed;
|
||||
+ };
|
||||
--
|
||||
Armbian
|
||||
|
@ -0,0 +1,382 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Tony <tonymckahan@gmail.com>
|
||||
Date: Wed, 3 Mar 2021 07:59:25 +0100
|
||||
Subject: [ARCHEOLOGY] RK3399 Typec DP (#2676)
|
||||
|
||||
> X-Git-Archeology: > recovered message: > * RK3399 NanoPC-T4 Add Type-C alt mode DP
|
||||
> X-Git-Archeology: > recovered message: > * rk3399 rockpi 4C add mini-DP (WIP)
|
||||
> X-Git-Archeology: > recovered message: > * [ rockchip64 ] revert rockPi 4C DP patch
|
||||
> X-Git-Archeology: > recovered message: > Add an extension to disable it, but leave for future work.
|
||||
> X-Git-Archeology: - Revision 4971535c774a1f49a811baebc083ea028ced0300: https://github.com/armbian/build/commit/4971535c774a1f49a811baebc083ea028ced0300
|
||||
> X-Git-Archeology: Date: Wed, 03 Mar 2021 07:59:25 +0100
|
||||
> X-Git-Archeology: From: Tony <tonymckahan@gmail.com>
|
||||
> X-Git-Archeology: Subject: RK3399 Typec DP (#2676)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 0cdffb29b07305209efb12cf3b5ac6032d3a1153: https://github.com/armbian/build/commit/0cdffb29b07305209efb12cf3b5ac6032d3a1153
|
||||
> X-Git-Archeology: Date: Wed, 24 Mar 2021 19:01:53 +0100
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igorpecovnik@users.noreply.github.com>
|
||||
> X-Git-Archeology: Subject: Renaming DEV branch to EDGE (#2704)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision ac8fc4385594d59257ee9dffd9efa85e3497fa7d: https://github.com/armbian/build/commit/ac8fc4385594d59257ee9dffd9efa85e3497fa7d
|
||||
> X-Git-Archeology: Date: Sat, 26 Feb 2022 07:46:44 +0100
|
||||
> X-Git-Archeology: From: Piotr Szczepanik <piter75@gmail.com>
|
||||
> X-Git-Archeology: Subject: Switch rockchip64 current to linux 5.15.y (#3489)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 897674aa74bce0326ed7fe06f5336bf4709a8a1f: https://github.com/armbian/build/commit/897674aa74bce0326ed7fe06f5336bf4709a8a1f
|
||||
> X-Git-Archeology: Date: Tue, 03 May 2022 08:27:32 +0200
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igorpecovnik@users.noreply.github.com>
|
||||
> X-Git-Archeology: Subject: Bump and freeze kernel at last known working versions (#3736)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 597d2dac11f00d9070a4e49d6bad1b2244e36cb3: https://github.com/armbian/build/commit/597d2dac11f00d9070a4e49d6bad1b2244e36cb3
|
||||
> X-Git-Archeology: Date: Sat, 28 May 2022 07:56:22 +0200
|
||||
> X-Git-Archeology: From: Jianfeng Liu <liujianfeng1994@gmail.com>
|
||||
> X-Git-Archeology: Subject: update rockchip64-edge to 5.18 (#3814)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 8c6641e7b79f0d50acdc306d140e586a4e923cf0: https://github.com/armbian/build/commit/8c6641e7b79f0d50acdc306d140e586a4e923cf0
|
||||
> X-Git-Archeology: Date: Wed, 03 Aug 2022 22:22:55 +0200
|
||||
> X-Git-Archeology: From: Jianfeng Liu <liujianfeng1994@gmail.com>
|
||||
> X-Git-Archeology: Subject: update rockchip64 edge to 5.19 (#4039)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 6765f734cc4a22aeaa9f99a3ad28c8c322de26f6: https://github.com/armbian/build/commit/6765f734cc4a22aeaa9f99a3ad28c8c322de26f6
|
||||
> X-Git-Archeology: Date: Tue, 25 Oct 2022 11:26:51 +0200
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igorpecovnik@users.noreply.github.com>
|
||||
> X-Git-Archeology: Subject: Bump rockchip64 edge to 6.0.y (#4337)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 92f1a22d76b987afa7ba555d5b509adc51d689e7: https://github.com/armbian/build/commit/92f1a22d76b987afa7ba555d5b509adc51d689e7
|
||||
> X-Git-Archeology: Date: Fri, 16 Dec 2022 13:38:13 +0100
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igorpecovnik@users.noreply.github.com>
|
||||
> X-Git-Archeology: Subject: Re-add rockchip64 6.0 patches (#4575)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 34ae84fac5d0b66a1ab2d1e51534b7beb13ef245: https://github.com/armbian/build/commit/34ae84fac5d0b66a1ab2d1e51534b7beb13ef245
|
||||
> X-Git-Archeology: Date: Fri, 05 May 2023 14:22:00 +0200
|
||||
> X-Git-Archeology: From: amazingfate <liujianfeng1994@gmail.com>
|
||||
> X-Git-Archeology: Subject: bump rockchip64 edge to v6.3
|
||||
> X-Git-Archeology:
|
||||
---
|
||||
drivers/extcon/Kconfig | 10 +
|
||||
drivers/extcon/Makefile | 1 +
|
||||
drivers/extcon/extcon-usbc-virtual-pd.c | 285 ++++++++++
|
||||
3 files changed, 296 insertions(+)
|
||||
|
||||
diff --git a/drivers/extcon/Kconfig b/drivers/extcon/Kconfig
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/extcon/Kconfig
|
||||
+++ b/drivers/extcon/Kconfig
|
||||
@@ -214,4 +214,14 @@ config EXTCON_RTK_TYPE_C
|
||||
The DHC (Digital Home Hub) RTD series SoC contains a type c module.
|
||||
This driver will detect the status of the type-c port.
|
||||
|
||||
+config EXTCON_USBC_VIRTUAL_PD
|
||||
+ tristate "Virtual Type-C PD EXTCON support"
|
||||
+ depends on GPIOLIB || COMPILE_TEST
|
||||
+ help
|
||||
+ Say Y here to enable Virtual Type-C PD extcon driver support, if
|
||||
+ hardware platform designed Type-C modes separately.
|
||||
+
|
||||
+ Example, of designing Display Port separately from Type-C Altmode
|
||||
+ instead of accessing Altmode Display Port in Type-C connector.
|
||||
+
|
||||
endif
|
||||
diff --git a/drivers/extcon/Makefile b/drivers/extcon/Makefile
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/extcon/Makefile
|
||||
+++ b/drivers/extcon/Makefile
|
||||
@@ -27,3 +27,4 @@ obj-$(CONFIG_EXTCON_USB_GPIO) += extcon-usb-gpio.o
|
||||
obj-$(CONFIG_EXTCON_USBC_CROS_EC) += extcon-usbc-cros-ec.o
|
||||
obj-$(CONFIG_EXTCON_USBC_TUSB320) += extcon-usbc-tusb320.o
|
||||
obj-$(CONFIG_EXTCON_RTK_TYPE_C) += extcon-rtk-type-c.o
|
||||
+obj-$(CONFIG_EXTCON_USBC_VIRTUAL_PD) += extcon-usbc-virtual-pd.o
|
||||
diff --git a/drivers/extcon/extcon-usbc-virtual-pd.c b/drivers/extcon/extcon-usbc-virtual-pd.c
|
||||
new file mode 100644
|
||||
index 000000000000..111111111111
|
||||
--- /dev/null
|
||||
+++ b/drivers/extcon/extcon-usbc-virtual-pd.c
|
||||
@@ -0,0 +1,285 @@
|
||||
+// SPDX-License-Identifier: GPL-2.0-only
|
||||
+/*
|
||||
+ * Type-C Virtual PD Extcon driver
|
||||
+ *
|
||||
+ * Copyright (c) 2019 Fuzhou Rockchip Electronics Co., Ltd
|
||||
+ * Copyright (c) 2019 Radxa Limited
|
||||
+ * Copyright (c) 2019 Amarula Solutions(India)
|
||||
+ */
|
||||
+
|
||||
+#include <linux/extcon-provider.h>
|
||||
+#include <linux/gpio.h>
|
||||
+#include <linux/interrupt.h>
|
||||
+#include <linux/init.h>
|
||||
+#include <linux/irq.h>
|
||||
+#include <linux/kernel.h>
|
||||
+#include <linux/module.h>
|
||||
+#include <linux/of_gpio.h>
|
||||
+#include <linux/platform_device.h>
|
||||
+#include <linux/slab.h>
|
||||
+
|
||||
+static const unsigned int vpd_cable[] = {
|
||||
+ EXTCON_USB,
|
||||
+ EXTCON_USB_HOST,
|
||||
+ EXTCON_DISP_DP,
|
||||
+ EXTCON_NONE,
|
||||
+};
|
||||
+
|
||||
+enum vpd_data_role {
|
||||
+ DR_NONE,
|
||||
+ DR_HOST,
|
||||
+ DR_DEVICE,
|
||||
+ DR_DISPLAY_PORT,
|
||||
+};
|
||||
+
|
||||
+enum vpd_polarity {
|
||||
+ POLARITY_NORMAL,
|
||||
+ POLARITY_FLIP,
|
||||
+};
|
||||
+
|
||||
+enum vpd_usb_ss {
|
||||
+ USB_SS_USB2,
|
||||
+ USB_SS_USB3,
|
||||
+};
|
||||
+
|
||||
+struct vpd_extcon {
|
||||
+ struct device *dev;
|
||||
+ struct extcon_dev *extcon;
|
||||
+ struct gpio_desc *det_gpio;
|
||||
+
|
||||
+ u8 polarity;
|
||||
+ u8 usb_ss;
|
||||
+ enum vpd_data_role data_role;
|
||||
+
|
||||
+ int irq;
|
||||
+ bool enable_irq;
|
||||
+ struct work_struct work;
|
||||
+ struct delayed_work irq_work;
|
||||
+};
|
||||
+
|
||||
+static void vpd_extcon_irq_work(struct work_struct *work)
|
||||
+{
|
||||
+ struct vpd_extcon *vpd = container_of(work, struct vpd_extcon, irq_work.work);
|
||||
+ bool host_connected = false, device_connected = false, dp_connected = false;
|
||||
+ union extcon_property_value property;
|
||||
+ int det;
|
||||
+
|
||||
+ det = vpd->det_gpio ? gpiod_get_raw_value(vpd->det_gpio) : 0;
|
||||
+ if (det) {
|
||||
+ device_connected = (vpd->data_role == DR_DEVICE) ? true : false;
|
||||
+ host_connected = (vpd->data_role == DR_HOST) ? true : false;
|
||||
+ dp_connected = (vpd->data_role == DR_DISPLAY_PORT) ? true : false;
|
||||
+ }
|
||||
+
|
||||
+ extcon_set_state(vpd->extcon, EXTCON_USB, host_connected);
|
||||
+ extcon_set_state(vpd->extcon, EXTCON_USB_HOST, device_connected);
|
||||
+ extcon_set_state(vpd->extcon, EXTCON_DISP_DP, dp_connected);
|
||||
+
|
||||
+ property.intval = vpd->polarity;
|
||||
+ extcon_set_property(vpd->extcon, EXTCON_USB,
|
||||
+ EXTCON_PROP_USB_TYPEC_POLARITY, property);
|
||||
+ extcon_set_property(vpd->extcon, EXTCON_USB_HOST,
|
||||
+ EXTCON_PROP_USB_TYPEC_POLARITY, property);
|
||||
+ extcon_set_property(vpd->extcon, EXTCON_DISP_DP,
|
||||
+ EXTCON_PROP_USB_TYPEC_POLARITY, property);
|
||||
+
|
||||
+ property.intval = vpd->usb_ss;
|
||||
+ extcon_set_property(vpd->extcon, EXTCON_USB,
|
||||
+ EXTCON_PROP_USB_SS, property);
|
||||
+ extcon_set_property(vpd->extcon, EXTCON_USB_HOST,
|
||||
+ EXTCON_PROP_USB_SS, property);
|
||||
+ extcon_set_property(vpd->extcon, EXTCON_DISP_DP,
|
||||
+ EXTCON_PROP_USB_SS, property);
|
||||
+
|
||||
+ extcon_sync(vpd->extcon, EXTCON_USB);
|
||||
+ extcon_sync(vpd->extcon, EXTCON_USB_HOST);
|
||||
+ extcon_sync(vpd->extcon, EXTCON_DISP_DP);
|
||||
+}
|
||||
+
|
||||
+static irqreturn_t vpd_extcon_irq_handler(int irq, void *dev_id)
|
||||
+{
|
||||
+ struct vpd_extcon *vpd = dev_id;
|
||||
+
|
||||
+ schedule_delayed_work(&vpd->irq_work, msecs_to_jiffies(10));
|
||||
+
|
||||
+ return IRQ_HANDLED;
|
||||
+}
|
||||
+
|
||||
+static enum vpd_data_role vpd_extcon_data_role(struct vpd_extcon *vpd)
|
||||
+{
|
||||
+ const char *const data_roles[] = {
|
||||
+ [DR_NONE] = "NONE",
|
||||
+ [DR_HOST] = "host",
|
||||
+ [DR_DEVICE] = "device",
|
||||
+ [DR_DISPLAY_PORT] = "display-port",
|
||||
+ };
|
||||
+ struct device *dev = vpd->dev;
|
||||
+ int ret;
|
||||
+ const char *dr;
|
||||
+
|
||||
+ ret = device_property_read_string(dev, "vpd-data-role", &dr);
|
||||
+ if (ret < 0)
|
||||
+ return DR_NONE;
|
||||
+
|
||||
+ ret = match_string(data_roles, ARRAY_SIZE(data_roles), dr);
|
||||
+
|
||||
+ return (ret < 0) ? DR_NONE : ret;
|
||||
+}
|
||||
+
|
||||
+static int vpd_extcon_parse_dts(struct vpd_extcon *vpd)
|
||||
+{
|
||||
+ struct device *dev = vpd->dev;
|
||||
+ bool val = false;
|
||||
+ int ret;
|
||||
+
|
||||
+ val = device_property_read_bool(dev, "vpd-polarity");
|
||||
+ if (val)
|
||||
+ vpd->polarity = POLARITY_FLIP;
|
||||
+ else
|
||||
+ vpd->polarity = POLARITY_NORMAL;
|
||||
+
|
||||
+ val = device_property_read_bool(dev, "vpd-super-speed");
|
||||
+ if (val)
|
||||
+ vpd->usb_ss = USB_SS_USB3;
|
||||
+ else
|
||||
+ vpd->usb_ss = USB_SS_USB2;
|
||||
+
|
||||
+ vpd->data_role = vpd_extcon_data_role(vpd);
|
||||
+
|
||||
+ vpd->det_gpio = devm_gpiod_get_optional(dev, "det", GPIOD_ASIS);
|
||||
+ if (IS_ERR(vpd->det_gpio)) {
|
||||
+ ret = PTR_ERR(vpd->det_gpio);
|
||||
+ dev_warn(dev, "failed to get det gpio: %d\n", ret);
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ vpd->irq = gpiod_to_irq(vpd->det_gpio);
|
||||
+ if (vpd->irq < 0) {
|
||||
+ dev_err(dev, "failed to get irq for gpio: %d\n", vpd->irq);
|
||||
+ return vpd->irq;
|
||||
+ }
|
||||
+
|
||||
+ ret = devm_request_threaded_irq(dev, vpd->irq, NULL,
|
||||
+ vpd_extcon_irq_handler,
|
||||
+ IRQF_TRIGGER_FALLING |
|
||||
+ IRQF_TRIGGER_RISING | IRQF_ONESHOT,
|
||||
+ NULL, vpd);
|
||||
+ if (ret)
|
||||
+ dev_err(dev, "failed to request gpio irq\n");
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static int vpd_extcon_probe(struct platform_device *pdev)
|
||||
+{
|
||||
+ struct vpd_extcon *vpd;
|
||||
+ struct device *dev = &pdev->dev;
|
||||
+ int ret;
|
||||
+
|
||||
+ vpd = devm_kzalloc(dev, sizeof(*vpd), GFP_KERNEL);
|
||||
+ if (!vpd)
|
||||
+ return -ENOMEM;
|
||||
+
|
||||
+ vpd->dev = dev;
|
||||
+ ret = vpd_extcon_parse_dts(vpd);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+ INIT_DELAYED_WORK(&vpd->irq_work, vpd_extcon_irq_work);
|
||||
+
|
||||
+ vpd->extcon = devm_extcon_dev_allocate(dev, vpd_cable);
|
||||
+ if (IS_ERR(vpd->extcon)) {
|
||||
+ dev_err(dev, "allocat extcon failed\n");
|
||||
+ return PTR_ERR(vpd->extcon);
|
||||
+ }
|
||||
+
|
||||
+ ret = devm_extcon_dev_register(dev, vpd->extcon);
|
||||
+ if (ret) {
|
||||
+ dev_err(dev, "register extcon failed: %d\n", ret);
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ extcon_set_property_capability(vpd->extcon, EXTCON_USB,
|
||||
+ EXTCON_PROP_USB_VBUS);
|
||||
+ extcon_set_property_capability(vpd->extcon, EXTCON_USB_HOST,
|
||||
+ EXTCON_PROP_USB_VBUS);
|
||||
+
|
||||
+ extcon_set_property_capability(vpd->extcon, EXTCON_USB,
|
||||
+ EXTCON_PROP_USB_TYPEC_POLARITY);
|
||||
+ extcon_set_property_capability(vpd->extcon, EXTCON_USB_HOST,
|
||||
+ EXTCON_PROP_USB_TYPEC_POLARITY);
|
||||
+ extcon_set_property_capability(vpd->extcon, EXTCON_USB,
|
||||
+ EXTCON_PROP_USB_SS);
|
||||
+ extcon_set_property_capability(vpd->extcon, EXTCON_USB_HOST,
|
||||
+ EXTCON_PROP_USB_SS);
|
||||
+
|
||||
+ extcon_set_property_capability(vpd->extcon, EXTCON_DISP_DP,
|
||||
+ EXTCON_PROP_USB_SS);
|
||||
+ extcon_set_property_capability(vpd->extcon, EXTCON_DISP_DP,
|
||||
+ EXTCON_PROP_USB_TYPEC_POLARITY);
|
||||
+
|
||||
+ platform_set_drvdata(pdev, vpd);
|
||||
+
|
||||
+ vpd_extcon_irq_work(&vpd->irq_work.work);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static void vpd_extcon_remove(struct platform_device *pdev)
|
||||
+{
|
||||
+ struct vpd_extcon *vpd = platform_get_drvdata(pdev);
|
||||
+
|
||||
+ cancel_delayed_work_sync(&vpd->irq_work);
|
||||
+
|
||||
+ return;
|
||||
+}
|
||||
+
|
||||
+#ifdef CONFIG_PM_SLEEP
|
||||
+static int vpd_extcon_suspend(struct device *dev)
|
||||
+{
|
||||
+ struct vpd_extcon *vpd = dev_get_drvdata(dev);
|
||||
+
|
||||
+ if (!vpd->enable_irq) {
|
||||
+ disable_irq_nosync(vpd->irq);
|
||||
+ vpd->enable_irq = true;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int vpd_extcon_resume(struct device *dev)
|
||||
+{
|
||||
+ struct vpd_extcon *vpd = dev_get_drvdata(dev);
|
||||
+
|
||||
+ if (vpd->enable_irq) {
|
||||
+ enable_irq(vpd->irq);
|
||||
+ vpd->enable_irq = false;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
+static SIMPLE_DEV_PM_OPS(vpd_extcon_pm_ops,
|
||||
+ vpd_extcon_suspend, vpd_extcon_resume);
|
||||
+
|
||||
+static const struct of_device_id vpd_extcon_dt_match[] = {
|
||||
+ { .compatible = "linux,extcon-usbc-virtual-pd", },
|
||||
+ { /* sentinel */ }
|
||||
+};
|
||||
+
|
||||
+static struct platform_driver vpd_extcon_driver = {
|
||||
+ .probe = vpd_extcon_probe,
|
||||
+ .remove = vpd_extcon_remove,
|
||||
+ .driver = {
|
||||
+ .name = "extcon-usbc-virtual-pd",
|
||||
+ .pm = &vpd_extcon_pm_ops,
|
||||
+ .of_match_table = vpd_extcon_dt_match,
|
||||
+ },
|
||||
+};
|
||||
+
|
||||
+module_platform_driver(vpd_extcon_driver);
|
||||
+
|
||||
+MODULE_AUTHOR("Jagan Teki <jagan@amarulasolutions.com>");
|
||||
+MODULE_DESCRIPTION("Type-C Virtual PD extcon driver");
|
||||
+MODULE_LICENSE("GPL v2");
|
||||
--
|
||||
Armbian
|
||||
|
@ -0,0 +1,66 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Paolo Sabatino <paolo.sabatino@gmail.com>
|
||||
Date: Wed, 2 Oct 2024 19:30:34 +0300
|
||||
Subject: compile .scr and install overlays in right path
|
||||
|
||||
---
|
||||
scripts/Makefile.dtbinst | 13 +++++++++-
|
||||
scripts/Makefile.dtbs | 8 +++++-
|
||||
2 files changed, 19 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/scripts/Makefile.dtbinst b/scripts/Makefile.dtbinst
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/scripts/Makefile.dtbinst
|
||||
+++ b/scripts/Makefile.dtbinst
|
||||
@@ -33,7 +33,18 @@ endef
|
||||
|
||||
$(foreach d, $(sort $(dir $(dtbs))), $(eval $(call gen_install_rules,$(d))))
|
||||
|
||||
-dtbs := $(notdir $(dtbs))
|
||||
+# Very convoluted way to flatten all the device tree
|
||||
+# directories, but keep the "/overlay/" directory
|
||||
+
|
||||
+# topmost directory (ie: from rockchip/overlay/rk322x-emmc.dtbo extracts rockchip)
|
||||
+topmost_dir = $(firstword $(subst /, ,$(dtbs)))
|
||||
+# collect dtbs entries which starts with "$topmost_dir/overlay/", then remove "$topmost_dir"
|
||||
+dtbs_overlays = $(subst $(topmost_dir)/,,$(filter $(topmost_dir)/overlay/%, $(dtbs)))
|
||||
+# collect the non-overlay dtbs
|
||||
+dtbs_regular = $(filter-out $(topmost_dir)/overlay/%, $(dtbs))
|
||||
+# compose the dtbs variable flattening all the non-overlays entries
|
||||
+# and appending the overlays entries
|
||||
+dtbs := $(notdir $(dtbs_regular)) $(dtbs_overlays)
|
||||
|
||||
endif # CONFIG_ARCH_WANT_FLAT_DTB_INSTALL
|
||||
|
||||
diff --git a/scripts/Makefile.dtbs b/scripts/Makefile.dtbs
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/scripts/Makefile.dtbs
|
||||
+++ b/scripts/Makefile.dtbs
|
||||
@@ -122,17 +122,23 @@ dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp)
|
||||
quiet_cmd_dtc = DTC $(quiet_dtb_check_tag) $@
|
||||
cmd_dtc = \
|
||||
$(HOSTCC) -E $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
|
||||
- $(DTC) -o $@ -b 0 $(addprefix -i,$(dir $<) $(DTC_INCLUDE)) \
|
||||
+ $(DTC) -@ -o $@ -b 0 $(addprefix -i,$(dir $<) $(DTC_INCLUDE)) \
|
||||
$(DTC_FLAGS) -d $(depfile).dtc.tmp $(dtc-tmp) ; \
|
||||
cat $(depfile).pre.tmp $(depfile).dtc.tmp > $(depfile) \
|
||||
$(cmd_dtb_check)
|
||||
|
||||
+quiet_cmd_scr = MKIMAGE $@
|
||||
+cmd_scr = mkimage -C none -A $(ARCH) -T script -d $< $@
|
||||
+
|
||||
$(obj)/%.dtb: $(obj)/%.dts $(DTC) $(DT_TMP_SCHEMA) FORCE
|
||||
$(call if_changed_dep,dtc)
|
||||
|
||||
$(obj)/%.dtbo: $(src)/%.dtso $(DTC) FORCE
|
||||
$(call if_changed_dep,dtc)
|
||||
|
||||
+$(obj)/%.scr: $(src)/%.scr-cmd FORCE
|
||||
+ $(call if_changed,scr)
|
||||
+
|
||||
# targets
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
--
|
||||
Armbian
|
||||
|
419
patch/kernel/rockchip64-6.16/general-add-overlay-configfs.patch
Normal file
419
patch/kernel/rockchip64-6.16/general-add-overlay-configfs.patch
Normal file
@ -0,0 +1,419 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
|
||||
Date: Wed, 3 Dec 2014 13:23:28 +0200
|
||||
Subject: OF: DT-Overlay configfs interface
|
||||
|
||||
This is a port of Pantelis Antoniou's v3 port that makes use of the
|
||||
new upstreamed configfs support for binary attributes.
|
||||
|
||||
Original commit message:
|
||||
|
||||
Add a runtime interface to using configfs for generic device tree overlay
|
||||
usage. With it its possible to use device tree overlays without having
|
||||
to use a per-platform overlay manager.
|
||||
|
||||
Please see Documentation/devicetree/configfs-overlays.txt for more info.
|
||||
|
||||
Changes since v2:
|
||||
- Removed ifdef CONFIG_OF_OVERLAY (since for now it's required)
|
||||
- Created a documentation entry
|
||||
- Slight rewording in Kconfig
|
||||
|
||||
Changes since v1:
|
||||
- of_resolve() -> of_resolve_phandles().
|
||||
|
||||
Originally-signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
|
||||
Signed-off-by: Phil Elwell <phil@raspberrypi.org>
|
||||
|
||||
DT configfs: Fix build errors on other platforms
|
||||
|
||||
Signed-off-by: Phil Elwell <phil@raspberrypi.org>
|
||||
|
||||
DT configfs: fix build error
|
||||
|
||||
There is an error when compiling rpi-4.6.y branch:
|
||||
CC drivers/of/configfs.o
|
||||
drivers/of/configfs.c:291:21: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
|
||||
.default_groups = of_cfs_def_groups,
|
||||
^
|
||||
drivers/of/configfs.c:291:21: note: (near initialization for 'of_cfs_subsys.su_group.default_groups.next')
|
||||
|
||||
The .default_groups is linked list since commit
|
||||
1ae1602de028acaa42a0f6ff18d19756f8e825c6.
|
||||
This commit uses configfs_add_default_group to fix this problem.
|
||||
|
||||
Signed-off-by: Slawomir Stepien <sst@poczta.fm>
|
||||
|
||||
configfs: New of_overlay API
|
||||
|
||||
of: configfs: Use of_overlay_fdt_apply API call
|
||||
|
||||
The published API to the dynamic overlay application mechanism now
|
||||
takes a Flattened Device Tree blob as input so that it can manage the
|
||||
lifetime of the unflattened tree. Conveniently, the new API call -
|
||||
of_overlay_fdt_apply - is virtually a drop-in replacement for
|
||||
create_overlay, which can now be deleted.
|
||||
|
||||
Signed-off-by: Phil Elwell <phil@raspberrypi.org>
|
||||
---
|
||||
Documentation/devicetree/configfs-overlays.txt | 31 ++
|
||||
drivers/of/Kconfig | 11 +
|
||||
drivers/of/Makefile | 1 +
|
||||
drivers/of/configfs.c | 277 ++++++++++
|
||||
4 files changed, 320 insertions(+)
|
||||
|
||||
diff --git a/Documentation/devicetree/configfs-overlays.txt b/Documentation/devicetree/configfs-overlays.txt
|
||||
new file mode 100644
|
||||
index 000000000000..111111111111
|
||||
--- /dev/null
|
||||
+++ b/Documentation/devicetree/configfs-overlays.txt
|
||||
@@ -0,0 +1,31 @@
|
||||
+Howto use the configfs overlay interface.
|
||||
+
|
||||
+A device-tree configfs entry is created in /config/device-tree/overlays
|
||||
+and and it is manipulated using standard file system I/O.
|
||||
+Note that this is a debug level interface, for use by developers and
|
||||
+not necessarily something accessed by normal users due to the
|
||||
+security implications of having direct access to the kernel's device tree.
|
||||
+
|
||||
+* To create an overlay you mkdir the directory:
|
||||
+
|
||||
+ # mkdir /config/device-tree/overlays/foo
|
||||
+
|
||||
+* Either you echo the overlay firmware file to the path property file.
|
||||
+
|
||||
+ # echo foo.dtbo >/config/device-tree/overlays/foo/path
|
||||
+
|
||||
+* Or you cat the contents of the overlay to the dtbo file
|
||||
+
|
||||
+ # cat foo.dtbo >/config/device-tree/overlays/foo/dtbo
|
||||
+
|
||||
+The overlay file will be applied, and devices will be created/destroyed
|
||||
+as required.
|
||||
+
|
||||
+To remove it simply rmdir the directory.
|
||||
+
|
||||
+ # rmdir /config/device-tree/overlays/foo
|
||||
+
|
||||
+The rationalle of the dual interface (firmware & direct copy) is that each is
|
||||
+better suited to different use patterns. The firmware interface is what's
|
||||
+intended to be used by hardware managers in the kernel, while the copy interface
|
||||
+make sense for developers (since it avoids problems with namespaces).
|
||||
diff --git a/drivers/of/Kconfig b/drivers/of/Kconfig
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/of/Kconfig
|
||||
+++ b/drivers/of/Kconfig
|
||||
@@ -126,4 +126,15 @@ config OF_OVERLAY_KUNIT_TEST
|
||||
config OF_NUMA
|
||||
bool
|
||||
|
||||
+config OF_DMA_DEFAULT_COHERENT
|
||||
+ # arches should select this if DMA is coherent by default for OF devices
|
||||
+ bool
|
||||
+
|
||||
+config OF_CONFIGFS
|
||||
+ bool "Device Tree Overlay ConfigFS interface"
|
||||
+ select CONFIGFS_FS
|
||||
+ select OF_OVERLAY
|
||||
+ help
|
||||
+ Enable a simple user-space driven DT overlay interface.
|
||||
+
|
||||
endif # OF
|
||||
diff --git a/drivers/of/Makefile b/drivers/of/Makefile
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/of/Makefile
|
||||
+++ b/drivers/of/Makefile
|
||||
@@ -1,6 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
obj-y = base.o cpu.o device.o module.o platform.o property.o
|
||||
obj-$(CONFIG_OF_KOBJ) += kobj.o
|
||||
+obj-$(CONFIG_OF_CONFIGFS) += configfs.o
|
||||
obj-$(CONFIG_OF_DYNAMIC) += dynamic.o
|
||||
obj-$(CONFIG_OF_FLATTREE) += fdt.o empty_root.dtb.o
|
||||
obj-$(CONFIG_OF_EARLY_FLATTREE) += fdt_address.o
|
||||
diff --git a/drivers/of/configfs.c b/drivers/of/configfs.c
|
||||
new file mode 100644
|
||||
index 000000000000..111111111111
|
||||
--- /dev/null
|
||||
+++ b/drivers/of/configfs.c
|
||||
@@ -0,0 +1,277 @@
|
||||
+/*
|
||||
+ * Configfs entries for device-tree
|
||||
+ *
|
||||
+ * Copyright (C) 2013 - Pantelis Antoniou <panto@antoniou-consulting.com>
|
||||
+ *
|
||||
+ * This program is free software; you can redistribute it and/or
|
||||
+ * modify it under the terms of the GNU General Public License
|
||||
+ * as published by the Free Software Foundation; either version
|
||||
+ * 2 of the License, or (at your option) any later version.
|
||||
+ */
|
||||
+#include <linux/ctype.h>
|
||||
+#include <linux/cpu.h>
|
||||
+#include <linux/module.h>
|
||||
+#include <linux/of.h>
|
||||
+#include <linux/of_fdt.h>
|
||||
+#include <linux/spinlock.h>
|
||||
+#include <linux/slab.h>
|
||||
+#include <linux/proc_fs.h>
|
||||
+#include <linux/configfs.h>
|
||||
+#include <linux/types.h>
|
||||
+#include <linux/stat.h>
|
||||
+#include <linux/limits.h>
|
||||
+#include <linux/file.h>
|
||||
+#include <linux/vmalloc.h>
|
||||
+#include <linux/firmware.h>
|
||||
+#include <linux/sizes.h>
|
||||
+
|
||||
+#include "of_private.h"
|
||||
+
|
||||
+struct cfs_overlay_item {
|
||||
+ struct config_item item;
|
||||
+
|
||||
+ char path[PATH_MAX];
|
||||
+
|
||||
+ const struct firmware *fw;
|
||||
+ struct device_node *overlay;
|
||||
+ int ov_id;
|
||||
+
|
||||
+ void *dtbo;
|
||||
+ int dtbo_size;
|
||||
+};
|
||||
+
|
||||
+static inline struct cfs_overlay_item *to_cfs_overlay_item(
|
||||
+ struct config_item *item)
|
||||
+{
|
||||
+ return item ? container_of(item, struct cfs_overlay_item, item) : NULL;
|
||||
+}
|
||||
+
|
||||
+static ssize_t cfs_overlay_item_path_show(struct config_item *item,
|
||||
+ char *page)
|
||||
+{
|
||||
+ struct cfs_overlay_item *overlay = to_cfs_overlay_item(item);
|
||||
+ return sprintf(page, "%s\n", overlay->path);
|
||||
+}
|
||||
+
|
||||
+static ssize_t cfs_overlay_item_path_store(struct config_item *item,
|
||||
+ const char *page, size_t count)
|
||||
+{
|
||||
+ struct cfs_overlay_item *overlay = to_cfs_overlay_item(item);
|
||||
+ const char *p = page;
|
||||
+ char *s;
|
||||
+ int err;
|
||||
+
|
||||
+ /* if it's set do not allow changes */
|
||||
+ if (overlay->path[0] != '\0' || overlay->dtbo_size > 0)
|
||||
+ return -EPERM;
|
||||
+
|
||||
+ /* copy to path buffer (and make sure it's always zero terminated */
|
||||
+ count = snprintf(overlay->path, sizeof(overlay->path) - 1, "%s", p);
|
||||
+ overlay->path[sizeof(overlay->path) - 1] = '\0';
|
||||
+
|
||||
+ /* strip trailing newlines */
|
||||
+ s = overlay->path + strlen(overlay->path);
|
||||
+ while (s > overlay->path && *--s == '\n')
|
||||
+ *s = '\0';
|
||||
+
|
||||
+ pr_debug("%s: path is '%s'\n", __func__, overlay->path);
|
||||
+
|
||||
+ err = request_firmware(&overlay->fw, overlay->path, NULL);
|
||||
+ if (err != 0)
|
||||
+ goto out_err;
|
||||
+
|
||||
+ err = of_overlay_fdt_apply((void *)overlay->fw->data,
|
||||
+ (u32)overlay->fw->size, &overlay->ov_id, NULL);
|
||||
+ if (err != 0)
|
||||
+ goto out_err;
|
||||
+
|
||||
+ return count;
|
||||
+
|
||||
+out_err:
|
||||
+
|
||||
+ release_firmware(overlay->fw);
|
||||
+ overlay->fw = NULL;
|
||||
+
|
||||
+ overlay->path[0] = '\0';
|
||||
+ return err;
|
||||
+}
|
||||
+
|
||||
+static ssize_t cfs_overlay_item_status_show(struct config_item *item,
|
||||
+ char *page)
|
||||
+{
|
||||
+ struct cfs_overlay_item *overlay = to_cfs_overlay_item(item);
|
||||
+
|
||||
+ return sprintf(page, "%s\n",
|
||||
+ overlay->ov_id > 0 ? "applied" : "unapplied");
|
||||
+}
|
||||
+
|
||||
+CONFIGFS_ATTR(cfs_overlay_item_, path);
|
||||
+CONFIGFS_ATTR_RO(cfs_overlay_item_, status);
|
||||
+
|
||||
+static struct configfs_attribute *cfs_overlay_attrs[] = {
|
||||
+ &cfs_overlay_item_attr_path,
|
||||
+ &cfs_overlay_item_attr_status,
|
||||
+ NULL,
|
||||
+};
|
||||
+
|
||||
+ssize_t cfs_overlay_item_dtbo_read(struct config_item *item,
|
||||
+ void *buf, size_t max_count)
|
||||
+{
|
||||
+ struct cfs_overlay_item *overlay = to_cfs_overlay_item(item);
|
||||
+
|
||||
+ pr_debug("%s: buf=%p max_count=%zu\n", __func__,
|
||||
+ buf, max_count);
|
||||
+
|
||||
+ if (overlay->dtbo == NULL)
|
||||
+ return 0;
|
||||
+
|
||||
+ /* copy if buffer provided */
|
||||
+ if (buf != NULL) {
|
||||
+ /* the buffer must be large enough */
|
||||
+ if (overlay->dtbo_size > max_count)
|
||||
+ return -ENOSPC;
|
||||
+
|
||||
+ memcpy(buf, overlay->dtbo, overlay->dtbo_size);
|
||||
+ }
|
||||
+
|
||||
+ return overlay->dtbo_size;
|
||||
+}
|
||||
+
|
||||
+ssize_t cfs_overlay_item_dtbo_write(struct config_item *item,
|
||||
+ const void *buf, size_t count)
|
||||
+{
|
||||
+ struct cfs_overlay_item *overlay = to_cfs_overlay_item(item);
|
||||
+ int err;
|
||||
+
|
||||
+ /* if it's set do not allow changes */
|
||||
+ if (overlay->path[0] != '\0' || overlay->dtbo_size > 0)
|
||||
+ return -EPERM;
|
||||
+
|
||||
+ /* copy the contents */
|
||||
+ overlay->dtbo = kmemdup(buf, count, GFP_KERNEL);
|
||||
+ if (overlay->dtbo == NULL)
|
||||
+ return -ENOMEM;
|
||||
+
|
||||
+ overlay->dtbo_size = count;
|
||||
+
|
||||
+ err = of_overlay_fdt_apply(overlay->dtbo, overlay->dtbo_size,
|
||||
+ &overlay->ov_id, NULL);
|
||||
+ if (err != 0)
|
||||
+ goto out_err;
|
||||
+
|
||||
+ return count;
|
||||
+
|
||||
+out_err:
|
||||
+ kfree(overlay->dtbo);
|
||||
+ overlay->dtbo = NULL;
|
||||
+ overlay->dtbo_size = 0;
|
||||
+ overlay->ov_id = 0;
|
||||
+
|
||||
+ return err;
|
||||
+}
|
||||
+
|
||||
+CONFIGFS_BIN_ATTR(cfs_overlay_item_, dtbo, NULL, SZ_1M);
|
||||
+
|
||||
+static struct configfs_bin_attribute *cfs_overlay_bin_attrs[] = {
|
||||
+ &cfs_overlay_item_attr_dtbo,
|
||||
+ NULL,
|
||||
+};
|
||||
+
|
||||
+static void cfs_overlay_release(struct config_item *item)
|
||||
+{
|
||||
+ struct cfs_overlay_item *overlay = to_cfs_overlay_item(item);
|
||||
+
|
||||
+ if (overlay->ov_id > 0)
|
||||
+ of_overlay_remove(&overlay->ov_id);
|
||||
+ if (overlay->fw)
|
||||
+ release_firmware(overlay->fw);
|
||||
+ /* kfree with NULL is safe */
|
||||
+ kfree(overlay->dtbo);
|
||||
+ kfree(overlay);
|
||||
+}
|
||||
+
|
||||
+static struct configfs_item_operations cfs_overlay_item_ops = {
|
||||
+ .release = cfs_overlay_release,
|
||||
+};
|
||||
+
|
||||
+static struct config_item_type cfs_overlay_type = {
|
||||
+ .ct_item_ops = &cfs_overlay_item_ops,
|
||||
+ .ct_attrs = cfs_overlay_attrs,
|
||||
+ .ct_bin_attrs = cfs_overlay_bin_attrs,
|
||||
+ .ct_owner = THIS_MODULE,
|
||||
+};
|
||||
+
|
||||
+static struct config_item *cfs_overlay_group_make_item(
|
||||
+ struct config_group *group, const char *name)
|
||||
+{
|
||||
+ struct cfs_overlay_item *overlay;
|
||||
+
|
||||
+ overlay = kzalloc(sizeof(*overlay), GFP_KERNEL);
|
||||
+ if (!overlay)
|
||||
+ return ERR_PTR(-ENOMEM);
|
||||
+
|
||||
+ config_item_init_type_name(&overlay->item, name, &cfs_overlay_type);
|
||||
+ return &overlay->item;
|
||||
+}
|
||||
+
|
||||
+static void cfs_overlay_group_drop_item(struct config_group *group,
|
||||
+ struct config_item *item)
|
||||
+{
|
||||
+ struct cfs_overlay_item *overlay = to_cfs_overlay_item(item);
|
||||
+
|
||||
+ config_item_put(&overlay->item);
|
||||
+}
|
||||
+
|
||||
+static struct configfs_group_operations overlays_ops = {
|
||||
+ .make_item = cfs_overlay_group_make_item,
|
||||
+ .drop_item = cfs_overlay_group_drop_item,
|
||||
+};
|
||||
+
|
||||
+static struct config_item_type overlays_type = {
|
||||
+ .ct_group_ops = &overlays_ops,
|
||||
+ .ct_owner = THIS_MODULE,
|
||||
+};
|
||||
+
|
||||
+static struct configfs_group_operations of_cfs_ops = {
|
||||
+ /* empty - we don't allow anything to be created */
|
||||
+};
|
||||
+
|
||||
+static struct config_item_type of_cfs_type = {
|
||||
+ .ct_group_ops = &of_cfs_ops,
|
||||
+ .ct_owner = THIS_MODULE,
|
||||
+};
|
||||
+
|
||||
+struct config_group of_cfs_overlay_group;
|
||||
+
|
||||
+static struct configfs_subsystem of_cfs_subsys = {
|
||||
+ .su_group = {
|
||||
+ .cg_item = {
|
||||
+ .ci_namebuf = "device-tree",
|
||||
+ .ci_type = &of_cfs_type,
|
||||
+ },
|
||||
+ },
|
||||
+ .su_mutex = __MUTEX_INITIALIZER(of_cfs_subsys.su_mutex),
|
||||
+};
|
||||
+
|
||||
+static int __init of_cfs_init(void)
|
||||
+{
|
||||
+ int ret;
|
||||
+
|
||||
+ pr_info("%s\n", __func__);
|
||||
+
|
||||
+ config_group_init(&of_cfs_subsys.su_group);
|
||||
+ config_group_init_type_name(&of_cfs_overlay_group, "overlays",
|
||||
+ &overlays_type);
|
||||
+ configfs_add_default_group(&of_cfs_overlay_group,
|
||||
+ &of_cfs_subsys.su_group);
|
||||
+
|
||||
+ ret = configfs_register_subsystem(&of_cfs_subsys);
|
||||
+ if (ret != 0) {
|
||||
+ pr_err("%s: failed to register subsys\n", __func__);
|
||||
+ goto out;
|
||||
+ }
|
||||
+ pr_info("%s: OK\n", __func__);
|
||||
+out:
|
||||
+ return ret;
|
||||
+}
|
||||
+late_initcall(of_cfs_init);
|
||||
--
|
||||
Armbian
|
||||
|
856
patch/kernel/rockchip64-6.16/general-add-panel-simple-dsi.patch
Normal file
856
patch/kernel/rockchip64-6.16/general-add-panel-simple-dsi.patch
Normal file
@ -0,0 +1,856 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: simple <991605149@qq.com>
|
||||
Date: Sun, 12 Sep 2021 20:06:02 +0200
|
||||
Subject: [ARCHEOLOGY] general add panel simple dsi (#3140)
|
||||
|
||||
> X-Git-Archeology: > recovered message: > * Backporting patch to 5.10 kernel makes sense. Lets do it.
|
||||
> X-Git-Archeology: > recovered message: > Co-authored-by: iamdrq <iamdrq@qq.com>
|
||||
> X-Git-Archeology: > recovered message: > Co-authored-by: Igor Pecovnik <igor.pecovnik@gmail.com>
|
||||
> X-Git-Archeology: - Revision 15819f00e21238e36ca70f6d8445efd6157fbe66: https://github.com/armbian/build/commit/15819f00e21238e36ca70f6d8445efd6157fbe66
|
||||
> X-Git-Archeology: Date: Sun, 12 Sep 2021 20:06:02 +0200
|
||||
> X-Git-Archeology: From: simple <991605149@qq.com>
|
||||
> X-Git-Archeology: Subject: general add panel simple dsi (#3140)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision dd51f9f2afcbc83a3e10b32eb6a5061d91d1558e: https://github.com/armbian/build/commit/dd51f9f2afcbc83a3e10b32eb6a5061d91d1558e
|
||||
> X-Git-Archeology: Date: Tue, 09 Nov 2021 18:06:34 +0100
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igorpecovnik@users.noreply.github.com>
|
||||
> X-Git-Archeology: Subject: Bump imx6, xu4, rockchip64 and jetson-nano to 5.15 (#3238)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 6b490e16944b30ff69bf9c13678905187df0d9d4: https://github.com/armbian/build/commit/6b490e16944b30ff69bf9c13678905187df0d9d4
|
||||
> X-Git-Archeology: Date: Tue, 11 Jan 2022 15:26:11 +0100
|
||||
> X-Git-Archeology: From: Oleg <balbes-150@yandex.ru>
|
||||
> X-Git-Archeology: Subject: move kernel edge to 5.16 (#3387)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision ac8fc4385594d59257ee9dffd9efa85e3497fa7d: https://github.com/armbian/build/commit/ac8fc4385594d59257ee9dffd9efa85e3497fa7d
|
||||
> X-Git-Archeology: Date: Sat, 26 Feb 2022 07:46:44 +0100
|
||||
> X-Git-Archeology: From: Piotr Szczepanik <piter75@gmail.com>
|
||||
> X-Git-Archeology: Subject: Switch rockchip64 current to linux 5.15.y (#3489)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 897674aa74bce0326ed7fe06f5336bf4709a8a1f: https://github.com/armbian/build/commit/897674aa74bce0326ed7fe06f5336bf4709a8a1f
|
||||
> X-Git-Archeology: Date: Tue, 03 May 2022 08:27:32 +0200
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igorpecovnik@users.noreply.github.com>
|
||||
> X-Git-Archeology: Subject: Bump and freeze kernel at last known working versions (#3736)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 597d2dac11f00d9070a4e49d6bad1b2244e36cb3: https://github.com/armbian/build/commit/597d2dac11f00d9070a4e49d6bad1b2244e36cb3
|
||||
> X-Git-Archeology: Date: Sat, 28 May 2022 07:56:22 +0200
|
||||
> X-Git-Archeology: From: Jianfeng Liu <liujianfeng1994@gmail.com>
|
||||
> X-Git-Archeology: Subject: update rockchip64-edge to 5.18 (#3814)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 8c6641e7b79f0d50acdc306d140e586a4e923cf0: https://github.com/armbian/build/commit/8c6641e7b79f0d50acdc306d140e586a4e923cf0
|
||||
> X-Git-Archeology: Date: Wed, 03 Aug 2022 22:22:55 +0200
|
||||
> X-Git-Archeology: From: Jianfeng Liu <liujianfeng1994@gmail.com>
|
||||
> X-Git-Archeology: Subject: update rockchip64 edge to 5.19 (#4039)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 92f1a22d76b987afa7ba555d5b509adc51d689e7: https://github.com/armbian/build/commit/92f1a22d76b987afa7ba555d5b509adc51d689e7
|
||||
> X-Git-Archeology: Date: Fri, 16 Dec 2022 13:38:13 +0100
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igorpecovnik@users.noreply.github.com>
|
||||
> X-Git-Archeology: Subject: Re-add rockchip64 6.0 patches (#4575)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 3b78b57fe367e60ad874d9e16ff1cd67957f8382: https://github.com/armbian/build/commit/3b78b57fe367e60ad874d9e16ff1cd67957f8382
|
||||
> X-Git-Archeology: Date: Sat, 24 Dec 2022 09:43:51 +0100
|
||||
> X-Git-Archeology: From: simple <991605149@qq.com>
|
||||
> X-Git-Archeology: Subject: Fix general-add-panel-simple-dsi.patch on linux6.1 (#4607)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 34ae84fac5d0b66a1ab2d1e51534b7beb13ef245: https://github.com/armbian/build/commit/34ae84fac5d0b66a1ab2d1e51534b7beb13ef245
|
||||
> X-Git-Archeology: Date: Fri, 05 May 2023 14:22:00 +0200
|
||||
> X-Git-Archeology: From: amazingfate <liujianfeng1994@gmail.com>
|
||||
> X-Git-Archeology: Subject: bump rockchip64 edge to v6.3
|
||||
> X-Git-Archeology:
|
||||
---
|
||||
drivers/gpu/drm/panel/Makefile | 1 +
|
||||
drivers/gpu/drm/panel/panel-simple-dsi.c | 772 ++++++++++
|
||||
2 files changed, 773 insertions(+)
|
||||
|
||||
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/gpu/drm/panel/Makefile
|
||||
+++ b/drivers/gpu/drm/panel/Makefile
|
||||
@@ -12,6 +12,7 @@ obj-$(CONFIG_DRM_PANEL_BOE_TV101WUM_NL6) += panel-boe-tv101wum-nl6.o
|
||||
obj-$(CONFIG_DRM_PANEL_DSI_CM) += panel-dsi-cm.o
|
||||
obj-$(CONFIG_DRM_PANEL_LVDS) += panel-lvds.o
|
||||
obj-$(CONFIG_DRM_PANEL_SIMPLE) += panel-simple.o
|
||||
+obj-$(CONFIG_DRM_PANEL_SIMPLE) += panel-simple-dsi.o
|
||||
obj-$(CONFIG_DRM_PANEL_EDP) += panel-edp.o
|
||||
obj-$(CONFIG_DRM_PANEL_EBBG_FT8719) += panel-ebbg-ft8719.o
|
||||
obj-$(CONFIG_DRM_PANEL_ELIDA_KD35T133) += panel-elida-kd35t133.o
|
||||
diff --git a/drivers/gpu/drm/panel/panel-simple-dsi.c b/drivers/gpu/drm/panel/panel-simple-dsi.c
|
||||
new file mode 100644
|
||||
index 000000000000..111111111111
|
||||
--- /dev/null
|
||||
+++ b/drivers/gpu/drm/panel/panel-simple-dsi.c
|
||||
@@ -0,0 +1,772 @@
|
||||
+/*
|
||||
+ * Copyright (C) 2021
|
||||
+ * This simple dsi driver porting from rock-chip panel-simple.c on linux-4.4
|
||||
+ */
|
||||
+
|
||||
+#include <linux/backlight.h>
|
||||
+#include <linux/gpio/consumer.h>
|
||||
+#include <linux/module.h>
|
||||
+#include <linux/of_platform.h>
|
||||
+#include <linux/platform_device.h>
|
||||
+#include <linux/regulator/consumer.h>
|
||||
+
|
||||
+#include <drm/drm_crtc.h>
|
||||
+#include <drm/drm_mipi_dsi.h>
|
||||
+#include <drm/drm_panel.h>
|
||||
+
|
||||
+#include <video/display_timing.h>
|
||||
+#include <video/mipi_display.h>
|
||||
+#include <linux/of_device.h>
|
||||
+#include <video/of_display_timing.h>
|
||||
+#include <linux/of_graph.h>
|
||||
+#include <video/videomode.h>
|
||||
+#include <linux/delay.h>
|
||||
+
|
||||
+struct cmd_ctrl_hdr {
|
||||
+ u8 dtype; /* data type */
|
||||
+ u8 wait; /* ms */
|
||||
+ u8 dlen; /* payload len */
|
||||
+} __packed;
|
||||
+
|
||||
+struct cmd_desc {
|
||||
+ struct cmd_ctrl_hdr dchdr;
|
||||
+ u8 *payload;
|
||||
+};
|
||||
+
|
||||
+struct panel_cmds {
|
||||
+ u8 *buf;
|
||||
+ int blen;
|
||||
+ struct cmd_desc *cmds;
|
||||
+ int cmd_cnt;
|
||||
+};
|
||||
+
|
||||
+struct panel_desc {
|
||||
+ const struct drm_display_mode *modes;
|
||||
+ unsigned int num_modes;
|
||||
+ const struct display_timing *timings;
|
||||
+ unsigned int num_timings;
|
||||
+
|
||||
+ unsigned int bpc;
|
||||
+
|
||||
+ struct {
|
||||
+ unsigned int width;
|
||||
+ unsigned int height;
|
||||
+ } size;
|
||||
+
|
||||
+ /**
|
||||
+ * @reset: the time (in milliseconds) indicates the delay time
|
||||
+ * after the panel to operate reset gpio
|
||||
+ * @init: the time (in milliseconds) that it takes for the panel to
|
||||
+ * power on and dsi host can send command to panel
|
||||
+ * @prepare: the time (in milliseconds) that it takes for the panel to
|
||||
+ * become ready and start receiving video data
|
||||
+ * @enable: the time (in milliseconds) that it takes for the panel to
|
||||
+ * display the first valid frame after starting to receive
|
||||
+ * video data
|
||||
+ * @disable: the time (in milliseconds) that it takes for the panel to
|
||||
+ * turn the display off (no content is visible)
|
||||
+ * @unprepare: the time (in milliseconds) that it takes for the panel
|
||||
+ * to power itself down completely
|
||||
+ */
|
||||
+ struct {
|
||||
+ unsigned int reset;
|
||||
+ unsigned int init;
|
||||
+ unsigned int prepare;
|
||||
+ unsigned int enable;
|
||||
+ unsigned int disable;
|
||||
+ unsigned int unprepare;
|
||||
+ } delay;
|
||||
+
|
||||
+ u32 bus_format;
|
||||
+};
|
||||
+
|
||||
+struct panel_simple {
|
||||
+ struct drm_panel base;
|
||||
+ struct mipi_dsi_device *dsi;
|
||||
+ bool prepared;
|
||||
+ bool enabled;
|
||||
+ bool power_invert;
|
||||
+
|
||||
+ struct device *dev;
|
||||
+ const struct panel_desc *desc;
|
||||
+
|
||||
+ struct regulator *supply;
|
||||
+
|
||||
+ struct gpio_desc *enable_gpio;
|
||||
+ struct gpio_desc *reset_gpio;
|
||||
+ int cmd_type;
|
||||
+
|
||||
+ struct panel_cmds *on_cmds;
|
||||
+ struct panel_cmds *off_cmds;
|
||||
+ struct device_node *np_crtc;
|
||||
+
|
||||
+ int reset_level;
|
||||
+ enum drm_panel_orientation orientation;
|
||||
+};
|
||||
+
|
||||
+enum rockchip_cmd_type {
|
||||
+ CMD_TYPE_DEFAULT,
|
||||
+ CMD_TYPE_SPI,
|
||||
+ CMD_TYPE_MCU
|
||||
+};
|
||||
+
|
||||
+static void panel_simple_sleep(unsigned int msec)
|
||||
+{
|
||||
+ if (msec > 20)
|
||||
+ msleep(msec);
|
||||
+ else
|
||||
+ usleep_range(msec * 1000, (msec + 1) * 1000);
|
||||
+}
|
||||
+
|
||||
+static inline struct panel_simple *to_panel_simple(struct drm_panel *panel)
|
||||
+{
|
||||
+ return container_of(panel, struct panel_simple, base);
|
||||
+}
|
||||
+
|
||||
+static void panel_simple_cmds_cleanup(struct panel_simple *p)
|
||||
+{
|
||||
+ if (p->on_cmds) {
|
||||
+ kfree(p->on_cmds->buf);
|
||||
+ kfree(p->on_cmds->cmds);
|
||||
+ }
|
||||
+
|
||||
+ if (p->off_cmds) {
|
||||
+ kfree(p->off_cmds->buf);
|
||||
+ kfree(p->off_cmds->cmds);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static int panel_simple_parse_cmds(struct device *dev,
|
||||
+ const u8 *data, int blen,
|
||||
+ struct panel_cmds *pcmds)
|
||||
+{
|
||||
+ unsigned int len;
|
||||
+ char *buf, *bp;
|
||||
+ struct cmd_ctrl_hdr *dchdr;
|
||||
+ int i, cnt;
|
||||
+
|
||||
+ if (!pcmds)
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ buf = kmemdup(data, blen, GFP_KERNEL);
|
||||
+ if (!buf)
|
||||
+ return -ENOMEM;
|
||||
+
|
||||
+ /* scan init commands */
|
||||
+ bp = buf;
|
||||
+ len = blen;
|
||||
+ cnt = 0;
|
||||
+ while (len > sizeof(*dchdr)) {
|
||||
+ dchdr = (struct cmd_ctrl_hdr *)bp;
|
||||
+
|
||||
+ if (dchdr->dlen > len) {
|
||||
+ dev_err(dev, "%s: error, len=%d", __func__,
|
||||
+ dchdr->dlen);
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
+ bp += sizeof(*dchdr);
|
||||
+ len -= sizeof(*dchdr);
|
||||
+ bp += dchdr->dlen;
|
||||
+ len -= dchdr->dlen;
|
||||
+ cnt++;
|
||||
+ }
|
||||
+
|
||||
+ if (len != 0) {
|
||||
+ dev_err(dev, "%s: dcs_cmd=%x len=%d error!",
|
||||
+ __func__, buf[0], blen);
|
||||
+ kfree(buf);
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
+ pcmds->cmds = kcalloc(cnt, sizeof(struct cmd_desc), GFP_KERNEL);
|
||||
+ if (!pcmds->cmds) {
|
||||
+ kfree(buf);
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+
|
||||
+ pcmds->cmd_cnt = cnt;
|
||||
+ pcmds->buf = buf;
|
||||
+ pcmds->blen = blen;
|
||||
+
|
||||
+ bp = buf;
|
||||
+ len = blen;
|
||||
+ for (i = 0; i < cnt; i++) {
|
||||
+ dchdr = (struct cmd_ctrl_hdr *)bp;
|
||||
+ len -= sizeof(*dchdr);
|
||||
+ bp += sizeof(*dchdr);
|
||||
+ pcmds->cmds[i].dchdr = *dchdr;
|
||||
+ pcmds->cmds[i].payload = bp;
|
||||
+ bp += dchdr->dlen;
|
||||
+ len -= dchdr->dlen;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int panel_simple_dsi_send_cmds(struct panel_simple *panel,
|
||||
+ struct panel_cmds *cmds)
|
||||
+{
|
||||
+ struct mipi_dsi_device *dsi = panel->dsi;
|
||||
+ int i, err;
|
||||
+
|
||||
+ if (!cmds)
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ for (i = 0; i < cmds->cmd_cnt; i++) {
|
||||
+ struct cmd_desc *cmd = &cmds->cmds[i];
|
||||
+
|
||||
+ switch (cmd->dchdr.dtype) {
|
||||
+ case MIPI_DSI_GENERIC_SHORT_WRITE_0_PARAM:
|
||||
+ case MIPI_DSI_GENERIC_SHORT_WRITE_1_PARAM:
|
||||
+ case MIPI_DSI_GENERIC_SHORT_WRITE_2_PARAM:
|
||||
+ case MIPI_DSI_GENERIC_LONG_WRITE:
|
||||
+ err = mipi_dsi_generic_write(dsi, cmd->payload,
|
||||
+ cmd->dchdr.dlen);
|
||||
+ break;
|
||||
+ case MIPI_DSI_DCS_SHORT_WRITE:
|
||||
+ case MIPI_DSI_DCS_SHORT_WRITE_PARAM:
|
||||
+ case MIPI_DSI_DCS_LONG_WRITE:
|
||||
+ err = mipi_dsi_dcs_write_buffer(dsi, cmd->payload,
|
||||
+ cmd->dchdr.dlen);
|
||||
+ break;
|
||||
+ default:
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
+ if (err < 0)
|
||||
+ dev_err(panel->dev, "failed to write dcs cmd: %d\n",
|
||||
+ err);
|
||||
+
|
||||
+ if (cmd->dchdr.wait)
|
||||
+ panel_simple_sleep(cmd->dchdr.wait);
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int panel_simple_get_cmds(struct panel_simple *panel)
|
||||
+{
|
||||
+ const void *data;
|
||||
+ int len;
|
||||
+ int err;
|
||||
+
|
||||
+ data = of_get_property(panel->dev->of_node, "panel-init-sequence",
|
||||
+ &len);
|
||||
+ if (data) {
|
||||
+ panel->on_cmds = devm_kzalloc(panel->dev,
|
||||
+ sizeof(*panel->on_cmds),
|
||||
+ GFP_KERNEL);
|
||||
+ if (!panel->on_cmds)
|
||||
+ return -ENOMEM;
|
||||
+
|
||||
+ err = panel_simple_parse_cmds(panel->dev, data, len,
|
||||
+ panel->on_cmds);
|
||||
+ if (err) {
|
||||
+ dev_err(panel->dev, "failed to parse panel init sequence\n");
|
||||
+ return err;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ data = of_get_property(panel->dev->of_node, "panel-exit-sequence",
|
||||
+ &len);
|
||||
+ if (data) {
|
||||
+ panel->off_cmds = devm_kzalloc(panel->dev,
|
||||
+ sizeof(*panel->off_cmds),
|
||||
+ GFP_KERNEL);
|
||||
+ if (!panel->off_cmds)
|
||||
+ return -ENOMEM;
|
||||
+
|
||||
+ err = panel_simple_parse_cmds(panel->dev, data, len,
|
||||
+ panel->off_cmds);
|
||||
+ if (err) {
|
||||
+ dev_err(panel->dev, "failed to parse panel exit sequence\n");
|
||||
+ return err;
|
||||
+ }
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int panel_simple_get_modes(struct drm_panel *panel,struct drm_connector *connector)
|
||||
+{
|
||||
+ struct panel_simple *p = to_panel_simple(panel);
|
||||
+ struct drm_device *drm = connector->dev;
|
||||
+ struct drm_display_mode *mode;
|
||||
+ struct device_node *timings_np;
|
||||
+ int ret;
|
||||
+
|
||||
+ timings_np = of_get_child_by_name(panel->dev->of_node,
|
||||
+ "display-timings");
|
||||
+ if (!timings_np) {
|
||||
+ dev_dbg(panel->dev, "failed to find display-timings node\n");
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ of_node_put(timings_np);
|
||||
+ mode = drm_mode_create(drm);
|
||||
+ if (!mode)
|
||||
+ return 0;
|
||||
+
|
||||
+ ret = of_get_drm_display_mode(panel->dev->of_node, mode, &p->desc->bus_format,
|
||||
+ OF_USE_NATIVE_MODE);
|
||||
+ if (ret) {
|
||||
+ dev_dbg(panel->dev, "failed to find dts display timings\n");
|
||||
+ drm_mode_destroy(drm, mode);
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ drm_mode_set_name(mode);
|
||||
+ mode->type |= DRM_MODE_TYPE_PREFERRED;
|
||||
+
|
||||
+ connector->display_info.width_mm = mode->width_mm;
|
||||
+ connector->display_info.height_mm = mode->height_mm;
|
||||
+
|
||||
+ drm_mode_probed_add(connector, mode);
|
||||
+
|
||||
+ /*
|
||||
+ * TODO: Remove once all drm drivers call
|
||||
+ * drm_connector_set_orientation_from_panel()
|
||||
+ */
|
||||
+ drm_connector_set_panel_orientation(connector, p->orientation);
|
||||
+
|
||||
+ return 1;
|
||||
+}
|
||||
+
|
||||
+static int panel_simple_regulator_enable(struct drm_panel *panel)
|
||||
+{
|
||||
+ struct panel_simple *p = to_panel_simple(panel);
|
||||
+ int err = 0;
|
||||
+
|
||||
+ if (p->power_invert) {
|
||||
+ if (regulator_is_enabled(p->supply) > 0)
|
||||
+ regulator_disable(p->supply);
|
||||
+ } else {
|
||||
+ err = regulator_enable(p->supply);
|
||||
+ if (err < 0) {
|
||||
+ dev_err(panel->dev, "failed to enable supply: %d\n",
|
||||
+ err);
|
||||
+ return err;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return err;
|
||||
+}
|
||||
+
|
||||
+static int panel_simple_regulator_disable(struct drm_panel *panel)
|
||||
+{
|
||||
+ struct panel_simple *p = to_panel_simple(panel);
|
||||
+ int err = 0;
|
||||
+
|
||||
+ if (p->power_invert) {
|
||||
+ if (!regulator_is_enabled(p->supply)) {
|
||||
+ err = regulator_enable(p->supply);
|
||||
+ if (err < 0) {
|
||||
+ dev_err(panel->dev, "failed to enable supply: %d\n",
|
||||
+ err);
|
||||
+ return err;
|
||||
+ }
|
||||
+ }
|
||||
+ } else {
|
||||
+ regulator_disable(p->supply);
|
||||
+ }
|
||||
+
|
||||
+ return err;
|
||||
+}
|
||||
+
|
||||
+static int panel_simple_disable(struct drm_panel *panel)
|
||||
+{
|
||||
+ struct panel_simple *p = to_panel_simple(panel);
|
||||
+ int err = 0;
|
||||
+
|
||||
+ if (!p->enabled)
|
||||
+ return 0;
|
||||
+
|
||||
+ if (p->desc && p->desc->delay.disable)
|
||||
+ panel_simple_sleep(p->desc->delay.disable);
|
||||
+
|
||||
+ p->enabled = false;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int panel_simple_unprepare(struct drm_panel *panel)
|
||||
+{
|
||||
+ struct panel_simple *p = to_panel_simple(panel);
|
||||
+ int err = 0;
|
||||
+
|
||||
+ if (!p->prepared)
|
||||
+ return 0;
|
||||
+
|
||||
+ if (p->off_cmds) {
|
||||
+ if (p->dsi)
|
||||
+ err = panel_simple_dsi_send_cmds(p, p->off_cmds);
|
||||
+ if (err)
|
||||
+ dev_err(p->dev, "failed to send off cmds\n");
|
||||
+ }
|
||||
+
|
||||
+ if (p->reset_gpio)
|
||||
+ gpiod_direction_output(p->reset_gpio, !p->reset_level);
|
||||
+
|
||||
+ if (p->enable_gpio)
|
||||
+ gpiod_direction_output(p->enable_gpio, 0);
|
||||
+
|
||||
+ panel_simple_regulator_disable(panel);
|
||||
+
|
||||
+ if (p->desc && p->desc->delay.unprepare)
|
||||
+ panel_simple_sleep(p->desc->delay.unprepare);
|
||||
+
|
||||
+ p->prepared = false;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int panel_simple_prepare(struct drm_panel *panel)
|
||||
+{
|
||||
+ struct panel_simple *p = to_panel_simple(panel);
|
||||
+ int err;
|
||||
+
|
||||
+ if (p->prepared)
|
||||
+ return 0;
|
||||
+
|
||||
+ err = panel_simple_regulator_enable(panel);
|
||||
+ if (err < 0) {
|
||||
+ dev_err(panel->dev, "failed to enable supply: %d\n", err);
|
||||
+ return err;
|
||||
+ }
|
||||
+
|
||||
+ if (p->enable_gpio)
|
||||
+ gpiod_direction_output(p->enable_gpio, 1);
|
||||
+
|
||||
+ if (p->desc && p->desc->delay.prepare)
|
||||
+ panel_simple_sleep(p->desc->delay.prepare);
|
||||
+
|
||||
+ if (p->reset_gpio)
|
||||
+ gpiod_direction_output(p->reset_gpio, !p->reset_level);
|
||||
+
|
||||
+ if (p->desc && p->desc->delay.reset)
|
||||
+ panel_simple_sleep(p->desc->delay.reset);
|
||||
+
|
||||
+ if (p->reset_gpio)
|
||||
+ gpiod_direction_output(p->reset_gpio, p->reset_level);
|
||||
+
|
||||
+ if (p->desc && p->desc->delay.init)
|
||||
+ panel_simple_sleep(p->desc->delay.init);
|
||||
+
|
||||
+ if (p->on_cmds) {
|
||||
+ if (p->dsi)
|
||||
+ err = panel_simple_dsi_send_cmds(p, p->on_cmds);
|
||||
+ if (err)
|
||||
+ dev_err(p->dev, "failed to send on cmds\n");
|
||||
+ }
|
||||
+
|
||||
+ p->prepared = true;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int panel_simple_enable(struct drm_panel *panel)
|
||||
+{
|
||||
+ struct panel_simple *p = to_panel_simple(panel);
|
||||
+ int err = 0;
|
||||
+
|
||||
+ if (p->enabled)
|
||||
+ return 0;
|
||||
+
|
||||
+ if (p->desc && p->desc->delay.enable)
|
||||
+ panel_simple_sleep(p->desc->delay.enable);
|
||||
+
|
||||
+ p->enabled = true;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int panel_simple_get_timings(struct drm_panel *panel,
|
||||
+ unsigned int num_timings,
|
||||
+ struct display_timing *timings)
|
||||
+{
|
||||
+ struct panel_simple *p = to_panel_simple(panel);
|
||||
+ unsigned int i;
|
||||
+
|
||||
+ if (!p->desc)
|
||||
+ return 0;
|
||||
+
|
||||
+ if (p->desc->num_timings < num_timings)
|
||||
+ num_timings = p->desc->num_timings;
|
||||
+
|
||||
+ if (timings)
|
||||
+ for (i = 0; i < num_timings; i++)
|
||||
+ timings[i] = p->desc->timings[i];
|
||||
+
|
||||
+ return p->desc->num_timings;
|
||||
+}
|
||||
+
|
||||
+static enum drm_panel_orientation panel_simple_get_orientation(struct drm_panel *panel)
|
||||
+{
|
||||
+ struct panel_simple *p = to_panel_simple(panel);
|
||||
+
|
||||
+ return p->orientation;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+static const struct drm_panel_funcs panel_simple_funcs = {
|
||||
+ .disable = panel_simple_disable,
|
||||
+ .unprepare = panel_simple_unprepare,
|
||||
+ .prepare = panel_simple_prepare,
|
||||
+ .enable = panel_simple_enable,
|
||||
+ .get_modes = panel_simple_get_modes,
|
||||
+ .get_orientation = panel_simple_get_orientation,
|
||||
+ .get_timings = panel_simple_get_timings,
|
||||
+};
|
||||
+
|
||||
+static int panel_simple_probe(struct device *dev, const struct panel_desc *desc)
|
||||
+{
|
||||
+ struct panel_simple *panel;
|
||||
+ struct panel_desc *of_desc;
|
||||
+ const char *cmd_type;
|
||||
+ u32 val;
|
||||
+ int err;
|
||||
+
|
||||
+ panel = devm_kzalloc(dev, sizeof(*panel), GFP_KERNEL);
|
||||
+ if (!panel)
|
||||
+ return -ENOMEM;
|
||||
+
|
||||
+ if (!desc)
|
||||
+ of_desc = devm_kzalloc(dev, sizeof(*of_desc), GFP_KERNEL);
|
||||
+ else
|
||||
+ of_desc = devm_kmemdup(dev, desc, sizeof(*of_desc), GFP_KERNEL);
|
||||
+
|
||||
+ if (!of_property_read_u32(dev->of_node, "bus-format", &val))
|
||||
+ of_desc->bus_format = val;
|
||||
+ if (!of_property_read_u32(dev->of_node, "bpc", &val))
|
||||
+ of_desc->bpc = val;
|
||||
+ if (!of_property_read_u32(dev->of_node, "prepare-delay-ms", &val))
|
||||
+ of_desc->delay.prepare = val;
|
||||
+ if (!of_property_read_u32(dev->of_node, "enable-delay-ms", &val))
|
||||
+ of_desc->delay.enable = val;
|
||||
+ if (!of_property_read_u32(dev->of_node, "disable-delay-ms", &val))
|
||||
+ of_desc->delay.disable = val;
|
||||
+ if (!of_property_read_u32(dev->of_node, "unprepare-delay-ms", &val))
|
||||
+ of_desc->delay.unprepare = val;
|
||||
+ if (!of_property_read_u32(dev->of_node, "reset-delay-ms", &val))
|
||||
+ of_desc->delay.reset = val;
|
||||
+ if (!of_property_read_u32(dev->of_node, "init-delay-ms", &val))
|
||||
+ of_desc->delay.init = val;
|
||||
+ if (!of_property_read_u32(dev->of_node, "width-mm", &val))
|
||||
+ of_desc->size.width = val;
|
||||
+ if (!of_property_read_u32(dev->of_node, "height-mm", &val))
|
||||
+ of_desc->size.height = val;
|
||||
+
|
||||
+ panel->enabled = false;
|
||||
+ panel->prepared = false;
|
||||
+ panel->desc = of_desc;
|
||||
+ panel->dev = dev;
|
||||
+
|
||||
+ err = panel_simple_get_cmds(panel);
|
||||
+ if (err) {
|
||||
+ dev_err(dev, "failed to get init cmd: %d\n", err);
|
||||
+ return err;
|
||||
+ }
|
||||
+ panel->supply = devm_regulator_get(dev, "power");
|
||||
+ if (IS_ERR(panel->supply))
|
||||
+ return PTR_ERR(panel->supply);
|
||||
+
|
||||
+ panel->enable_gpio = devm_gpiod_get_optional(dev, "enable", 0);
|
||||
+ if (IS_ERR(panel->enable_gpio)) {
|
||||
+ err = PTR_ERR(panel->enable_gpio);
|
||||
+ dev_err(dev, "failed to request enable GPIO: %d\n", err);
|
||||
+ return err;
|
||||
+ }
|
||||
+
|
||||
+ panel->reset_gpio = devm_gpiod_get_optional(dev, "reset", 0);
|
||||
+ if (IS_ERR(panel->reset_gpio)) {
|
||||
+ err = PTR_ERR(panel->reset_gpio);
|
||||
+ dev_err(dev, "failed to request reset GPIO: %d\n", err);
|
||||
+ return err;
|
||||
+ }
|
||||
+
|
||||
+ if (!of_property_read_u32(dev->of_node, "reset-level", &val)) {
|
||||
+ panel->reset_level = val;
|
||||
+ } else {
|
||||
+ panel->reset_level = 0;
|
||||
+ }
|
||||
+
|
||||
+ err = of_drm_get_panel_orientation(dev->of_node, &panel->orientation);
|
||||
+ if (err) {
|
||||
+ dev_err(dev, "%pOF: failed to get orientation %d\n", dev->of_node, err);
|
||||
+ return err;
|
||||
+ }
|
||||
+
|
||||
+ panel->cmd_type = CMD_TYPE_DEFAULT;
|
||||
+
|
||||
+ panel->power_invert =
|
||||
+ of_property_read_bool(dev->of_node, "power-invert");
|
||||
+
|
||||
+ drm_panel_init(&panel->base, dev, &panel_simple_funcs,DRM_MODE_CONNECTOR_DSI);
|
||||
+ panel->base.dev = dev;
|
||||
+ panel->base.funcs = &panel_simple_funcs;
|
||||
+
|
||||
+ err = drm_panel_of_backlight(&panel->base);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+
|
||||
+ drm_panel_add(&panel->base);
|
||||
+
|
||||
+ dev_set_drvdata(dev, panel);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int panel_simple_remove(struct device *dev)
|
||||
+{
|
||||
+ struct panel_simple *panel = dev_get_drvdata(dev);
|
||||
+
|
||||
+ drm_panel_remove(&panel->base);
|
||||
+
|
||||
+ panel_simple_disable(&panel->base);
|
||||
+ panel_simple_unprepare(&panel->base);
|
||||
+
|
||||
+ panel_simple_cmds_cleanup(panel);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static void panel_simple_shutdown(struct device *dev)
|
||||
+{
|
||||
+ struct panel_simple *panel = dev_get_drvdata(dev);
|
||||
+
|
||||
+ panel_simple_disable(&panel->base);
|
||||
+
|
||||
+ if (panel->prepared) {
|
||||
+ if (panel->reset_gpio)
|
||||
+ gpiod_direction_output(panel->reset_gpio, !panel->reset_level);
|
||||
+
|
||||
+ if (panel->enable_gpio)
|
||||
+ gpiod_direction_output(panel->enable_gpio, 0);
|
||||
+
|
||||
+ panel_simple_regulator_disable(&panel->base);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+struct panel_desc_dsi {
|
||||
+ struct panel_desc desc;
|
||||
+
|
||||
+ unsigned long flags;
|
||||
+ enum mipi_dsi_pixel_format format;
|
||||
+ unsigned int lanes;
|
||||
+};
|
||||
+
|
||||
+/*
|
||||
+static const struct drm_display_mode panasonic_vvx10f004b00_mode = {
|
||||
+ .clock = 157200,
|
||||
+ .hdisplay = 1920,
|
||||
+ .hsync_start = 1920 + 154,
|
||||
+ .hsync_end = 1920 + 154 + 16,
|
||||
+ .htotal = 1920 + 154 + 16 + 32,
|
||||
+ .vdisplay = 1200,
|
||||
+ .vsync_start = 1200 + 17,
|
||||
+ .vsync_end = 1200 + 17 + 2,
|
||||
+ .vtotal = 1200 + 17 + 2 + 16,
|
||||
+ .vrefresh = 60,
|
||||
+};
|
||||
+static const struct panel_desc_dsi panasonic_vvx10f004b00 = {
|
||||
+ .desc = {
|
||||
+ .modes = &panasonic_vvx10f004b00_mode,
|
||||
+ .num_modes = 1,
|
||||
+ .bpc = 8,
|
||||
+ .size = {
|
||||
+ .width = 217,
|
||||
+ .height = 136,
|
||||
+ },
|
||||
+ },
|
||||
+ .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
|
||||
+ MIPI_DSI_CLOCK_NON_CONTINUOUS,
|
||||
+ .format = MIPI_DSI_FMT_RGB888,
|
||||
+ .lanes = 4,
|
||||
+};
|
||||
+*/
|
||||
+
|
||||
+static const struct of_device_id dsi_of_match[] = {
|
||||
+ {
|
||||
+ .compatible = "panel-dsi-simple",
|
||||
+ .data = NULL
|
||||
+ }, {
|
||||
+ /* sentinel */
|
||||
+ }
|
||||
+};
|
||||
+MODULE_DEVICE_TABLE(of, dsi_of_match);
|
||||
+
|
||||
+static int panel_simple_dsi_probe(struct mipi_dsi_device *dsi)
|
||||
+{
|
||||
+ struct device *dev = &dsi->dev;
|
||||
+ struct panel_simple *panel;
|
||||
+ const struct panel_desc_dsi *desc;
|
||||
+ const struct of_device_id *id;
|
||||
+ const struct panel_desc *pdesc;
|
||||
+ int err;
|
||||
+ u32 val;
|
||||
+
|
||||
+ id = of_match_node(dsi_of_match, dev->of_node);
|
||||
+ if (!id)
|
||||
+ return -ENODEV;
|
||||
+
|
||||
+ desc = id->data;
|
||||
+
|
||||
+ if (desc) {
|
||||
+ dsi->mode_flags = desc->flags;
|
||||
+ dsi->format = desc->format;
|
||||
+ dsi->lanes = desc->lanes;
|
||||
+ pdesc = &desc->desc;
|
||||
+ } else {
|
||||
+ pdesc = NULL;
|
||||
+ }
|
||||
+
|
||||
+ err = panel_simple_probe(dev, pdesc);
|
||||
+ if (err < 0)
|
||||
+ return err;
|
||||
+
|
||||
+ panel = dev_get_drvdata(dev);
|
||||
+ panel->dsi = dsi;
|
||||
+
|
||||
+ if (!of_property_read_u32(dev->of_node, "dsi,flags", &val))
|
||||
+ dsi->mode_flags = val;
|
||||
+
|
||||
+ if (!of_property_read_u32(dev->of_node, "dsi,format", &val))
|
||||
+ dsi->format = val;
|
||||
+
|
||||
+ if (!of_property_read_u32(dev->of_node, "dsi,lanes", &val))
|
||||
+ dsi->lanes = val;
|
||||
+
|
||||
+ return mipi_dsi_attach(dsi);
|
||||
+}
|
||||
+
|
||||
+static void panel_simple_dsi_remove(struct mipi_dsi_device *dsi)
|
||||
+{
|
||||
+ int err;
|
||||
+
|
||||
+ err = mipi_dsi_detach(dsi);
|
||||
+ if (err < 0)
|
||||
+ dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", err);
|
||||
+
|
||||
+ panel_simple_remove(&dsi->dev);
|
||||
+}
|
||||
+
|
||||
+static void panel_simple_dsi_shutdown(struct mipi_dsi_device *dsi)
|
||||
+{
|
||||
+ panel_simple_shutdown(&dsi->dev);
|
||||
+}
|
||||
+
|
||||
+static struct mipi_dsi_driver panel_simple_dsi_driver = {
|
||||
+ .driver = {
|
||||
+ .name = "panel-dsi-simple",
|
||||
+ .of_match_table = dsi_of_match,
|
||||
+ },
|
||||
+ .probe = panel_simple_dsi_probe,
|
||||
+ .remove = panel_simple_dsi_remove,
|
||||
+ .shutdown = panel_simple_dsi_shutdown,
|
||||
+};
|
||||
+
|
||||
+module_mipi_dsi_driver(panel_simple_dsi_driver);
|
||||
+
|
||||
+MODULE_AUTHOR("iamdrq <iamdrq@qq.com>");
|
||||
+MODULE_DESCRIPTION("DRM Driver for DSI Simple Panels");
|
||||
+MODULE_LICENSE("GPL");
|
||||
--
|
||||
Armbian
|
||||
|
155
patch/kernel/rockchip64-6.16/general-add-pll-hdmi-timings.patch
Normal file
155
patch/kernel/rockchip64-6.16/general-add-pll-hdmi-timings.patch
Normal file
@ -0,0 +1,155 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: paolo <paolo.sabatino@gmail.com>
|
||||
Date: Sun, 17 Jan 2021 10:20:21 +0000
|
||||
Subject: [ARCHEOLOGY] Adding pll hdmi timing to rockchip64-dev too
|
||||
|
||||
> X-Git-Archeology: > recovered message: > Fixed rk3328 mali node, shortening memory range to 0x30000 as per-stated in official documentation
|
||||
> X-Git-Archeology: - Revision 3a037e899b06452043e23cd2a17f40fe1a932c5f: https://github.com/armbian/build/commit/3a037e899b06452043e23cd2a17f40fe1a932c5f
|
||||
> X-Git-Archeology: Date: Sun, 17 Jan 2021 10:20:21 +0000
|
||||
> X-Git-Archeology: From: paolo <paolo.sabatino@gmail.com>
|
||||
> X-Git-Archeology: Subject: Adding pll hdmi timing to rockchip64-dev too
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 0cdffb29b07305209efb12cf3b5ac6032d3a1153: https://github.com/armbian/build/commit/0cdffb29b07305209efb12cf3b5ac6032d3a1153
|
||||
> X-Git-Archeology: Date: Wed, 24 Mar 2021 19:01:53 +0100
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igorpecovnik@users.noreply.github.com>
|
||||
> X-Git-Archeology: Subject: Renaming DEV branch to EDGE (#2704)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision e7377248b3cae186e24e2be781cd3365b43246f0: https://github.com/armbian/build/commit/e7377248b3cae186e24e2be781cd3365b43246f0
|
||||
> X-Git-Archeology: Date: Thu, 22 Jul 2021 00:15:54 +0200
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igorpecovnik@users.noreply.github.com>
|
||||
> X-Git-Archeology: Subject: Second part of EDGE bumping to 5.13.y (#3045)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 744ea89a589d62cb6f409baab60fc6664520bc39: https://github.com/armbian/build/commit/744ea89a589d62cb6f409baab60fc6664520bc39
|
||||
> X-Git-Archeology: Date: Wed, 08 Sep 2021 17:51:34 +0200
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igorpecovnik@users.noreply.github.com>
|
||||
> X-Git-Archeology: Subject: Bumping EDGE kernel to 5.14.y (#3125)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision dd51f9f2afcbc83a3e10b32eb6a5061d91d1558e: https://github.com/armbian/build/commit/dd51f9f2afcbc83a3e10b32eb6a5061d91d1558e
|
||||
> X-Git-Archeology: Date: Tue, 09 Nov 2021 18:06:34 +0100
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igorpecovnik@users.noreply.github.com>
|
||||
> X-Git-Archeology: Subject: Bump imx6, xu4, rockchip64 and jetson-nano to 5.15 (#3238)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision ac8fc4385594d59257ee9dffd9efa85e3497fa7d: https://github.com/armbian/build/commit/ac8fc4385594d59257ee9dffd9efa85e3497fa7d
|
||||
> X-Git-Archeology: Date: Sat, 26 Feb 2022 07:46:44 +0100
|
||||
> X-Git-Archeology: From: Piotr Szczepanik <piter75@gmail.com>
|
||||
> X-Git-Archeology: Subject: Switch rockchip64 current to linux 5.15.y (#3489)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 897674aa74bce0326ed7fe06f5336bf4709a8a1f: https://github.com/armbian/build/commit/897674aa74bce0326ed7fe06f5336bf4709a8a1f
|
||||
> X-Git-Archeology: Date: Tue, 03 May 2022 08:27:32 +0200
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igorpecovnik@users.noreply.github.com>
|
||||
> X-Git-Archeology: Subject: Bump and freeze kernel at last known working versions (#3736)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 597d2dac11f00d9070a4e49d6bad1b2244e36cb3: https://github.com/armbian/build/commit/597d2dac11f00d9070a4e49d6bad1b2244e36cb3
|
||||
> X-Git-Archeology: Date: Sat, 28 May 2022 07:56:22 +0200
|
||||
> X-Git-Archeology: From: Jianfeng Liu <liujianfeng1994@gmail.com>
|
||||
> X-Git-Archeology: Subject: update rockchip64-edge to 5.18 (#3814)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 8c6641e7b79f0d50acdc306d140e586a4e923cf0: https://github.com/armbian/build/commit/8c6641e7b79f0d50acdc306d140e586a4e923cf0
|
||||
> X-Git-Archeology: Date: Wed, 03 Aug 2022 22:22:55 +0200
|
||||
> X-Git-Archeology: From: Jianfeng Liu <liujianfeng1994@gmail.com>
|
||||
> X-Git-Archeology: Subject: update rockchip64 edge to 5.19 (#4039)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 6765f734cc4a22aeaa9f99a3ad28c8c322de26f6: https://github.com/armbian/build/commit/6765f734cc4a22aeaa9f99a3ad28c8c322de26f6
|
||||
> X-Git-Archeology: Date: Tue, 25 Oct 2022 11:26:51 +0200
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igorpecovnik@users.noreply.github.com>
|
||||
> X-Git-Archeology: Subject: Bump rockchip64 edge to 6.0.y (#4337)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 92f1a22d76b987afa7ba555d5b509adc51d689e7: https://github.com/armbian/build/commit/92f1a22d76b987afa7ba555d5b509adc51d689e7
|
||||
> X-Git-Archeology: Date: Fri, 16 Dec 2022 13:38:13 +0100
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igorpecovnik@users.noreply.github.com>
|
||||
> X-Git-Archeology: Subject: Re-add rockchip64 6.0 patches (#4575)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 34ae84fac5d0b66a1ab2d1e51534b7beb13ef245: https://github.com/armbian/build/commit/34ae84fac5d0b66a1ab2d1e51534b7beb13ef245
|
||||
> X-Git-Archeology: Date: Fri, 05 May 2023 14:22:00 +0200
|
||||
> X-Git-Archeology: From: amazingfate <liujianfeng1994@gmail.com>
|
||||
> X-Git-Archeology: Subject: bump rockchip64 edge to v6.3
|
||||
> X-Git-Archeology:
|
||||
---
|
||||
drivers/phy/rockchip/phy-rockchip-inno-hdmi.c | 71 ++++++++++
|
||||
1 file changed, 71 insertions(+)
|
||||
|
||||
diff --git a/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c b/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c
|
||||
+++ b/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c
|
||||
@@ -465,6 +465,77 @@ static const struct pre_pll_config pre_pll_cfg_table[] = {
|
||||
{594000000, 297000000, 1, 99, 0, 1, 1, 1, 0, 1, 1, 0, 0x0},
|
||||
{594000000, 371250000, 4, 495, 0, 3, 1, 1, 3, 0, 0, 1, 0x0},
|
||||
{594000000, 594000000, 1, 99, 0, 2, 0, 1, 0, 1, 1, 0, 0x0},
|
||||
+ { 25175000, 25175000, 30, 1007, 1, 2, 2, 1, 2, 3, 4, 0, 0},
|
||||
+ { 31500000, 31500000, 1, 21, 1, 1, 1, 1, 2, 2, 2, 0, 0},
|
||||
+ { 33750000, 33750000, 1, 45, 1, 2, 2, 1, 2, 3, 4, 0, 0},
|
||||
+ { 35500000, 35500000, 3, 71, 1, 1, 1, 1, 2, 2, 2, 0, 0},
|
||||
+ { 36000000, 36000000, 1, 12, 0, 1, 1, 1, 0, 2, 2, 0, 0},
|
||||
+ { 49500000, 49500000, 1, 33, 1, 1, 1, 1, 2, 2, 2, 0, 0},
|
||||
+ { 50000000, 50000000, 3, 50, 0, 1, 1, 1, 0, 2, 2, 0, 0},
|
||||
+ { 56250000, 56250000, 1, 75, 1, 2, 2, 1, 2, 3, 4, 0, 0},
|
||||
+ { 65000000, 65000000, 3, 65, 0, 1, 1, 1, 0, 2, 2, 0, 0},
|
||||
+ { 68250000, 68250000, 1, 91, 1, 2, 2, 1, 2, 3, 4, 0, 0},
|
||||
+ { 71000000, 71000000, 3, 71, 0, 1, 1, 1, 0, 2, 2, 0, 0},
|
||||
+ { 72000000, 72000000, 1, 24, 0, 1, 1, 1, 0, 2, 2, 0, 0},
|
||||
+ { 73250000, 73250000, 3, 293, 1, 2, 2, 1, 2, 3, 4, 0, 0},
|
||||
+ { 75000000, 75000000, 1, 25, 0, 1, 1, 1, 0, 2, 2, 0, 0},
|
||||
+ { 78750000, 78750000, 1, 105, 1, 2, 2, 1, 2, 3, 4, 0, 0},
|
||||
+ { 79500000, 79500000, 1, 53, 1, 1, 1, 1, 2, 2, 2, 0, 0},
|
||||
+ { 83500000, 83500000, 3, 167, 1, 1, 1, 1, 2, 2, 2, 0, 0},
|
||||
+ { 85500000, 85500000, 1, 57, 1, 1, 1, 1, 2, 2, 2, 0, 0},
|
||||
+ { 88750000, 88750000, 3, 355, 1, 2, 2, 1, 2, 3, 4, 0, 0},
|
||||
+ { 94500000, 94500000, 1, 63, 1, 1, 1, 1, 2, 2, 2, 0, 0},
|
||||
+ {101000000, 101000000, 3, 101, 0, 1, 1, 1, 0, 2, 2, 0, 0},
|
||||
+ {102250000, 102250000, 3, 409, 1, 2, 2, 1, 2, 3, 4, 0, 0},
|
||||
+ {106500000, 106500000, 1, 71, 1, 1, 1, 1, 2, 2, 2, 0, 0},
|
||||
+ {108000000, 108000000, 1, 36, 0, 1, 1, 1, 0, 2, 2, 0, 0},
|
||||
+ {115500000, 115500000, 1, 77, 1, 1, 1, 1, 2, 2, 2, 0, 0},
|
||||
+ {117500000, 117500000, 3, 235, 1, 1, 1, 1, 2, 2, 2, 0, 0},
|
||||
+ {119000000, 119000000, 3, 119, 0, 1, 1, 1, 0, 2, 2, 0, 0},
|
||||
+ {121750000, 121750000, 3, 487, 1, 2, 2, 1, 2, 3, 4, 0, 0},
|
||||
+ {122500000, 122500000, 3, 245, 1, 1, 1, 1, 2, 2, 2, 0, 0},
|
||||
+ {135000000, 135000000, 1, 45, 0, 1, 1, 1, 0, 2, 2, 0, 0},
|
||||
+ {136750000, 136750000, 3, 547, 1, 2, 2, 1, 2, 3, 4, 0, 0},
|
||||
+ {140250000, 140250000, 1, 187, 1, 2, 2, 1, 2, 3, 4, 0, 0},
|
||||
+ {146250000, 146250000, 1, 195, 1, 2, 2, 1, 2, 3, 4, 0, 0},
|
||||
+ {148250000, 148250000, 3, 593, 1, 2, 2, 1, 2, 3, 4, 0, 0},
|
||||
+ {154000000, 154000000, 3, 154, 0, 1, 1, 1, 0, 2, 2, 0, 0},
|
||||
+ {156000000, 156000000, 1, 52, 0, 1, 1, 1, 0, 2, 2, 0, 0},
|
||||
+ {156750000, 156750000, 1, 209, 1, 2, 2, 1, 2, 3, 4, 0, 0},
|
||||
+ {157000000, 157000000, 3, 157, 0, 1, 1, 1, 0, 2, 2, 0, 0},
|
||||
+ {157500000, 157500000, 1, 105, 1, 1, 1, 1, 2, 2, 2, 0, 0},
|
||||
+ {162000000, 162000000, 1, 54, 0, 1, 1, 1, 0, 2, 2, 0, 0},
|
||||
+ {175500000, 175500000, 1, 117, 1, 1, 1, 1, 2, 2, 2, 0, 0},
|
||||
+ {179500000, 179500000, 3, 359, 1, 1, 1, 1, 2, 2, 2, 0, 0},
|
||||
+ {182750000, 182750000, 3, 731, 1, 2, 2, 1, 2, 3, 4, 0, 0},
|
||||
+ {187000000, 187000000, 3, 187, 0, 1, 1, 1, 0, 2, 2, 0, 0},
|
||||
+ {187250000, 187250000, 3, 749, 1, 2, 2, 1, 2, 3, 4, 0, 0},
|
||||
+ {189000000, 189000000, 1, 63, 0, 1, 1, 1, 0, 2, 2, 0, 0},
|
||||
+ {193250000, 193250000, 3, 773, 1, 2, 2, 1, 2, 3, 4, 0, 0},
|
||||
+ {202500000, 202500000, 1, 135, 1, 1, 1, 1, 2, 2, 2, 0, 0},
|
||||
+ {204750000, 204750000, 1, 273, 1, 2, 2, 1, 2, 3, 4, 0, 0},
|
||||
+ {208000000, 208000000, 3, 208, 0, 1, 1, 1, 0, 2, 2, 0, 0},
|
||||
+ {214750000, 214750000, 3, 859, 1, 2, 2, 1, 2, 3, 4, 0, 0},
|
||||
+ {218250000, 218250000, 1, 291, 1, 2, 2, 1, 2, 3, 4, 0, 0},
|
||||
+ {229500000, 229500000, 1, 153, 1, 1, 1, 1, 2, 2, 2, 0, 0},
|
||||
+ {234000000, 234000000, 1, 78, 0, 1, 1, 1, 0, 2, 2, 0, 0},
|
||||
+ {241500000, 241500000, 1, 161, 1, 1, 1, 1, 2, 2, 2, 0, 0},
|
||||
+ {245250000, 245250000, 1, 327, 1, 2, 2, 1, 2, 3, 4, 0, 0},
|
||||
+ {245500000, 245500000, 3, 491, 1, 1, 1, 1, 2, 2, 2, 0, 0},
|
||||
+ {261000000, 261000000, 1, 87, 0, 1, 1, 1, 0, 2, 2, 0, 0},
|
||||
+ {268250000, 268250000, 3, 1073, 1, 2, 2, 1, 2, 3, 4, 0, 0},
|
||||
+ {268500000, 268500000, 1, 179, 1, 1, 1, 1, 2, 2, 2, 0, 0},
|
||||
+ {281250000, 281250000, 1, 375, 1, 2, 2, 1, 2, 3, 4, 0, 0},
|
||||
+ {288000000, 288000000, 1, 96, 0, 1, 1, 1, 0, 2, 2, 0, 0},
|
||||
+ {312250000, 312250000, 3, 1249, 1, 2, 2, 1, 2, 3, 4, 0, 0},
|
||||
+ {317000000, 317000000, 3, 317, 0, 1, 1, 1, 0, 2, 2, 0, 0},
|
||||
+ {333250000, 333250000, 3, 1333, 1, 2, 2, 1, 2, 3, 4, 0, 0},
|
||||
+ {348500000, 348500000, 3, 697, 1, 1, 1, 1, 2, 2, 2, 0, 0},
|
||||
+ {356500000, 356500000, 3, 713, 1, 1, 1, 1, 2, 2, 2, 0, 0},
|
||||
+ {380500000, 380500000, 3, 761, 1, 1, 1, 1, 2, 2, 2, 0, 0},
|
||||
+ {443250000, 443250000, 1, 591, 1, 2, 2, 1, 2, 3, 4, 0, 0},
|
||||
+ {505250000, 505250000, 3, 2021, 1, 2, 2, 1, 2, 3, 4, 0, 0},
|
||||
+ {552750000, 552750000, 1, 737, 1, 2, 2, 1, 2, 3, 4, 0, 0},
|
||||
{ /* sentinel */ }
|
||||
};
|
||||
|
||||
--
|
||||
Armbian
|
||||
|
@ -0,0 +1,82 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: microcai <microcaicai@gmail.com>
|
||||
Date: Mon, 29 Jun 2020 23:36:40 +0800
|
||||
Subject: spi-nor: Add support for xt25f32b/xt25f128b
|
||||
|
||||
The RockPi4b dev board ship with xt25f32b solded. add these ids so the
|
||||
board's spi flash can be accessed within linux.
|
||||
|
||||
Signed-off-by: microcai <microcaicai@gmail.com>
|
||||
---
|
||||
drivers/mtd/spi-nor/Makefile | 1 +
|
||||
drivers/mtd/spi-nor/core.c | 1 +
|
||||
drivers/mtd/spi-nor/core.h | 1 +
|
||||
drivers/mtd/spi-nor/xtx.c | 21 ++++++++++
|
||||
4 files changed, 24 insertions(+)
|
||||
|
||||
diff --git a/drivers/mtd/spi-nor/Makefile b/drivers/mtd/spi-nor/Makefile
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/mtd/spi-nor/Makefile
|
||||
+++ b/drivers/mtd/spi-nor/Makefile
|
||||
@@ -15,6 +15,7 @@ spi-nor-objs += sst.o
|
||||
spi-nor-objs += winbond.o
|
||||
spi-nor-objs += xmc.o
|
||||
spi-nor-$(CONFIG_DEBUG_FS) += debugfs.o
|
||||
+spi-nor-objs += xtx.o
|
||||
obj-$(CONFIG_MTD_SPI_NOR) += spi-nor.o
|
||||
|
||||
obj-$(CONFIG_MTD_SPI_NOR) += controllers/
|
||||
diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/mtd/spi-nor/core.c
|
||||
+++ b/drivers/mtd/spi-nor/core.c
|
||||
@@ -1954,6 +1954,7 @@ static const struct spi_nor_manufacturer *manufacturers[] = {
|
||||
&spi_nor_sst,
|
||||
&spi_nor_winbond,
|
||||
&spi_nor_xmc,
|
||||
+ &spi_nor_xtx,
|
||||
};
|
||||
|
||||
static const struct flash_info spi_nor_generic_flash = {
|
||||
diff --git a/drivers/mtd/spi-nor/core.h b/drivers/mtd/spi-nor/core.h
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/mtd/spi-nor/core.h
|
||||
+++ b/drivers/mtd/spi-nor/core.h
|
||||
@@ -598,6 +598,7 @@ extern const struct spi_nor_manufacturer spi_nor_spansion;
|
||||
extern const struct spi_nor_manufacturer spi_nor_sst;
|
||||
extern const struct spi_nor_manufacturer spi_nor_winbond;
|
||||
extern const struct spi_nor_manufacturer spi_nor_xmc;
|
||||
+extern const struct spi_nor_manufacturer spi_nor_xtx;
|
||||
|
||||
extern const struct attribute_group *spi_nor_sysfs_groups[];
|
||||
|
||||
diff --git a/drivers/mtd/spi-nor/xtx.c b/drivers/mtd/spi-nor/xtx.c
|
||||
new file mode 100644
|
||||
index 000000000000..111111111111
|
||||
--- /dev/null
|
||||
+++ b/drivers/mtd/spi-nor/xtx.c
|
||||
@@ -0,0 +1,21 @@
|
||||
+// SPDX-License-Identifier: GPL-2.0
|
||||
+/*
|
||||
+ * Copyright (C) 2005, Intec Automation Inc.
|
||||
+ * Copyright (C) 2014, Freescale Semiconductor, Inc.
|
||||
+ */
|
||||
+
|
||||
+#include <linux/mtd/spi-nor.h>
|
||||
+
|
||||
+#include "core.h"
|
||||
+
|
||||
+static const struct flash_info xtx_parts[] = {
|
||||
+ /* XTX (Shenzhen Xin Tian Xia Tech) */
|
||||
+ { "xt25f32b", SNOR_ID(0x0b, 0x40, 0x16) },
|
||||
+ { "xt25f128b", SNOR_ID(0x0b, 0x40, 0x18) },
|
||||
+};
|
||||
+
|
||||
+const struct spi_nor_manufacturer spi_nor_xtx = {
|
||||
+ .name = "xtx",
|
||||
+ .parts = xtx_parts,
|
||||
+ .nparts = ARRAY_SIZE(xtx_parts),
|
||||
+};
|
||||
--
|
||||
Armbian
|
||||
|
302
patch/kernel/rockchip64-6.16/general-cryptov1-trng.patch
Normal file
302
patch/kernel/rockchip64-6.16/general-cryptov1-trng.patch
Normal file
@ -0,0 +1,302 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Paolo Sabatino <paolo.sabatino@gmail.com>
|
||||
Date: Sun, 14 Jan 2024 11:53:20 +0100
|
||||
Subject: rockchip64: add TRNG to existing crypto v1 driver
|
||||
|
||||
original patch source: https://patchwork.kernel.org/project/linux-rockchip/patch/20230707115242.3411259-1-clabbe@baylibre.com/
|
||||
---
|
||||
drivers/crypto/Kconfig | 8 +
|
||||
drivers/crypto/rockchip/Makefile | 1 +
|
||||
drivers/crypto/rockchip/rk3288_crypto.c | 18 +-
|
||||
drivers/crypto/rockchip/rk3288_crypto.h | 18 ++
|
||||
drivers/crypto/rockchip/rk3288_crypto_ahash.c | 2 +
|
||||
drivers/crypto/rockchip/rk3288_crypto_skcipher.c | 2 +
|
||||
drivers/crypto/rockchip/rk3288_crypto_trng.c | 92 ++++++++++
|
||||
7 files changed, 140 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/crypto/Kconfig
|
||||
+++ b/drivers/crypto/Kconfig
|
||||
@@ -694,6 +694,14 @@ config CRYPTO_DEV_ROCKCHIP
|
||||
This driver interfaces with the hardware crypto accelerator.
|
||||
Supporting cbc/ecb chainmode, and aes/des/des3_ede cipher mode.
|
||||
|
||||
+config CRYPTO_DEV_ROCKCHIP_TRNG
|
||||
+ bool "Support for Rockchip TRNG"
|
||||
+ depends on CRYPTO_DEV_ROCKCHIP
|
||||
+ select HW_RANDOM
|
||||
+ help
|
||||
+ Select this option if you want to provide kernel-side support for
|
||||
+ the True Random Number Generator found in the Crypto IP.
|
||||
+
|
||||
config CRYPTO_DEV_ROCKCHIP_DEBUG
|
||||
bool "Enable Rockchip crypto stats"
|
||||
depends on CRYPTO_DEV_ROCKCHIP
|
||||
diff --git a/drivers/crypto/rockchip/Makefile b/drivers/crypto/rockchip/Makefile
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/crypto/rockchip/Makefile
|
||||
+++ b/drivers/crypto/rockchip/Makefile
|
||||
@@ -3,3 +3,4 @@ obj-$(CONFIG_CRYPTO_DEV_ROCKCHIP) += rk_crypto.o
|
||||
rk_crypto-objs := rk3288_crypto.o \
|
||||
rk3288_crypto_skcipher.o \
|
||||
rk3288_crypto_ahash.o
|
||||
+rk_crypto-$(CONFIG_CRYPTO_DEV_ROCKCHIP_TRNG) += rk3288_crypto_trng.o
|
||||
diff --git a/drivers/crypto/rockchip/rk3288_crypto.c b/drivers/crypto/rockchip/rk3288_crypto.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/crypto/rockchip/rk3288_crypto.c
|
||||
+++ b/drivers/crypto/rockchip/rk3288_crypto.c
|
||||
@@ -47,15 +47,18 @@ static const struct rk_variant rk3288_variant = {
|
||||
.num_clks = 4,
|
||||
.rkclks = {
|
||||
{ "sclk", 150000000},
|
||||
- }
|
||||
+ },
|
||||
+ .trng = false,
|
||||
};
|
||||
|
||||
static const struct rk_variant rk3328_variant = {
|
||||
.num_clks = 3,
|
||||
+ .trng = false,
|
||||
};
|
||||
|
||||
static const struct rk_variant rk3399_variant = {
|
||||
.num_clks = 3,
|
||||
+ .trng = true,
|
||||
};
|
||||
|
||||
static int rk_crypto_get_clks(struct rk_crypto_info *dev)
|
||||
@@ -201,6 +204,10 @@ static int rk_crypto_debugfs_show(struct seq_file *seq, void *v)
|
||||
seq_printf(seq, "%s %s requests: %lu\n",
|
||||
dev_driver_string(dd->dev), dev_name(dd->dev),
|
||||
dd->nreq);
|
||||
+#ifdef CONFIG_CRYPTO_DEV_ROCKCHIP_TRNG
|
||||
+ seq_printf(seq, "HWRNG: %lu %lu\n",
|
||||
+ dd->hwrng_stat_req, dd->hwrng_stat_bytes);
|
||||
+#endif
|
||||
}
|
||||
spin_unlock(&rocklist.lock);
|
||||
|
||||
@@ -395,6 +402,10 @@ static int rk_crypto_probe(struct platform_device *pdev)
|
||||
dev_err(dev, "Fail to register crypto algorithms");
|
||||
goto err_register_alg;
|
||||
}
|
||||
+#ifdef CONFIG_CRYPTO_DEV_ROCKCHIP_TRNG
|
||||
+ if (crypto_info->variant->trng)
|
||||
+ rk3288_hwrng_register(crypto_info);
|
||||
+#endif
|
||||
|
||||
register_debugfs(crypto_info);
|
||||
}
|
||||
@@ -425,6 +436,11 @@ static void rk_crypto_remove(struct platform_device *pdev)
|
||||
#ifdef CONFIG_CRYPTO_DEV_ROCKCHIP_DEBUG
|
||||
debugfs_remove_recursive(rocklist.dbgfs_dir);
|
||||
#endif
|
||||
+#ifdef CONFIG_CRYPTO_DEV_ROCKCHIP_TRNG
|
||||
+ if (crypto_tmp->variant->trng)
|
||||
+ rk3288_hwrng_unregister(crypto_tmp);
|
||||
+#endif
|
||||
+
|
||||
rk_crypto_unregister();
|
||||
}
|
||||
rk_crypto_pm_exit(crypto_tmp);
|
||||
diff --git a/drivers/crypto/rockchip/rk3288_crypto.h b/drivers/crypto/rockchip/rk3288_crypto.h
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/crypto/rockchip/rk3288_crypto.h
|
||||
+++ b/drivers/crypto/rockchip/rk3288_crypto.h
|
||||
@@ -11,6 +11,7 @@
|
||||
#include <crypto/sha1.h>
|
||||
#include <crypto/sha2.h>
|
||||
#include <linux/dma-mapping.h>
|
||||
+#include <linux/hw_random.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/pm_runtime.h>
|
||||
#include <linux/scatterlist.h>
|
||||
@@ -180,6 +181,16 @@
|
||||
#define RK_CRYPTO_HASH_DOUT_6 0x01a4
|
||||
#define RK_CRYPTO_HASH_DOUT_7 0x01a8
|
||||
|
||||
+#define RK_CRYPTO_TRNG_CTRL 0x0200
|
||||
+#define RK_CRYPTO_OSC_ENABLE BIT(16)
|
||||
+#define RK_CRYPTO_TRNG_DOUT_0 0x0204
|
||||
+/* sample < 1000 lead to 100% failure on rngtest,
|
||||
+ * using more than 1200 does not increase success.
|
||||
+ */
|
||||
+#define RK_CRYPTO_RNG_SAMPLE 1200
|
||||
+
|
||||
+#define RK_CRYPTO_MAX_TRNG_BYTE 32
|
||||
+
|
||||
#define CRYPTO_READ(dev, offset) \
|
||||
readl_relaxed(((dev)->reg + (offset)))
|
||||
#define CRYPTO_WRITE(dev, offset, val) \
|
||||
@@ -209,6 +220,7 @@ struct rk_clks {
|
||||
struct rk_variant {
|
||||
int num_clks;
|
||||
struct rk_clks rkclks[RK_MAX_CLKS];
|
||||
+ bool trng;
|
||||
};
|
||||
|
||||
struct rk_crypto_info {
|
||||
@@ -219,11 +231,15 @@ struct rk_crypto_info {
|
||||
struct reset_control *rst;
|
||||
void __iomem *reg;
|
||||
int irq;
|
||||
+ struct mutex lock;
|
||||
+ struct hwrng hwrng;
|
||||
const struct rk_variant *variant;
|
||||
unsigned long nreq;
|
||||
struct crypto_engine *engine;
|
||||
struct completion complete;
|
||||
int status;
|
||||
+ unsigned long hwrng_stat_req;
|
||||
+ unsigned long hwrng_stat_bytes;
|
||||
};
|
||||
|
||||
/* the private variable of hash */
|
||||
@@ -283,3 +299,5 @@ extern struct rk_crypto_tmp rk_ahash_md5;
|
||||
|
||||
struct rk_crypto_info *get_rk_crypto(void);
|
||||
#endif
|
||||
+int rk3288_hwrng_register(struct rk_crypto_info *rk);
|
||||
+void rk3288_hwrng_unregister(struct rk_crypto_info *rk);
|
||||
diff --git a/drivers/crypto/rockchip/rk3288_crypto_ahash.c b/drivers/crypto/rockchip/rk3288_crypto_ahash.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/crypto/rockchip/rk3288_crypto_ahash.c
|
||||
+++ b/drivers/crypto/rockchip/rk3288_crypto_ahash.c
|
||||
@@ -298,6 +298,7 @@ static int rk_hash_run(struct crypto_engine *engine, void *breq)
|
||||
goto theend;
|
||||
}
|
||||
|
||||
+ mutex_lock(&rkc->lock);
|
||||
rk_ahash_reg_init(areq, rkc);
|
||||
|
||||
while (sg) {
|
||||
@@ -332,6 +333,7 @@ static int rk_hash_run(struct crypto_engine *engine, void *breq)
|
||||
}
|
||||
|
||||
theend:
|
||||
+ mutex_unlock(&rkc->lock);
|
||||
pm_runtime_put_autosuspend(rkc->dev);
|
||||
|
||||
rk_hash_unprepare(engine, breq);
|
||||
diff --git a/drivers/crypto/rockchip/rk3288_crypto_skcipher.c b/drivers/crypto/rockchip/rk3288_crypto_skcipher.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/crypto/rockchip/rk3288_crypto_skcipher.c
|
||||
+++ b/drivers/crypto/rockchip/rk3288_crypto_skcipher.c
|
||||
@@ -363,6 +363,7 @@ static int rk_cipher_run(struct crypto_engine *engine, void *async_req)
|
||||
}
|
||||
}
|
||||
err = 0;
|
||||
+ mutex_unlock(&rkc->lock);
|
||||
rk_cipher_hw_init(rkc, areq);
|
||||
if (ivsize) {
|
||||
if (ivsize == DES_BLOCK_SIZE)
|
||||
@@ -378,6 +379,7 @@ static int rk_cipher_run(struct crypto_engine *engine, void *async_req)
|
||||
crypto_dma_start(rkc, sgs, sgd, todo / 4);
|
||||
wait_for_completion_interruptible_timeout(&rkc->complete,
|
||||
msecs_to_jiffies(2000));
|
||||
+ mutex_unlock(&rkc->lock);
|
||||
if (!rkc->status) {
|
||||
dev_err(rkc->dev, "DMA timeout\n");
|
||||
err = -EFAULT;
|
||||
diff --git a/drivers/crypto/rockchip/rk3288_crypto_trng.c b/drivers/crypto/rockchip/rk3288_crypto_trng.c
|
||||
new file mode 100644
|
||||
index 000000000000..111111111111
|
||||
--- /dev/null
|
||||
+++ b/drivers/crypto/rockchip/rk3288_crypto_trng.c
|
||||
@@ -0,0 +1,92 @@
|
||||
+// SPDX-License-Identifier: GPL-2.0
|
||||
+/*
|
||||
+ * rk3288_crypto_trng.c - hardware cryptographic offloader for rockchip
|
||||
+ *
|
||||
+ * Copyright (C) 2022-2023 Corentin Labbe <clabbe@baylibre.com>
|
||||
+ *
|
||||
+ * This file handle the TRNG
|
||||
+ */
|
||||
+#include "rk3288_crypto.h"
|
||||
+#include <linux/hw_random.h>
|
||||
+#include <linux/iopoll.h>
|
||||
+#include <linux/pm_runtime.h>
|
||||
+
|
||||
+static int rk3288_trng_read(struct hwrng *hwrng, void *data, size_t max, bool wait)
|
||||
+{
|
||||
+ struct rk_crypto_info *rk;
|
||||
+ unsigned int todo;
|
||||
+ int err = 0;
|
||||
+ int i;
|
||||
+ u32 v;
|
||||
+
|
||||
+ rk = container_of(hwrng, struct rk_crypto_info, hwrng);
|
||||
+
|
||||
+ todo = min_t(size_t, max, RK_CRYPTO_MAX_TRNG_BYTE);
|
||||
+
|
||||
+#ifdef CONFIG_CRYPTO_DEV_ROCKCHIP_DEBUG
|
||||
+ rk->hwrng_stat_req++;
|
||||
+ rk->hwrng_stat_bytes += todo;
|
||||
+#endif
|
||||
+
|
||||
+ err = pm_runtime_resume_and_get(rk->dev);
|
||||
+ if (err < 0)
|
||||
+ goto err_pm;
|
||||
+
|
||||
+ mutex_lock(&rk->lock);
|
||||
+
|
||||
+#define HIWORD_UPDATE(val, mask, shift) \
|
||||
+ ((val) << (shift) | (mask) << ((shift) + 16))
|
||||
+ v = RK_CRYPTO_OSC_ENABLE | RK_CRYPTO_RNG_SAMPLE;
|
||||
+ CRYPTO_WRITE(rk, RK_CRYPTO_TRNG_CTRL, v);
|
||||
+
|
||||
+ v = HIWORD_UPDATE(RK_CRYPTO_TRNG_START, RK_CRYPTO_TRNG_START, 0);
|
||||
+ CRYPTO_WRITE(rk, RK_CRYPTO_CTRL, v);
|
||||
+ wmb();
|
||||
+
|
||||
+ err = readl_poll_timeout(rk->reg + RK_CRYPTO_CTRL, v,
|
||||
+ !(v & RK_CRYPTO_TRNG_START),
|
||||
+ 100, 2000);
|
||||
+ if (err) {
|
||||
+ dev_err(rk->dev, "HWRNG read timeout");
|
||||
+ goto readfail;
|
||||
+ }
|
||||
+
|
||||
+ for (i = 0; i < todo / 4; i++) {
|
||||
+ v = readl(rk->reg + RK_CRYPTO_TRNG_DOUT_0 + i * 4);
|
||||
+ put_unaligned_le32(v, data + i * 4);
|
||||
+ }
|
||||
+
|
||||
+ err = todo;
|
||||
+
|
||||
+ v = HIWORD_UPDATE(0, RK_CRYPTO_TRNG_START, 0);
|
||||
+ CRYPTO_WRITE(rk, RK_CRYPTO_CTRL, v);
|
||||
+
|
||||
+readfail:
|
||||
+ mutex_unlock(&rk->lock);
|
||||
+
|
||||
+ pm_runtime_put(rk->dev);
|
||||
+
|
||||
+err_pm:
|
||||
+ return err;
|
||||
+}
|
||||
+
|
||||
+int rk3288_hwrng_register(struct rk_crypto_info *rk)
|
||||
+{
|
||||
+ int ret;
|
||||
+
|
||||
+ dev_info(rk->dev, "Register TRNG with sample=%d\n", RK_CRYPTO_RNG_SAMPLE);
|
||||
+
|
||||
+ rk->hwrng.name = "Rockchip rk3288 TRNG";
|
||||
+ rk->hwrng.read = rk3288_trng_read;
|
||||
+ rk->hwrng.quality = 300;
|
||||
+
|
||||
+ ret = hwrng_register(&rk->hwrng);
|
||||
+ if (ret)
|
||||
+ dev_err(rk->dev, "Fail to register the TRNG\n");
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+void rk3288_hwrng_unregister(struct rk_crypto_info *rk)
|
||||
+{
|
||||
+ hwrng_unregister(&rk->hwrng);
|
||||
+}
|
||||
--
|
||||
Armbian
|
||||
|
@ -0,0 +1,51 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Igor Pecovnik <igor.pecovnik@gmail.com>
|
||||
Date: Wed, 21 Jul 2021 20:59:39 +0000
|
||||
Subject: Disable MTU validation
|
||||
|
||||
This patch reverts: https://github.com/torvalds/linux/commit/eaf4fac478077d4ed57cbca2c044c4b58a96bd98
|
||||
|
||||
It works around following issues:
|
||||
- no way to change MTU (tx_fifo_size is reported as 0 for Rockchip's dwmac)
|
||||
|
||||
Signed-off-by: Piotr Szczepanik <piter75@gmail.com>
|
||||
Signed-off-by: Igor Pecovnik <igor.pecovnik@gmail.com>
|
||||
---
|
||||
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 12 ----------
|
||||
1 file changed, 12 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
||||
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
||||
@@ -5934,27 +5934,15 @@ static void stmmac_set_rx_mode(struct net_device *dev)
|
||||
static int stmmac_change_mtu(struct net_device *dev, int new_mtu)
|
||||
{
|
||||
struct stmmac_priv *priv = netdev_priv(dev);
|
||||
- int txfifosz = priv->plat->tx_fifo_size;
|
||||
struct stmmac_dma_conf *dma_conf;
|
||||
const int mtu = new_mtu;
|
||||
int ret;
|
||||
|
||||
- if (txfifosz == 0)
|
||||
- txfifosz = priv->dma_cap.tx_fifo_size;
|
||||
-
|
||||
- txfifosz /= priv->plat->tx_queues_to_use;
|
||||
-
|
||||
if (stmmac_xdp_is_enabled(priv) && new_mtu > ETH_DATA_LEN) {
|
||||
netdev_dbg(priv->dev, "Jumbo frames not supported for XDP\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
- new_mtu = STMMAC_ALIGN(new_mtu);
|
||||
-
|
||||
- /* If condition true, FIFO is too small or MTU too large */
|
||||
- if ((txfifosz < new_mtu) || (new_mtu > BUF_SIZE_16KiB))
|
||||
- return -EINVAL;
|
||||
-
|
||||
if (netif_running(dev)) {
|
||||
netdev_dbg(priv->dev, "restarting interface to change its MTU\n");
|
||||
/* Try to allocate the new DMA conf with the new mtu */
|
||||
--
|
||||
Armbian
|
||||
|
1397
patch/kernel/rockchip64-6.16/general-driver-tm16xx-led-driver.patch
Normal file
1397
patch/kernel/rockchip64-6.16/general-driver-tm16xx-led-driver.patch
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,378 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Muhammed Efe Cetin <efectn@protonmail.com>
|
||||
Date: Sun, 17 Aug 2025 14:24:30 +0300
|
||||
Subject: drm/panel: Add Yixian YX0345 panel
|
||||
|
||||
---
|
||||
drivers/gpu/drm/panel/Kconfig | 9 +
|
||||
drivers/gpu/drm/panel/Makefile | 1 +
|
||||
drivers/gpu/drm/panel/panel-yixian-yx0345wv00v2.c | 329 ++++++++++
|
||||
3 files changed, 339 insertions(+)
|
||||
|
||||
diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/gpu/drm/panel/Kconfig
|
||||
+++ b/drivers/gpu/drm/panel/Kconfig
|
||||
@@ -1087,6 +1087,15 @@ config DRM_PANEL_WIDECHIPS_WS2401
|
||||
480x800 display controller used in panels such as Samsung LMS380KF01.
|
||||
This display is used in the Samsung Galaxy Ace 2 GT-I8160 (Codina).
|
||||
|
||||
+config DRM_PANEL_YIXIAN_YX0345
|
||||
+ tristate "Yixian YX0345 DPI panel driver"
|
||||
+ depends on OF
|
||||
+ depends on DRM_MIPI_DSI
|
||||
+ help
|
||||
+ Say Y here if you want to enable support for the Yixian YX0345WV00V2
|
||||
+ 480x800 display controller used in SBCc such as NanoPi M6s.
|
||||
+
|
||||
+
|
||||
config DRM_PANEL_XINPENG_XPP055C272
|
||||
tristate "Xinpeng XPP055C272 panel driver"
|
||||
depends on OF
|
||||
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/gpu/drm/panel/Makefile
|
||||
+++ b/drivers/gpu/drm/panel/Makefile
|
||||
@@ -112,3 +112,4 @@ obj-$(CONFIG_DRM_PANEL_VISIONOX_VTDR6130) += panel-visionox-vtdr6130.o
|
||||
obj-$(CONFIG_DRM_PANEL_VISIONOX_R66451) += panel-visionox-r66451.o
|
||||
obj-$(CONFIG_DRM_PANEL_WIDECHIPS_WS2401) += panel-widechips-ws2401.o
|
||||
obj-$(CONFIG_DRM_PANEL_XINPENG_XPP055C272) += panel-xinpeng-xpp055c272.o
|
||||
+obj-$(CONFIG_DRM_PANEL_YIXIAN_YX0345) += panel-yixian-yx0345wv00v2.o
|
||||
diff --git a/drivers/gpu/drm/panel/panel-yixian-yx0345wv00v2.c b/drivers/gpu/drm/panel/panel-yixian-yx0345wv00v2.c
|
||||
new file mode 100644
|
||||
index 000000000000..111111111111
|
||||
--- /dev/null
|
||||
+++ b/drivers/gpu/drm/panel/panel-yixian-yx0345wv00v2.c
|
||||
@@ -0,0 +1,329 @@
|
||||
+// SPDX-License-Identifier: GPL-2.0-only
|
||||
+// Copyright (c) 2025 Muhammed Efe Cetin <efectn@protonmail.com>
|
||||
+
|
||||
+#include <linux/delay.h>
|
||||
+#include <linux/gpio/consumer.h>
|
||||
+#include <linux/module.h>
|
||||
+#include <linux/mod_devicetable.h>
|
||||
+#include <linux/property.h>
|
||||
+#include <linux/regulator/consumer.h>
|
||||
+
|
||||
+#include <drm/drm_mipi_dsi.h>
|
||||
+#include <drm/drm_probe_helper.h>
|
||||
+#include <drm/drm_modes.h>
|
||||
+#include <drm/drm_panel.h>
|
||||
+
|
||||
+struct yixian_yx0345_panel_info {
|
||||
+ struct drm_display_mode mode;
|
||||
+ const struct regulator_bulk_data *regulators;
|
||||
+ int num_regulators;
|
||||
+ struct yixian_yx0345_panel_data *panel_data;
|
||||
+};
|
||||
+
|
||||
+struct yixian_yx0345 {
|
||||
+ struct drm_panel panel;
|
||||
+ const struct yixian_yx0345_panel_info *panel_info;
|
||||
+ struct mipi_dsi_device *dsi;
|
||||
+ struct gpio_desc *reset_gpio;
|
||||
+ struct regulator_bulk_data *supplies;
|
||||
+ int num_supplies;
|
||||
+};
|
||||
+
|
||||
+struct yixian_yx0345_cmd {
|
||||
+ u8 delay;
|
||||
+ u8 data[32];
|
||||
+ u8 len;
|
||||
+};
|
||||
+
|
||||
+static const struct yixian_yx0345_cmd yixian_yx0345_init_code[] = {
|
||||
+ { 0x0A, { 0x01, 0x00 }, 0x02 },
|
||||
+ { 0x7D, { 0x11, 0x00 }, 0x02 },
|
||||
+ { 0x00, { 0xFF, 0x77, 0x01, 0x00, 0x00, 0x13 }, 0x06 },
|
||||
+ { 0x00, { 0xEF, 0x08 }, 0x02 },
|
||||
+ { 0x00, { 0xFF, 0x77, 0x01, 0x00, 0x00, 0x10 }, 0x06 },
|
||||
+ { 0x00, { 0xC0, 0x63, 0x00 }, 0x03 },
|
||||
+ { 0x00, { 0xC1, 0x14, 0x14 }, 0x03 },
|
||||
+ { 0x00, { 0xC2, 0x37, 0x02 }, 0x03 },
|
||||
+ { 0x00, { 0xCC, 0x10 }, 0x02 },
|
||||
+ { 0x00,
|
||||
+ { 0xB0, 0xC5, 0x11, 0x1B, 0x0D, 0x11, 0x07, 0x0A, 0x09, 0x08, 0x24,
|
||||
+ 0x05, 0x12, 0x10, 0xA9, 0x32, 0xDF },
|
||||
+ 0x11 },
|
||||
+ { 0x00,
|
||||
+ { 0xB1, 0xC5, 0x19, 0x21, 0x0B, 0x0E, 0x03, 0x0C, 0x07, 0x07, 0x26,
|
||||
+ 0x04, 0x12, 0x11, 0xAA, 0x32, 0xDF },
|
||||
+ 0x11 },
|
||||
+ { 0x00, { 0xFF, 0x77, 0x01, 0x00, 0x00, 0x11 }, 0x06 },
|
||||
+ { 0x00, { 0xB0, 0x4D }, 0x02 },
|
||||
+ { 0x00, { 0xB1, 0x59 }, 0x02 },
|
||||
+ { 0x00, { 0xB2, 0x81 }, 0x02 },
|
||||
+ { 0x00, { 0xB3, 0x80 }, 0x02 },
|
||||
+ { 0x00, { 0xB5, 0x4E }, 0x02 },
|
||||
+ { 0x00, { 0xB7, 0x85 }, 0x02 },
|
||||
+ { 0x00, { 0xB8, 0x32 }, 0x02 },
|
||||
+ { 0x00, { 0xBB, 0x03 }, 0x02 },
|
||||
+ { 0x00, { 0xC1, 0x08 }, 0x02 },
|
||||
+ { 0x00, { 0xC2, 0x08 }, 0x02 },
|
||||
+ { 0x00, { 0xD0, 0x88 }, 0x02 },
|
||||
+ { 0x00, { 0xE0, 0x00, 0x00, 0x02 }, 0x04 },
|
||||
+ { 0x00,
|
||||
+ { 0xE1, 0x06, 0x28, 0x08, 0x28, 0x05, 0x28, 0x07, 0x28, 0x0E, 0x33,
|
||||
+ 0x33 },
|
||||
+ 0x0C },
|
||||
+ { 0x00,
|
||||
+ { 0xE2, 0x30, 0x30, 0x33, 0x33, 0x34, 0x00, 0x00, 0x00, 0x34, 0x00,
|
||||
+ 0x00, 0x00 },
|
||||
+ 0x0D },
|
||||
+ { 0x00, { 0xE3, 0x00, 0x00, 0x33, 0x33 }, 0x05 },
|
||||
+ { 0x00, { 0xE4, 0x44, 0x44 }, 0x03 },
|
||||
+ { 0x00,
|
||||
+ { 0xE5, 0x09, 0x2F, 0x2C, 0x8C, 0x0B, 0x31, 0x2C, 0x8C, 0x0D, 0x33,
|
||||
+ 0x2C, 0x8C, 0x0F, 0x35, 0x2C, 0x8C },
|
||||
+ 0x11 },
|
||||
+ { 0x00, { 0xE6, 0x00, 0x00, 0x33, 0x33 }, 0x05 },
|
||||
+ { 0x00, { 0xE7, 0x44, 0x44 }, 0x03 },
|
||||
+ { 0x00,
|
||||
+ { 0xE8, 0x08, 0x2E, 0x2C, 0x8C, 0x0A, 0x30, 0x2C, 0x8C, 0x0C, 0x32,
|
||||
+ 0x2C, 0x8C, 0x0E, 0x34, 0x2C, 0x8C },
|
||||
+ 0x11 },
|
||||
+ { 0x00, { 0xE9, 0x36, 0x00 }, 0x03 },
|
||||
+ { 0x00, { 0xEB, 0x00, 0x01, 0xE4, 0xE4, 0x44, 0x88, 0x40 }, 0x08 },
|
||||
+ { 0x00,
|
||||
+ { 0xED, 0xFF, 0xFC, 0xB2, 0x45, 0x67, 0xFA, 0x01, 0xFF, 0xFF, 0x10,
|
||||
+ 0xAF, 0x76, 0x54, 0x2B, 0xCF, 0xFF },
|
||||
+ 0x11 },
|
||||
+ { 0x00, { 0xEF, 0x08, 0x08, 0x08, 0x45, 0x3F, 0x54 }, 0x07 },
|
||||
+ { 0x00, { 0xFF, 0x77, 0x01, 0x00, 0x00, 0x13 }, 0x06 },
|
||||
+ { 0x00, { 0xE8, 0x00, 0x0E }, 0x03 },
|
||||
+ { 0x78, { 0x11, 0x00 }, 0x02 },
|
||||
+ { 0x0A, { 0xE8, 0x00, 0x0C }, 0x03 },
|
||||
+ { 0x00, { 0xE8, 0x00, 0x00 }, 0x03 },
|
||||
+ { 0x00, { 0xFF, 0x77, 0x01, 0x00, 0x00, 0x00 }, 0x06 },
|
||||
+ { 0x00, { 0x36, 0x00 }, 0x02 },
|
||||
+ { 0x00, { 0x29, 0x00 }, 0x02 },
|
||||
+};
|
||||
+
|
||||
+struct yixian_yx0345_panel_data {
|
||||
+ struct yixian_yx0345_cmd *init_code;
|
||||
+ int len;
|
||||
+};
|
||||
+
|
||||
+static struct yixian_yx0345_panel_data yx0345_panel_data = {
|
||||
+ .init_code = (struct yixian_yx0345_cmd *)yixian_yx0345_init_code,
|
||||
+ .len = ARRAY_SIZE(yixian_yx0345_init_code)
|
||||
+};
|
||||
+
|
||||
+static inline struct yixian_yx0345 *to_yixian_yx0345(struct drm_panel *panel)
|
||||
+{
|
||||
+ return container_of(panel, struct yixian_yx0345, panel);
|
||||
+}
|
||||
+
|
||||
+static void yixian_yx0345_reset(struct yixian_yx0345 *ctx)
|
||||
+{
|
||||
+ if (ctx->reset_gpio) {
|
||||
+ gpiod_set_value_cansleep(ctx->reset_gpio, 0);
|
||||
+ msleep(60);
|
||||
+ gpiod_set_value_cansleep(ctx->reset_gpio, 1);
|
||||
+ msleep(60);
|
||||
+ gpiod_set_value_cansleep(ctx->reset_gpio, 0);
|
||||
+ msleep(60);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static int yixian_yx0345_prepare(struct drm_panel *panel)
|
||||
+{
|
||||
+ struct yixian_yx0345 *ctx = to_yixian_yx0345(panel);
|
||||
+ struct mipi_dsi_multi_context mctx = { .dsi = ctx->dsi };
|
||||
+ int ret;
|
||||
+
|
||||
+ ret = regulator_bulk_enable(ctx->num_supplies, ctx->supplies);
|
||||
+ if (ret < 0)
|
||||
+ return ret;
|
||||
+
|
||||
+ yixian_yx0345_reset(ctx);
|
||||
+
|
||||
+ msleep(60);
|
||||
+
|
||||
+ struct yixian_yx0345_panel_data *panel_data =
|
||||
+ ctx->panel_info->panel_data;
|
||||
+
|
||||
+ for (int i = 0; i < panel_data->len; i++) {
|
||||
+ struct yixian_yx0345_cmd code = panel_data->init_code[i];
|
||||
+
|
||||
+ mipi_dsi_dcs_write_buffer_multi(&mctx, &code.data, code.len);
|
||||
+
|
||||
+ if (code.delay > 0) {
|
||||
+ mipi_dsi_msleep(&mctx, code.delay);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ mipi_dsi_msleep(&mctx, 10);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int yixian_yx0345_unprepare(struct drm_panel *panel)
|
||||
+{
|
||||
+ struct yixian_yx0345 *ctx = to_yixian_yx0345(panel);
|
||||
+
|
||||
+ gpiod_set_value_cansleep(ctx->reset_gpio, 1);
|
||||
+ regulator_bulk_disable(ctx->num_supplies, ctx->supplies);
|
||||
+
|
||||
+ msleep(60);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int yixian_yx0345_disable(struct drm_panel *panel)
|
||||
+{
|
||||
+ struct yixian_yx0345 *yx0345 = to_yixian_yx0345(panel);
|
||||
+ struct mipi_dsi_multi_context ctx = { .dsi = yx0345->dsi };
|
||||
+ int ret;
|
||||
+
|
||||
+ u8 data = 0x00;
|
||||
+ ret = mipi_dsi_dcs_write(ctx.dsi, 0x28, &data, 1);
|
||||
+ if (ret < 0)
|
||||
+ return ret;
|
||||
+
|
||||
+ ret = mipi_dsi_dcs_write(ctx.dsi, 0x10, &data, 1);
|
||||
+ if (ret < 0)
|
||||
+ return ret;
|
||||
+
|
||||
+ mipi_dsi_msleep(&ctx, 70);
|
||||
+
|
||||
+ return ctx.accum_err;
|
||||
+}
|
||||
+
|
||||
+static int yixian_yx0345_get_modes(struct drm_panel *panel,
|
||||
+ struct drm_connector *connector)
|
||||
+{
|
||||
+ struct yixian_yx0345 *ctx = to_yixian_yx0345(panel);
|
||||
+
|
||||
+ return drm_connector_helper_get_modes_fixed(connector,
|
||||
+ &ctx->panel_info->mode);
|
||||
+}
|
||||
+
|
||||
+static const struct drm_panel_funcs yixian_yx0345_funcs = {
|
||||
+ .prepare = yixian_yx0345_prepare,
|
||||
+ .unprepare = yixian_yx0345_unprepare,
|
||||
+ .get_modes = yixian_yx0345_get_modes,
|
||||
+ .disable = yixian_yx0345_disable,
|
||||
+};
|
||||
+
|
||||
+static int yixian_yx0345_probe(struct mipi_dsi_device *dsi)
|
||||
+{
|
||||
+ struct device *dev = &dsi->dev;
|
||||
+ struct yixian_yx0345 *ctx;
|
||||
+ int ret = 0;
|
||||
+
|
||||
+ ctx = devm_drm_panel_alloc(dev, struct yixian_yx0345, panel,
|
||||
+ &yixian_yx0345_funcs,
|
||||
+ DRM_MODE_CONNECTOR_DSI);
|
||||
+ if (IS_ERR(ctx))
|
||||
+ return PTR_ERR(ctx);
|
||||
+
|
||||
+ ctx->panel_info = device_get_match_data(dev);
|
||||
+ if (!ctx->panel_info)
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ ctx->num_supplies = ctx->panel_info->num_regulators;
|
||||
+ ret = devm_regulator_bulk_get_const(&dsi->dev,
|
||||
+ ctx->panel_info->num_regulators,
|
||||
+ ctx->panel_info->regulators,
|
||||
+ &ctx->supplies);
|
||||
+ if (ret < 0)
|
||||
+ return ret;
|
||||
+
|
||||
+ ctx->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW);
|
||||
+ if (IS_ERR(ctx->reset_gpio))
|
||||
+ return dev_err_probe(dev, PTR_ERR(ctx->reset_gpio),
|
||||
+ "Failed to get reset-gpios\n");
|
||||
+
|
||||
+ ctx->dsi = dsi;
|
||||
+ mipi_dsi_set_drvdata(dsi, ctx);
|
||||
+
|
||||
+ dsi->lanes = 2;
|
||||
+ dsi->format = MIPI_DSI_FMT_RGB888;
|
||||
+ dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
|
||||
+ MIPI_DSI_MODE_LPM | MIPI_DSI_CLOCK_NON_CONTINUOUS;
|
||||
+ ctx->panel.prepare_prev_first = true;
|
||||
+
|
||||
+ ret = drm_panel_of_backlight(&ctx->panel);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+ drm_panel_add(&ctx->panel);
|
||||
+
|
||||
+ ret = mipi_dsi_attach(dsi);
|
||||
+ if (ret < 0) {
|
||||
+ dev_err(dev, "Failed to attach to DSI host: %d\n", ret);
|
||||
+ drm_panel_remove(&ctx->panel);
|
||||
+ }
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static void yixian_yx0345_remove(struct mipi_dsi_device *dsi)
|
||||
+{
|
||||
+ struct yixian_yx0345 *ctx = mipi_dsi_get_drvdata(dsi);
|
||||
+ int ret;
|
||||
+
|
||||
+ ret = mipi_dsi_detach(dsi);
|
||||
+ if (ret < 0)
|
||||
+ dev_err(&dsi->dev, "Failed to detach DSI host: %d\n", ret);
|
||||
+
|
||||
+ drm_panel_remove(&ctx->panel);
|
||||
+}
|
||||
+
|
||||
+static const struct regulator_bulk_data yx0345_regulators[] = {
|
||||
+ {
|
||||
+ .supply = "vcc2v8",
|
||||
+ }, /* 2.8V */
|
||||
+ {
|
||||
+ .supply = "vcc1v8",
|
||||
+ }, /* 1.8V */
|
||||
+ {
|
||||
+ .supply = "vcc3v3",
|
||||
+ }, /* 3.3v */
|
||||
+};
|
||||
+
|
||||
+static const struct yixian_yx0345_panel_info yx0345_info = {
|
||||
+ .mode = {
|
||||
+ .clock = 29700,
|
||||
+ .hdisplay = 480,
|
||||
+ .hsync_start = 480 + 40,
|
||||
+ .hsync_end = 480 + 40 + 30,
|
||||
+ .htotal = 480 + 40 + 30 + 32,
|
||||
+ .vdisplay = 800,
|
||||
+ .vsync_start = 800 + 20,
|
||||
+ .vsync_end = 800 + 20 + 20,
|
||||
+ .vtotal = 800 + 20 + 20 + 10,
|
||||
+ .width_mm = 45,
|
||||
+ .height_mm = 75,
|
||||
+ .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
|
||||
+ .type = DRM_MODE_TYPE_DRIVER,
|
||||
+ },
|
||||
+ .regulators = yx0345_regulators,
|
||||
+ .num_regulators = ARRAY_SIZE(yx0345_regulators),
|
||||
+ .panel_data = &yx0345_panel_data,
|
||||
+};
|
||||
+
|
||||
+static const struct of_device_id yixian_yx0345_of_match[] = {
|
||||
+ { .compatible = "yixian,yx0345wv00v2", .data = &yx0345_info },
|
||||
+ { /*sentinel*/ }
|
||||
+};
|
||||
+MODULE_DEVICE_TABLE(of, yixian_yx0345_of_match);
|
||||
+
|
||||
+static struct mipi_dsi_driver yixian_yx0345_driver = {
|
||||
+ .probe = yixian_yx0345_probe,
|
||||
+ .remove = yixian_yx0345_remove,
|
||||
+ .driver = {
|
||||
+ .name = "panel-yixian-yx0345wv00v2",
|
||||
+ .of_match_table = yixian_yx0345_of_match,
|
||||
+ },
|
||||
+};
|
||||
+module_mipi_dsi_driver(yixian_yx0345_driver);
|
||||
+
|
||||
+MODULE_AUTHOR("Muhammed Efe Cetin <efectn@protonmail.com>");
|
||||
+MODULE_DESCRIPTION("DRM driver for Yixian YX0345WV00V2 DSI panels");
|
||||
+MODULE_LICENSE("GPL");
|
||||
--
|
||||
Armbian
|
||||
|
@ -0,0 +1,39 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: SuperKali <hello@superkali.me>
|
||||
Date: Fri, 7 Mar 2025 15:06:42 +0000
|
||||
Subject: drm/rockchip: Set dma mask to 64 bit
|
||||
|
||||
The vop mmu support translate physical address upper 4 GB to iova
|
||||
below 4 GB. So set dma mask to 64 bit to indicate we support address
|
||||
> 4GB.
|
||||
|
||||
This can avoid warnging message like this on some boards with DDR
|
||||
> 4 GB:
|
||||
|
||||
rockchip-drm display-subsystem: swiotlb buffer is full (sz: 266240 bytes), total 32768 (slots), used 130 (slots)
|
||||
rockchip-drm display-subsystem: swiotlb buffer is full (sz: 266240 bytes), total 32768 (slots), used 0 (slots)
|
||||
rockchip-drm display-subsystem: swiotlb buffer is full (sz: 266240 bytes), total 32768 (slots), used 130 (slots)
|
||||
rockchip-drm display-subsystem: swiotlb buffer is full (sz: 266240 bytes), total 32768 (slots), used 130 (slots)
|
||||
rockchip-drm display-subsystem: swiotlb buffer is full (sz: 266240 bytes), total 32768 (slots), used 0 (slots)
|
||||
---
|
||||
drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
|
||||
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
|
||||
@@ -472,7 +472,9 @@ static int rockchip_drm_platform_probe(struct platform_device *pdev)
|
||||
return ret;
|
||||
}
|
||||
|
||||
- return 0;
|
||||
+ ret = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(64));
|
||||
+
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
static void rockchip_drm_platform_remove(struct platform_device *pdev)
|
||||
--
|
||||
Armbian
|
||||
|
@ -0,0 +1,105 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Yannick Adam <yannick.adam@gmail.com>
|
||||
Date: Tue, 14 Apr 2020 17:15:09 +0200
|
||||
Subject: [ARCHEOLOGY] Enable es8316 on RockPi4 (#1885)
|
||||
|
||||
> X-Git-Archeology: - Revision 454038a50d1d24e636626213ad65b3463d632aa0: https://github.com/armbian/build/commit/454038a50d1d24e636626213ad65b3463d632aa0
|
||||
> X-Git-Archeology: Date: Tue, 14 Apr 2020 17:15:09 +0200
|
||||
> X-Git-Archeology: From: Yannick Adam <yannick.adam@gmail.com>
|
||||
> X-Git-Archeology: Subject: Enable es8316 on RockPi4 (#1885)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision bd486c75623e75bdf2bdcaf09dc5a0affe9706c1: https://github.com/armbian/build/commit/bd486c75623e75bdf2bdcaf09dc5a0affe9706c1
|
||||
> X-Git-Archeology: Date: Tue, 14 Apr 2020 20:14:24 +0200
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igor.pecovnik@gmail.com>
|
||||
> X-Git-Archeology: Subject: Enable es8316 on RockPi4 for Rockchip64 current too https://github.com/armbian/build/pull/1885
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 0cdffb29b07305209efb12cf3b5ac6032d3a1153: https://github.com/armbian/build/commit/0cdffb29b07305209efb12cf3b5ac6032d3a1153
|
||||
> X-Git-Archeology: Date: Wed, 24 Mar 2021 19:01:53 +0100
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igorpecovnik@users.noreply.github.com>
|
||||
> X-Git-Archeology: Subject: Renaming DEV branch to EDGE (#2704)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision e7377248b3cae186e24e2be781cd3365b43246f0: https://github.com/armbian/build/commit/e7377248b3cae186e24e2be781cd3365b43246f0
|
||||
> X-Git-Archeology: Date: Thu, 22 Jul 2021 00:15:54 +0200
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igorpecovnik@users.noreply.github.com>
|
||||
> X-Git-Archeology: Subject: Second part of EDGE bumping to 5.13.y (#3045)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 744ea89a589d62cb6f409baab60fc6664520bc39: https://github.com/armbian/build/commit/744ea89a589d62cb6f409baab60fc6664520bc39
|
||||
> X-Git-Archeology: Date: Wed, 08 Sep 2021 17:51:34 +0200
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igorpecovnik@users.noreply.github.com>
|
||||
> X-Git-Archeology: Subject: Bumping EDGE kernel to 5.14.y (#3125)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision dd51f9f2afcbc83a3e10b32eb6a5061d91d1558e: https://github.com/armbian/build/commit/dd51f9f2afcbc83a3e10b32eb6a5061d91d1558e
|
||||
> X-Git-Archeology: Date: Tue, 09 Nov 2021 18:06:34 +0100
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igorpecovnik@users.noreply.github.com>
|
||||
> X-Git-Archeology: Subject: Bump imx6, xu4, rockchip64 and jetson-nano to 5.15 (#3238)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 6b490e16944b30ff69bf9c13678905187df0d9d4: https://github.com/armbian/build/commit/6b490e16944b30ff69bf9c13678905187df0d9d4
|
||||
> X-Git-Archeology: Date: Tue, 11 Jan 2022 15:26:11 +0100
|
||||
> X-Git-Archeology: From: Oleg <balbes-150@yandex.ru>
|
||||
> X-Git-Archeology: Subject: move kernel edge to 5.16 (#3387)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision ac8fc4385594d59257ee9dffd9efa85e3497fa7d: https://github.com/armbian/build/commit/ac8fc4385594d59257ee9dffd9efa85e3497fa7d
|
||||
> X-Git-Archeology: Date: Sat, 26 Feb 2022 07:46:44 +0100
|
||||
> X-Git-Archeology: From: Piotr Szczepanik <piter75@gmail.com>
|
||||
> X-Git-Archeology: Subject: Switch rockchip64 current to linux 5.15.y (#3489)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision f52a4193d02ef88333ba117c68d49486dfd7ff41: https://github.com/armbian/build/commit/f52a4193d02ef88333ba117c68d49486dfd7ff41
|
||||
> X-Git-Archeology: Date: Sun, 20 Mar 2022 22:58:21 +0100
|
||||
> X-Git-Archeology: From: Oleg <balbes-150@yandex.ru>
|
||||
> X-Git-Archeology: Subject: Adding Pine64 Quartz64a as WIP target (#3539)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 0afe24c95729044910e0b3f84dc5500bcdc6524c: https://github.com/armbian/build/commit/0afe24c95729044910e0b3f84dc5500bcdc6524c
|
||||
> X-Git-Archeology: Date: Sun, 24 Apr 2022 22:33:47 +0200
|
||||
> X-Git-Archeology: From: Oleg <balbes-150@yandex.ru>
|
||||
> X-Git-Archeology: Subject: move kernel media edge to 5.17 (#3704)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 897674aa74bce0326ed7fe06f5336bf4709a8a1f: https://github.com/armbian/build/commit/897674aa74bce0326ed7fe06f5336bf4709a8a1f
|
||||
> X-Git-Archeology: Date: Tue, 03 May 2022 08:27:32 +0200
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igorpecovnik@users.noreply.github.com>
|
||||
> X-Git-Archeology: Subject: Bump and freeze kernel at last known working versions (#3736)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 597d2dac11f00d9070a4e49d6bad1b2244e36cb3: https://github.com/armbian/build/commit/597d2dac11f00d9070a4e49d6bad1b2244e36cb3
|
||||
> X-Git-Archeology: Date: Sat, 28 May 2022 07:56:22 +0200
|
||||
> X-Git-Archeology: From: Jianfeng Liu <liujianfeng1994@gmail.com>
|
||||
> X-Git-Archeology: Subject: update rockchip64-edge to 5.18 (#3814)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 8c6641e7b79f0d50acdc306d140e586a4e923cf0: https://github.com/armbian/build/commit/8c6641e7b79f0d50acdc306d140e586a4e923cf0
|
||||
> X-Git-Archeology: Date: Wed, 03 Aug 2022 22:22:55 +0200
|
||||
> X-Git-Archeology: From: Jianfeng Liu <liujianfeng1994@gmail.com>
|
||||
> X-Git-Archeology: Subject: update rockchip64 edge to 5.19 (#4039)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 6765f734cc4a22aeaa9f99a3ad28c8c322de26f6: https://github.com/armbian/build/commit/6765f734cc4a22aeaa9f99a3ad28c8c322de26f6
|
||||
> X-Git-Archeology: Date: Tue, 25 Oct 2022 11:26:51 +0200
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igorpecovnik@users.noreply.github.com>
|
||||
> X-Git-Archeology: Subject: Bump rockchip64 edge to 6.0.y (#4337)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 92f1a22d76b987afa7ba555d5b509adc51d689e7: https://github.com/armbian/build/commit/92f1a22d76b987afa7ba555d5b509adc51d689e7
|
||||
> X-Git-Archeology: Date: Fri, 16 Dec 2022 13:38:13 +0100
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igorpecovnik@users.noreply.github.com>
|
||||
> X-Git-Archeology: Subject: Re-add rockchip64 6.0 patches (#4575)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 34ae84fac5d0b66a1ab2d1e51534b7beb13ef245: https://github.com/armbian/build/commit/34ae84fac5d0b66a1ab2d1e51534b7beb13ef245
|
||||
> X-Git-Archeology: Date: Fri, 05 May 2023 14:22:00 +0200
|
||||
> X-Git-Archeology: From: amazingfate <liujianfeng1994@gmail.com>
|
||||
> X-Git-Archeology: Subject: bump rockchip64 edge to v6.3
|
||||
> X-Git-Archeology:
|
||||
---
|
||||
sound/soc/codecs/es8316.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/sound/soc/codecs/es8316.c b/sound/soc/codecs/es8316.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/sound/soc/codecs/es8316.c
|
||||
+++ b/sound/soc/codecs/es8316.c
|
||||
@@ -732,7 +732,7 @@ static void es8316_disable_jack_detect(struct snd_soc_component *component)
|
||||
snd_soc_component_update_bits(component, ES8316_GPIO_DEBOUNCE,
|
||||
ES8316_GPIO_ENABLE_INTERRUPT, 0);
|
||||
|
||||
- if (es8316->jack->status & SND_JACK_MICROPHONE) {
|
||||
+ if (es8316->jack && (es8316->jack->status & SND_JACK_MICROPHONE)) {
|
||||
es8316_disable_micbias_for_mic_gnd_short_detect(component);
|
||||
snd_soc_jack_report(es8316->jack, 0, SND_JACK_BTN_0);
|
||||
}
|
||||
--
|
||||
Armbian
|
||||
|
@ -0,0 +1,46 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jonas Karlman <jonas@kwiboo.se>
|
||||
Date: Sun, 17 Feb 2019 22:14:38 +0000
|
||||
Subject: mmc: core: set initial signal voltage on power off
|
||||
|
||||
Some boards have SD card connectors where the power rail cannot be switched
|
||||
off by the driver. If the card has not been power cycled, it may still be
|
||||
using 1.8V signaling after a warm re-boot. Bootroms expecting 3.3V signaling
|
||||
will fail to boot from a UHS card that continue to use 1.8V signaling.
|
||||
|
||||
Set initial signal voltage in mmc_power_off() to allow re-boot to function.
|
||||
|
||||
This fixes re-boot with UHS cards on Asus Tinker Board (Rockchip RK3288),
|
||||
same issue have been seen on some Rockchip RK3399 boards.
|
||||
|
||||
I am sending this as a RFC because I have no insights into SD/MMC subsystem,
|
||||
this change fix a re-boot issue on my boards and does not break emmc/sdio.
|
||||
Is this an acceptable workaround? Any advice is appreciated.
|
||||
|
||||
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
|
||||
---
|
||||
drivers/mmc/core/core.c | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/mmc/core/core.c
|
||||
+++ b/drivers/mmc/core/core.c
|
||||
@@ -1374,6 +1374,14 @@ void mmc_power_off(struct mmc_host *host)
|
||||
if (host->ios.power_mode == MMC_POWER_OFF)
|
||||
return;
|
||||
|
||||
+ mmc_set_initial_signal_voltage(host);
|
||||
+
|
||||
+ /*
|
||||
+ * This delay should be sufficient to allow the power supply
|
||||
+ * to reach the minimum voltage.
|
||||
+ */
|
||||
+ mmc_delay(host->ios.power_delay_ms);
|
||||
+
|
||||
mmc_pwrseq_power_off(host);
|
||||
|
||||
host->ios.clock = 0;
|
||||
--
|
||||
Armbian
|
||||
|
257
patch/kernel/rockchip64-6.16/general-hdmi-clock-fixes.patch
Normal file
257
patch/kernel/rockchip64-6.16/general-hdmi-clock-fixes.patch
Normal file
@ -0,0 +1,257 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Paolo Sabatino <paolo.sabatino@gmail.com>
|
||||
Date: Sat, 6 Apr 2024 15:40:30 +0200
|
||||
Subject: hdmi timing core changes and fixes
|
||||
|
||||
---
|
||||
drivers/clk/rockchip/clk-rk3399.c | 49 ++++++++--
|
||||
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 12 +--
|
||||
drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 42 ++++++++
|
||||
drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 7 ++
|
||||
4 files changed, 97 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/drivers/clk/rockchip/clk-rk3399.c b/drivers/clk/rockchip/clk-rk3399.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/clk/rockchip/clk-rk3399.c
|
||||
+++ b/drivers/clk/rockchip/clk-rk3399.c
|
||||
@@ -105,6 +105,39 @@ static struct rockchip_pll_rate_table rk3399_pll_rates[] = {
|
||||
{ /* sentinel */ },
|
||||
};
|
||||
|
||||
+static struct rockchip_pll_rate_table rk3399_vpll_rates[] = {
|
||||
+ /* _mhz, _refdiv, _fbdiv, _postdiv1, _postdiv2, _dsmpd, _frac */
|
||||
+ RK3036_PLL_RATE( 594000000, 1, 74, 3, 1, 0, 4194304), /* vco = 1782000000 fout = 594000000 */
|
||||
+ RK3036_PLL_RATE( 593406592, 1, 74, 3, 1, 0, 2949838), /* vco = 1780219777 fout = 593406592.36908 */
|
||||
+ RK3036_PLL_RATE( 319750000, 1, 79, 6, 1, 0, 15728640), /* vco = 1918500000 fout = 319750000 */
|
||||
+ RK3036_PLL_RATE( 297000000, 1, 74, 6, 1, 0, 4194304), /* vco = 1782000000 fout = 297000000 */
|
||||
+ RK3036_PLL_RATE( 296703296, 1, 74, 6, 1, 0, 2949838), /* vco = 1780219777 fout = 296703296.18454 */
|
||||
+ RK3036_PLL_RATE( 241500000, 1, 60, 6, 1, 0, 6291456), /* vco = 1449000000 fout = 241500000 */
|
||||
+ RK3036_PLL_RATE( 162000000, 1, 67, 5, 2, 0, 8388608), /* vco = 1620000000 fout = 162000000 */
|
||||
+ RK3036_PLL_RATE( 148500000, 1, 74, 6, 2, 0, 4194304), /* vco = 1782000000 fout = 148500000*/
|
||||
+ RK3036_PLL_RATE( 148351648, 1, 74, 6, 2, 0, 2949838), /* vco = 1780219777 fout = 148351648.09227 */
|
||||
+ RK3036_PLL_RATE( 136750000, 1, 68, 2, 6, 0, 6291456), /* vco = 1641000000 fout = 136750000 */
|
||||
+ RK3036_PLL_RATE( 135000000, 1, 56, 5, 2, 0, 4194304), /* vco = 1350000000 fout = 135000000 */
|
||||
+ RK3036_PLL_RATE( 119000000, 1, 59, 6, 2, 0, 8388608), /* vco = 1428000000 fout = 119000000 */
|
||||
+ RK3036_PLL_RATE( 108000000, 1, 63, 7, 2, 1, 0), /* vco = 1512000000 fout = 108000000 */
|
||||
+ RK3036_PLL_RATE( 106500000, 1, 62, 7, 2, 0, 2097152), /* vco = 1491000000 fout = 106500000 */
|
||||
+ RK3036_PLL_RATE( 88750000, 1, 55, 5, 3, 0, 7864320), /* vco = 1331250000 fout = 88750000 */
|
||||
+ RK3036_PLL_RATE( 85500000, 1, 57, 4, 4, 1, 0), /* vco = 1368000000 fout = 85500000 */
|
||||
+ RK3036_PLL_RATE( 78750000, 1, 59, 6, 3, 0, 1048576), /* vco = 1417500000 fout = 78750000 */
|
||||
+ RK3036_PLL_RATE( 74250000, 1, 74, 6, 4, 0, 4194304), /* vco = 1782000000 fout = 74250000 */
|
||||
+ RK3036_PLL_RATE( 74175824, 1, 74, 6, 4, 0, 2949838), /* vco = 1780219777 fout = 74175824.046135 */
|
||||
+ RK3036_PLL_RATE( 71000000, 1, 71, 6, 4, 1, 0), /* vco = 1704000000 fout = 71000000 */
|
||||
+ RK3036_PLL_RATE( 65000000, 1, 65, 6, 4, 0, 0), /* vco = 1560000000 fout = 65000000 */
|
||||
+ RK3036_PLL_RATE( 59340659, 1, 59, 6, 4, 0, 5715310), /* vco = 1424175816 fout = 59340659.022331 */
|
||||
+ RK3036_PLL_RATE( 54000000, 1, 63, 7, 4, 1, 0), /* vco = 1512000000 fout = 54000000 */
|
||||
+ RK3036_PLL_RATE( 49500000, 1, 72, 5, 7, 0, 3145728), /* vco = 1732500000 fout = 49500000 */
|
||||
+ RK3036_PLL_RATE( 40000000, 1, 70, 7, 6, 1, 0), /* vco = 1680000000 fout = 40000000 */
|
||||
+ RK3036_PLL_RATE( 31500000, 1, 55, 7, 6, 0, 2097152), /* vco = 1323000000 fout = 31500000 */
|
||||
+ RK3036_PLL_RATE( 27000000, 1, 55, 7, 7, 0, 2097152), /* vco = 1323000000 fout = 27000000 */
|
||||
+ RK3036_PLL_RATE( 26973026, 1, 55, 7, 7, 0, 1173214), /* vco = 1321678296 fout = 26973026.450799 */
|
||||
+ { /* sentinel */ },
|
||||
+};
|
||||
+
|
||||
/* CRU parents */
|
||||
PNAME(mux_pll_p) = { "xin24m", "xin32k" };
|
||||
|
||||
@@ -123,7 +156,7 @@ PNAME(mux_ddrclk_p) = { "clk_ddrc_lpll_src",
|
||||
PNAME(mux_aclk_cci_p) = { "cpll_aclk_cci_src",
|
||||
"gpll_aclk_cci_src",
|
||||
"npll_aclk_cci_src",
|
||||
- "vpll_aclk_cci_src" };
|
||||
+ "prevent:vpll" };
|
||||
PNAME(mux_cci_trace_p) = { "cpll_cci_trace",
|
||||
"gpll_cci_trace" };
|
||||
PNAME(mux_cs_p) = { "cpll_cs", "gpll_cs",
|
||||
@@ -149,10 +182,12 @@ PNAME(mux_pll_src_cpll_gpll_npll_upll_24m_p) = { "cpll", "gpll", "npll",
|
||||
PNAME(mux_pll_src_cpll_gpll_npll_ppll_upll_24m_p) = { "cpll", "gpll", "npll",
|
||||
"ppll", "upll", "xin24m" };
|
||||
|
||||
-PNAME(mux_pll_src_vpll_cpll_gpll_p) = { "vpll", "cpll", "gpll" };
|
||||
-PNAME(mux_pll_src_vpll_cpll_gpll_npll_p) = { "vpll", "cpll", "gpll",
|
||||
+PNAME(mux_pll_src_vpll_cpll_gpll_p) = { "prevent:vpll", "cpll", "gpll" };
|
||||
+PNAME(vop0_mux_pll_src_vpll_cpll_gpll_p) = { "vpll", "prevent:cpll", "prevent:gpll" };
|
||||
+
|
||||
+PNAME(mux_pll_src_vpll_cpll_gpll_npll_p) = { "prevent:vpll", "cpll", "gpll",
|
||||
"npll" };
|
||||
-PNAME(mux_pll_src_vpll_cpll_gpll_24m_p) = { "vpll", "cpll", "gpll",
|
||||
+PNAME(mux_pll_src_vpll_cpll_gpll_24m_p) = { "prevent:vpll", "cpll", "gpll",
|
||||
"xin24m" };
|
||||
|
||||
PNAME(mux_dclk_vop0_p) = { "dclk_vop0_div",
|
||||
@@ -229,7 +264,7 @@ static struct rockchip_pll_clock rk3399_pll_clks[] __initdata = {
|
||||
[npll] = PLL(pll_rk3399, PLL_NPLL, "npll", mux_pll_p, 0, RK3399_PLL_CON(40),
|
||||
RK3399_PLL_CON(43), 8, 31, ROCKCHIP_PLL_SYNC_RATE, rk3399_pll_rates),
|
||||
[vpll] = PLL(pll_rk3399, PLL_VPLL, "vpll", mux_pll_p, 0, RK3399_PLL_CON(48),
|
||||
- RK3399_PLL_CON(51), 8, 31, ROCKCHIP_PLL_SYNC_RATE, rk3399_pll_rates),
|
||||
+ RK3399_PLL_CON(51), 8, 31, ROCKCHIP_PLL_SYNC_RATE, rk3399_vpll_rates),
|
||||
};
|
||||
|
||||
static struct rockchip_pll_clock rk3399_pmu_pll_clks[] __initdata = {
|
||||
@@ -279,7 +314,7 @@ static struct rockchip_clk_branch rk3399_uart4_pmu_fracmux __initdata =
|
||||
RK3399_PMU_CLKSEL_CON(5), 8, 2, MFLAGS);
|
||||
|
||||
static struct rockchip_clk_branch rk3399_dclk_vop0_fracmux __initdata =
|
||||
- MUX(DCLK_VOP0, "dclk_vop0", mux_dclk_vop0_p, CLK_SET_RATE_PARENT,
|
||||
+ MUX(DCLK_VOP0, "dclk_vop0", mux_dclk_vop0_p, CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT,
|
||||
RK3399_CLKSEL_CON(49), 11, 1, MFLAGS);
|
||||
|
||||
static struct rockchip_clk_branch rk3399_dclk_vop1_fracmux __initdata =
|
||||
@@ -1162,7 +1197,7 @@ static struct rockchip_clk_branch rk3399_clk_branches[] __initdata = {
|
||||
GATE(HCLK_VOP0_NOC, "hclk_vop0_noc", "hclk_vop0_pre", CLK_IGNORE_UNUSED,
|
||||
RK3399_CLKGATE_CON(28), 0, GFLAGS),
|
||||
|
||||
- COMPOSITE(DCLK_VOP0_DIV, "dclk_vop0_div", mux_pll_src_vpll_cpll_gpll_p, 0,
|
||||
+ COMPOSITE(DCLK_VOP0_DIV, "dclk_vop0_div", vop0_mux_pll_src_vpll_cpll_gpll_p, CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT,
|
||||
RK3399_CLKSEL_CON(49), 8, 2, MFLAGS, 0, 8, DFLAGS,
|
||||
RK3399_CLKGATE_CON(10), 12, GFLAGS),
|
||||
|
||||
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
|
||||
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
|
||||
@@ -69,15 +69,15 @@ static const u16 csc_coeff_rgb_out_eitu709[3][4] = {
|
||||
};
|
||||
|
||||
static const u16 csc_coeff_rgb_in_eitu601[3][4] = {
|
||||
- { 0x2591, 0x1322, 0x074b, 0x0000 },
|
||||
- { 0x6535, 0x2000, 0x7acc, 0x0200 },
|
||||
- { 0x6acd, 0x7534, 0x2000, 0x0200 }
|
||||
+ { 0x2040, 0x1080, 0x0640, 0x0040 },
|
||||
+ { 0xe880, 0x1c00, 0xfb80, 0x0200 },
|
||||
+ { 0xed80, 0xf680, 0x1c00, 0x0200 }
|
||||
};
|
||||
|
||||
static const u16 csc_coeff_rgb_in_eitu709[3][4] = {
|
||||
- { 0x2dc5, 0x0d9b, 0x049e, 0x0000 },
|
||||
- { 0x62f0, 0x2000, 0x7d11, 0x0200 },
|
||||
- { 0x6756, 0x78ab, 0x2000, 0x0200 }
|
||||
+ { 0x2740, 0x0bc0, 0x0400, 0x0040 },
|
||||
+ { 0xe680, 0x1c00, 0xfd80, 0x0200 },
|
||||
+ { 0xea40, 0xf980, 0x1c00, 0x0200 }
|
||||
};
|
||||
|
||||
static const u16 csc_coeff_rgb_full_to_rgb_limited[3][4] = {
|
||||
diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
|
||||
+++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
|
||||
@@ -178,6 +178,46 @@ static const struct dw_hdmi_mpll_config rockchip_mpll_cfg[] = {
|
||||
}
|
||||
};
|
||||
|
||||
+static const struct dw_hdmi_mpll_config rockchip_mpll_cfg_420[] = {
|
||||
+ {
|
||||
+ 30666000, {
|
||||
+ { 0x00b7, 0x0000 },
|
||||
+ { 0x2157, 0x0000 },
|
||||
+ { 0x40f7, 0x0000 },
|
||||
+ },
|
||||
+ }, {
|
||||
+ 92000000, {
|
||||
+ { 0x00b7, 0x0000 },
|
||||
+ { 0x2143, 0x0001 },
|
||||
+ { 0x40a3, 0x0001 },
|
||||
+ },
|
||||
+ }, {
|
||||
+ 184000000, {
|
||||
+ { 0x0073, 0x0001 },
|
||||
+ { 0x2146, 0x0002 },
|
||||
+ { 0x4062, 0x0002 },
|
||||
+ },
|
||||
+ }, {
|
||||
+ 340000000, {
|
||||
+ { 0x0052, 0x0003 },
|
||||
+ { 0x214d, 0x0003 },
|
||||
+ { 0x4065, 0x0003 },
|
||||
+ },
|
||||
+ }, {
|
||||
+ 600000000, {
|
||||
+ { 0x0041, 0x0003 },
|
||||
+ { 0x3b4d, 0x0003 },
|
||||
+ { 0x5a65, 0x0003 },
|
||||
+ },
|
||||
+ }, {
|
||||
+ ~0UL, {
|
||||
+ { 0x0000, 0x0000 },
|
||||
+ { 0x0000, 0x0000 },
|
||||
+ { 0x0000, 0x0000 },
|
||||
+ },
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
static const struct dw_hdmi_curr_ctrl rockchip_cur_ctr[] = {
|
||||
/* pixelclk bpp8 bpp10 bpp12 */
|
||||
{
|
||||
@@ -343,6 +383,8 @@ static int dw_hdmi_rockchip_genphy_init(struct dw_hdmi *dw_hdmi, void *data,
|
||||
|
||||
dw_hdmi_set_high_tmds_clock_ratio(dw_hdmi, display);
|
||||
|
||||
+ dw_hdmi_set_high_tmds_clock_ratio(dw_hdmi, display);
|
||||
+
|
||||
return phy_power_on(hdmi->phy);
|
||||
}
|
||||
|
||||
diff --git a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c
|
||||
+++ b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c
|
||||
@@ -765,6 +765,7 @@ static const struct vop_intr rk3288_vop_intr = {
|
||||
static const struct vop_data rk3288_vop = {
|
||||
.version = VOP_VERSION(3, 1),
|
||||
.feature = VOP_FEATURE_OUTPUT_RGB10,
|
||||
+ .max_output = { 3840, 2160 },
|
||||
.intr = &rk3288_vop_intr,
|
||||
.common = &rk3288_common,
|
||||
.modeset = &rk3288_modeset,
|
||||
@@ -872,6 +873,7 @@ static const struct vop_misc rk3368_misc = {
|
||||
|
||||
static const struct vop_data rk3368_vop = {
|
||||
.version = VOP_VERSION(3, 2),
|
||||
+ .max_output = { 4096, 2160 },
|
||||
.intr = &rk3368_vop_intr,
|
||||
.common = &rk3288_common,
|
||||
.modeset = &rk3288_modeset,
|
||||
@@ -894,6 +896,7 @@ static const struct vop_intr rk3366_vop_intr = {
|
||||
|
||||
static const struct vop_data rk3366_vop = {
|
||||
.version = VOP_VERSION(3, 4),
|
||||
+ .max_output = { 4096, 2160 },
|
||||
.intr = &rk3366_vop_intr,
|
||||
.common = &rk3288_common,
|
||||
.modeset = &rk3288_modeset,
|
||||
@@ -1047,6 +1050,7 @@ static const struct vop_afbc rk3399_vop_afbc = {
|
||||
static const struct vop_data rk3399_vop_big = {
|
||||
.version = VOP_VERSION(3, 5),
|
||||
.feature = VOP_FEATURE_OUTPUT_RGB10,
|
||||
+ .max_output = { 4096, 2160 },
|
||||
.intr = &rk3366_vop_intr,
|
||||
.common = &rk3399_common,
|
||||
.modeset = &rk3288_modeset,
|
||||
@@ -1075,6 +1079,7 @@ static const struct vop_win_yuv2yuv_data rk3399_vop_lit_win_yuv2yuv_data[] = {
|
||||
|
||||
static const struct vop_data rk3399_vop_lit = {
|
||||
.version = VOP_VERSION(3, 6),
|
||||
+ .max_output = { 2560, 1600 },
|
||||
.intr = &rk3366_vop_intr,
|
||||
.common = &rk3399_common,
|
||||
.modeset = &rk3288_modeset,
|
||||
@@ -1097,6 +1102,7 @@ static const struct vop_win_data rk3228_vop_win_data[] = {
|
||||
static const struct vop_data rk3228_vop = {
|
||||
.version = VOP_VERSION(3, 7),
|
||||
.feature = VOP_FEATURE_OUTPUT_RGB10,
|
||||
+ .max_output = { 4096, 2160 },
|
||||
.intr = &rk3366_vop_intr,
|
||||
.common = &rk3288_common,
|
||||
.modeset = &rk3288_modeset,
|
||||
@@ -1169,6 +1175,7 @@ static const struct vop_win_data rk3328_vop_win_data[] = {
|
||||
static const struct vop_data rk3328_vop = {
|
||||
.version = VOP_VERSION(3, 8),
|
||||
.feature = VOP_FEATURE_OUTPUT_RGB10,
|
||||
+ .max_output = { 4096, 2160 },
|
||||
.intr = &rk3328_vop_intr,
|
||||
.common = &rk3328_common,
|
||||
.modeset = &rk3328_modeset,
|
||||
--
|
||||
Armbian
|
||||
|
@ -0,0 +1,25 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Paolo Sabatino <paolo.sabatino@gmail.com>
|
||||
Date: Sun, 12 Jan 2025 12:39:03 +0100
|
||||
Subject: rockchip: increase SPDIF max burst value to maximum
|
||||
|
||||
---
|
||||
sound/soc/rockchip/rockchip_spdif.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/sound/soc/rockchip/rockchip_spdif.c b/sound/soc/rockchip/rockchip_spdif.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/sound/soc/rockchip/rockchip_spdif.c
|
||||
+++ b/sound/soc/rockchip/rockchip_spdif.c
|
||||
@@ -329,7 +329,7 @@ static int rk_spdif_probe(struct platform_device *pdev)
|
||||
|
||||
spdif->playback_dma_data.addr = res->start + SPDIF_SMPDR;
|
||||
spdif->playback_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
|
||||
- spdif->playback_dma_data.maxburst = 4;
|
||||
+ spdif->playback_dma_data.maxburst = 8;
|
||||
|
||||
spdif->dev = &pdev->dev;
|
||||
dev_set_drvdata(&pdev->dev, spdif);
|
||||
--
|
||||
Armbian
|
||||
|
@ -0,0 +1,140 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Igor Pecovnik <igor.pecovnik@gmail.com>
|
||||
Date: Mon, 21 Aug 2017 08:54:53 +0200
|
||||
Subject: [ARCHEOLOGY] Increasing DMA block memory allocation to 2048k on all
|
||||
relevant kernels.
|
||||
|
||||
> X-Git-Archeology: > recovered message: > https://forum.armbian.com/index.php?/topic/4811-uas-mainline-kernel-coherent-pool-memory-size
|
||||
> X-Git-Archeology: - Revision 908bb199ec2defd77f7f05d2016980abf100d627: https://github.com/armbian/build/commit/908bb199ec2defd77f7f05d2016980abf100d627
|
||||
> X-Git-Archeology: Date: Mon, 21 Aug 2017 08:54:53 +0200
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igor.pecovnik@gmail.com>
|
||||
> X-Git-Archeology: Subject: Increasing DMA block memory allocation to 2048k on all relevant kernels.
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision a3cf7b74858e1f862db8ca238bd44f6406be6662: https://github.com/armbian/build/commit/a3cf7b74858e1f862db8ca238bd44f6406be6662
|
||||
> X-Git-Archeology: Date: Mon, 21 Aug 2017 17:52:29 +0200
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igor.pecovnik@gmail.com>
|
||||
> X-Git-Archeology: Subject: Revert "Increasing DMA block memory allocation to 2048k on all relevant kernels."
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 2be21aad5dc965b3bc67e136a1e1170119d60f74: https://github.com/armbian/build/commit/2be21aad5dc965b3bc67e136a1e1170119d60f74
|
||||
> X-Git-Archeology: Date: Mon, 21 Aug 2017 17:52:48 +0200
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igor.pecovnik@gmail.com>
|
||||
> X-Git-Archeology: Subject: Increasing DMA block memory allocation to 2048k on all relevant kernels. https://forum.armbian.com/index.php?/topic/4811-uas-mainline-kernel-coherent-pool-memory-size
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision b3d2bd4864d89ce032344051e6ced2ba9371084b: https://github.com/armbian/build/commit/b3d2bd4864d89ce032344051e6ced2ba9371084b
|
||||
> X-Git-Archeology: Date: Wed, 30 Aug 2017 05:42:08 +0000
|
||||
> X-Git-Archeology: From: Tonymac32 <tonymckahan@gmail.com>
|
||||
> X-Git-Archeology: Subject: Meson64 Dev increase DMA block memory allocation
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 2c59bb9934b749b5df74d4134cd393dc24fd5160: https://github.com/armbian/build/commit/2c59bb9934b749b5df74d4134cd393dc24fd5160
|
||||
> X-Git-Archeology: Date: Mon, 18 Sep 2017 12:06:30 +0200
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igor.pecovnik@gmail.com>
|
||||
> X-Git-Archeology: Subject: Lepotato. Added NEXT, added patches from C2 NEXT, au, config update, removed deprecated patches, ...
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 13e94e58f04be27db51d18b7dac1d15a1864b79e: https://github.com/armbian/build/commit/13e94e58f04be27db51d18b7dac1d15a1864b79e
|
||||
> X-Git-Archeology: Date: Fri, 27 Oct 2017 16:14:21 +0300
|
||||
> X-Git-Archeology: From: zador-blood-stained <zador-blood-stained@users.noreply.github.com>
|
||||
> X-Git-Archeology: Subject: Remove random executable bits from patch files
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 2c08ec8f5a210de35f9482f482ac01ea15381792: https://github.com/armbian/build/commit/2c08ec8f5a210de35f9482f482ac01ea15381792
|
||||
> X-Git-Archeology: Date: Thu, 24 May 2018 13:32:29 +0200
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igor.pecovnik@gmail.com>
|
||||
> X-Git-Archeology: Subject: Merge sunxi family into stable
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 7d2f3af08f23049c91c88eec5062613bbfbc85d4: https://github.com/armbian/build/commit/7d2f3af08f23049c91c88eec5062613bbfbc85d4
|
||||
> X-Git-Archeology: Date: Thu, 24 May 2018 15:44:15 +0200
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igor.pecovnik@gmail.com>
|
||||
> X-Git-Archeology: Subject: Merging Rockchip family
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 99a34c7be1e342247a981f99c7930ee73c144f3e: https://github.com/armbian/build/commit/99a34c7be1e342247a981f99c7930ee73c144f3e
|
||||
> X-Git-Archeology: Date: Tue, 26 Jun 2018 12:47:49 +0000
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igor.pecovnik@gmail.com>
|
||||
> X-Git-Archeology: Subject: Move Odroid C2 from 4.14.y to 4.16.y, added patch for ethernet, DEV to master, both tested ... not perfect but in a better condition.
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision fcb85f17675990514d8fadc905e6ccc3bded7138: https://github.com/armbian/build/commit/fcb85f17675990514d8fadc905e6ccc3bded7138
|
||||
> X-Git-Archeology: Date: Thu, 28 Jun 2018 08:27:08 +0000
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igor.pecovnik@gmail.com>
|
||||
> X-Git-Archeology: Subject: Major Amlogic RFC and cleanup
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision c57ebd663cf1b15ad193d4a761f9c044ba3b2acf: https://github.com/armbian/build/commit/c57ebd663cf1b15ad193d4a761f9c044ba3b2acf
|
||||
> X-Git-Archeology: Date: Tue, 17 Jul 2018 16:11:07 +0200
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igor.pecovnik@gmail.com>
|
||||
> X-Git-Archeology: Subject: - attach Odroid XU4 4.14.y back to Hardkernel kernel branch
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision a26ccdee627f1fa27b3285e3840434cddb5aae62: https://github.com/armbian/build/commit/a26ccdee627f1fa27b3285e3840434cddb5aae62
|
||||
> X-Git-Archeology: Date: Wed, 07 Nov 2018 11:11:51 +0100
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igor.pecovnik@gmail.com>
|
||||
> X-Git-Archeology: Subject: [odroid xu4] Drop kernel 3.10.y, default -> offical 4.14.y, next = vanilla 4.19.y http://ix.io/1rcZ & dev = n/a
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision a156fddf8f5bb5a6ac28ffc528ba0ec28ff9df81: https://github.com/armbian/build/commit/a156fddf8f5bb5a6ac28ffc528ba0ec28ff9df81
|
||||
> X-Git-Archeology: Date: Fri, 18 Jan 2019 20:10:35 +0100
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igor.pecovnik@gmail.com>
|
||||
> X-Git-Archeology: Subject: [ odroidxu4 ] Reverting NEXT back to stock 4.14.y due to many troubles, DEV = 4.19.y
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 79c1c2781915c59bd24576af92b9dbe57da24fac: https://github.com/armbian/build/commit/79c1c2781915c59bd24576af92b9dbe57da24fac
|
||||
> X-Git-Archeology: Date: Fri, 17 May 2019 10:46:57 +0200
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igor.pecovnik@gmail.com>
|
||||
> X-Git-Archeology: Subject: [ odroidxu4 dev ] Move to 5.1.y
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 150ac0c2afa147d9e3b036c8ecd8238fe5648cf3: https://github.com/armbian/build/commit/150ac0c2afa147d9e3b036c8ecd8238fe5648cf3
|
||||
> X-Git-Archeology: Date: Tue, 19 Nov 2019 23:25:39 +0100
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igorpecovnik@users.noreply.github.com>
|
||||
> X-Git-Archeology: Subject: Remove K<4, change branches, new features (#1586)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 4d4c3f58ffc1cbfbb060cbabc9eb414036a2fda5: https://github.com/armbian/build/commit/4d4c3f58ffc1cbfbb060cbabc9eb414036a2fda5
|
||||
> X-Git-Archeology: Date: Wed, 02 Sep 2020 23:22:09 +0200
|
||||
> X-Git-Archeology: From: Piotr Szczepanik <piter75@gmail.com>
|
||||
> X-Git-Archeology: Subject: Switched rockchip64 curent to kernel 5.8.y (#2175)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 0cdffb29b07305209efb12cf3b5ac6032d3a1153: https://github.com/armbian/build/commit/0cdffb29b07305209efb12cf3b5ac6032d3a1153
|
||||
> X-Git-Archeology: Date: Wed, 24 Mar 2021 19:01:53 +0100
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igorpecovnik@users.noreply.github.com>
|
||||
> X-Git-Archeology: Subject: Renaming DEV branch to EDGE (#2704)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 92f1a22d76b987afa7ba555d5b509adc51d689e7: https://github.com/armbian/build/commit/92f1a22d76b987afa7ba555d5b509adc51d689e7
|
||||
> X-Git-Archeology: Date: Fri, 16 Dec 2022 13:38:13 +0100
|
||||
> X-Git-Archeology: From: Igor Pecovnik <igorpecovnik@users.noreply.github.com>
|
||||
> X-Git-Archeology: Subject: Re-add rockchip64 6.0 patches (#4575)
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision e4d413b9166e3633b40fb23382fb1045b9d0e315: https://github.com/armbian/build/commit/e4d413b9166e3633b40fb23382fb1045b9d0e315
|
||||
> X-Git-Archeology: Date: Tue, 26 Mar 2024 13:46:35 +0100
|
||||
> X-Git-Archeology: From: Paolo Sabatino <paolo.sabatino@gmail.com>
|
||||
> X-Git-Archeology: Subject: rockchip64: bump edge kernel to 6.8
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 69ca2492628b2aae217c33fde921b3840851eb14: https://github.com/armbian/build/commit/69ca2492628b2aae217c33fde921b3840851eb14
|
||||
> X-Git-Archeology: Date: Wed, 05 Jun 2024 22:18:24 +0200
|
||||
> X-Git-Archeology: From: Paolo Sabatino <paolo.sabatino@gmail.com>
|
||||
> X-Git-Archeology: Subject: rockchip64: bump edge kernel to 6.9
|
||||
> X-Git-Archeology:
|
||||
> X-Git-Archeology: - Revision 4ae0a958146810117050d0dbd359b99691a0fa0c: https://github.com/armbian/build/commit/4ae0a958146810117050d0dbd359b99691a0fa0c
|
||||
> X-Git-Archeology: Date: Mon, 22 Jul 2024 19:17:52 +0200
|
||||
> X-Git-Archeology: From: Paolo Sabatino <paolo.sabatino@gmail.com>
|
||||
> X-Git-Archeology: Subject: rockchip64: bump edge kernel to 6.10
|
||||
> X-Git-Archeology:
|
||||
---
|
||||
kernel/dma/pool.c | 8 +++-----
|
||||
1 file changed, 3 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/kernel/dma/pool.c b/kernel/dma/pool.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/kernel/dma/pool.c
|
||||
+++ b/kernel/dma/pool.c
|
||||
@@ -189,13 +189,11 @@ static int __init dma_atomic_pool_init(void)
|
||||
int ret = 0;
|
||||
|
||||
/*
|
||||
- * If coherent_pool was not used on the command line, default the pool
|
||||
- * sizes to 128KB per 1GB of memory, min 128KB, max MAX_PAGE_ORDER.
|
||||
+ * Always use 2MiB as default pool size.
|
||||
+ * See: https://forum.armbian.com/topic/4811-uas-mainline-kernel-coherent-pool-memory-size/
|
||||
*/
|
||||
if (!atomic_pool_size) {
|
||||
- unsigned long pages = totalram_pages() / (SZ_1G / SZ_128K);
|
||||
- pages = min_t(unsigned long, pages, MAX_ORDER_NR_PAGES);
|
||||
- atomic_pool_size = max_t(size_t, pages << PAGE_SHIFT, SZ_128K);
|
||||
+ atomic_pool_size = SZ_2M;
|
||||
}
|
||||
INIT_WORK(&atomic_pool_work, atomic_pool_work_fn);
|
||||
|
||||
--
|
||||
Armbian
|
||||
|
@ -0,0 +1,421 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Paolo Sabatino <paolo.sabatino@gmail.com>
|
||||
Date: Sun, 12 Jan 2025 12:36:50 +0100
|
||||
Subject: pl330: fix dma engine periodic transfers
|
||||
|
||||
---
|
||||
drivers/dma/pl330.c | 277 +++++++---
|
||||
1 file changed, 186 insertions(+), 91 deletions(-)
|
||||
|
||||
diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/dma/pl330.c
|
||||
+++ b/drivers/dma/pl330.c
|
||||
@@ -239,6 +239,7 @@ enum pl330_byteswap {
|
||||
|
||||
#define BYTE_TO_BURST(b, ccr) ((b) / BRST_SIZE(ccr) / BRST_LEN(ccr))
|
||||
#define BURST_TO_BYTE(c, ccr) ((c) * BRST_SIZE(ccr) * BRST_LEN(ccr))
|
||||
+#define BYTE_MOD_BURST_LEN(b, ccr) (((b) / BRST_SIZE(ccr)) % BRST_LEN(ccr))
|
||||
|
||||
/*
|
||||
* With 256 bytes, we can do more than 2.5MB and 5MB xfers per req
|
||||
@@ -455,9 +456,6 @@ struct dma_pl330_chan {
|
||||
enum dma_data_direction dir;
|
||||
struct dma_slave_config slave_config;
|
||||
|
||||
- /* for cyclic capability */
|
||||
- bool cyclic;
|
||||
-
|
||||
/* for runtime pm tracking */
|
||||
bool active;
|
||||
};
|
||||
@@ -545,6 +543,10 @@ struct dma_pl330_desc {
|
||||
unsigned peri:5;
|
||||
/* Hook to attach to DMAC's list of reqs with due callback */
|
||||
struct list_head rqd;
|
||||
+
|
||||
+ /* For cyclic capability */
|
||||
+ bool cyclic;
|
||||
+ size_t num_periods;
|
||||
};
|
||||
|
||||
struct _xfer_spec {
|
||||
@@ -1368,6 +1370,108 @@ static inline int _loop(struct pl330_dmac *pl330, unsigned dry_run, u8 buf[],
|
||||
return off;
|
||||
}
|
||||
|
||||
+static int _period(struct pl330_dmac *pl330, unsigned int dry_run, u8 buf[],
|
||||
+ unsigned long bursts, const struct _xfer_spec *pxs, int ev)
|
||||
+{
|
||||
+ unsigned int lcnt1, ljmp1;
|
||||
+ int cyc, off = 0, num_dregs = 0;
|
||||
+ struct _arg_LPEND lpend;
|
||||
+ struct pl330_xfer *x = &pxs->desc->px;
|
||||
+
|
||||
+ if (bursts > 256) {
|
||||
+ lcnt1 = 256;
|
||||
+ cyc = bursts / 256;
|
||||
+ } else {
|
||||
+ lcnt1 = bursts;
|
||||
+ cyc = 1;
|
||||
+ }
|
||||
+
|
||||
+ /* loop1 */
|
||||
+ off += _emit_LP(dry_run, &buf[off], 1, lcnt1);
|
||||
+ ljmp1 = off;
|
||||
+ off += _bursts(pl330, dry_run, &buf[off], pxs, cyc);
|
||||
+ lpend.cond = ALWAYS;
|
||||
+ lpend.forever = false;
|
||||
+ lpend.loop = 1;
|
||||
+ lpend.bjump = off - ljmp1;
|
||||
+ off += _emit_LPEND(dry_run, &buf[off], &lpend);
|
||||
+
|
||||
+ /* remainder */
|
||||
+ lcnt1 = bursts - (lcnt1 * cyc);
|
||||
+
|
||||
+ if (lcnt1) {
|
||||
+ off += _emit_LP(dry_run, &buf[off], 1, lcnt1);
|
||||
+ ljmp1 = off;
|
||||
+ off += _bursts(pl330, dry_run, &buf[off], pxs, 1);
|
||||
+ lpend.cond = ALWAYS;
|
||||
+ lpend.forever = false;
|
||||
+ lpend.loop = 1;
|
||||
+ lpend.bjump = off - ljmp1;
|
||||
+ off += _emit_LPEND(dry_run, &buf[off], &lpend);
|
||||
+ }
|
||||
+
|
||||
+ num_dregs = BYTE_MOD_BURST_LEN(x->bytes, pxs->ccr);
|
||||
+
|
||||
+ if (num_dregs) {
|
||||
+ off += _dregs(pl330, dry_run, &buf[off], pxs, num_dregs);
|
||||
+ off += _emit_MOV(dry_run, &buf[off], CCR, pxs->ccr);
|
||||
+ }
|
||||
+
|
||||
+ off += _emit_SEV(dry_run, &buf[off], ev);
|
||||
+
|
||||
+ return off;
|
||||
+}
|
||||
+
|
||||
+static inline int _loop_cyclic(struct pl330_dmac *pl330, unsigned int dry_run,
|
||||
+ u8 buf[], unsigned long bursts,
|
||||
+ const struct _xfer_spec *pxs, int ev)
|
||||
+{
|
||||
+ int off, periods, residue, i;
|
||||
+ unsigned int lcnt0, ljmp0, ljmpfe;
|
||||
+ struct _arg_LPEND lpend;
|
||||
+ struct pl330_xfer *x = &pxs->desc->px;
|
||||
+
|
||||
+ off = 0;
|
||||
+ ljmpfe = off;
|
||||
+ lcnt0 = pxs->desc->num_periods;
|
||||
+ periods = 1;
|
||||
+
|
||||
+ while (lcnt0 > 256) {
|
||||
+ periods++;
|
||||
+ lcnt0 = pxs->desc->num_periods / periods;
|
||||
+ }
|
||||
+
|
||||
+ residue = pxs->desc->num_periods % periods;
|
||||
+
|
||||
+ /* forever loop */
|
||||
+ off += _emit_MOV(dry_run, &buf[off], SAR, x->src_addr);
|
||||
+ off += _emit_MOV(dry_run, &buf[off], DAR, x->dst_addr);
|
||||
+
|
||||
+ /* loop0 */
|
||||
+ off += _emit_LP(dry_run, &buf[off], 0, lcnt0);
|
||||
+ ljmp0 = off;
|
||||
+
|
||||
+ for (i = 0; i < periods; i++)
|
||||
+ off += _period(pl330, dry_run, &buf[off], bursts, pxs, ev);
|
||||
+
|
||||
+ lpend.cond = ALWAYS;
|
||||
+ lpend.forever = false;
|
||||
+ lpend.loop = 0;
|
||||
+ lpend.bjump = off - ljmp0;
|
||||
+ off += _emit_LPEND(dry_run, &buf[off], &lpend);
|
||||
+
|
||||
+ for (i = 0; i < residue; i++)
|
||||
+ off += _period(pl330, dry_run, &buf[off], bursts, pxs, ev);
|
||||
+
|
||||
+ lpend.cond = ALWAYS;
|
||||
+ lpend.forever = true;
|
||||
+ lpend.loop = 1;
|
||||
+ lpend.bjump = off - ljmpfe;
|
||||
+ off += _emit_LPEND(dry_run, &buf[off], &lpend);
|
||||
+
|
||||
+ return off;
|
||||
+}
|
||||
+
|
||||
static inline int _setup_loops(struct pl330_dmac *pl330,
|
||||
unsigned dry_run, u8 buf[],
|
||||
const struct _xfer_spec *pxs)
|
||||
@@ -1407,6 +1511,21 @@ static inline int _setup_xfer(struct pl330_dmac *pl330,
|
||||
return off;
|
||||
}
|
||||
|
||||
+static inline int _setup_xfer_cyclic(struct pl330_dmac *pl330,
|
||||
+ unsigned int dry_run, u8 buf[],
|
||||
+ const struct _xfer_spec *pxs, int ev)
|
||||
+{
|
||||
+ struct pl330_xfer *x = &pxs->desc->px;
|
||||
+ u32 ccr = pxs->ccr;
|
||||
+ unsigned long bursts = BYTE_TO_BURST(x->bytes, ccr);
|
||||
+ int off = 0;
|
||||
+
|
||||
+ /* Setup Loop(s) */
|
||||
+ off += _loop_cyclic(pl330, dry_run, &buf[off], bursts, pxs, ev);
|
||||
+
|
||||
+ return off;
|
||||
+}
|
||||
+
|
||||
/*
|
||||
* A req is a sequence of one or more xfer units.
|
||||
* Returns the number of bytes taken to setup the MC for the req.
|
||||
@@ -1424,12 +1543,17 @@ static int _setup_req(struct pl330_dmac *pl330, unsigned dry_run,
|
||||
/* DMAMOV CCR, ccr */
|
||||
off += _emit_MOV(dry_run, &buf[off], CCR, pxs->ccr);
|
||||
|
||||
- off += _setup_xfer(pl330, dry_run, &buf[off], pxs);
|
||||
+ if (!pxs->desc->cyclic) {
|
||||
+ off += _setup_xfer(pl330, dry_run, &buf[off], pxs);
|
||||
|
||||
- /* DMASEV peripheral/event */
|
||||
- off += _emit_SEV(dry_run, &buf[off], thrd->ev);
|
||||
- /* DMAEND */
|
||||
- off += _emit_END(dry_run, &buf[off]);
|
||||
+ /* DMASEV peripheral/event */
|
||||
+ off += _emit_SEV(dry_run, &buf[off], thrd->ev);
|
||||
+ /* DMAEND */
|
||||
+ off += _emit_END(dry_run, &buf[off]);
|
||||
+ } else {
|
||||
+ off += _setup_xfer_cyclic(pl330, dry_run, &buf[off],
|
||||
+ pxs, thrd->ev);
|
||||
+ }
|
||||
|
||||
return off;
|
||||
}
|
||||
@@ -1703,15 +1827,17 @@ static int pl330_update(struct pl330_dmac *pl330)
|
||||
|
||||
/* Detach the req */
|
||||
descdone = thrd->req[active].desc;
|
||||
- thrd->req[active].desc = NULL;
|
||||
-
|
||||
- thrd->req_running = -1;
|
||||
-
|
||||
- /* Get going again ASAP */
|
||||
- pl330_start_thread(thrd);
|
||||
-
|
||||
- /* For now, just make a list of callbacks to be done */
|
||||
- list_add_tail(&descdone->rqd, &pl330->req_done);
|
||||
+ if (descdone) {
|
||||
+ if (!descdone->cyclic) {
|
||||
+ thrd->req[active].desc = NULL;
|
||||
+ thrd->req_running = -1;
|
||||
+ /* Get going again ASAP */
|
||||
+ pl330_start_thread(thrd);
|
||||
+ }
|
||||
+
|
||||
+ /* For now, just make a list of callbacks to be done */
|
||||
+ list_add_tail(&descdone->rqd, &pl330->req_done);
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2076,12 +2202,25 @@ static void pl330_tasklet(struct tasklet_struct *t)
|
||||
spin_lock_irqsave(&pch->lock, flags);
|
||||
|
||||
/* Pick up ripe tomatoes */
|
||||
- list_for_each_entry_safe(desc, _dt, &pch->work_list, node)
|
||||
+ list_for_each_entry_safe(desc, _dt, &pch->work_list, node) {
|
||||
if (desc->status == DONE) {
|
||||
- if (!pch->cyclic)
|
||||
+ if (!desc->cyclic) {
|
||||
dma_cookie_complete(&desc->txd);
|
||||
- list_move_tail(&desc->node, &pch->completed_list);
|
||||
+ list_move_tail(&desc->node, &pch->completed_list);
|
||||
+ } else {
|
||||
+ struct dmaengine_desc_callback cb;
|
||||
+
|
||||
+ desc->status = BUSY;
|
||||
+ dmaengine_desc_get_callback(&desc->txd, &cb);
|
||||
+
|
||||
+ if (dmaengine_desc_callback_valid(&cb)) {
|
||||
+ spin_unlock_irqrestore(&pch->lock, flags);
|
||||
+ dmaengine_desc_callback_invoke(&cb, NULL);
|
||||
+ spin_lock_irqsave(&pch->lock, flags);
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
+ }
|
||||
|
||||
/* Try to submit a req imm. next to the last completed cookie */
|
||||
fill_queue(pch);
|
||||
@@ -2107,20 +2246,8 @@ static void pl330_tasklet(struct tasklet_struct *t)
|
||||
|
||||
dmaengine_desc_get_callback(&desc->txd, &cb);
|
||||
|
||||
- if (pch->cyclic) {
|
||||
- desc->status = PREP;
|
||||
- list_move_tail(&desc->node, &pch->work_list);
|
||||
- if (power_down) {
|
||||
- pch->active = true;
|
||||
- spin_lock(&pch->thread->dmac->lock);
|
||||
- pl330_start_thread(pch->thread);
|
||||
- spin_unlock(&pch->thread->dmac->lock);
|
||||
- power_down = false;
|
||||
- }
|
||||
- } else {
|
||||
- desc->status = FREE;
|
||||
- list_move_tail(&desc->node, &pch->dmac->desc_pool);
|
||||
- }
|
||||
+ desc->status = FREE;
|
||||
+ list_move_tail(&desc->node, &pch->dmac->desc_pool);
|
||||
|
||||
dma_descriptor_unmap(&desc->txd);
|
||||
|
||||
@@ -2168,7 +2295,6 @@ static int pl330_alloc_chan_resources(struct dma_chan *chan)
|
||||
spin_lock_irqsave(&pl330->lock, flags);
|
||||
|
||||
dma_cookie_init(chan);
|
||||
- pch->cyclic = false;
|
||||
|
||||
pch->thread = pl330_request_channel(pl330);
|
||||
if (!pch->thread) {
|
||||
@@ -2367,8 +2493,7 @@ static void pl330_free_chan_resources(struct dma_chan *chan)
|
||||
pl330_release_channel(pch->thread);
|
||||
pch->thread = NULL;
|
||||
|
||||
- if (pch->cyclic)
|
||||
- list_splice_tail_init(&pch->work_list, &pch->dmac->desc_pool);
|
||||
+ list_splice_tail_init(&pch->work_list, &pch->dmac->desc_pool);
|
||||
|
||||
spin_unlock_irqrestore(&pl330->lock, flags);
|
||||
pm_runtime_mark_last_busy(pch->dmac->ddma.dev);
|
||||
@@ -2431,7 +2556,7 @@ pl330_tx_status(struct dma_chan *chan, dma_cookie_t cookie,
|
||||
|
||||
/* Check in pending list */
|
||||
list_for_each_entry(desc, &pch->work_list, node) {
|
||||
- if (desc->status == DONE)
|
||||
+ if (desc->status == DONE && !desc->cyclic)
|
||||
transferred = desc->bytes_requested;
|
||||
else if (running && desc == running)
|
||||
transferred =
|
||||
@@ -2516,10 +2641,7 @@ static dma_cookie_t pl330_tx_submit(struct dma_async_tx_descriptor *tx)
|
||||
/* Assign cookies to all nodes */
|
||||
while (!list_empty(&last->node)) {
|
||||
desc = list_entry(last->node.next, struct dma_pl330_desc, node);
|
||||
- if (pch->cyclic) {
|
||||
- desc->txd.callback = last->txd.callback;
|
||||
- desc->txd.callback_param = last->txd.callback_param;
|
||||
- }
|
||||
+
|
||||
desc->last = false;
|
||||
|
||||
dma_cookie_assign(&desc->txd);
|
||||
@@ -2622,6 +2744,9 @@ static struct dma_pl330_desc *pl330_get_desc(struct dma_pl330_chan *pch)
|
||||
desc->peri = peri_id ? pch->chan.chan_id : 0;
|
||||
desc->rqcfg.pcfg = &pch->dmac->pcfg;
|
||||
|
||||
+ desc->cyclic = false;
|
||||
+ desc->num_periods = 1;
|
||||
+
|
||||
dma_async_tx_descriptor_init(&desc->txd, &pch->chan);
|
||||
|
||||
return desc;
|
||||
@@ -2685,12 +2810,10 @@ static struct dma_async_tx_descriptor *pl330_prep_dma_cyclic(
|
||||
size_t period_len, enum dma_transfer_direction direction,
|
||||
unsigned long flags)
|
||||
{
|
||||
- struct dma_pl330_desc *desc = NULL, *first = NULL;
|
||||
+ struct dma_pl330_desc *desc = NULL;
|
||||
struct dma_pl330_chan *pch = to_pchan(chan);
|
||||
- struct pl330_dmac *pl330 = pch->dmac;
|
||||
- unsigned int i;
|
||||
- dma_addr_t dst;
|
||||
- dma_addr_t src;
|
||||
+ dma_addr_t dst = 0;
|
||||
+ dma_addr_t src = 0;
|
||||
|
||||
if (len % period_len != 0)
|
||||
return NULL;
|
||||
@@ -2706,33 +2829,14 @@ static struct dma_async_tx_descriptor *pl330_prep_dma_cyclic(
|
||||
if (!pl330_prep_slave_fifo(pch, direction))
|
||||
return NULL;
|
||||
|
||||
- for (i = 0; i < len / period_len; i++) {
|
||||
- desc = pl330_get_desc(pch);
|
||||
- if (!desc) {
|
||||
- unsigned long iflags;
|
||||
-
|
||||
- dev_err(pch->dmac->ddma.dev, "%s:%d Unable to fetch desc\n",
|
||||
- __func__, __LINE__);
|
||||
-
|
||||
- if (!first)
|
||||
- return NULL;
|
||||
-
|
||||
- spin_lock_irqsave(&pl330->pool_lock, iflags);
|
||||
-
|
||||
- while (!list_empty(&first->node)) {
|
||||
- desc = list_entry(first->node.next,
|
||||
- struct dma_pl330_desc, node);
|
||||
- list_move_tail(&desc->node, &pl330->desc_pool);
|
||||
- }
|
||||
-
|
||||
- list_move_tail(&first->node, &pl330->desc_pool);
|
||||
-
|
||||
- spin_unlock_irqrestore(&pl330->pool_lock, iflags);
|
||||
-
|
||||
- return NULL;
|
||||
- }
|
||||
+ desc = pl330_get_desc(pch);
|
||||
+ if (!desc) {
|
||||
+ dev_err(pch->dmac->ddma.dev, "%s:%d Unable to fetch desc\n",
|
||||
+ __func__, __LINE__);
|
||||
+ return NULL;
|
||||
+ }
|
||||
|
||||
- switch (direction) {
|
||||
+ switch (direction) {
|
||||
case DMA_MEM_TO_DEV:
|
||||
desc->rqcfg.src_inc = 1;
|
||||
desc->rqcfg.dst_inc = 0;
|
||||
@@ -2746,27 +2850,18 @@ static struct dma_async_tx_descriptor *pl330_prep_dma_cyclic(
|
||||
dst = dma_addr;
|
||||
break;
|
||||
default:
|
||||
- break;
|
||||
- }
|
||||
-
|
||||
- desc->rqtype = direction;
|
||||
- desc->rqcfg.brst_size = pch->burst_sz;
|
||||
- desc->rqcfg.brst_len = pch->burst_len;
|
||||
- desc->bytes_requested = period_len;
|
||||
- fill_px(&desc->px, dst, src, period_len);
|
||||
-
|
||||
- if (!first)
|
||||
- first = desc;
|
||||
- else
|
||||
- list_add_tail(&desc->node, &first->node);
|
||||
-
|
||||
- dma_addr += period_len;
|
||||
+ break;
|
||||
}
|
||||
|
||||
- if (!desc)
|
||||
- return NULL;
|
||||
+ desc->rqtype = direction;
|
||||
+ desc->rqcfg.brst_size = pch->burst_sz;
|
||||
+ desc->rqcfg.brst_len = pch->burst_len;
|
||||
+ desc->bytes_requested = len;
|
||||
+ fill_px(&desc->px, dst, src, period_len);
|
||||
|
||||
- pch->cyclic = true;
|
||||
+ desc->cyclic = true;
|
||||
+ desc->num_periods = len / period_len;
|
||||
+ desc->txd.flags = flags;
|
||||
|
||||
return &desc->txd;
|
||||
}
|
||||
--
|
||||
Armbian
|
||||
|
@ -0,0 +1,261 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Paolo Sabatino <paolo.sabatino@gmail.com>
|
||||
Date: Thu, 23 Jan 2025 20:23:50 +0100
|
||||
Subject: rockchip/64: pl330 - add support for interleaved transfers
|
||||
|
||||
original source: https://patchwork.kernel.org/project/linux-rockchip/cover/1712150304-60832-1-git-send-email-sugar.zhang@rock-chips.com/
|
||||
---
|
||||
drivers/dma/pl330.c | 168 +++++++++-
|
||||
include/linux/dmaengine.h | 1 +
|
||||
2 files changed, 163 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/dma/pl330.c
|
||||
+++ b/drivers/dma/pl330.c
|
||||
@@ -543,6 +543,8 @@ struct dma_pl330_desc {
|
||||
unsigned peri:5;
|
||||
/* Hook to attach to DMAC's list of reqs with due callback */
|
||||
struct list_head rqd;
|
||||
+ /* interleaved size */
|
||||
+ struct data_chunk sgl;
|
||||
|
||||
/* For cyclic capability */
|
||||
bool cyclic;
|
||||
@@ -579,6 +581,22 @@ static inline u32 get_revision(u32 periph_id)
|
||||
return (periph_id >> PERIPH_REV_SHIFT) & PERIPH_REV_MASK;
|
||||
}
|
||||
|
||||
+static inline u32 _emit_ADDH(unsigned dry_run, u8 buf[],
|
||||
+ enum pl330_dst da, u16 val)
|
||||
+{
|
||||
+ if (dry_run)
|
||||
+ return SZ_DMAADDH;
|
||||
+
|
||||
+ buf[0] = CMD_DMAADDH;
|
||||
+ buf[0] |= (da << 1);
|
||||
+ *((__le16 *)&buf[1]) = cpu_to_le16(val);
|
||||
+
|
||||
+ PL330_DBGCMD_DUMP(SZ_DMAADDH, "\tDMAADDH %s %u\n",
|
||||
+ da == 1 ? "DA" : "SA", val);
|
||||
+
|
||||
+ return SZ_DMAADDH;
|
||||
+}
|
||||
+
|
||||
static inline u32 _emit_END(unsigned dry_run, u8 buf[])
|
||||
{
|
||||
if (dry_run)
|
||||
@@ -1189,7 +1207,7 @@ static inline int _ldst_peripheral(struct pl330_dmac *pl330,
|
||||
const struct _xfer_spec *pxs, int cyc,
|
||||
enum pl330_cond cond)
|
||||
{
|
||||
- int off = 0;
|
||||
+ int off = 0, i = 0, burstn = 1;
|
||||
|
||||
/*
|
||||
* do FLUSHP at beginning to clear any stale dma requests before the
|
||||
@@ -1197,12 +1215,36 @@ static inline int _ldst_peripheral(struct pl330_dmac *pl330,
|
||||
*/
|
||||
if (!(pl330->quirks & PL330_QUIRK_BROKEN_NO_FLUSHP))
|
||||
off += _emit_FLUSHP(dry_run, &buf[off], pxs->desc->peri);
|
||||
+
|
||||
+ if (pxs->desc->sgl.size) {
|
||||
+ WARN_ON(BYTE_MOD_BURST_LEN(pxs->desc->sgl.size, pxs->ccr));
|
||||
+ burstn = BYTE_TO_BURST(pxs->desc->sgl.size, pxs->ccr);
|
||||
+ }
|
||||
+
|
||||
while (cyc--) {
|
||||
- off += _emit_WFP(dry_run, &buf[off], cond, pxs->desc->peri);
|
||||
- off += _emit_load(dry_run, &buf[off], cond, pxs->desc->rqtype,
|
||||
- pxs->desc->peri);
|
||||
- off += _emit_store(dry_run, &buf[off], cond, pxs->desc->rqtype,
|
||||
- pxs->desc->peri);
|
||||
+ for (i = 0; i < burstn; i++) {
|
||||
+ off += _emit_WFP(dry_run, &buf[off], cond, pxs->desc->peri);
|
||||
+ off += _emit_load(dry_run, &buf[off], cond, pxs->desc->rqtype,
|
||||
+ pxs->desc->peri);
|
||||
+ off += _emit_store(dry_run, &buf[off], cond, pxs->desc->rqtype,
|
||||
+ pxs->desc->peri);
|
||||
+ }
|
||||
+
|
||||
+ switch (pxs->desc->rqtype) {
|
||||
+ case DMA_DEV_TO_MEM:
|
||||
+ if (pxs->desc->sgl.dst_icg)
|
||||
+ off += _emit_ADDH(dry_run, &buf[off], DST,
|
||||
+ pxs->desc->sgl.dst_icg);
|
||||
+ break;
|
||||
+ case DMA_MEM_TO_DEV:
|
||||
+ if (pxs->desc->sgl.src_icg)
|
||||
+ off += _emit_ADDH(dry_run, &buf[off], SRC,
|
||||
+ pxs->desc->sgl.src_icg);
|
||||
+ break;
|
||||
+ default:
|
||||
+ WARN_ON(1);
|
||||
+ break;
|
||||
+ }
|
||||
}
|
||||
|
||||
return off;
|
||||
@@ -1483,6 +1525,9 @@ static inline int _setup_loops(struct pl330_dmac *pl330,
|
||||
BRST_SIZE(ccr);
|
||||
int off = 0;
|
||||
|
||||
+ if (pxs->desc->sgl.size)
|
||||
+ bursts = x->bytes / pxs->desc->sgl.size;
|
||||
+
|
||||
while (bursts) {
|
||||
c = bursts;
|
||||
off += _loop(pl330, dry_run, &buf[off], &c, pxs);
|
||||
@@ -2743,6 +2788,9 @@ static struct dma_pl330_desc *pl330_get_desc(struct dma_pl330_chan *pch)
|
||||
|
||||
desc->peri = peri_id ? pch->chan.chan_id : 0;
|
||||
desc->rqcfg.pcfg = &pch->dmac->pcfg;
|
||||
+ desc->sgl.size = 0;
|
||||
+ desc->sgl.src_icg = 0;
|
||||
+ desc->sgl.dst_icg = 0;
|
||||
|
||||
desc->cyclic = false;
|
||||
desc->num_periods = 1;
|
||||
@@ -2866,6 +2914,110 @@ static struct dma_async_tx_descriptor *pl330_prep_dma_cyclic(
|
||||
return &desc->txd;
|
||||
}
|
||||
|
||||
+static struct dma_async_tx_descriptor *pl330_prep_interleaved_dma(
|
||||
+ struct dma_chan *chan, struct dma_interleaved_template *xt,
|
||||
+ unsigned long flags)
|
||||
+{
|
||||
+ struct dma_pl330_desc *desc = NULL, *first = NULL;
|
||||
+ struct dma_pl330_chan *pch = to_pchan(chan);
|
||||
+ struct pl330_dmac *pl330 = pch->dmac;
|
||||
+ unsigned int i;
|
||||
+ dma_addr_t dst;
|
||||
+ dma_addr_t src;
|
||||
+ size_t size, src_icg, dst_icg, period_bytes, buffer_bytes, full_period_bytes;
|
||||
+ size_t nump = 0, numf = 0;
|
||||
+
|
||||
+ if (!xt->numf || !xt->sgl[0].size || xt->frame_size != 1)
|
||||
+ return NULL;
|
||||
+ nump = xt->nump;
|
||||
+ numf = xt->numf;
|
||||
+ size = xt->sgl[0].size;
|
||||
+ period_bytes = size * nump;
|
||||
+ buffer_bytes = size * numf;
|
||||
+
|
||||
+ if (flags & DMA_PREP_REPEAT && (!nump || (numf % nump)))
|
||||
+ return NULL;
|
||||
+
|
||||
+ src_icg = dmaengine_get_src_icg(xt, &xt->sgl[0]);
|
||||
+ dst_icg = dmaengine_get_dst_icg(xt, &xt->sgl[0]);
|
||||
+
|
||||
+ pl330_config_write(chan, &pch->slave_config, xt->dir);
|
||||
+
|
||||
+ if (!pl330_prep_slave_fifo(pch, xt->dir))
|
||||
+ return NULL;
|
||||
+
|
||||
+ for (i = 0; i < numf / nump; i++) {
|
||||
+ desc = pl330_get_desc(pch);
|
||||
+ if (!desc) {
|
||||
+ unsigned long iflags;
|
||||
+
|
||||
+ dev_err(pch->dmac->ddma.dev, "%s:%d Unable to fetch desc\n",
|
||||
+ __func__, __LINE__);
|
||||
+
|
||||
+ if (!first)
|
||||
+ return NULL;
|
||||
+
|
||||
+ spin_lock_irqsave(&pl330->pool_lock, iflags);
|
||||
+
|
||||
+ while (!list_empty(&first->node)) {
|
||||
+ desc = list_entry(first->node.next,
|
||||
+ struct dma_pl330_desc, node);
|
||||
+ list_move_tail(&desc->node, &pl330->desc_pool);
|
||||
+ }
|
||||
+
|
||||
+ list_move_tail(&first->node, &pl330->desc_pool);
|
||||
+
|
||||
+ spin_unlock_irqrestore(&pl330->pool_lock, iflags);
|
||||
+
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ switch (xt->dir) {
|
||||
+ case DMA_MEM_TO_DEV:
|
||||
+ desc->rqcfg.src_inc = 1;
|
||||
+ desc->rqcfg.dst_inc = 0;
|
||||
+ src = xt->src_start + period_bytes * i;
|
||||
+ dst = pch->fifo_dma;
|
||||
+ full_period_bytes = (size + src_icg) * nump;
|
||||
+ break;
|
||||
+ case DMA_DEV_TO_MEM:
|
||||
+ desc->rqcfg.src_inc = 0;
|
||||
+ desc->rqcfg.dst_inc = 1;
|
||||
+ src = pch->fifo_dma;
|
||||
+ dst = xt->dst_start + period_bytes * i;
|
||||
+ full_period_bytes = (size + dst_icg) * nump;
|
||||
+ break;
|
||||
+ default:
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ desc->rqtype = xt->dir;
|
||||
+ desc->rqcfg.brst_size = pch->burst_sz;
|
||||
+ desc->rqcfg.brst_len = pch->burst_len;
|
||||
+ desc->bytes_requested = full_period_bytes;
|
||||
+ desc->sgl.size = size;
|
||||
+ desc->sgl.src_icg = src_icg;
|
||||
+ desc->sgl.dst_icg = dst_icg;
|
||||
+ fill_px(&desc->px, dst, src, period_bytes);
|
||||
+
|
||||
+ if (!first)
|
||||
+ first = desc;
|
||||
+ else
|
||||
+ list_add_tail(&desc->node, &first->node);
|
||||
+ }
|
||||
+
|
||||
+ if (!desc)
|
||||
+ return NULL;
|
||||
+
|
||||
+ if (flags & DMA_PREP_REPEAT)
|
||||
+ desc->cyclic = true;
|
||||
+
|
||||
+ dev_dbg(chan->device->dev, "size: %zu, src_icg: %zu, dst_icg: %zu, nump: %zu, numf: %zu\n",
|
||||
+ size, src_icg, dst_icg, nump, numf);
|
||||
+
|
||||
+ return &desc->txd;
|
||||
+}
|
||||
+
|
||||
static struct dma_async_tx_descriptor *
|
||||
pl330_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dst,
|
||||
dma_addr_t src, size_t len, unsigned long flags)
|
||||
@@ -3221,12 +3373,16 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id)
|
||||
dma_cap_set(DMA_SLAVE, pd->cap_mask);
|
||||
dma_cap_set(DMA_CYCLIC, pd->cap_mask);
|
||||
dma_cap_set(DMA_PRIVATE, pd->cap_mask);
|
||||
+ dma_cap_set(DMA_INTERLEAVE, pd->cap_mask);
|
||||
+ dma_cap_set(DMA_REPEAT, pd->cap_mask);
|
||||
+ dma_cap_set(DMA_LOAD_EOT, pd->cap_mask);
|
||||
}
|
||||
|
||||
pd->device_alloc_chan_resources = pl330_alloc_chan_resources;
|
||||
pd->device_free_chan_resources = pl330_free_chan_resources;
|
||||
pd->device_prep_dma_memcpy = pl330_prep_dma_memcpy;
|
||||
pd->device_prep_dma_cyclic = pl330_prep_dma_cyclic;
|
||||
+ pd->device_prep_interleaved_dma = pl330_prep_interleaved_dma;
|
||||
pd->device_tx_status = pl330_tx_status;
|
||||
pd->device_prep_slave_sg = pl330_prep_slave_sg;
|
||||
pd->device_config = pl330_config;
|
||||
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/include/linux/dmaengine.h
|
||||
+++ b/include/linux/dmaengine.h
|
||||
@@ -156,6 +156,7 @@ struct dma_interleaved_template {
|
||||
bool src_sgl;
|
||||
bool dst_sgl;
|
||||
size_t numf;
|
||||
+ size_t nump;
|
||||
size_t frame_size;
|
||||
struct data_chunk sgl[];
|
||||
};
|
||||
--
|
||||
Armbian
|
||||
|
@ -0,0 +1,27 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Paolo Sabatino <paolo.sabatino@gmail.com>
|
||||
Date: Sun, 26 Jan 2025 14:49:18 +0100
|
||||
Subject: increase pl330 microcode buffer size
|
||||
|
||||
suggestion comes from the scatter/gather functionality as
|
||||
proposed here: https://github.com/radxa/kernel/commit/ec0b65dbc59793426b6dc7af06ab6675f4a24940
|
||||
---
|
||||
drivers/dma/pl330.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/dma/pl330.c
|
||||
+++ b/drivers/dma/pl330.c
|
||||
@@ -247,7 +247,7 @@ enum pl330_byteswap {
|
||||
* For typical scenario, at 1word/burst, 10MB and 20MB xfers per req
|
||||
* should be enough for P<->M and M<->M respectively.
|
||||
*/
|
||||
-#define MCODE_BUFF_PER_REQ 256
|
||||
+#define MCODE_BUFF_PER_REQ 512
|
||||
|
||||
/* Use this _only_ to wait on transient states */
|
||||
#define UNTIL(t, s) while (!(_state(t) & (s))) cpu_relax();
|
||||
--
|
||||
Armbian
|
||||
|
@ -0,0 +1,81 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Sugar Zhang <sugar.zhang@rock-chips.com>
|
||||
Date: Sat, 26 Mar 2022 18:01:21 +0800
|
||||
Subject: dmaengine: pl330: Fix unbalanced runtime PM
|
||||
|
||||
This driver use runtime PM autosuspend mechanism to manager clk.
|
||||
|
||||
pm_runtime_use_autosuspend(&adev->dev);
|
||||
pm_runtime_set_autosuspend_delay(&adev->dev, PL330_AUTOSUSPEND_DELAY);
|
||||
|
||||
So, after ref count reached to zero, it will enter suspend
|
||||
after the delay time elapsed.
|
||||
|
||||
The unbalanced PM:
|
||||
|
||||
* May cause dmac the next start failed.
|
||||
* May cause dmac read unexpected state.
|
||||
* May cause dmac stall if power down happen at the middle of the transfer.
|
||||
e.g. may lose ack from AXI bus and stall.
|
||||
|
||||
Considering the following situation:
|
||||
|
||||
DMA TERMINATE TASKLET ROUTINE
|
||||
| |
|
||||
| issue_pending
|
||||
| |
|
||||
| pch->active = true
|
||||
| pm_runtime_get
|
||||
pm_runtime_put(if active) |
|
||||
pch->active = false |
|
||||
| work_list empty
|
||||
| |
|
||||
| pm_runtime_put(force)
|
||||
| |
|
||||
|
||||
At this point, it's unbalanced(1 get / 2 put).
|
||||
|
||||
After this patch:
|
||||
|
||||
DMA TERMINATE TASKLET ROUTINE
|
||||
| |
|
||||
| issue_pending
|
||||
| |
|
||||
| pch->active = true
|
||||
| pm_runtime_get
|
||||
pm_runtime_put(if active) |
|
||||
pch->active = false |
|
||||
| work_list empty
|
||||
| |
|
||||
| pm_runtime_put(if active)
|
||||
| |
|
||||
|
||||
Now, it's balanced(1 get / 1 put).
|
||||
|
||||
Fixes:
|
||||
commit 5c9e6c2b2ba3 ("dmaengine: pl330: Fix runtime PM support for terminated transfers")
|
||||
commit ae43b3289186 ("ARM: 8202/1: dmaengine: pl330: Add runtime Power Management support v12")
|
||||
|
||||
Change-Id: Ib1feb508c16afb4bc9ced0c3660f2b6b4a19c068
|
||||
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
|
||||
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
|
||||
---
|
||||
drivers/dma/pl330.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/dma/pl330.c
|
||||
+++ b/drivers/dma/pl330.c
|
||||
@@ -2274,7 +2274,7 @@ static void pl330_tasklet(struct tasklet_struct *t)
|
||||
spin_lock(&pch->thread->dmac->lock);
|
||||
_stop(pch->thread);
|
||||
spin_unlock(&pch->thread->dmac->lock);
|
||||
- power_down = true;
|
||||
+ power_down = pch->active;
|
||||
pch->active = false;
|
||||
} else {
|
||||
/* Make sure the PL330 Channel thread is active */
|
||||
--
|
||||
Armbian
|
||||
|
@ -0,0 +1,70 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Paolo Sabatino <paolo.sabatino@gmail.com>
|
||||
Date: Sun, 16 Feb 2025 11:15:55 +0100
|
||||
Subject: pl330: fix buffer underrun with cyclic dma
|
||||
|
||||
userspace applications (notably, pulseaudio) were
|
||||
suffering frequent buffer underruns when cyclic DMA
|
||||
was handled by controller itself. This patch fixes
|
||||
the buffer underruns avoiding to juggle with the
|
||||
descriptor state, keeping it in BUSY state as long
|
||||
as it is actual transfer is progressing.
|
||||
---
|
||||
drivers/dma/pl330.c | 24 +++++-----
|
||||
1 file changed, 12 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/dma/pl330.c
|
||||
+++ b/drivers/dma/pl330.c
|
||||
@@ -1737,11 +1737,11 @@ static void dma_pl330_rqcb(struct dma_pl330_desc *desc, enum pl330_op_err err)
|
||||
if (!pch)
|
||||
return;
|
||||
|
||||
- spin_lock_irqsave(&pch->lock, flags);
|
||||
-
|
||||
- desc->status = DONE;
|
||||
-
|
||||
- spin_unlock_irqrestore(&pch->lock, flags);
|
||||
+ if (!desc->cyclic) {
|
||||
+ spin_lock_irqsave(&pch->lock, flags);
|
||||
+ desc->status = DONE;
|
||||
+ spin_unlock_irqrestore(&pch->lock, flags);
|
||||
+ }
|
||||
|
||||
tasklet_schedule(&pch->task);
|
||||
}
|
||||
@@ -2248,23 +2248,23 @@ static void pl330_tasklet(struct tasklet_struct *t)
|
||||
|
||||
/* Pick up ripe tomatoes */
|
||||
list_for_each_entry_safe(desc, _dt, &pch->work_list, node) {
|
||||
- if (desc->status == DONE) {
|
||||
- if (!desc->cyclic) {
|
||||
- dma_cookie_complete(&desc->txd);
|
||||
- list_move_tail(&desc->node, &pch->completed_list);
|
||||
- } else {
|
||||
- struct dmaengine_desc_callback cb;
|
||||
|
||||
+ if (desc->cyclic) {
|
||||
+ if (desc->status == BUSY || desc->status == DONE) {
|
||||
+ struct dmaengine_desc_callback cb;
|
||||
desc->status = BUSY;
|
||||
dmaengine_desc_get_callback(&desc->txd, &cb);
|
||||
-
|
||||
if (dmaengine_desc_callback_valid(&cb)) {
|
||||
spin_unlock_irqrestore(&pch->lock, flags);
|
||||
dmaengine_desc_callback_invoke(&cb, NULL);
|
||||
spin_lock_irqsave(&pch->lock, flags);
|
||||
}
|
||||
}
|
||||
+ } else if (desc->status == DONE) {
|
||||
+ dma_cookie_complete(&desc->txd);
|
||||
+ list_move_tail(&desc->node, &pch->completed_list);
|
||||
}
|
||||
+
|
||||
}
|
||||
|
||||
/* Try to submit a req imm. next to the last completed cookie */
|
||||
--
|
||||
Armbian
|
||||
|
@ -0,0 +1,51 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Piotr Szczepanik <piter75@gmail.com>
|
||||
Date: Sun, 24 Jan 2021 16:14:06 +0100
|
||||
Subject: add possibility of disabling rk808-rtc
|
||||
|
||||
To disable rk808-rtc driver from loading for specific board
|
||||
add the following stanza to rk808 node in device tree:
|
||||
|
||||
rtc {
|
||||
compatible = "rk808-rtc";
|
||||
status = "disabled";
|
||||
}
|
||||
|
||||
This is needed for roc-rk3399-pc plus (a.k.a. Station P1).
|
||||
Without the change rk808's rtc is initialised and used for time keeping
|
||||
although there is another rtc (hym8563) that should be actually used.
|
||||
|
||||
Signed-off-by: Piotr Szczepanik <piter75@gmail.com>
|
||||
---
|
||||
drivers/mfd/mfd-core.c | 2 +-
|
||||
drivers/mfd/rk8xx-core.c | 1 +
|
||||
2 files changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/mfd/mfd-core.c
|
||||
+++ b/drivers/mfd/mfd-core.c
|
||||
@@ -208,7 +208,7 @@ static int mfd_add_device(struct device *parent, int id,
|
||||
|
||||
match:
|
||||
if (!pdev->dev.of_node)
|
||||
- pr_warn("%s: Failed to locate of_node [id: %d]\n",
|
||||
+ pr_debug("%s: Failed to locate of_node [id: %d]\n",
|
||||
cell->name, platform_id);
|
||||
}
|
||||
|
||||
diff --git a/drivers/mfd/rk8xx-core.c b/drivers/mfd/rk8xx-core.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/mfd/rk8xx-core.c
|
||||
+++ b/drivers/mfd/rk8xx-core.c
|
||||
@@ -133,6 +133,7 @@ static const struct mfd_cell rk818s[] = {
|
||||
{ .name = "rk808-regulator", },
|
||||
{
|
||||
.name = "rk808-rtc",
|
||||
+ .of_compatible = "rk808-rtc",
|
||||
.num_resources = ARRAY_SIZE(rtc_resources),
|
||||
.resources = rtc_resources,
|
||||
},
|
||||
--
|
||||
Armbian
|
||||
|
@ -0,0 +1,104 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Piotr Szczepanik <piter75@gmail.com>
|
||||
Date: Tue, 2 Mar 2021 21:07:22 +0100
|
||||
Subject: allows to change the way that BUCK1 and BUCK2 of rk808 PMIC
|
||||
|
||||
This patch allows to change the way that BUCK1 and BUCK2 of rk808 PMIC set voltage.
|
||||
|
||||
It allows to change the hardcoded max. 100mV per one change
|
||||
to any multiple of 12.5mV while keeping the 100mV default.
|
||||
|
||||
It was observed that making the steps smaller (eg. 50mV = 4 * 12.5mV)
|
||||
makes the NanoPi M4V2 running stable.
|
||||
|
||||
One can configure the max number of steps per single change using
|
||||
the "max-buck-steps-per-change" property of rk808 node in device tree.
|
||||
|
||||
Below example ensures that voltage is not changed in jumps larger than 50mV:
|
||||
|
||||
&rk808 {
|
||||
max-buck-steps-per-change = <4>;
|
||||
}
|
||||
|
||||
Be aware that changing this parameter affects the time taken to switch between
|
||||
OPPs of LiTTLE cores of rk3399.
|
||||
|
||||
For overclocked LiTTLE cores with base 408MHz @ 0.825V
|
||||
and max. 1.5GHz @ 1.2V it will take 7 steps of 50mV (at least 65uS each - caused by i2c),
|
||||
the final 25mV step and 1uS to settle: 7 x 65uS + 1uS = 456uS.
|
||||
|
||||
With default setting it would be 3 steps of 100mV (at least 65uS each - caused by i2c),
|
||||
the final 75mV step and 1uS to settle: 3 x 65uS + 1uS = 196uS.
|
||||
|
||||
- rpardini: fix 'client_dev' -> 'dev' (for '->of_node') for 6.5.y
|
||||
|
||||
Signed-off-by: Piotr Szczepanik <piter75@gmail.com>
|
||||
Signed-off-by: Ricardo Pardini <ricardo@pardini.net>
|
||||
---
|
||||
drivers/regulator/rk808-regulator.c | 17 +++++++---
|
||||
1 file changed, 13 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/drivers/regulator/rk808-regulator.c b/drivers/regulator/rk808-regulator.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/regulator/rk808-regulator.c
|
||||
+++ b/drivers/regulator/rk808-regulator.c
|
||||
@@ -207,6 +207,7 @@ struct rk8xx_register_bit {
|
||||
|
||||
struct rk808_regulator_data {
|
||||
struct gpio_desc *dvs_gpio[2];
|
||||
+ unsigned max_buck_steps_per_change;
|
||||
};
|
||||
|
||||
static const struct linear_range rk808_ldo3_voltage_ranges[] = {
|
||||
@@ -419,7 +420,8 @@ static int rk808_buck1_2_get_voltage_sel_regmap(struct regulator_dev *rdev)
|
||||
}
|
||||
|
||||
static int rk808_buck1_2_i2c_set_voltage_sel(struct regulator_dev *rdev,
|
||||
- unsigned sel)
|
||||
+ unsigned sel,
|
||||
+ int max_steps)
|
||||
{
|
||||
int ret, delta_sel;
|
||||
unsigned int old_sel, tmp, val, mask = rdev->desc->vsel_mask;
|
||||
@@ -438,8 +440,8 @@ static int rk808_buck1_2_i2c_set_voltage_sel(struct regulator_dev *rdev,
|
||||
* the risk of overshoot. Put it into a multi-step, can effectively
|
||||
* avoid this problem, a step is 100mv here.
|
||||
*/
|
||||
- while (delta_sel > MAX_STEPS_ONE_TIME) {
|
||||
- old_sel += MAX_STEPS_ONE_TIME;
|
||||
+ while (delta_sel > max_steps) {
|
||||
+ old_sel += max_steps;
|
||||
val = old_sel << (ffs(mask) - 1);
|
||||
val |= tmp;
|
||||
|
||||
@@ -473,12 +475,13 @@ static int rk808_buck1_2_set_voltage_sel(struct regulator_dev *rdev,
|
||||
struct rk808_regulator_data *pdata = rdev_get_drvdata(rdev);
|
||||
int id = rdev_get_id(rdev);
|
||||
struct gpio_desc *gpio = pdata->dvs_gpio[id];
|
||||
+ int max_steps = pdata->max_buck_steps_per_change;
|
||||
unsigned int reg = rdev->desc->vsel_reg;
|
||||
unsigned old_sel;
|
||||
int ret, gpio_level;
|
||||
|
||||
if (!gpio)
|
||||
- return rk808_buck1_2_i2c_set_voltage_sel(rdev, sel);
|
||||
+ return rk808_buck1_2_i2c_set_voltage_sel(rdev, sel, max_steps);
|
||||
|
||||
gpio_level = gpiod_get_value(gpio);
|
||||
if (gpio_level == 0) {
|
||||
@@ -1860,6 +1863,12 @@ static int rk808_regulator_dt_parse_pdata(struct device *dev, struct regmap *map
|
||||
gpiod_is_active_low(pdata->dvs_gpio[i]) ? 0 : tmp);
|
||||
}
|
||||
|
||||
+ tmp = of_property_read_u32(dev->of_node, "max-buck-steps-per-change", &pdata->max_buck_steps_per_change);
|
||||
+ if (tmp) {
|
||||
+ pdata->max_buck_steps_per_change = MAX_STEPS_ONE_TIME;
|
||||
+ }
|
||||
+ dev_info(dev, "max buck steps per change: %d\n", pdata->max_buck_steps_per_change);
|
||||
+
|
||||
dt_parse_end:
|
||||
of_node_put(np);
|
||||
return ret;
|
||||
--
|
||||
Armbian
|
||||
|
30
patch/kernel/rockchip64-6.16/general-rockchip-overlays.patch
Normal file
30
patch/kernel/rockchip64-6.16/general-rockchip-overlays.patch
Normal file
@ -0,0 +1,30 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Martin Ayotte <martinayotte@yahoo.ca>
|
||||
Date: Wed, 5 Dec 2018 15:00:44 -0500
|
||||
Subject: add overlays framework for rockchip (scripts/Makefile.build only)
|
||||
|
||||
- rpardini: real overlays are now bare in "overlay" directory and are handled
|
||||
directly by the patching scripts. No more null-patching of overlays.
|
||||
|
||||
Signed-off-by: Werner <werner@armbian.com>
|
||||
---
|
||||
scripts/Makefile.build | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/scripts/Makefile.build
|
||||
+++ b/scripts/Makefile.build
|
||||
@@ -107,6 +107,9 @@ always-y += $(hostprogs-always-y) $(hostprogs-always-m)
|
||||
userprogs += $(userprogs-always-y) $(userprogs-always-m)
|
||||
always-y += $(userprogs-always-y) $(userprogs-always-m)
|
||||
|
||||
+# Overlay targets
|
||||
+extra-y += $(dtbo-y) $(scr-y) $(dtbotxt-y)
|
||||
+
|
||||
# Add subdir path
|
||||
|
||||
ifneq ($(obj),.)
|
||||
--
|
||||
Armbian
|
||||
|
203
patch/kernel/rockchip64-6.16/general-st7796-driver.patch
Normal file
203
patch/kernel/rockchip64-6.16/general-st7796-driver.patch
Normal file
@ -0,0 +1,203 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Maxim Medvedev <redrathnure@gmail.com>
|
||||
Date: Fri, 12 May 2023 22:30:14 +0000
|
||||
Subject: Custom st7796 display module
|
||||
|
||||
---
|
||||
drivers/staging/fbtft/Kconfig | 6 +
|
||||
drivers/staging/fbtft/Makefile | 1 +
|
||||
drivers/staging/fbtft/fb_st7796.c | 154 ++++++++++
|
||||
3 files changed, 161 insertions(+)
|
||||
|
||||
diff --git a/drivers/staging/fbtft/Kconfig b/drivers/staging/fbtft/Kconfig
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/staging/fbtft/Kconfig
|
||||
+++ b/drivers/staging/fbtft/Kconfig
|
||||
@@ -70,6 +70,12 @@ config FB_TFT_ILI9481
|
||||
help
|
||||
Generic Framebuffer support for ILI9481
|
||||
|
||||
+config FB_TFT_ST7796
|
||||
+ tristate "FB driver for the ST7796 LCD Controller"
|
||||
+ depends on FB_TFT
|
||||
+ help
|
||||
+ Generic Framebuffer support for ST7796
|
||||
+
|
||||
config FB_TFT_ILI9486
|
||||
tristate "FB driver for the ILI9486 LCD Controller"
|
||||
help
|
||||
diff --git a/drivers/staging/fbtft/Makefile b/drivers/staging/fbtft/Makefile
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/staging/fbtft/Makefile
|
||||
+++ b/drivers/staging/fbtft/Makefile
|
||||
@@ -16,6 +16,7 @@ obj-$(CONFIG_FB_TFT_ILI9325) += fb_ili9325.o
|
||||
obj-$(CONFIG_FB_TFT_ILI9340) += fb_ili9340.o
|
||||
obj-$(CONFIG_FB_TFT_ILI9341) += fb_ili9341.o
|
||||
obj-$(CONFIG_FB_TFT_ILI9481) += fb_ili9481.o
|
||||
+obj-$(CONFIG_FB_TFT_ST7796) += fb_st7796.o
|
||||
obj-$(CONFIG_FB_TFT_ILI9486) += fb_ili9486.o
|
||||
obj-$(CONFIG_FB_TFT_PCD8544) += fb_pcd8544.o
|
||||
obj-$(CONFIG_FB_TFT_RA8875) += fb_ra8875.o
|
||||
diff --git a/drivers/staging/fbtft/fb_st7796.c b/drivers/staging/fbtft/fb_st7796.c
|
||||
new file mode 100755
|
||||
index 000000000000..111111111111
|
||||
--- /dev/null
|
||||
+++ b/drivers/staging/fbtft/fb_st7796.c
|
||||
@@ -0,0 +1,154 @@
|
||||
+// SPDX-License-Identifier: GPL-2.0+
|
||||
+/*
|
||||
+ * FB driver for the ST7796 LCD display controller
|
||||
+ *
|
||||
+ * Based on ILI9486 from Christian Vogelgsang and adafruit22fb.c by Noralf Tronnes.
|
||||
+ */
|
||||
+
|
||||
+#include <linux/module.h>
|
||||
+#include <linux/kernel.h>
|
||||
+#include <linux/init.h>
|
||||
+#include <linux/delay.h>
|
||||
+#include <video/mipi_display.h>
|
||||
+
|
||||
+#include "fbtft.h"
|
||||
+
|
||||
+// Patch from MKS - start
|
||||
+
|
||||
+#define DRVNAME "fb_st7796"
|
||||
+#define WIDTH 320
|
||||
+#define HEIGHT 480
|
||||
+#define TXBUFLEN 0xfffe // (4 * PAGE_SIZE)
|
||||
+
|
||||
+ // Patch from MKS - end
|
||||
+
|
||||
+#define DEFAULT_GAMMA "1F 1A 18 0A 0F 06 45 87 32 0A 07 02 07 05 00\n" \
|
||||
+ "00 25 27 05 10 09 3A 78 4D 05 18 0D 38 3A 1F"
|
||||
+
|
||||
+static int init_display(struct fbtft_par *par)
|
||||
+{
|
||||
+ par->fbtftops.reset(par);
|
||||
+
|
||||
+ /* startup sequence for MI0283QT-9A */
|
||||
+ write_reg(par, MIPI_DCS_SOFT_RESET);
|
||||
+ mdelay(5);
|
||||
+ write_reg(par, MIPI_DCS_SET_DISPLAY_OFF);
|
||||
+
|
||||
+ // Patch from MKS - start
|
||||
+
|
||||
+ /*these are for st7796*/
|
||||
+ /* --------------------------------------------------------- */
|
||||
+ write_reg(par, 0xf0, 0xc3);
|
||||
+ write_reg(par, 0xf0, 0x96);
|
||||
+ write_reg(par, 0x36, 0x28);
|
||||
+ write_reg(par, 0x3A, 0x55);
|
||||
+ write_reg(par, 0xB4, 0x01);
|
||||
+ write_reg(par, 0xB7, 0xc6);
|
||||
+ write_reg(par, 0xE8, 0x40, 0x8a, 0x00, 0x00, 0x29, 0x19, 0xa5, 0x33);
|
||||
+ write_reg(par, 0xc1, 0x06);
|
||||
+ write_reg(par, 0xc2, 0xa7);
|
||||
+ write_reg(par, 0xc5, 0x18);
|
||||
+ write_reg(par, 0xE0, 0xf0, 0x09, 0x0b, 0x06, 0x04, 0x15, 0x2f, 0x54, 0x42, 0x3c, 0x17, 0x14, 0x18, 0x1b);
|
||||
+ write_reg(par, 0xE1, 0xf0, 0x09, 0x0b, 0x06, 0x04, 0x03, 0x2d, 0x43, 0x42, 0x3b, 0x16, 0x14, 0x17, 0x1b);
|
||||
+ write_reg(par, 0xf0, 0x3c);
|
||||
+ write_reg(par, 0xf0, 0x69);
|
||||
+ write_reg(par, 0x11);
|
||||
+ mdelay(100);
|
||||
+ write_reg(par, 0x29);
|
||||
+ mdelay(20);
|
||||
+
|
||||
+ // Patch from MKS - end
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static void set_addr_win(struct fbtft_par *par, int xs, int ys, int xe, int ye)
|
||||
+{
|
||||
+ write_reg(par, MIPI_DCS_SET_COLUMN_ADDRESS,
|
||||
+ (xs >> 8) & 0xFF, xs & 0xFF, (xe >> 8) & 0xFF, xe & 0xFF);
|
||||
+
|
||||
+ write_reg(par, MIPI_DCS_SET_PAGE_ADDRESS,
|
||||
+ (ys >> 8) & 0xFF, ys & 0xFF, (ye >> 8) & 0xFF, ye & 0xFF);
|
||||
+
|
||||
+ write_reg(par, MIPI_DCS_WRITE_MEMORY_START);
|
||||
+}
|
||||
+
|
||||
+#define MEM_Y BIT(7) /* MY row address order */
|
||||
+#define MEM_X BIT(6) /* MX column address order */
|
||||
+#define MEM_V BIT(5) /* MV row / column exchange */
|
||||
+#define MEM_L BIT(4) /* ML vertical refresh order */
|
||||
+#define MEM_H BIT(2) /* MH horizontal refresh order */
|
||||
+#define MEM_BGR (3) /* RGB-BGR Order */
|
||||
+static int set_var(struct fbtft_par *par)
|
||||
+{
|
||||
+ switch (par->info->var.rotate) {
|
||||
+ case 0:
|
||||
+ write_reg(par, MIPI_DCS_SET_ADDRESS_MODE,
|
||||
+ MEM_X | (par->bgr << MEM_BGR));
|
||||
+ break;
|
||||
+ case 270:
|
||||
+ write_reg(par, MIPI_DCS_SET_ADDRESS_MODE,
|
||||
+ MEM_V | MEM_L | (par->bgr << MEM_BGR));
|
||||
+ break;
|
||||
+ case 180:
|
||||
+ write_reg(par, MIPI_DCS_SET_ADDRESS_MODE,
|
||||
+ MEM_Y | (par->bgr << MEM_BGR));
|
||||
+ break;
|
||||
+ case 90:
|
||||
+ write_reg(par, MIPI_DCS_SET_ADDRESS_MODE,
|
||||
+ MEM_Y | MEM_X | MEM_V | (par->bgr << MEM_BGR));
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * Gamma string format:
|
||||
+ * Positive: Par1 Par2 [...] Par15
|
||||
+ * Negative: Par1 Par2 [...] Par15
|
||||
+ */
|
||||
+#define CURVE(num, idx) curves[(num) * par->gamma.num_values + (idx)]
|
||||
+static int set_gamma(struct fbtft_par *par, u32 *curves)
|
||||
+{
|
||||
+ int i;
|
||||
+
|
||||
+ for (i = 0; i < par->gamma.num_curves; i++)
|
||||
+ write_reg(par, 0xE0 + i,
|
||||
+ CURVE(i, 0), CURVE(i, 1), CURVE(i, 2),
|
||||
+ CURVE(i, 3), CURVE(i, 4), CURVE(i, 5),
|
||||
+ CURVE(i, 6), CURVE(i, 7), CURVE(i, 8),
|
||||
+ CURVE(i, 9), CURVE(i, 10), CURVE(i, 11),
|
||||
+ CURVE(i, 12), CURVE(i, 13), CURVE(i, 14));
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+#undef CURVE
|
||||
+
|
||||
+static struct fbtft_display display = {
|
||||
+ .regwidth = 8,
|
||||
+ .width = WIDTH,
|
||||
+ .height = HEIGHT,
|
||||
+ .txbuflen = TXBUFLEN,
|
||||
+ .gamma_num = 2,
|
||||
+ .gamma_len = 15,
|
||||
+ .gamma = DEFAULT_GAMMA,
|
||||
+ .fbtftops = {
|
||||
+ .init_display = init_display,
|
||||
+ .set_addr_win = set_addr_win,
|
||||
+ .set_var = set_var,
|
||||
+ .set_gamma = set_gamma,
|
||||
+ },
|
||||
+};
|
||||
+
|
||||
+FBTFT_REGISTER_DRIVER(DRVNAME, "ilitek,st7796", &display);
|
||||
+
|
||||
+MODULE_ALIAS("spi:" DRVNAME);
|
||||
+MODULE_ALIAS("platform:" DRVNAME);
|
||||
+MODULE_ALIAS("spi:st7796");
|
||||
+MODULE_ALIAS("platform:st7796");
|
||||
+
|
||||
+MODULE_DESCRIPTION("FB driver for the ST7796 LCD display controller");
|
||||
+MODULE_AUTHOR("Christian Vogelgsang + somebody from makerbase");
|
||||
+MODULE_LICENSE("GPL");
|
||||
--
|
||||
Armbian
|
||||
|
1808
patch/kernel/rockchip64-6.16/general-v4l2-iep-driver.patch
Normal file
1808
patch/kernel/rockchip64-6.16/general-v4l2-iep-driver.patch
Normal file
File diff suppressed because it is too large
Load Diff
491
patch/kernel/rockchip64-6.16/general-v4l2-rkvdec-01-vp9.patch
Normal file
491
patch/kernel/rockchip64-6.16/general-v4l2-rkvdec-01-vp9.patch
Normal file
@ -0,0 +1,491 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jonas Karlman <jonas@kwiboo.se>
|
||||
Date: Sat, 23 May 2020 10:16:01 +0000
|
||||
Subject: WIP: media: rkvdec: pm runtime dont use autosuspend before disable
|
||||
and cleanup
|
||||
|
||||
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
|
||||
---
|
||||
drivers/staging/media/rkvdec/rkvdec.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/staging/media/rkvdec/rkvdec.c
|
||||
+++ b/drivers/staging/media/rkvdec/rkvdec.c
|
||||
@@ -1176,9 +1176,9 @@ static void rkvdec_remove(struct platform_device *pdev)
|
||||
|
||||
cancel_delayed_work_sync(&rkvdec->watchdog_work);
|
||||
|
||||
- rkvdec_v4l2_cleanup(rkvdec);
|
||||
- pm_runtime_disable(&pdev->dev);
|
||||
pm_runtime_dont_use_autosuspend(&pdev->dev);
|
||||
+ pm_runtime_disable(&pdev->dev);
|
||||
+ rkvdec_v4l2_cleanup(rkvdec);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
--
|
||||
Armbian
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Randy Li <ayaka@soulik.info>
|
||||
Date: Sun, 6 Jan 2019 01:48:37 +0800
|
||||
Subject: soc: rockchip: power-domain: export idle request
|
||||
|
||||
We need to put the power status of HEVC IP into IDLE unless
|
||||
we can't reset that IP or the SoC would crash down.
|
||||
rockchip_pmu_idle_request(dev, true)---> enter idle
|
||||
rockchip_pmu_idle_request(dev, false)---> exit idle
|
||||
|
||||
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
|
||||
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
|
||||
Signed-off-by: Randy Li <ayaka@soulik.info>
|
||||
---
|
||||
drivers/pmdomain/rockchip/pm-domains.c | 23 ++++++++++
|
||||
include/linux/rockchip_pmu.h | 15 ++++++
|
||||
include/soc/rockchip/pm_domains.h | 6 +++
|
||||
3 files changed, 44 insertions(+)
|
||||
|
||||
diff --git a/drivers/pmdomain/rockchip/pm-domains.c b/drivers/pmdomain/rockchip/pm-domains.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/pmdomain/rockchip/pm-domains.c
|
||||
+++ b/drivers/pmdomain/rockchip/pm-domains.c
|
||||
@@ -417,6 +417,29 @@ static int rockchip_pmu_set_idle_request(struct rockchip_pm_domain *pd,
|
||||
return 0;
|
||||
}
|
||||
|
||||
+int rockchip_pmu_idle_request(struct device *dev, bool idle)
|
||||
+{
|
||||
+ struct generic_pm_domain *genpd;
|
||||
+ struct rockchip_pm_domain *pd;
|
||||
+ int ret;
|
||||
+
|
||||
+ if (IS_ERR_OR_NULL(dev))
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ if (IS_ERR_OR_NULL(dev->pm_domain))
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ genpd = pd_to_genpd(dev->pm_domain);
|
||||
+ pd = to_rockchip_pd(genpd);
|
||||
+
|
||||
+ mutex_lock(&pd->pmu->mutex);
|
||||
+ ret = rockchip_pmu_set_idle_request(pd, idle);
|
||||
+ mutex_unlock(&pd->pmu->mutex);
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+EXPORT_SYMBOL(rockchip_pmu_idle_request);
|
||||
+
|
||||
static int rockchip_pmu_save_qos(struct rockchip_pm_domain *pd)
|
||||
{
|
||||
int i;
|
||||
diff --git a/include/linux/rockchip_pmu.h b/include/linux/rockchip_pmu.h
|
||||
new file mode 100644
|
||||
index 000000000000..111111111111
|
||||
--- /dev/null
|
||||
+++ b/include/linux/rockchip_pmu.h
|
||||
@@ -0,0 +1,15 @@
|
||||
+/*
|
||||
+ * pm_domain.h - Definitions and headers related to device power domains.
|
||||
+ *
|
||||
+ * Copyright (C) 2017 Randy Li <ayaka@soulik.info>.
|
||||
+ *
|
||||
+ * This file is released under the GPLv2.
|
||||
+ */
|
||||
+
|
||||
+#ifndef _LINUX_ROCKCHIP_PM_H
|
||||
+#define _LINUX_ROCKCHIP_PM_H
|
||||
+#include <linux/device.h>
|
||||
+
|
||||
+int rockchip_pmu_idle_request(struct device *dev, bool idle);
|
||||
+
|
||||
+#endif /* _LINUX_ROCKCHIP_PM_H */
|
||||
diff --git a/include/soc/rockchip/pm_domains.h b/include/soc/rockchip/pm_domains.h
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/include/soc/rockchip/pm_domains.h
|
||||
+++ b/include/soc/rockchip/pm_domains.h
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
int rockchip_pmu_block(void);
|
||||
void rockchip_pmu_unblock(void);
|
||||
+int rockchip_pmu_idle_request(struct device *dev, bool idle);
|
||||
|
||||
#else /* CONFIG_ROCKCHIP_PM_DOMAINS */
|
||||
|
||||
@@ -20,6 +21,11 @@ static inline int rockchip_pmu_block(void)
|
||||
|
||||
static inline void rockchip_pmu_unblock(void) { }
|
||||
|
||||
+static inline int rockchip_pmu_idle_request(struct device *dev, bool idle)
|
||||
+{
|
||||
+ return -ENOTSUPP;
|
||||
+}
|
||||
+
|
||||
#endif /* CONFIG_ROCKCHIP_PM_DOMAINS */
|
||||
|
||||
#endif /* __SOC_ROCKCHIP_PM_DOMAINS_H__ */
|
||||
--
|
||||
Armbian
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Alex Bee <knaerzche@gmail.com>
|
||||
Date: Wed, 20 May 2020 17:04:47 +0200
|
||||
Subject: WIP: media: rkvdec: implement reset controls
|
||||
|
||||
---
|
||||
Documentation/devicetree/bindings/media/rockchip,vdec.yaml | 19 ++++
|
||||
drivers/staging/media/rkvdec/rkvdec-regs.h | 5 +
|
||||
drivers/staging/media/rkvdec/rkvdec.c | 53 ++++++++++
|
||||
drivers/staging/media/rkvdec/rkvdec.h | 11 +-
|
||||
4 files changed, 87 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Documentation/devicetree/bindings/media/rockchip,vdec.yaml b/Documentation/devicetree/bindings/media/rockchip,vdec.yaml
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/Documentation/devicetree/bindings/media/rockchip,vdec.yaml
|
||||
+++ b/Documentation/devicetree/bindings/media/rockchip,vdec.yaml
|
||||
@@ -53,6 +53,18 @@ properties:
|
||||
iommus:
|
||||
maxItems: 1
|
||||
|
||||
+ resets:
|
||||
+ maxItems: 6
|
||||
+
|
||||
+ reset-names:
|
||||
+ items:
|
||||
+ - const: video_h
|
||||
+ - const: video_a
|
||||
+ - const: video_core
|
||||
+ - const: video_cabac
|
||||
+ - const: niu_a
|
||||
+ - const: niu_h
|
||||
+
|
||||
required:
|
||||
- compatible
|
||||
- reg
|
||||
@@ -60,6 +72,8 @@ required:
|
||||
- clocks
|
||||
- clock-names
|
||||
- power-domains
|
||||
+ - resets
|
||||
+ - reset-names
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
@@ -78,6 +92,11 @@ examples:
|
||||
clock-names = "axi", "ahb", "cabac", "core";
|
||||
power-domains = <&power RK3399_PD_VDU>;
|
||||
iommus = <&vdec_mmu>;
|
||||
+ resets = <&cru SRST_H_VDU>, <&cru SRST_A_VDU>,
|
||||
+ <&cru SRST_VDU_CORE>, <&cru SRST_VDU_CA>,
|
||||
+ <&cru SRST_A_VDU_NOC>, <&cru SRST_H_VDU_NOC>;
|
||||
+ reset-names = "video_h", "video_a", "video_core", "video_cabac",
|
||||
+ "niu_a", "niu_h";
|
||||
};
|
||||
|
||||
...
|
||||
diff --git a/drivers/staging/media/rkvdec/rkvdec-regs.h b/drivers/staging/media/rkvdec/rkvdec-regs.h
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/staging/media/rkvdec/rkvdec-regs.h
|
||||
+++ b/drivers/staging/media/rkvdec/rkvdec-regs.h
|
||||
@@ -28,6 +28,11 @@
|
||||
#define RKVDEC_SOFTRST_EN_P BIT(20)
|
||||
#define RKVDEC_FORCE_SOFTRESET_VALID BIT(21)
|
||||
#define RKVDEC_SOFTRESET_RDY BIT(22)
|
||||
+#define RKVDEC_ERR_MASK (RKVDEC_BUS_STA \
|
||||
+ | RKVDEC_ERR_STA \
|
||||
+ | RKVDEC_TIMEOUT_STA \
|
||||
+ | RKVDEC_BUF_EMPTY_STA \
|
||||
+ | RKVDEC_COLMV_REF_ERR_STA )
|
||||
|
||||
#define RKVDEC_REG_SYSCTRL 0x008
|
||||
#define RKVDEC_IN_ENDIAN BIT(0)
|
||||
diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/staging/media/rkvdec/rkvdec.c
|
||||
+++ b/drivers/staging/media/rkvdec/rkvdec.c
|
||||
@@ -10,12 +10,15 @@
|
||||
*/
|
||||
|
||||
#include <linux/clk.h>
|
||||
+#include <linux/delay.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/pm.h>
|
||||
#include <linux/pm_runtime.h>
|
||||
+#include <linux/reset.h>
|
||||
+#include <linux/rockchip_pmu.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/videodev2.h>
|
||||
#include <linux/workqueue.h>
|
||||
@@ -766,6 +769,11 @@ static void rkvdec_job_finish(struct rkvdec_ctx *ctx,
|
||||
|
||||
pm_runtime_mark_last_busy(rkvdec->dev);
|
||||
pm_runtime_put_autosuspend(rkvdec->dev);
|
||||
+
|
||||
+ if (result == VB2_BUF_STATE_ERROR &&
|
||||
+ rkvdec->reset_mask == RESET_NONE)
|
||||
+ rkvdec->reset_mask |= RESET_SOFT;
|
||||
+
|
||||
rkvdec_job_finish_no_pm(ctx, result);
|
||||
}
|
||||
|
||||
@@ -803,6 +811,33 @@ static void rkvdec_device_run(void *priv)
|
||||
|
||||
if (WARN_ON(!desc))
|
||||
return;
|
||||
+ if (rkvdec->reset_mask != RESET_NONE) {
|
||||
+
|
||||
+ if (rkvdec->reset_mask & RESET_SOFT) {
|
||||
+ writel(RKVDEC_SOFTRST_EN_P,
|
||||
+ rkvdec->regs + RKVDEC_REG_INTERRUPT);
|
||||
+ udelay(RKVDEC_RESET_DELAY);
|
||||
+ if (readl(rkvdec->regs + RKVDEC_REG_INTERRUPT)
|
||||
+ & RKVDEC_SOFTRESET_RDY)
|
||||
+ dev_info_ratelimited(rkvdec->dev,
|
||||
+ "softreset failed\n");
|
||||
+ }
|
||||
+
|
||||
+ if (rkvdec->reset_mask & RESET_HARD) {
|
||||
+ rockchip_pmu_idle_request(rkvdec->dev, true);
|
||||
+ ret = reset_control_assert(rkvdec->rstc);
|
||||
+ if (!ret) {
|
||||
+ udelay(RKVDEC_RESET_DELAY);
|
||||
+ ret = reset_control_deassert(rkvdec->rstc);
|
||||
+ }
|
||||
+ rockchip_pmu_idle_request(rkvdec->dev, false);
|
||||
+ if (ret)
|
||||
+ dev_notice_ratelimited(rkvdec->dev,
|
||||
+ "hardreset failed\n");
|
||||
+ }
|
||||
+ rkvdec->reset_mask = RESET_NONE;
|
||||
+ pm_runtime_suspend(rkvdec->dev);
|
||||
+ }
|
||||
|
||||
ret = pm_runtime_resume_and_get(rkvdec->dev);
|
||||
if (ret < 0) {
|
||||
@@ -1069,6 +1104,11 @@ static irqreturn_t rkvdec_irq_handler(int irq, void *priv)
|
||||
if (cancel_delayed_work(&rkvdec->watchdog_work)) {
|
||||
struct rkvdec_ctx *ctx;
|
||||
|
||||
+ if (state == VB2_BUF_STATE_ERROR) {
|
||||
+ rkvdec->reset_mask |= (status & RKVDEC_ERR_MASK) ?
|
||||
+ RESET_HARD : RESET_SOFT;
|
||||
+ }
|
||||
+
|
||||
ctx = v4l2_m2m_get_curr_priv(rkvdec->m2m_dev);
|
||||
rkvdec_job_finish(ctx, state);
|
||||
}
|
||||
@@ -1086,6 +1126,7 @@ static void rkvdec_watchdog_func(struct work_struct *work)
|
||||
ctx = v4l2_m2m_get_curr_priv(rkvdec->m2m_dev);
|
||||
if (ctx) {
|
||||
dev_err(rkvdec->dev, "Frame processing timed out!\n");
|
||||
+ rkvdec->reset_mask |= RESET_HARD;
|
||||
writel(RKVDEC_IRQ_DIS, rkvdec->regs + RKVDEC_REG_INTERRUPT);
|
||||
writel(0, rkvdec->regs + RKVDEC_REG_SYSCTRL);
|
||||
rkvdec_job_finish(ctx, VB2_BUF_STATE_ERROR);
|
||||
@@ -1154,6 +1195,18 @@ static int rkvdec_probe(struct platform_device *pdev)
|
||||
return ret;
|
||||
}
|
||||
|
||||
+
|
||||
+ rkvdec->rstc = devm_reset_control_array_get_optional_exclusive(&pdev->dev);
|
||||
+ if (IS_ERR(rkvdec->rstc)) {
|
||||
+ dev_err(&pdev->dev,
|
||||
+ "get resets failed %ld\n", PTR_ERR(rkvdec->rstc));
|
||||
+ return PTR_ERR(rkvdec->rstc);
|
||||
+ } else {
|
||||
+ dev_dbg(&pdev->dev,
|
||||
+ "requested %d resets\n",
|
||||
+ reset_control_get_count(&pdev->dev));
|
||||
+ }
|
||||
+
|
||||
pm_runtime_set_autosuspend_delay(&pdev->dev, 100);
|
||||
pm_runtime_use_autosuspend(&pdev->dev);
|
||||
pm_runtime_enable(&pdev->dev);
|
||||
diff --git a/drivers/staging/media/rkvdec/rkvdec.h b/drivers/staging/media/rkvdec/rkvdec.h
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/staging/media/rkvdec/rkvdec.h
|
||||
+++ b/drivers/staging/media/rkvdec/rkvdec.h
|
||||
@@ -11,10 +11,11 @@
|
||||
#ifndef RKVDEC_H_
|
||||
#define RKVDEC_H_
|
||||
|
||||
+#include <linux/clk.h>
|
||||
#include <linux/platform_device.h>
|
||||
+#include <linux/reset.h>
|
||||
#include <linux/videodev2.h>
|
||||
#include <linux/wait.h>
|
||||
-#include <linux/clk.h>
|
||||
|
||||
#include <media/v4l2-ctrls.h>
|
||||
#include <media/v4l2-device.h>
|
||||
@@ -22,6 +23,12 @@
|
||||
#include <media/videobuf2-core.h>
|
||||
#include <media/videobuf2-dma-contig.h>
|
||||
|
||||
+#define RESET_NONE 0
|
||||
+#define RESET_SOFT BIT(0)
|
||||
+#define RESET_HARD BIT(1)
|
||||
+
|
||||
+#define RKVDEC_RESET_DELAY 5
|
||||
+
|
||||
struct rkvdec_ctx;
|
||||
|
||||
struct rkvdec_ctrl_desc {
|
||||
@@ -110,6 +117,8 @@ struct rkvdec_dev {
|
||||
void __iomem *regs;
|
||||
struct mutex vdev_lock; /* serializes ioctls */
|
||||
struct delayed_work watchdog_work;
|
||||
+ struct reset_control *rstc;
|
||||
+ u8 reset_mask;
|
||||
};
|
||||
|
||||
struct rkvdec_ctx {
|
||||
--
|
||||
Armbian
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Alex Bee <knaerzche@gmail.com>
|
||||
Date: Sat, 21 Aug 2021 16:12:36 +0200
|
||||
Subject: media: hantro: rockchip: Increase RK3288's max ACLK
|
||||
|
||||
Required to proper decode H.264@4K
|
||||
|
||||
Signed-off-by: Alex Bee <knaerzche@gmail.com>
|
||||
---
|
||||
drivers/media/platform/verisilicon/rockchip_vpu_hw.c | 14 ++++++++--
|
||||
1 file changed, 11 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/drivers/media/platform/verisilicon/rockchip_vpu_hw.c b/drivers/media/platform/verisilicon/rockchip_vpu_hw.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/media/platform/verisilicon/rockchip_vpu_hw.c
|
||||
+++ b/drivers/media/platform/verisilicon/rockchip_vpu_hw.c
|
||||
@@ -16,7 +16,8 @@
|
||||
#include "rockchip_vpu981_regs.h"
|
||||
|
||||
#define RK3066_ACLK_MAX_FREQ (300 * 1000 * 1000)
|
||||
-#define RK3288_ACLK_MAX_FREQ (400 * 1000 * 1000)
|
||||
+#define RK3288_ACLK_MAX_FREQ (600 * 1000 * 1000)
|
||||
+#define RK3399_ACLK_MAX_FREQ (400 * 1000 * 1000)
|
||||
#define RK3588_ACLK_MAX_FREQ (300 * 1000 * 1000)
|
||||
|
||||
#define ROCKCHIP_VPU981_MIN_SIZE 64
|
||||
@@ -461,13 +462,20 @@ static int rk3588_vpu981_hw_init(struct hantro_dev *vpu)
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static int rockchip_vpu_hw_init(struct hantro_dev *vpu)
|
||||
+static int rk3288_vpu_hw_init(struct hantro_dev *vpu)
|
||||
{
|
||||
/* Bump ACLK to max. possible freq. to improve performance. */
|
||||
clk_set_rate(vpu->clocks[0].clk, RK3288_ACLK_MAX_FREQ);
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static int rockchip_vpu_hw_init(struct hantro_dev *vpu)
|
||||
+{
|
||||
+ /* Bump ACLK to max. possible freq. to improve performance. */
|
||||
+ clk_set_rate(vpu->clocks[0].clk, RK3399_ACLK_MAX_FREQ);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
static void rk3066_vpu_dec_reset(struct hantro_ctx *ctx)
|
||||
{
|
||||
struct hantro_dev *vpu = ctx->dev;
|
||||
@@ -723,7 +731,7 @@ const struct hantro_variant rk3288_vpu_variant = {
|
||||
.codec_ops = rk3288_vpu_codec_ops,
|
||||
.irqs = rockchip_vpu1_irqs,
|
||||
.num_irqs = ARRAY_SIZE(rockchip_vpu1_irqs),
|
||||
- .init = rockchip_vpu_hw_init,
|
||||
+ .init = rk3288_vpu_hw_init,
|
||||
.clk_names = rockchip_vpu_clk_names,
|
||||
.num_clocks = ARRAY_SIZE(rockchip_vpu_clk_names)
|
||||
};
|
||||
--
|
||||
Armbian
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Alex Bee <knaerzche@gmail.com>
|
||||
Date: Sun, 4 Jul 2021 15:19:44 +0200
|
||||
Subject: media: rkvdec: disable QoS for VP9 (corruptions on RK3328 otherwise)
|
||||
|
||||
Signed-off-by: Alex Bee <knaerzche@gmail.com>
|
||||
---
|
||||
drivers/staging/media/rkvdec/rkvdec-regs.h | 2 ++
|
||||
drivers/staging/media/rkvdec/rkvdec-vp9.c | 8 ++++++++
|
||||
2 files changed, 10 insertions(+)
|
||||
|
||||
diff --git a/drivers/staging/media/rkvdec/rkvdec-regs.h b/drivers/staging/media/rkvdec/rkvdec-regs.h
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/staging/media/rkvdec/rkvdec-regs.h
|
||||
+++ b/drivers/staging/media/rkvdec/rkvdec-regs.h
|
||||
@@ -222,6 +222,8 @@
|
||||
#define RKVDEC_REG_H264_ERR_E 0x134
|
||||
#define RKVDEC_H264_ERR_EN_HIGHBITS(x) ((x) & 0x3fffffff)
|
||||
|
||||
+#define RKVDEC_QOS_CTRL 0x18C
|
||||
+
|
||||
#define RKVDEC_REG_PREF_LUMA_CACHE_COMMAND 0x410
|
||||
#define RKVDEC_REG_PREF_CHR_CACHE_COMMAND 0x450
|
||||
|
||||
diff --git a/drivers/staging/media/rkvdec/rkvdec-vp9.c b/drivers/staging/media/rkvdec/rkvdec-vp9.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/staging/media/rkvdec/rkvdec-vp9.c
|
||||
+++ b/drivers/staging/media/rkvdec/rkvdec-vp9.c
|
||||
@@ -803,6 +803,7 @@ static int rkvdec_vp9_run(struct rkvdec_ctx *ctx)
|
||||
struct rkvdec_dev *rkvdec = ctx->dev;
|
||||
struct rkvdec_vp9_run run = { };
|
||||
int ret;
|
||||
+ u32 reg;
|
||||
|
||||
ret = rkvdec_vp9_run_preamble(ctx, &run);
|
||||
if (ret) {
|
||||
@@ -824,6 +825,13 @@ static int rkvdec_vp9_run(struct rkvdec_ctx *ctx)
|
||||
writel(1, rkvdec->regs + RKVDEC_REG_PREF_CHR_CACHE_COMMAND);
|
||||
|
||||
writel(0xe, rkvdec->regs + RKVDEC_REG_STRMD_ERR_EN);
|
||||
+
|
||||
+ /* disable QOS for RK3328 - no effect on other SoCs */
|
||||
+ reg = readl(rkvdec->regs + RKVDEC_QOS_CTRL);
|
||||
+ reg |= 0xFFFF;
|
||||
+ reg &= (~BIT(12));
|
||||
+ writel(reg, rkvdec->regs + RKVDEC_QOS_CTRL);
|
||||
+
|
||||
/* Start decoding! */
|
||||
writel(RKVDEC_INTERRUPT_DEC_E | RKVDEC_CONFIG_DEC_CLK_GATE_E |
|
||||
RKVDEC_TIMEOUT_E | RKVDEC_BUF_EMPTY_E,
|
||||
--
|
||||
Armbian
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Alex Bee <knaerzche@gmail.com>
|
||||
Date: Thu, 16 Jun 2022 13:18:22 +0200
|
||||
Subject: WIP: arm64: dts: add resets to vdec for RK3328
|
||||
|
||||
---
|
||||
arch/arm64/boot/dts/rockchip/rk3328.dtsi | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/arch/arm64/boot/dts/rockchip/rk3328.dtsi b/arch/arm64/boot/dts/rockchip/rk3328.dtsi
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/arch/arm64/boot/dts/rockchip/rk3328.dtsi
|
||||
+++ b/arch/arm64/boot/dts/rockchip/rk3328.dtsi
|
||||
@@ -705,6 +705,11 @@ vdec: video-codec@ff360000 {
|
||||
assigned-clocks = <&cru ACLK_RKVDEC>, <&cru SCLK_VDEC_CABAC>,
|
||||
<&cru SCLK_VDEC_CORE>;
|
||||
assigned-clock-rates = <400000000>, <400000000>, <300000000>;
|
||||
+ resets = <&cru SRST_VDEC_H>, <&cru SRST_VDEC_A>,
|
||||
+ <&cru SRST_VDEC_CORE>, <&cru SRST_VDEC_CABAC>,
|
||||
+ <&cru SRST_VDEC_NIU_A>, <&cru SRST_VDEC_NIU_H>;
|
||||
+ reset-names = "video_h", "video_a", "video_core", "video_cabac",
|
||||
+ "niu_a", "niu_h";
|
||||
iommus = <&vdec_mmu>;
|
||||
power-domains = <&power RK3328_PD_VIDEO>;
|
||||
};
|
||||
--
|
||||
Armbian
|
||||
|
3748
patch/kernel/rockchip64-6.16/media-0001-Add-rkvdec2-Support-v3.patch
Normal file
3748
patch/kernel/rockchip64-6.16/media-0001-Add-rkvdec2-Support-v3.patch
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,43 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: amazingfate <liujianfeng1994@gmail.com>
|
||||
Date: Fri, 21 Jun 2024 16:32:55 +0800
|
||||
Subject: media: v4l2-core: Initialize h264 frame_mbs_only_flag as 1
|
||||
|
||||
---
|
||||
drivers/media/v4l2-core/v4l2-ctrls-core.c | 13 ++++++++++
|
||||
1 file changed, 13 insertions(+)
|
||||
|
||||
diff --git a/drivers/media/v4l2-core/v4l2-ctrls-core.c b/drivers/media/v4l2-core/v4l2-ctrls-core.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/media/v4l2-core/v4l2-ctrls-core.c
|
||||
+++ b/drivers/media/v4l2-core/v4l2-ctrls-core.c
|
||||
@@ -111,6 +111,7 @@ static void std_init_compound(const struct v4l2_ctrl *ctrl, u32 idx,
|
||||
struct v4l2_ctrl_vp9_frame *p_vp9_frame;
|
||||
struct v4l2_ctrl_fwht_params *p_fwht_params;
|
||||
struct v4l2_ctrl_h264_scaling_matrix *p_h264_scaling_matrix;
|
||||
+ struct v4l2_ctrl_h264_sps *p_h264_sps;
|
||||
struct v4l2_ctrl_av1_sequence *p_av1_sequence;
|
||||
void *p = ptr.p + idx * ctrl->elem_size;
|
||||
|
||||
@@ -179,6 +180,18 @@ static void std_init_compound(const struct v4l2_ctrl *ctrl, u32 idx,
|
||||
*/
|
||||
memset(p_h264_scaling_matrix, 16, sizeof(*p_h264_scaling_matrix));
|
||||
break;
|
||||
+ case V4L2_CTRL_TYPE_H264_SPS:
|
||||
+ p_h264_sps = p;
|
||||
+ /*
|
||||
+ * Without V4L2_H264_SPS_FLAG_FRAME_MBS_ONLY,
|
||||
+ * frame_mbs_only_flag set to 0 will translate to a miniumum
|
||||
+ * height of 32 (see H.264 specification 7-8). Some driver may
|
||||
+ * have a minimum size lower then 32, which would fail
|
||||
+ * validation with the SPS value. Set this flag, so that there
|
||||
+ * is now doubling in the height, allowing a valid default.
|
||||
+ */
|
||||
+ p_h264_sps->flags = V4L2_H264_SPS_FLAG_FRAME_MBS_ONLY;
|
||||
+ break;
|
||||
}
|
||||
}
|
||||
|
||||
--
|
||||
Armbian
|
||||
|
@ -0,0 +1,97 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: amazingfate <liujianfeng1994@gmail.com>
|
||||
Date: Sun, 28 Jul 2024 14:35:34 +0800
|
||||
Subject: [ARCHEOLOGY] rockchip64-edge: disable hantro g1 h264 decoder on
|
||||
rk356x
|
||||
|
||||
> X-Git-Archeology: - Revision d5cb0d6732f7ab06f34ee6ce18ed6bef266c3c4a: https://github.com/armbian/build/commit/d5cb0d6732f7ab06f34ee6ce18ed6bef266c3c4a
|
||||
> X-Git-Archeology: Date: Sun, 28 Jul 2024 14:35:34 +0800
|
||||
> X-Git-Archeology: From: amazingfate <liujianfeng1994@gmail.com>
|
||||
> X-Git-Archeology: Subject: rockchip64-edge: disable hantro g1 h264 decoder on rk356x
|
||||
> X-Git-Archeology:
|
||||
---
|
||||
arch/arm64/boot/dts/rockchip/rk3588-base.dtsi | 2 +-
|
||||
drivers/media/platform/verisilicon/hantro_drv.c | 1 -
|
||||
drivers/media/platform/verisilicon/hantro_hw.h | 1 -
|
||||
drivers/media/platform/verisilicon/rockchip_vpu_hw.c | 21 ++--------
|
||||
4 files changed, 4 insertions(+), 21 deletions(-)
|
||||
|
||||
diff --git a/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi b/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi
|
||||
+++ b/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi
|
||||
@@ -1141,7 +1141,7 @@ power-domain@RK3588_PD_SDMMC {
|
||||
};
|
||||
|
||||
vpu121: video-codec@fdb50000 {
|
||||
- compatible = "rockchip,rk3588-vpu121", "rockchip,rk3568-vpu";
|
||||
+ compatible = "rockchip,rk3588-vpu121", "rockchip,rk3328-vpu";
|
||||
reg = <0x0 0xfdb50000 0x0 0x800>;
|
||||
interrupts = <GIC_SPI 119 IRQ_TYPE_LEVEL_HIGH 0>;
|
||||
interrupt-names = "vdpu";
|
||||
diff --git a/drivers/media/platform/verisilicon/hantro_drv.c b/drivers/media/platform/verisilicon/hantro_drv.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/media/platform/verisilicon/hantro_drv.c
|
||||
+++ b/drivers/media/platform/verisilicon/hantro_drv.c
|
||||
@@ -721,7 +721,6 @@ static const struct of_device_id of_hantro_match[] = {
|
||||
{ .compatible = "rockchip,rk3328-vpu", .data = &rk3328_vpu_variant, },
|
||||
{ .compatible = "rockchip,rk3399-vpu", .data = &rk3399_vpu_variant, },
|
||||
{ .compatible = "rockchip,rk3568-vepu", .data = &rk3568_vepu_variant, },
|
||||
- { .compatible = "rockchip,rk3568-vpu", .data = &rk3568_vpu_variant, },
|
||||
{ .compatible = "rockchip,rk3588-vepu121", .data = &rk3568_vepu_variant, },
|
||||
{ .compatible = "rockchip,rk3588-av1-vpu", .data = &rk3588_vpu981_variant, },
|
||||
#endif
|
||||
diff --git a/drivers/media/platform/verisilicon/hantro_hw.h b/drivers/media/platform/verisilicon/hantro_hw.h
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/media/platform/verisilicon/hantro_hw.h
|
||||
+++ b/drivers/media/platform/verisilicon/hantro_hw.h
|
||||
@@ -413,7 +413,6 @@ extern const struct hantro_variant rk3288_vpu_variant;
|
||||
extern const struct hantro_variant rk3328_vpu_variant;
|
||||
extern const struct hantro_variant rk3399_vpu_variant;
|
||||
extern const struct hantro_variant rk3568_vepu_variant;
|
||||
-extern const struct hantro_variant rk3568_vpu_variant;
|
||||
extern const struct hantro_variant rk3588_vpu981_variant;
|
||||
extern const struct hantro_variant sama5d4_vdec_variant;
|
||||
extern const struct hantro_variant sunxi_vpu_variant;
|
||||
diff --git a/drivers/media/platform/verisilicon/rockchip_vpu_hw.c b/drivers/media/platform/verisilicon/rockchip_vpu_hw.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/media/platform/verisilicon/rockchip_vpu_hw.c
|
||||
+++ b/drivers/media/platform/verisilicon/rockchip_vpu_hw.c
|
||||
@@ -740,10 +740,9 @@ const struct hantro_variant rk3288_vpu_variant = {
|
||||
|
||||
const struct hantro_variant rk3328_vpu_variant = {
|
||||
.dec_offset = 0x400,
|
||||
- .dec_fmts = rockchip_vdpu2_dec_fmts,
|
||||
- .num_dec_fmts = ARRAY_SIZE(rockchip_vdpu2_dec_fmts),
|
||||
- .codec = HANTRO_MPEG2_DECODER | HANTRO_VP8_DECODER |
|
||||
- HANTRO_H264_DECODER,
|
||||
+ .dec_fmts = rk3399_vpu_dec_fmts,
|
||||
+ .num_dec_fmts = ARRAY_SIZE(rk3399_vpu_dec_fmts),
|
||||
+ .codec = HANTRO_MPEG2_DECODER | HANTRO_VP8_DECODER,
|
||||
.codec_ops = rk3399_vpu_codec_ops,
|
||||
.irqs = rockchip_vdpu2_irqs,
|
||||
.num_irqs = ARRAY_SIZE(rockchip_vdpu2_irqs),
|
||||
@@ -787,20 +786,6 @@ const struct hantro_variant rk3568_vepu_variant = {
|
||||
.num_clocks = ARRAY_SIZE(rockchip_vpu_clk_names)
|
||||
};
|
||||
|
||||
-const struct hantro_variant rk3568_vpu_variant = {
|
||||
- .dec_offset = 0x400,
|
||||
- .dec_fmts = rockchip_vdpu2_dec_fmts,
|
||||
- .num_dec_fmts = ARRAY_SIZE(rockchip_vdpu2_dec_fmts),
|
||||
- .codec = HANTRO_MPEG2_DECODER |
|
||||
- HANTRO_VP8_DECODER | HANTRO_H264_DECODER,
|
||||
- .codec_ops = rk3399_vpu_codec_ops,
|
||||
- .irqs = rockchip_vdpu2_irqs,
|
||||
- .num_irqs = ARRAY_SIZE(rockchip_vdpu2_irqs),
|
||||
- .init = rockchip_vpu_hw_init,
|
||||
- .clk_names = rockchip_vpu_clk_names,
|
||||
- .num_clocks = ARRAY_SIZE(rockchip_vpu_clk_names)
|
||||
-};
|
||||
-
|
||||
const struct hantro_variant px30_vpu_variant = {
|
||||
.enc_offset = 0x0,
|
||||
.enc_fmts = rockchip_vpu_enc_fmts,
|
||||
--
|
||||
Armbian
|
||||
|
@ -0,0 +1,79 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: David Bauer <mail@david-bauer.net>
|
||||
Date: Sun, 26 Jul 2020 02:38:31 +0200
|
||||
Subject: net: usb: r8152: add LED configuration from OF
|
||||
|
||||
This adds the ability to configure the LED configuration register using
|
||||
OF. This way, the correct value for board specific LED configuration can
|
||||
be determined.
|
||||
|
||||
Signed-off-by: David Bauer <mail@david-bauer.net>
|
||||
---
|
||||
drivers/net/usb/r8152.c | 23 ++++++++++
|
||||
1 file changed, 23 insertions(+)
|
||||
|
||||
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/net/usb/r8152.c
|
||||
+++ b/drivers/net/usb/r8152.c
|
||||
@@ -12,6 +12,7 @@
|
||||
#include <linux/ethtool.h>
|
||||
#include <linux/phy.h>
|
||||
#include <linux/usb.h>
|
||||
+#include <linux/of.h>
|
||||
#include <linux/crc32.h>
|
||||
#include <linux/if_vlan.h>
|
||||
#include <linux/uaccess.h>
|
||||
@@ -7017,6 +7018,22 @@ static void rtl_tally_reset(struct r8152 *tp)
|
||||
ocp_write_word(tp, MCU_TYPE_PLA, PLA_RSTTALLY, ocp_data);
|
||||
}
|
||||
|
||||
+static int r8152_led_configuration(struct r8152 *tp)
|
||||
+{
|
||||
+ u32 led_data;
|
||||
+ int ret;
|
||||
+
|
||||
+ ret = of_property_read_u32(tp->udev->dev.of_node, "realtek,led-data",
|
||||
+ &led_data);
|
||||
+
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+ ocp_write_word(tp, MCU_TYPE_PLA, PLA_LEDSEL, led_data);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
static void r8152b_init(struct r8152 *tp)
|
||||
{
|
||||
u32 ocp_data;
|
||||
@@ -7058,6 +7075,8 @@ static void r8152b_init(struct r8152 *tp)
|
||||
ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_USB_CTRL);
|
||||
ocp_data &= ~(RX_AGG_DISABLE | RX_ZERO_EN);
|
||||
ocp_write_word(tp, MCU_TYPE_USB, USB_USB_CTRL, ocp_data);
|
||||
+
|
||||
+ r8152_led_configuration(tp);
|
||||
}
|
||||
|
||||
static void r8153_init(struct r8152 *tp)
|
||||
@@ -7198,6 +7217,8 @@ static void r8153_init(struct r8152 *tp)
|
||||
tp->coalesce = COALESCE_SLOW;
|
||||
break;
|
||||
}
|
||||
+
|
||||
+ r8152_led_configuration(tp);
|
||||
}
|
||||
|
||||
static void r8153b_init(struct r8152 *tp)
|
||||
@@ -7280,6 +7301,8 @@ static void r8153b_init(struct r8152 *tp)
|
||||
rtl_tally_reset(tp);
|
||||
|
||||
tp->coalesce = 15000; /* 15 us */
|
||||
+
|
||||
+ r8152_led_configuration(tp);
|
||||
}
|
||||
|
||||
static void r8153c_init(struct r8152 *tp)
|
||||
--
|
||||
Armbian
|
||||
|
597
patch/kernel/rockchip64-6.16/regulator-add-fan53200-driver.patch
Normal file
597
patch/kernel/rockchip64-6.16/regulator-add-fan53200-driver.patch
Normal file
@ -0,0 +1,597 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Rock Shen <rock_shen@asus.com>
|
||||
Date: Tue, 27 Apr 2021 11:13:25 +0800
|
||||
Subject: regulator: add fan53200 regulator driver for Tinkerboard-2
|
||||
|
||||
1. Add fan53200 regulator support for vdd_cpu_b & vdd_gpu
|
||||
2. By Tinker2 HW design, Vsel gpio pin polarity was reversed, switch
|
||||
sleep_reg & vol_reg at fan53200_voltages_setup_fairchild
|
||||
3. Use vsel0 as suspend source, vsel1 as normal source
|
||||
|
||||
- rpardini: hammered .probe and probe_type = PROBE_PREFER_ASYNCHRONOUS to
|
||||
work on 6.6.y, after https://lore.kernel.org/all/20230505220218.1239542-1-u.kleine-koenig@pengutronix.de/
|
||||
|
||||
Signed-off-by: Rock Shen <rock_shen@asus.com>
|
||||
Signed-off-by: Ricardo Pardini <ricardo@pardini.net>
|
||||
---
|
||||
arch/arm64/configs/defconfig | 1 +
|
||||
drivers/regulator/Kconfig | 11 +
|
||||
drivers/regulator/Makefile | 1 +
|
||||
drivers/regulator/fan53200.c | 520 ++++++++++
|
||||
4 files changed, 533 insertions(+)
|
||||
|
||||
diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/arch/arm64/configs/defconfig
|
||||
+++ b/arch/arm64/configs/defconfig
|
||||
@@ -792,6 +792,7 @@ CONFIG_REGULATOR_BD9571MWV=y
|
||||
CONFIG_REGULATOR_CROS_EC=y
|
||||
CONFIG_REGULATOR_DA9211=m
|
||||
CONFIG_REGULATOR_FAN53555=y
|
||||
+CONFIG_REGULATOR_FAN53200=y
|
||||
CONFIG_REGULATOR_GPIO=y
|
||||
CONFIG_REGULATOR_HI6421V530=y
|
||||
CONFIG_REGULATOR_HI655X=y
|
||||
diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/regulator/Kconfig
|
||||
+++ b/drivers/regulator/Kconfig
|
||||
@@ -432,6 +432,17 @@ config REGULATOR_FAN53880
|
||||
(PMIC), it is controlled by I2C and provides one BUCK, one BOOST
|
||||
and four LDO outputs.
|
||||
|
||||
+config REGULATOR_FAN53200
|
||||
+ tristate "Fairchild FAN53200 Regulator"
|
||||
+ depends on I2C
|
||||
+ select REGMAP_I2C
|
||||
+ help
|
||||
+ This driver supports Fairchild FAN53200 Digitally Programmable
|
||||
+ TinyBuck Regulator. The FAN53200 is a step-down switching voltage
|
||||
+ regulator that delivers a digitally programmable output from an
|
||||
+ input voltage supply of 2.5V to 5.5V. The output voltage is
|
||||
+ programmed through an I2C interface.
|
||||
+
|
||||
config REGULATOR_GPIO
|
||||
tristate "GPIO regulator support"
|
||||
depends on GPIOLIB || COMPILE_TEST
|
||||
diff --git a/drivers/regulator/Makefile b/drivers/regulator/Makefile
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/regulator/Makefile
|
||||
+++ b/drivers/regulator/Makefile
|
||||
@@ -51,6 +51,7 @@ obj-$(CONFIG_REGULATOR_DBX500_PRCMU) += dbx500-prcmu.o
|
||||
obj-$(CONFIG_REGULATOR_DB8500_PRCMU) += db8500-prcmu.o
|
||||
obj-$(CONFIG_REGULATOR_FAN53555) += fan53555.o
|
||||
obj-$(CONFIG_REGULATOR_FAN53880) += fan53880.o
|
||||
+obj-$(CONFIG_REGULATOR_FAN53555) += fan53200.o
|
||||
obj-$(CONFIG_REGULATOR_GPIO) += gpio-regulator.o
|
||||
obj-$(CONFIG_REGULATOR_HI6421) += hi6421-regulator.o
|
||||
obj-$(CONFIG_REGULATOR_HI6421V530) += hi6421v530-regulator.o
|
||||
diff --git a/drivers/regulator/fan53200.c b/drivers/regulator/fan53200.c
|
||||
new file mode 100644
|
||||
index 000000000000..111111111111
|
||||
--- /dev/null
|
||||
+++ b/drivers/regulator/fan53200.c
|
||||
@@ -0,0 +1,520 @@
|
||||
+/*
|
||||
+ * FAN53200 Fairchild Digitally Programmable TinyBuck Regulator Driver.
|
||||
+ *
|
||||
+ * Supported Part Numbers:
|
||||
+ * FAN53200UC35X/44X
|
||||
+ *
|
||||
+ * Copyright (c) 2021 ASUSTeK Computer Inc.
|
||||
+ * Rock Shen <rock_shen@asus.com>
|
||||
+ *
|
||||
+ * This package is free software; you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License version 2 as
|
||||
+ * published by the Free Software Foundation.
|
||||
+ *
|
||||
+ */
|
||||
+#include <linux/module.h>
|
||||
+#include <linux/param.h>
|
||||
+#include <linux/err.h>
|
||||
+#include <linux/platform_device.h>
|
||||
+#include <linux/regulator/driver.h>
|
||||
+#include <linux/regulator/machine.h>
|
||||
+#include <linux/regulator/of_regulator.h>
|
||||
+#include <linux/of_device.h>
|
||||
+#include <linux/i2c.h>
|
||||
+#include <linux/slab.h>
|
||||
+#include <linux/regmap.h>
|
||||
+#include <linux/gpio.h>
|
||||
+#include <linux/of_gpio.h>
|
||||
+
|
||||
+/* Voltage setting */
|
||||
+#define FAN53200_VSEL0 0x00
|
||||
+#define FAN53200_VSEL1 0x01
|
||||
+
|
||||
+/* Control register */
|
||||
+#define FAN53200_CONTROL 0x02
|
||||
+/* IC Type */
|
||||
+#define FAN53200_ID1 0x03
|
||||
+/* IC mask version */
|
||||
+#define FAN53200_ID2 0x04
|
||||
+
|
||||
+/* VSEL bit definitions */
|
||||
+#define VSEL_BUCK_EN (1 << 7)
|
||||
+#define VSEL_MODE (1 << 6)
|
||||
+#define VSEL_NSEL_MASK 0x3F
|
||||
+/* Chip ID and Verison */
|
||||
+#define DIE_ID 0x0F /* ID1 */
|
||||
+#define DIE_REV 0x0F /* ID2 */
|
||||
+/* Control bit definitions */
|
||||
+#define CTL_OUTPUT_DISCHG (1 << 7)
|
||||
+#define CTL_SLEW_MASK (0x7 << 4)
|
||||
+#define CTL_SLEW_SHIFT 4
|
||||
+#define CTL_RESET (1 << 2)
|
||||
+
|
||||
+#define TCS_VSEL_NSEL_MASK 0x7f
|
||||
+#define TCS_VSEL0_MODE (1 << 7)
|
||||
+#define TCS_VSEL1_MODE (1 << 6)
|
||||
+
|
||||
+#define TCS_SLEW_SHIFT 3
|
||||
+#define TCS_SLEW_MASK (0x3 < 3)
|
||||
+
|
||||
+#define FAN53200_NVOLTAGES 64 /* Numbers of voltages */
|
||||
+
|
||||
+enum fan53200_vendor {
|
||||
+ FAN53200_VENDOR_FAIRCHILD = 0,
|
||||
+};
|
||||
+
|
||||
+/* VSEL ID */
|
||||
+enum {
|
||||
+ FAN53200_VSEL_ID_0 = 0,
|
||||
+ FAN53200_VSEL_ID_1,
|
||||
+};
|
||||
+
|
||||
+enum {
|
||||
+ FAN53200_CHIP_ID_00 = 0x8001,
|
||||
+ FAN53200_CHIP_ID_01 = 0x8101,
|
||||
+};
|
||||
+
|
||||
+struct fan53200_platform_data {
|
||||
+ struct regulator_init_data *regulator;
|
||||
+ unsigned int slew_rate;
|
||||
+ /* Sleep VSEL ID */
|
||||
+ unsigned int sleep_vsel_id;
|
||||
+ struct gpio_desc *vsel_gpio;
|
||||
+};
|
||||
+
|
||||
+struct fan53200_device_info {
|
||||
+ enum fan53200_vendor vendor;
|
||||
+ struct regmap *regmap;
|
||||
+ struct device *dev;
|
||||
+ struct regulator_desc desc;
|
||||
+ struct regulator_dev *rdev;
|
||||
+ struct regulator_init_data *regulator;
|
||||
+ /* IC Type and Rev */
|
||||
+ int chip_id;
|
||||
+ int chip_rev;
|
||||
+ /* Voltage setting register */
|
||||
+ unsigned int vol_reg;
|
||||
+ unsigned int sleep_reg;
|
||||
+ unsigned int mode_reg;
|
||||
+ unsigned int vol_mask;
|
||||
+ unsigned int mode_mask;
|
||||
+ unsigned int slew_reg;
|
||||
+ unsigned int slew_mask;
|
||||
+ unsigned int slew_shift;
|
||||
+ /* Voltage range and step(linear) */
|
||||
+ unsigned int vsel_min;
|
||||
+ unsigned int vsel_step;
|
||||
+ unsigned int n_voltages;
|
||||
+ /* Voltage slew rate limiting */
|
||||
+ unsigned int slew_rate;
|
||||
+ /* Sleep voltage cache */
|
||||
+ unsigned int sleep_vol_cache;
|
||||
+ struct gpio_desc *vsel_gpio;
|
||||
+ unsigned int sleep_vsel_id;
|
||||
+};
|
||||
+
|
||||
+static unsigned int fan53200_map_mode(unsigned int mode)
|
||||
+{
|
||||
+ return mode == REGULATOR_MODE_FAST ?
|
||||
+ REGULATOR_MODE_FAST : REGULATOR_MODE_NORMAL;
|
||||
+}
|
||||
+
|
||||
+static int fan53200_set_suspend_voltage(struct regulator_dev *rdev, int uV)
|
||||
+{
|
||||
+ struct fan53200_device_info *di = rdev_get_drvdata(rdev);
|
||||
+ int ret;
|
||||
+
|
||||
+ if (di->sleep_vol_cache == uV)
|
||||
+ return 0;
|
||||
+ ret = regulator_map_voltage_linear(rdev, uV, uV);
|
||||
+ if (ret < 0)
|
||||
+ return ret;
|
||||
+ ret = regmap_update_bits(di->regmap, di->sleep_reg,
|
||||
+ di->vol_mask, ret);
|
||||
+ if (ret < 0)
|
||||
+ return ret;
|
||||
+ /* Cache the sleep voltage setting.
|
||||
+ * Might not be the real voltage which is rounded */
|
||||
+ di->sleep_vol_cache = uV;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int fan53200_set_suspend_enable(struct regulator_dev *rdev)
|
||||
+{
|
||||
+ struct fan53200_device_info *di = rdev_get_drvdata(rdev);
|
||||
+
|
||||
+ return regmap_update_bits(di->regmap, di->sleep_reg,
|
||||
+ VSEL_BUCK_EN, VSEL_BUCK_EN);
|
||||
+}
|
||||
+
|
||||
+static int fan53200_set_suspend_disable(struct regulator_dev *rdev)
|
||||
+{
|
||||
+ struct fan53200_device_info *di = rdev_get_drvdata(rdev);
|
||||
+
|
||||
+ return regmap_update_bits(di->regmap, di->sleep_reg,
|
||||
+ VSEL_BUCK_EN, 0);
|
||||
+}
|
||||
+
|
||||
+static int fan53200_set_enable(struct regulator_dev *rdev)
|
||||
+{
|
||||
+ struct fan53200_device_info *di = rdev_get_drvdata(rdev);
|
||||
+
|
||||
+ if (di->vsel_gpio) {
|
||||
+ gpiod_set_raw_value(di->vsel_gpio, !di->sleep_vsel_id);
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ return regmap_update_bits(di->regmap, di->vol_reg,
|
||||
+ VSEL_BUCK_EN, VSEL_BUCK_EN);
|
||||
+}
|
||||
+
|
||||
+static int fan53200_set_disable(struct regulator_dev *rdev)
|
||||
+{
|
||||
+ struct fan53200_device_info *di = rdev_get_drvdata(rdev);
|
||||
+
|
||||
+ if (di->vsel_gpio) {
|
||||
+ gpiod_set_raw_value(di->vsel_gpio, di->sleep_vsel_id);
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ return regmap_update_bits(di->regmap, di->vol_reg,
|
||||
+ VSEL_BUCK_EN, 0);
|
||||
+}
|
||||
+
|
||||
+static int fan53200_is_enabled(struct regulator_dev *rdev)
|
||||
+{
|
||||
+ struct fan53200_device_info *di = rdev_get_drvdata(rdev);
|
||||
+ unsigned int val;
|
||||
+ int ret = 0;
|
||||
+
|
||||
+ if (di->vsel_gpio) {
|
||||
+ if (di->sleep_vsel_id)
|
||||
+ return !gpiod_get_raw_value(di->vsel_gpio);
|
||||
+ else
|
||||
+ return gpiod_get_raw_value(di->vsel_gpio);
|
||||
+ }
|
||||
+
|
||||
+ ret = regmap_read(di->regmap, di->vol_reg, &val);
|
||||
+ if (ret < 0)
|
||||
+ return ret;
|
||||
+ if (val & VSEL_BUCK_EN)
|
||||
+ return 1;
|
||||
+ else
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int fan53200_set_mode(struct regulator_dev *rdev, unsigned int mode)
|
||||
+{
|
||||
+ struct fan53200_device_info *di = rdev_get_drvdata(rdev);
|
||||
+
|
||||
+ switch (mode) {
|
||||
+ case REGULATOR_MODE_FAST:
|
||||
+ regmap_update_bits(di->regmap, di->mode_reg,
|
||||
+ di->mode_mask, di->mode_mask);
|
||||
+ break;
|
||||
+ case REGULATOR_MODE_NORMAL:
|
||||
+ regmap_update_bits(di->regmap, di->mode_reg, di->mode_mask, 0);
|
||||
+ break;
|
||||
+ default:
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static unsigned int fan53200_get_mode(struct regulator_dev *rdev)
|
||||
+{
|
||||
+ struct fan53200_device_info *di = rdev_get_drvdata(rdev);
|
||||
+ unsigned int val;
|
||||
+ int ret = 0;
|
||||
+
|
||||
+ ret = regmap_read(di->regmap, di->mode_reg, &val);
|
||||
+ if (ret < 0)
|
||||
+ return ret;
|
||||
+ if (val & di->mode_mask)
|
||||
+ return REGULATOR_MODE_FAST;
|
||||
+ else
|
||||
+ return REGULATOR_MODE_NORMAL;
|
||||
+}
|
||||
+
|
||||
+static const int slew_rates[] = {
|
||||
+ 80000,
|
||||
+ 40000,
|
||||
+ 20000,
|
||||
+ 10000,
|
||||
+ 5000,
|
||||
+ 2500,
|
||||
+ 1250,
|
||||
+ 625,
|
||||
+};
|
||||
+
|
||||
+static int fan53200_set_ramp(struct regulator_dev *rdev, int ramp)
|
||||
+{
|
||||
+ struct fan53200_device_info *di = rdev_get_drvdata(rdev);
|
||||
+ int regval = -1, i;
|
||||
+
|
||||
+ for (i = 0; i < ARRAY_SIZE(slew_rates); i++) {
|
||||
+ if (ramp <= slew_rates[i])
|
||||
+ regval = i;
|
||||
+ else
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ if (regval < 0) {
|
||||
+ dev_err(di->dev, "unsupported ramp value %d\n", ramp);
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
+ return regmap_update_bits(di->regmap, di->slew_reg,
|
||||
+ di->slew_mask, regval << di->slew_shift);
|
||||
+}
|
||||
+
|
||||
+static struct regulator_ops fan53200_regulator_ops = {
|
||||
+ .set_voltage_sel = regulator_set_voltage_sel_regmap,
|
||||
+ .get_voltage_sel = regulator_get_voltage_sel_regmap,
|
||||
+ .set_voltage_time_sel = regulator_set_voltage_time_sel,
|
||||
+ .map_voltage = regulator_map_voltage_linear,
|
||||
+ .list_voltage = regulator_list_voltage_linear,
|
||||
+ .set_suspend_voltage = fan53200_set_suspend_voltage,
|
||||
+ .enable = fan53200_set_enable,
|
||||
+ .disable = fan53200_set_disable,
|
||||
+ .is_enabled = fan53200_is_enabled,
|
||||
+ .set_mode = fan53200_set_mode,
|
||||
+ .get_mode = fan53200_get_mode,
|
||||
+ .set_ramp_delay = fan53200_set_ramp,
|
||||
+ .set_suspend_enable = fan53200_set_suspend_enable,
|
||||
+ .set_suspend_disable = fan53200_set_suspend_disable,
|
||||
+};
|
||||
+
|
||||
+static int fan53200_voltages_setup_fairchild(struct fan53200_device_info *di)
|
||||
+{
|
||||
+
|
||||
+ if (di->sleep_vsel_id) {
|
||||
+ di->sleep_reg = FAN53200_VSEL0;
|
||||
+ di->vol_reg = FAN53200_VSEL1;
|
||||
+ } else {
|
||||
+ di->sleep_reg = FAN53200_VSEL1;
|
||||
+ di->vol_reg = FAN53200_VSEL0;
|
||||
+ }
|
||||
+
|
||||
+ /* Init voltage range and step */
|
||||
+ di->vsel_min = 600000;
|
||||
+ di->vsel_step = 12500;
|
||||
+ di->vol_mask = VSEL_NSEL_MASK;
|
||||
+ di->mode_reg = di->vol_reg;
|
||||
+ di->mode_mask = VSEL_MODE;
|
||||
+ di->slew_reg = FAN53200_CONTROL;
|
||||
+ di->slew_mask = CTL_SLEW_MASK;
|
||||
+ di->slew_shift = CTL_SLEW_SHIFT;
|
||||
+ di->n_voltages = FAN53200_NVOLTAGES;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+/* For 00,01,03,05 options:
|
||||
+ * VOUT = 0.60V + NSELx * 10mV, from 0.60 to 1.23V.
|
||||
+ * For 04 option:
|
||||
+ * VOUT = 0.603V + NSELx * 12.826mV, from 0.603 to 1.411V.
|
||||
+ * */
|
||||
+static int fan53200_device_setup(struct fan53200_device_info *di,
|
||||
+ struct fan53200_platform_data *pdata)
|
||||
+{
|
||||
+ int ret = 0;
|
||||
+
|
||||
+ ret = fan53200_voltages_setup_fairchild(di);
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static int fan53200_regulator_register(struct fan53200_device_info *di,
|
||||
+ struct regulator_config *config)
|
||||
+{
|
||||
+ struct regulator_desc *rdesc = &di->desc;
|
||||
+
|
||||
+ rdesc->name = "fan53200-reg";
|
||||
+ rdesc->supply_name = "vin";
|
||||
+ rdesc->ops = &fan53200_regulator_ops;
|
||||
+ rdesc->type = REGULATOR_VOLTAGE;
|
||||
+ rdesc->n_voltages = di->n_voltages;
|
||||
+ rdesc->enable_reg = di->vol_reg;
|
||||
+ rdesc->enable_mask = VSEL_BUCK_EN;
|
||||
+ rdesc->min_uV = di->vsel_min;
|
||||
+ rdesc->uV_step = di->vsel_step;
|
||||
+ rdesc->vsel_reg = di->vol_reg;
|
||||
+ rdesc->vsel_mask = di->vol_mask;
|
||||
+ rdesc->owner = THIS_MODULE;
|
||||
+ rdesc->enable_time = 400;
|
||||
+
|
||||
+ di->rdev = devm_regulator_register(di->dev, &di->desc, config);
|
||||
+ return PTR_ERR_OR_ZERO(di->rdev);
|
||||
+}
|
||||
+
|
||||
+static const struct regmap_config fan53200_regmap_config = {
|
||||
+ .reg_bits = 8,
|
||||
+ .val_bits = 8,
|
||||
+};
|
||||
+
|
||||
+static struct fan53200_platform_data *fan53200_parse_dt(struct device *dev,
|
||||
+ struct device_node *np,
|
||||
+ const struct regulator_desc *desc)
|
||||
+{
|
||||
+ struct fan53200_platform_data *pdata;
|
||||
+ int ret, flag;
|
||||
+ u32 tmp;
|
||||
+
|
||||
+ pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
|
||||
+ if (!pdata)
|
||||
+ return NULL;
|
||||
+
|
||||
+ pdata->regulator = of_get_regulator_init_data(dev, np, desc);
|
||||
+ pdata->regulator->constraints.initial_state = PM_SUSPEND_MEM;
|
||||
+
|
||||
+ ret = of_property_read_u32(np, "fcs,suspend-voltage-selector",
|
||||
+ &tmp);
|
||||
+ if (!ret)
|
||||
+ pdata->sleep_vsel_id = tmp;
|
||||
+
|
||||
+ if (pdata->sleep_vsel_id)
|
||||
+ flag = GPIOD_OUT_LOW;
|
||||
+ else
|
||||
+ flag = GPIOD_OUT_HIGH;
|
||||
+
|
||||
+ pdata->vsel_gpio =
|
||||
+ devm_gpiod_get_index_optional(dev, "vsel", 0,
|
||||
+ flag);
|
||||
+ if (IS_ERR(pdata->vsel_gpio)) {
|
||||
+ ret = PTR_ERR(pdata->vsel_gpio);
|
||||
+ dev_err(dev, "failed to get vesl gpio (%d)\n", ret);
|
||||
+ }
|
||||
+
|
||||
+ return pdata;
|
||||
+}
|
||||
+
|
||||
+static const struct of_device_id fan53200_dt_ids[] = {
|
||||
+ {
|
||||
+ .compatible = "fcs,fan53200",
|
||||
+ .data = (void *)FAN53200_VENDOR_FAIRCHILD,
|
||||
+ },
|
||||
+ { }
|
||||
+};
|
||||
+MODULE_DEVICE_TABLE(of, fan53200_dt_ids);
|
||||
+
|
||||
+static int fan53200_regulator_probe(struct i2c_client *client)
|
||||
+{
|
||||
+ const struct i2c_device_id *id = i2c_client_get_device_id(client);
|
||||
+ struct device_node *np = client->dev.of_node;
|
||||
+ struct fan53200_device_info *di;
|
||||
+ struct fan53200_platform_data *pdata;
|
||||
+ struct regulator_config config = { };
|
||||
+ unsigned int val;
|
||||
+ int ret;
|
||||
+
|
||||
+ di = devm_kzalloc(&client->dev, sizeof(struct fan53200_device_info),
|
||||
+ GFP_KERNEL);
|
||||
+ if (!di)
|
||||
+ return -ENOMEM;
|
||||
+
|
||||
+ di->desc.of_map_mode = fan53200_map_mode;
|
||||
+
|
||||
+ pdata = dev_get_platdata(&client->dev);
|
||||
+ if (!pdata)
|
||||
+ pdata = fan53200_parse_dt(&client->dev, np, &di->desc);
|
||||
+
|
||||
+ if (!pdata || !pdata->regulator) {
|
||||
+ dev_err(&client->dev, "Platform data not found!\n");
|
||||
+ return -ENODEV;
|
||||
+ }
|
||||
+
|
||||
+ di->vsel_gpio = pdata->vsel_gpio;
|
||||
+ di->sleep_vsel_id = pdata->sleep_vsel_id;
|
||||
+
|
||||
+ di->regulator = pdata->regulator;
|
||||
+ if (client->dev.of_node) {
|
||||
+ const struct of_device_id *match;
|
||||
+
|
||||
+ match = of_match_device(of_match_ptr(fan53200_dt_ids),
|
||||
+ &client->dev);
|
||||
+ if (!match)
|
||||
+ return -ENODEV;
|
||||
+
|
||||
+ di->vendor = (unsigned long) match->data;
|
||||
+ } else {
|
||||
+ /* if no ramp constraint set, get the pdata ramp_delay */
|
||||
+ if (!di->regulator->constraints.ramp_delay) {
|
||||
+ int slew_idx = (pdata->slew_rate & 0x7)
|
||||
+ ? pdata->slew_rate : 0;
|
||||
+
|
||||
+ di->regulator->constraints.ramp_delay
|
||||
+ = slew_rates[slew_idx];
|
||||
+ }
|
||||
+
|
||||
+ di->vendor = id->driver_data;
|
||||
+ }
|
||||
+
|
||||
+ di->regmap = devm_regmap_init_i2c(client, &fan53200_regmap_config);
|
||||
+ if (IS_ERR(di->regmap)) {
|
||||
+ dev_err(&client->dev, "Failed to allocate regmap!\n");
|
||||
+ return PTR_ERR(di->regmap);
|
||||
+ }
|
||||
+ di->dev = &client->dev;
|
||||
+ i2c_set_clientdata(client, di);
|
||||
+ /* Get chip ID */
|
||||
+ ret = regmap_read(di->regmap, FAN53200_ID1, &val);
|
||||
+ if (ret < 0) {
|
||||
+ dev_err(&client->dev, "Failed to get chip ID!\n");
|
||||
+ return ret;
|
||||
+ }
|
||||
+ di->chip_id = val & DIE_ID;
|
||||
+ /* Get chip revision */
|
||||
+ ret = regmap_read(di->regmap, FAN53200_ID2, &val);
|
||||
+ if (ret < 0) {
|
||||
+ dev_err(&client->dev, "Failed to get chip Rev!\n");
|
||||
+ return ret;
|
||||
+ }
|
||||
+ di->chip_rev = val & DIE_REV;
|
||||
+ dev_info(&client->dev, "FAN53200 Option[%d] Rev[%d] Detected!\n",
|
||||
+ di->chip_id, di->chip_rev);
|
||||
+ /* Device init */
|
||||
+ ret = fan53200_device_setup(di, pdata);
|
||||
+ if (ret < 0) {
|
||||
+ dev_err(&client->dev, "Failed to setup device!\n");
|
||||
+ return ret;
|
||||
+ }
|
||||
+ /* Register regulator */
|
||||
+ config.dev = di->dev;
|
||||
+ config.init_data = di->regulator;
|
||||
+ config.regmap = di->regmap;
|
||||
+ config.driver_data = di;
|
||||
+ config.of_node = np;
|
||||
+
|
||||
+ ret = fan53200_regulator_register(di, &config);
|
||||
+ if (ret < 0)
|
||||
+ dev_err(&client->dev, "Failed to register regulator!\n");
|
||||
+ return ret;
|
||||
+
|
||||
+}
|
||||
+
|
||||
+static const struct i2c_device_id fan53200_id[] = {
|
||||
+ {
|
||||
+ .name = "fan53200",
|
||||
+ .driver_data = FAN53200_VENDOR_FAIRCHILD
|
||||
+ },
|
||||
+ { },
|
||||
+};
|
||||
+MODULE_DEVICE_TABLE(i2c, fan53200_id);
|
||||
+
|
||||
+static struct i2c_driver fan53200_regulator_driver = {
|
||||
+ .driver = {
|
||||
+ .name = "fan53200-regulator",
|
||||
+ .probe_type = PROBE_PREFER_ASYNCHRONOUS,
|
||||
+ .of_match_table = of_match_ptr(fan53200_dt_ids),
|
||||
+ },
|
||||
+ .probe = fan53200_regulator_probe,
|
||||
+ .id_table = fan53200_id,
|
||||
+};
|
||||
+
|
||||
+module_i2c_driver(fan53200_regulator_driver);
|
||||
+
|
||||
+MODULE_AUTHOR("Rock Shen <rock_shen@asus.com>");
|
||||
+MODULE_DESCRIPTION("FAN53200 regulator driver");
|
||||
+MODULE_LICENSE("GPL v2");
|
||||
--
|
||||
Armbian
|
||||
|
@ -0,0 +1,77 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: amazingfate <liujianfeng1994@gmail.com>
|
||||
Date: Sun, 28 Jul 2024 14:35:34 +0800
|
||||
Subject: [ARCHEOLOGY] rockchip64-edge: add rkvdec2 for rk356x
|
||||
|
||||
> X-Git-Archeology: - Revision e1a64270fa9aad808afd6dd5b4bb0b63e4295d20: https://github.com/armbian/build/commit/e1a64270fa9aad808afd6dd5b4bb0b63e4295d20
|
||||
> X-Git-Archeology: Date: Sun, 28 Jul 2024 14:35:34 +0800
|
||||
> X-Git-Archeology: From: amazingfate <liujianfeng1994@gmail.com>
|
||||
> X-Git-Archeology: Subject: rockchip64-edge: add rkvdec2 for rk356x
|
||||
> X-Git-Archeology:
|
||||
---
|
||||
arch/arm64/boot/dts/rockchip/rk356x-base.dtsi | 35 +++++++++-
|
||||
1 file changed, 34 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/arch/arm64/boot/dts/rockchip/rk356x-base.dtsi b/arch/arm64/boot/dts/rockchip/rk356x-base.dtsi
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/arch/arm64/boot/dts/rockchip/rk356x-base.dtsi
|
||||
+++ b/arch/arm64/boot/dts/rockchip/rk356x-base.dtsi
|
||||
@@ -380,6 +380,19 @@ usb2phy1_grf: syscon@fdca8000 {
|
||||
reg = <0x0 0xfdca8000 0x0 0x8000>;
|
||||
};
|
||||
|
||||
+ sram@fdcc0000 {
|
||||
+ compatible = "mmio-sram";
|
||||
+ reg = <0x0 0xfdcc0000 0x0 0xb000>;
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <1>;
|
||||
+ ranges = <0x0 0x0 0xfdcc0000 0xb000>;
|
||||
+
|
||||
+ vdec_sram: rkvdec-sram@0 {
|
||||
+ reg = <0x0 0xb000>;
|
||||
+ pool;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
pmucru: clock-controller@fdd00000 {
|
||||
compatible = "rockchip,rk3568-pmucru";
|
||||
reg = <0x0 0xfdd00000 0x0 0x1000>;
|
||||
@@ -565,7 +578,7 @@ gpu: gpu@fde60000 {
|
||||
};
|
||||
|
||||
vpu: video-codec@fdea0400 {
|
||||
- compatible = "rockchip,rk3568-vpu";
|
||||
+ compatible = "rockchip,rk3328-vpu";
|
||||
reg = <0x0 0xfdea0000 0x0 0x800>;
|
||||
interrupts = <GIC_SPI 139 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupt-names = "vdpu";
|
||||
@@ -616,6 +629,26 @@ vepu_mmu: iommu@fdee0800 {
|
||||
#iommu-cells = <0>;
|
||||
};
|
||||
|
||||
+ vdec: video-codec@fdf80200 {
|
||||
+ compatible = "rockchip,rk3588-vdec";
|
||||
+ reg = <0x0 0xfdf80100 0x0 0x100>, <0x0 0xfdf80200 0x0 0x500>, <0x0 0xfdf80700 0x0 0x100>;
|
||||
+ reg-names = "link", "function", "cache";
|
||||
+ interrupts = <GIC_SPI 91 IRQ_TYPE_LEVEL_HIGH 0>;
|
||||
+ clocks = <&cru ACLK_RKVDEC>, <&cru HCLK_RKVDEC>, <&cru CLK_RKVDEC_CA>,
|
||||
+ <&cru CLK_RKVDEC_CORE>, <&cru CLK_RKVDEC_HEVC_CA>;
|
||||
+ clock-names = "axi", "ahb", "cabac", "core", "hevc_cabac";
|
||||
+ assigned-clocks = <&cru ACLK_RKVDEC>, <&cru CLK_RKVDEC_CORE>,
|
||||
+ <&cru CLK_RKVDEC_CA>, <&cru CLK_RKVDEC_HEVC_CA>;
|
||||
+ assigned-clock-rates = <297000000>, <297000000>,
|
||||
+ <297000000>, <297000000>;
|
||||
+ resets = <&cru SRST_A_RKVDEC>, <&cru SRST_H_RKVDEC>, <&cru SRST_RKVDEC_CA>,
|
||||
+ <&cru SRST_RKVDEC_CORE>, <&cru SRST_RKVDEC_HEVC_CA>;
|
||||
+ reset-names = "rst_axi", "rst_ahb", "rst_cabac",
|
||||
+ "rst_core", "rst_hevc_cabac";
|
||||
+ power-domains = <&power RK3568_PD_RKVDEC>;
|
||||
+ sram = <&vdec_sram>;
|
||||
+ };
|
||||
+
|
||||
sdmmc2: mmc@fe000000 {
|
||||
compatible = "rockchip,rk3568-dw-mshc", "rockchip,rk3288-dw-mshc";
|
||||
reg = <0x0 0xfe000000 0x0 0x4000>;
|
||||
--
|
||||
Armbian
|
||||
|
142
patch/kernel/rockchip64-6.16/rk3588-0010-fix-clk-divisions.patch
Normal file
142
patch/kernel/rockchip64-6.16/rk3588-0010-fix-clk-divisions.patch
Normal file
@ -0,0 +1,142 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Reichel <sebastian.reichel@collabora.com>
|
||||
Date: Tue, 24 Oct 2023 16:09:35 +0200
|
||||
Subject: math.h: add DIV_ROUND_UP_NO_OVERFLOW
|
||||
|
||||
Add a new DIV_ROUND_UP helper, which cannot overflow when
|
||||
big numbers are being used.
|
||||
|
||||
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
|
||||
---
|
||||
include/linux/math.h | 11 ++++++++++
|
||||
1 file changed, 11 insertions(+)
|
||||
|
||||
diff --git a/include/linux/math.h b/include/linux/math.h
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/include/linux/math.h
|
||||
+++ b/include/linux/math.h
|
||||
@@ -48,6 +48,17 @@
|
||||
|
||||
#define DIV_ROUND_UP __KERNEL_DIV_ROUND_UP
|
||||
|
||||
+/**
|
||||
+ * DIV_ROUND_UP_NO_OVERFLOW - divide two numbers and always round up
|
||||
+ * @n: numerator / dividend
|
||||
+ * @d: denominator / divisor
|
||||
+ *
|
||||
+ * This functions does the same as DIV_ROUND_UP, but internally uses a
|
||||
+ * division and a modulo operation instead of math tricks. This way it
|
||||
+ * avoids overflowing when handling big numbers.
|
||||
+ */
|
||||
+#define DIV_ROUND_UP_NO_OVERFLOW(n, d) (((n) / (d)) + !!((n) % (d)))
|
||||
+
|
||||
#define DIV_ROUND_DOWN_ULL(ll, d) \
|
||||
({ unsigned long long _tmp = (ll); do_div(_tmp, d); _tmp; })
|
||||
|
||||
--
|
||||
Armbian
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Reichel <sebastian.reichel@collabora.com>
|
||||
Date: Tue, 24 Oct 2023 16:13:50 +0200
|
||||
Subject: clk: divider: Fix divisor masking on 64 bit platforms
|
||||
|
||||
The clock framework handles clock rates as "unsigned long", so u32 on
|
||||
32-bit architectures and u64 on 64-bit architectures.
|
||||
|
||||
The current code casts the dividend to u64 on 32-bit to avoid a
|
||||
potential overflow. For example DIV_ROUND_UP(3000000000, 1500000000)
|
||||
= (3.0G + 1.5G - 1) / 1.5G = = OVERFLOW / 1.5G, which has been
|
||||
introduced in commit 9556f9dad8f5 ("clk: divider: handle integer overflow
|
||||
when dividing large clock rates").
|
||||
|
||||
On 64 bit platforms this masks the divisor, so that only the lower
|
||||
32 bit are used. Thus requesting a frequency >= 4.3GHz results
|
||||
in incorrect values. For example requesting 4300000000 (4.3 GHz) will
|
||||
effectively request ca. 5 MHz. Requesting clk_round_rate(clk, ULONG_MAX)
|
||||
is a bit of a special case, since that still returns correct values as
|
||||
long as the parent clock is below 8.5 GHz.
|
||||
|
||||
Fix this by switching to DIV_ROUND_UP_NO_OVERFLOW, which cannot
|
||||
overflow. This avoids any requirements on the arguments (except
|
||||
that divisor should not be 0 obviously).
|
||||
|
||||
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
|
||||
---
|
||||
drivers/clk/clk-divider.c | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/drivers/clk/clk-divider.c b/drivers/clk/clk-divider.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/clk/clk-divider.c
|
||||
+++ b/drivers/clk/clk-divider.c
|
||||
@@ -226,7 +226,7 @@ static int _div_round_up(const struct clk_div_table *table,
|
||||
unsigned long parent_rate, unsigned long rate,
|
||||
unsigned long flags)
|
||||
{
|
||||
- int div = DIV_ROUND_UP_ULL((u64)parent_rate, rate);
|
||||
+ int div = DIV_ROUND_UP_NO_OVERFLOW(parent_rate, rate);
|
||||
|
||||
if (flags & CLK_DIVIDER_POWER_OF_TWO)
|
||||
div = __roundup_pow_of_two(div);
|
||||
@@ -243,7 +243,7 @@ static int _div_round_closest(const struct clk_div_table *table,
|
||||
int up, down;
|
||||
unsigned long up_rate, down_rate;
|
||||
|
||||
- up = DIV_ROUND_UP_ULL((u64)parent_rate, rate);
|
||||
+ up = DIV_ROUND_UP_NO_OVERFLOW(parent_rate, rate);
|
||||
down = parent_rate / rate;
|
||||
|
||||
if (flags & CLK_DIVIDER_POWER_OF_TWO) {
|
||||
@@ -479,7 +479,7 @@ int divider_get_val(unsigned long rate, unsigned long parent_rate,
|
||||
{
|
||||
unsigned int div, value;
|
||||
|
||||
- div = DIV_ROUND_UP_ULL((u64)parent_rate, rate);
|
||||
+ div = DIV_ROUND_UP_NO_OVERFLOW(parent_rate, rate);
|
||||
|
||||
if (!_is_valid_div(table, div, flags))
|
||||
return -EINVAL;
|
||||
--
|
||||
Armbian
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Reichel <sebastian.reichel@collabora.com>
|
||||
Date: Tue, 24 Oct 2023 18:09:57 +0200
|
||||
Subject: clk: composite: replace open-coded abs_diff()
|
||||
|
||||
Replace the open coded abs_diff() with the existing helper function.
|
||||
|
||||
Suggested-by: Andy Shevchenko <andriy.shevchenko@intel.com>
|
||||
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
|
||||
---
|
||||
drivers/clk/clk-composite.c | 6 ++----
|
||||
1 file changed, 2 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/drivers/clk/clk-composite.c b/drivers/clk/clk-composite.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/clk/clk-composite.c
|
||||
+++ b/drivers/clk/clk-composite.c
|
||||
@@ -6,6 +6,7 @@
|
||||
#include <linux/clk-provider.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/err.h>
|
||||
+#include <linux/math.h>
|
||||
#include <linux/slab.h>
|
||||
|
||||
static u8 clk_composite_get_parent(struct clk_hw *hw)
|
||||
@@ -119,10 +120,7 @@ static int clk_composite_determine_rate(struct clk_hw *hw,
|
||||
if (ret)
|
||||
continue;
|
||||
|
||||
- if (req->rate >= tmp_req.rate)
|
||||
- rate_diff = req->rate - tmp_req.rate;
|
||||
- else
|
||||
- rate_diff = tmp_req.rate - req->rate;
|
||||
+ rate_diff = abs_diff(req->rate, tmp_req.rate);
|
||||
|
||||
if (!rate_diff || !req->best_parent_hw
|
||||
|| best_rate_diff > rate_diff) {
|
||||
--
|
||||
Armbian
|
||||
|
2328
patch/kernel/rockchip64-6.16/rk35xx-montjoie-crypto-v2-rk35xx.patch
Normal file
2328
patch/kernel/rockchip64-6.16/rk35xx-montjoie-crypto-v2-rk35xx.patch
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,21 @@
|
||||
Temporary patch to workaround a DMA reset issue with rockchip
|
||||
devices experienced at least on rk3288 and rk3328 with a message
|
||||
like this:
|
||||
|
||||
rk_gmac-dwmac ff290000.ethernet end0: Failed to reset the dma
|
||||
|
||||
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
||||
index e0fb06af1f94..156a5d25d1fd 100644
|
||||
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
||||
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
||||
@@ -3133,8 +3133,8 @@ static int stmmac_init_dma_engine(struct stmmac_priv *priv)
|
||||
|
||||
ret = stmmac_reset(priv, priv->ioaddr);
|
||||
if (ret) {
|
||||
- netdev_err(priv->dev, "Failed to reset the dma\n");
|
||||
- return ret;
|
||||
+ netdev_warn(priv->dev, "Failed to reset the dma, device will work with reduced throughput\n");
|
||||
+ ret = 0;
|
||||
}
|
||||
|
||||
/* DMA Configuration */
|
@ -0,0 +1,45 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Paolo Sabatino <paolo.sabatino@gmail.com>
|
||||
Date: Thu, 10 Feb 2022 21:30:54 +0000
|
||||
Subject: add broadcom bcm43342 chip id
|
||||
|
||||
---
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 2 ++
|
||||
drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h | 1 +
|
||||
2 files changed, 3 insertions(+)
|
||||
|
||||
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
|
||||
@@ -609,6 +609,7 @@ BRCMF_FW_DEF(4329, "brcmfmac4329-sdio");
|
||||
BRCMF_FW_DEF(4330, "brcmfmac4330-sdio");
|
||||
BRCMF_FW_DEF(4334, "brcmfmac4334-sdio");
|
||||
BRCMF_FW_DEF(43340, "brcmfmac43340-sdio");
|
||||
+BRCMF_FW_DEF(43342, "brcmfmac43342-sdio");
|
||||
BRCMF_FW_DEF(4335, "brcmfmac4335-sdio");
|
||||
BRCMF_FW_DEF(43362, "brcmfmac43362-sdio");
|
||||
BRCMF_FW_DEF(4339, "brcmfmac4339-sdio");
|
||||
@@ -642,6 +643,7 @@ static const struct brcmf_firmware_mapping brcmf_sdio_fwnames[] = {
|
||||
BRCMF_FW_ENTRY(BRCM_CC_4334_CHIP_ID, 0xFFFFFFFF, 4334),
|
||||
BRCMF_FW_ENTRY(BRCM_CC_43340_CHIP_ID, 0xFFFFFFFF, 43340),
|
||||
BRCMF_FW_ENTRY(BRCM_CC_43341_CHIP_ID, 0xFFFFFFFF, 43340),
|
||||
+ BRCMF_FW_ENTRY(BRCM_CC_43342_CHIP_ID, 0xFFFFFFFF, 43342),
|
||||
BRCMF_FW_ENTRY(BRCM_CC_4335_CHIP_ID, 0xFFFFFFFF, 4335),
|
||||
BRCMF_FW_ENTRY(BRCM_CC_43362_CHIP_ID, 0xFFFFFFFE, 43362),
|
||||
BRCMF_FW_ENTRY(BRCM_CC_4339_CHIP_ID, 0xFFFFFFFF, 4339),
|
||||
diff --git a/drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h b/drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h
|
||||
index 111111111111..222222222222 100644
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h
|
||||
@@ -27,6 +27,7 @@
|
||||
#define BRCM_CC_4334_CHIP_ID 0x4334
|
||||
#define BRCM_CC_43340_CHIP_ID 43340
|
||||
#define BRCM_CC_43341_CHIP_ID 43341
|
||||
+#define BRCM_CC_43342_CHIP_ID 43342
|
||||
#define BRCM_CC_43362_CHIP_ID 43362
|
||||
#define BRCM_CC_4335_CHIP_ID 0x4335
|
||||
#define BRCM_CC_4339_CHIP_ID 0x4339
|
||||
--
|
||||
Armbian
|
||||
|
@ -1,28 +1,3 @@
|
||||
diff '--color=auto' -Naur uboot_btt_pi2_or/arch/arm/dts/rk3566-btt-pi2.dts uboot_btt_pi2/arch/arm/dts/rk3566-btt-pi2.dts
|
||||
--- uboot_btt_pi2_or/arch/arm/dts/rk3566-btt-pi2.dts 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ uboot_btt_pi2/arch/arm/dts/rk3566-btt-pi2.dts 2024-12-25 14:33:13.750360443 +0100
|
||||
@@ -0,0 +1,3 @@
|
||||
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
|
||||
+
|
||||
+#include <arm64/rockchip/rk3566-btt-pi2.dts>
|
||||
diff '--color=auto' -Naur uboot_btt_pi2_or/arch/arm/dts/rk3566-btt-pi2.dtsi uboot_btt_pi2/arch/arm/dts/rk3566-btt-pi2.dtsi
|
||||
--- uboot_btt_pi2_or/arch/arm/dts/rk3566-btt-pi2.dtsi 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ uboot_btt_pi2/arch/arm/dts/rk3566-btt-pi2.dtsi 2024-12-25 14:33:00.070527818 +0100
|
||||
@@ -0,0 +1,14 @@
|
||||
+// SPDX-License-Identifier: GPL-2.0+
|
||||
+
|
||||
+#include "rk356x-u-boot.dtsi"
|
||||
+
|
||||
+&gpio4 {
|
||||
+ bootph-pre-ram;
|
||||
+};
|
||||
+
|
||||
+&sfc {
|
||||
+ flash@0 {
|
||||
+ bootph-pre-ram;
|
||||
+ bootph-some-ram;
|
||||
+ };
|
||||
+};
|
||||
diff '--color=auto' -Naur uboot_btt_pi2_or/arch/arm/mach-rockchip/rk3568/Kconfig uboot_btt_pi2/arch/arm/mach-rockchip/rk3568/Kconfig
|
||||
--- uboot_btt_pi2_or/arch/arm/mach-rockchip/rk3568/Kconfig 2025-06-27 23:33:08.241020412 +0200
|
||||
+++ uboot_btt_pi2/arch/arm/mach-rockchip/rk3568/Kconfig 2025-06-27 23:43:47.734346143 +0200
|
||||
@ -83,7 +58,7 @@ diff '--color=auto' -Naur uboot_btt_pi2_or/board/btt/btt_pi2/btt_pi2.c uboot_btt
|
||||
+};
|
||||
+
|
||||
+static const struct board_model board_models[] = {
|
||||
+ { 0, "btt/rk3566-btt-pi2-v1.0.1.dtb", "rk3566-btt-pi2-v1.0.1.dtb" },
|
||||
+ { 0, "rk3566-bigtreetech-pi2.dtb" },
|
||||
+};
|
||||
+
|
||||
+static int get_board_value(void)
|
||||
@ -177,7 +152,7 @@ diff '--color=auto' -Naur uboot_btt_pi2_or/configs/btt-pi2_defconfig uboot_btt_p
|
||||
+CONFIG_SPL_FIT_SIGNATURE=y
|
||||
+CONFIG_SPL_LOAD_FIT=y
|
||||
+CONFIG_LEGACY_IMAGE_FORMAT=y
|
||||
+CONFIG_DEFAULT_FDT_FILE="rockchip/rk3566-btt-pi2.dtb"
|
||||
+CONFIG_DEFAULT_FDT_FILE="rockchip/rk3566-bigtreetech-pi2.dts"
|
||||
+# CONFIG_DISPLAY_CPUINFO is not set
|
||||
+CONFIG_DISPLAY_BOARDINFO_LATE=y
|
||||
+CONFIG_SPL_MAX_SIZE=0x40000
|
||||
@ -249,77 +224,4 @@ diff '--color=auto' -Naur uboot_btt_pi2_or/configs/btt-pi2_defconfig uboot_btt_p
|
||||
+CONFIG_USB_DWC3=y
|
||||
+CONFIG_USB_DWC3_GENERIC=y
|
||||
+CONFIG_ERRNO_STR=y
|
||||
diff '--color=auto' -Naur uboot_btt_pi2_or/dts/upstream/src/arm64/rockchip/rk3566-btt-pi2.dts uboot_btt_pi2/dts/upstream/src/arm64/rockchip/rk3566-btt-pi2.dts
|
||||
--- uboot_btt_pi2_or/dts/upstream/src/arm64/rockchip/rk3566-btt-pi2.dts 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ uboot_btt_pi2/dts/upstream/src/arm64/rockchip/rk3566-btt-pi2.dts 2024-12-25 14:03:08.870311329 +0100
|
||||
@@ -0,0 +1,70 @@
|
||||
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
|
||||
+
|
||||
+/dts-v1/;
|
||||
+
|
||||
+#include "rk3566-btt-pi2.dtsi"
|
||||
+
|
||||
+/ {
|
||||
+ model = "BigTreeTech Pi2 RK3566";
|
||||
+ compatible = "btt,pi2", "rockchip,rk3566";
|
||||
+
|
||||
+ vccio_phy1: regulator-1v8-vccio-phy {
|
||||
+ compatible = "regulator-fixed";
|
||||
+ regulator-name = "vccio_phy1";
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-max-microvolt = <1800000>;
|
||||
+ regulator-min-microvolt = <1800000>;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&pmu_io_domains {
|
||||
+ vccio5-supply = <&vccio_phy1>;
|
||||
+};
|
||||
+
|
||||
+&gmac1 {
|
||||
+ phy-handle = <&rgmii_phy1>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&mdio1 {
|
||||
+ rgmii_phy1: ethernet-phy@1 {
|
||||
+ compatible = "ethernet-phy-ieee802.3-c22";
|
||||
+ reg = <1>;
|
||||
+ reset-assert-us = <20000>;
|
||||
+ reset-deassert-us = <50000>;
|
||||
+ reset-gpios = <&gpio4 RK_PC4 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&sdmmc1 {
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <0>;
|
||||
+
|
||||
+ brcmf: wifi@1 {
|
||||
+ compatible = "brcm,bcm43456-fmac", "brcm,bcm4329-fmac";
|
||||
+ reg = <1>;
|
||||
+ interrupt-parent = <&gpio0>;
|
||||
+ interrupts = <RK_PD6 IRQ_TYPE_LEVEL_HIGH>;
|
||||
+ interrupt-names = "host-wake";
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&wifi_wake_host_h>;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&uart1 {
|
||||
+ bluetooth {
|
||||
+ compatible = "brcm,bcm4345c5";
|
||||
+ clocks = <&rk809 1>;
|
||||
+ clock-names = "lpo";
|
||||
+ interrupt-parent = <&gpio2>;
|
||||
+ interrupts = <RK_PC0 IRQ_TYPE_LEVEL_HIGH>;
|
||||
+ interrupt-names = "host-wakeup";
|
||||
+ device-wakeup-gpios = <&gpio2 RK_PC1 GPIO_ACTIVE_HIGH>;
|
||||
+ shutdown-gpios = <&gpio2 RK_PB7 GPIO_ACTIVE_HIGH>;
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&bt_reg_on_h &bt_wake_host_h &host_wake_bt_h>;
|
||||
+ vbat-supply = <&vcc_3v3>;
|
||||
+ vddio-supply = <&vcc_1v8>;
|
||||
+ };
|
||||
+};
|
||||
|
@ -155,6 +155,8 @@ class OS:
|
||||
else:
|
||||
args.insert(0, "sudo")
|
||||
err_n = args[1]
|
||||
else:
|
||||
err_n = args
|
||||
p = subprocess.Popen(args, cwd=cwd, env=env, stdout=stdout, stderr=stdout, shell=shell)
|
||||
p.wait()
|
||||
if (p.returncode != 0):
|
||||
@ -270,6 +272,7 @@ class OS:
|
||||
# remove temp directory
|
||||
self.__tmp_clean(temp_dir)
|
||||
self.__extract_tar(arch_path, temp_dir)
|
||||
self.__sudo(f"rm {temp_dir}/usr/bin/qemu-{self.arch}", shell=True)
|
||||
sqh_fn = f"{ROOT_DIR}/out/root_{date}.sqh"
|
||||
self.__make_sqh(temp_dir, sqh_fn)
|
||||
os.symlink(sqh_fn, f"{ROOT_DIR}/out/root.sqh.tmp")
|
||||
@ -374,9 +377,8 @@ class OS:
|
||||
if (part_size > (90 * 1024 * 1024)) and (i == idx):
|
||||
# required partition
|
||||
#print(f"\tIdx:{i} Size:{part_size}")
|
||||
self.__sudo(["losetup", "-o", str(offset), "--sizelimit",
|
||||
str(part_size), "/dev/loop0", img_or_blk],
|
||||
cwd=ROOT_DIR)#, stdout=subprocess.DEVNULL)
|
||||
self.__sudo(f"losetup -o {offset} --sizelimit {part_size} /dev/loop0 {img_or_blk}",
|
||||
cwd=ROOT_DIR, shell=True)#, stdout=subprocess.DEVNULL)
|
||||
return True
|
||||
i += 1
|
||||
offset += part_size
|
||||
@ -425,7 +427,7 @@ class OS:
|
||||
self.__copy_file(f"{self.board.out_sh}/uInitrd", f"{out_dir}/")
|
||||
Logger.install(f"\tCopy root.sqh")
|
||||
self.__sudo(["cp", "-H", f"{self.board.out_sh}/root.sqh", f"{out_dir}/"])
|
||||
self.__sudo(["cp", "-H", f"{self.board.out_sh}/modules", f"{out_dir}/"])
|
||||
self.__sudo(["cp", "-Hr", f"{self.board.out_sh}/modules", f"{out_dir}/"])
|
||||
|
||||
def __install_rw(self, out_dir):
|
||||
self.__sudo(["touch", f"{out_dir}/rw_part"], stdout=subprocess.DEVNULL)
|
||||
|
@ -225,22 +225,6 @@
|
||||
regulator-name = "vcc_sd";
|
||||
vin-supply = <&vcc3v3_sys>;
|
||||
};
|
||||
|
||||
onewire: onewire {
|
||||
compatible = "w1-gpio";
|
||||
gpios = <&gpio4 RK_PB2 GPIO_ACTIVE_HIGH>;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&gpio_w1>;
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
|
||||
&pinctrl {
|
||||
gpio-w1 {
|
||||
gpio_w1:gpio-w1 {
|
||||
rockchip,pins = <4 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&combphy1 {
|
||||
@ -267,16 +251,7 @@
|
||||
cpu-supply = <&vdd_cpu>;
|
||||
};
|
||||
|
||||
&tsadc {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&dsi_dphy1 {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&dsi1 {
|
||||
status = "disabled";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
@ -354,7 +329,7 @@
|
||||
|
||||
&gpu {
|
||||
mali-supply = <&vdd_gpu>;
|
||||
status = "okay";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&hdmi {
|
||||
@ -375,6 +350,10 @@
|
||||
};
|
||||
};
|
||||
|
||||
&hdmi_sound {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&i2c0 {
|
||||
status = "okay";
|
||||
|
||||
@ -629,8 +608,7 @@
|
||||
};
|
||||
|
||||
&i2c2 {
|
||||
status = "okay";
|
||||
pinctrl-names = "default";
|
||||
status = "disabled";
|
||||
clock-frequency = <100000>;
|
||||
pinctrl-0 = <&i2c2m1_xfer>;
|
||||
avdd-1v8-supply = <&vcca1v8_image>;
|
||||
@ -661,6 +639,20 @@
|
||||
};
|
||||
};
|
||||
|
||||
&i2c3 {
|
||||
status = "disabled";
|
||||
|
||||
tft_tp: touchscreen@48 {
|
||||
compatible = "ti,tsc2007";
|
||||
reg = <0x48>;
|
||||
status = "okay";
|
||||
ti,x-plate-ohms = <660>;
|
||||
ti,rt-thr = <3000>;
|
||||
ti,fuzzx = <32>;
|
||||
ti,fuzzy = <16>;
|
||||
};
|
||||
};
|
||||
|
||||
&i2s1_8ch {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&i2s1m0_sclktx &i2s1m0_lrcktx &i2s1m0_sdi0 &i2s1m0_sdo0>;
|
||||
@ -696,6 +688,7 @@
|
||||
pinctrl-0 = <&pcie_reset_h>;
|
||||
reset-gpios = <&gpio1 RK_PB2 GPIO_ACTIVE_HIGH>;
|
||||
vpcie3v3-supply = <&vcc3v3_pcie>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&pinctrl {
|
||||
@ -856,7 +849,7 @@
|
||||
rockchip,default-sample-phase = <90>;
|
||||
status = "okay";
|
||||
|
||||
sdio-wifi@1 {
|
||||
wifi@1 {
|
||||
compatible = "brcm,bcm4329-fmac";
|
||||
reg = <1>;
|
||||
interrupt-parent = <&gpio2>;
|
||||
@ -874,6 +867,10 @@
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&tsadc {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&uart1 {
|
||||
dma-names = "tx","rx";
|
||||
pinctrl-names = "default";
|
||||
@ -969,10 +966,6 @@
|
||||
vop-supply = <&vdd_logic>;
|
||||
};
|
||||
|
||||
&scmi_clk {
|
||||
rockchip,clk-init = <1104000000>;
|
||||
};
|
||||
|
||||
&vp0 {
|
||||
vp0_out_hdmi: endpoint@ROCKCHIP_VOP2_EP_HDMI0 {
|
||||
reg = <ROCKCHIP_VOP2_EP_HDMI0>;
|
||||
|
@ -7,6 +7,79 @@
|
||||
/ {
|
||||
model = "BigTreeTech Pi 2";
|
||||
compatible = "bigtreetech,pi2", "rockchip,rk3566";
|
||||
|
||||
onewire: onewire {
|
||||
compatible = "w1-gpio";
|
||||
gpios = <&gpio4 RK_PB2 GPIO_ACTIVE_HIGH>;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&gpio_w1>;
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
|
||||
&pinctrl {
|
||||
gpio-w1 {
|
||||
gpio_w1:gpio-w1 {
|
||||
rockchip,pins = <4 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&scmi_clk {
|
||||
rockchip,clk-init = <1104000000>;
|
||||
};
|
||||
|
||||
&sfc {
|
||||
status = "okay";
|
||||
|
||||
flash@0 {
|
||||
compatible = "jedec,spi-nor";
|
||||
reg = <0>;
|
||||
spi-max-frequency = <100000000>;
|
||||
spi-rx-bus-width = <4>;
|
||||
spi-tx-bus-width = <1>;
|
||||
};
|
||||
};
|
||||
|
||||
&display_subsystem {
|
||||
status = "disabled";
|
||||
};
|
||||
&dsi1 {
|
||||
status = "disabled";
|
||||
};
|
||||
&dsi1_panel {
|
||||
status = "disabled";
|
||||
};
|
||||
&dsi1_in_vp1 {
|
||||
status = "disabled";
|
||||
};
|
||||
&dsi_dphy1 {
|
||||
status = "disabled";
|
||||
};
|
||||
&tp_dsi {
|
||||
status = "disabled";
|
||||
};
|
||||
&bl_dsi {
|
||||
status = "disabled";
|
||||
};
|
||||
&vop {
|
||||
vop-supply = <&vdd_logic>;
|
||||
status = "disabled";
|
||||
};
|
||||
&vop_mmu {
|
||||
status = "disabled";
|
||||
};
|
||||
&display_subsystem {
|
||||
status = "disabled";
|
||||
};
|
||||
&hdmi_sound {
|
||||
status = "disabled";
|
||||
};
|
||||
&hdmi {
|
||||
status = "disabled";
|
||||
};
|
||||
&hdmi_in_vp0 {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
/* HDMI output */
|
||||
@ -33,7 +106,7 @@
|
||||
};*/
|
||||
|
||||
/* DSI1 output */
|
||||
&vop {
|
||||
/*&vop {
|
||||
status = "okay";
|
||||
};
|
||||
&vop_mmu {
|
||||
@ -59,4 +132,16 @@
|
||||
};
|
||||
&bl_dsi {
|
||||
status = "okay";
|
||||
};*/
|
||||
|
||||
&i2c3 {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&i2s0_8ch {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&pcie2x1 {
|
||||
status = "disabled";
|
||||
};
|
||||
|
@ -174,6 +174,18 @@
|
||||
method = "smc";
|
||||
};
|
||||
|
||||
reserved-memory {
|
||||
#address-cells = <2>;
|
||||
#size-cells = <2>;
|
||||
ranges;
|
||||
|
||||
scmi_shmem: shmem@10f000 {
|
||||
compatible = "arm,scmi-shmem";
|
||||
reg = <0x0 0x0010f000 0x0 0x100>;
|
||||
no-map;
|
||||
};
|
||||
};
|
||||
|
||||
timer {
|
||||
compatible = "arm,armv8-timer";
|
||||
interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_HIGH>,
|
||||
@ -199,19 +211,6 @@
|
||||
#clock-cells = <0>;
|
||||
};
|
||||
|
||||
sram@10f000 {
|
||||
compatible = "mmio-sram";
|
||||
reg = <0x0 0x0010f000 0x0 0x100>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
ranges = <0 0x0 0x0010f000 0x100>;
|
||||
|
||||
scmi_shmem: sram@0 {
|
||||
compatible = "arm,scmi-shmem";
|
||||
reg = <0x0 0x100>;
|
||||
};
|
||||
};
|
||||
|
||||
sata1: sata@fc400000 {
|
||||
compatible = "rockchip,rk3568-dwc-ahci", "snps,dwc-ahci";
|
||||
reg = <0 0xfc400000 0 0x1000>;
|
||||
@ -284,6 +283,18 @@
|
||||
mbi-alias = <0x0 0xfd410000>;
|
||||
mbi-ranges = <296 24>;
|
||||
msi-controller;
|
||||
ranges;
|
||||
#address-cells = <2>;
|
||||
#size-cells = <2>;
|
||||
dma-noncoherent;
|
||||
|
||||
its: msi-controller@fd440000 {
|
||||
compatible = "arm,gic-v3-its";
|
||||
reg = <0x0 0xfd440000 0 0x20000>;
|
||||
dma-noncoherent;
|
||||
msi-controller;
|
||||
#msi-cells = <1>;
|
||||
};
|
||||
};
|
||||
|
||||
usb_host0_ehci: usb@fd800000 {
|
||||
@ -988,9 +999,9 @@
|
||||
<0 0 0 4 &pcie_intc 3>;
|
||||
linux,pci-domain = <0>;
|
||||
num-ib-windows = <6>;
|
||||
num-ob-windows = <8>;
|
||||
num-ob-windows = <2>;
|
||||
max-link-speed = <2>;
|
||||
msi-map = <0x0 &gic 0x0 0x1000>;
|
||||
msi-map = <0x0 &its 0x0 0x1000>;
|
||||
num-lanes = <1>;
|
||||
phys = <&combphy2 PHY_TYPE_PCIE>;
|
||||
phy-names = "pcie-phy";
|
||||
@ -1065,6 +1076,11 @@
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
/*
|
||||
* Testing showed that the HWRNG found in RK3566 produces unacceptably
|
||||
* low quality of random data, so the HWRNG isn't enabled for all RK356x
|
||||
* SoC variants despite its presence.
|
||||
*/
|
||||
rng: rng@fe388000 {
|
||||
compatible = "rockchip,rk3568-rng";
|
||||
reg = <0x0 0xfe388000 0x0 0x4000>;
|
||||
|
Loading…
x
Reference in New Issue
Block a user