Skip to content

Commit

Permalink
sunxi cedar codec supported
Browse files Browse the repository at this point in the history
  • Loading branch information
TSKangetsu committed Jul 28, 2024
1 parent 0629e56 commit 8e90a56
Show file tree
Hide file tree
Showing 6 changed files with 105 additions and 19 deletions.
1 change: 1 addition & 0 deletions package/kernel/linux/modules/video.mk
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@ define KernelPackage/video-core
DEPENDS:=+PACKAGE_kmod-i2c-core:kmod-i2c-core
KCONFIG:= \
CONFIG_MEDIA_SUPPORT=y \
CONFIG_MEDIA_PLATFORM_SUPPORT=y \
CONFIG_MEDIA_CAMERA_SUPPORT=y \
CONFIG_VIDEO_DEV \
CONFIG_VIDEO_ADV_DEBUG=y \
Expand Down
35 changes: 35 additions & 0 deletions package/kernel/sunxi-cedar/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=sunxi-cedar
PKG_RELEASE=1

PKG_LICENSE:=GPLv2
PKG_LICENSE_FILES:=

PKG_SOURCE_URL:=https://github.com/TSKangetsu/sunxi-cedar-mainline
PKG_MIRROR_HASH:=skip
PKG_SOURCE_PROTO:=git
PKG_SOURCE_DATE:=2024-7-24

PKG_SOURCE_VERSION:=8ec74cb1d6228740c37399bee0ca765e372aa71d
PKG_BUILD_PARALLEL:=1

include $(INCLUDE_DIR)/kernel.mk
include $(INCLUDE_DIR)/package.mk

define KernelPackage/sunxi-cedar
SUBMENU:=Video Support
TITLE:=Driver for sunxi de/encoder device cedar_dev
DEPENDS:=@TARGET_sunxi
FILES:=$(PKG_BUILD_DIR)/cedar_ve.ko
AUTOLOAD:=$(call AutoProbe,cedar_ve)
endef

define Build/Compile
+$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \
$(KERNEL_MAKE_FLAGS) \
M="$(PKG_BUILD_DIR)" \
modules
endef

$(eval $(call KernelPackage,sunxi-cedar))
19 changes: 15 additions & 4 deletions target/linux/sunxi/config-5.10
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,22 @@ CONFIG_CLK_SUNXI_PRCM_SUN6I=y
CONFIG_CLK_SUNXI_PRCM_SUN8I=y
CONFIG_CLK_SUNXI_PRCM_SUN9I=y
CONFIG_CLONE_BACKWARDS=y
CONFIG_CMA=y
CONFIG_CMA_ALIGNMENT=8
CONFIG_CMA_AREAS=7
CONFIG_CMA_DEBUG=y
# CONFIG_CMA_DEBUGFS is not set
CONFIG_CMA_SIZE_MBYTES=0
# CONFIG_CMA_SIZE_SEL_MAX is not set
CONFIG_CMA_SIZE_SEL_MBYTES=y
# CONFIG_CMA_SIZE_SEL_MIN is not set
# CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set
CONFIG_COMMON_CLK=y
CONFIG_COMPAT_32BIT_TIME=y
CONFIG_CONFIGFS_FS=y
CONFIG_CONNECTOR=y
CONFIG_CONSOLE_TRANSLATIONS=y
CONFIG_CONTIG_ALLOC=y
CONFIG_COREDUMP=y
CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
CONFIG_CPUFREQ_DT=y
Expand Down Expand Up @@ -113,6 +124,7 @@ CONFIG_CRYPTO_DEV_SUN4I_SS_PRNG=y
# CONFIG_CRYPTO_DEV_SUN8I_CE is not set
# CONFIG_CRYPTO_DEV_SUN8I_SS is not set
CONFIG_CRYPTO_HW=y
CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y
CONFIG_CRYPTO_LIB_DES=y
CONFIG_CRYPTO_MD5=y
CONFIG_CRYPTO_RNG=y
Expand All @@ -123,6 +135,7 @@ CONFIG_DEBUG_BUGVERBOSE=y
CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S"
CONFIG_DEBUG_MEMORY_INIT=y
CONFIG_DMADEVICES=y
CONFIG_DMA_CMA=y
CONFIG_DMA_ENGINE=y
CONFIG_DMA_OF=y
CONFIG_DMA_OPS=y
Expand Down Expand Up @@ -177,6 +190,7 @@ CONFIG_GENERIC_BUG=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
CONFIG_GENERIC_CPU_AUTOPROBE=y
CONFIG_GENERIC_CPU_VULNERABILITIES=y
CONFIG_GENERIC_EARLY_IOREMAP=y
CONFIG_GENERIC_GETTIMEOFDAY=y
CONFIG_GENERIC_IDLE_POLL_SETUP=y
Expand Down Expand Up @@ -272,6 +286,7 @@ CONFIG_MEDIA_SUPPORT=y
CONFIG_MEDIA_TEST_SUPPORT=y
CONFIG_MEDIA_TUNER=y
CONFIG_MEMFD_CREATE=y
CONFIG_MEMORY_ISOLATION=y
CONFIG_MFD_AXP20X=y
CONFIG_MFD_AXP20X_I2C=y
CONFIG_MFD_AXP20X_RSB=y
Expand Down Expand Up @@ -386,8 +401,6 @@ CONFIG_RESET_SUNXI=y
CONFIG_RFS_ACCEL=y
CONFIG_RPS=y
CONFIG_RWSEM_SPIN_ON_OWNER=y
CONFIG_SATA_HOST=y
CONFIG_SATA_PMP=y
CONFIG_SCSI=y
CONFIG_SDIO_UART=y
CONFIG_SECURITYFS=y
Expand Down Expand Up @@ -496,8 +509,6 @@ CONFIG_VFPv3=y
CONFIG_VHOST=y
CONFIG_VHOST_IOTLB=y
CONFIG_VHOST_NET=y
# CONFIG_VIDEO_SUN4I_CSI is not set
# CONFIG_VIDEO_SUN6I_CSI is not set
CONFIG_VM_EVENT_COUNTERS=y
CONFIG_VT=y
CONFIG_VT_CONSOLE=y
Expand Down
55 changes: 41 additions & 14 deletions target/linux/sunxi/dts/sun8i-h3-nanopi-neo-air.dts
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,6 @@
};
};

reserved-memory {
#address-cells = <0x01>;
#size-cells = <0x01>;
ranges;

linux,cma {
compatible = "shared-dma-pool";
reusable;
size = <0x4000000>;
alignment = <0x2000>;
linux,cma-default;
};
};

wifi_pwrseq: wifi_pwrseq {
compatible = "mmc-pwrseq-simple";
reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */
Expand Down Expand Up @@ -90,8 +76,49 @@
vin-supply = <&reg_vcc3v3>;
};

reserved-memory {
#address-cells = <0x01>;
#size-cells = <0x01>;
ranges;
cma_pool: cma@43c00000 {
compatible = "shared-dma-pool";
reusable;
reg = <0x57c00000 0x6000000>;
linux,cma-default;
status = "okay";
};
};

soc {
compatible = "simple-bus";
#address-cells = <0x01>;
#size-cells = <0x01>;

ve: video-engine@1c0e000 {
compatible = "allwinner,sunxi-cedar-ve";
reg = <0x01c0e000 0x1000>,
<0x01c00000 0x10>,
<0x01c20000 0x800>;
memory-region = <&cma_pool>;
syscon = <&syscon>;
clocks = <&ccu 0x29>, <&ccu 0x6c>, //CLK_BUS_VE, CLK_VE
<&ccu 0x61>; //CLK_DRAM_VE
clock-names = "ahb", "mod", "ram";
resets = <&ccu 0x1a>; //RST_BUS_VE
interrupts = <0x0 58 0x04>; //GIC_SPI, 58, IRQ_TYPE_LEVEL_HIGH
allwinner,sram = <&ve_sram 1>;
status = "okay";
};
};
};



&syscon {
compatible = "allwinner,sun8i-h3-system-control","syscon"; //add syscon module load
};


&r_pio {
wifi_en_pin: wifi_en_pin {
pins = "PL7";
Expand Down
4 changes: 3 additions & 1 deletion target/linux/sunxi/modules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
define KernelPackage/sunxi-csi
TITLE:=SUN6I SoC CSI
DEPENDS:=@TARGET_sunxi +kmod-video-videobuf2
KCONFIG:= CONFIG_VIDEO_SUN6I_CSI \
KCONFIG:= CONFIG_VIDEO_SUN4I_CSI=n \
CONFIG_VIDEO_SUN6I_CSI \
CONFIG_MEDIA_CONTROLLER_DVB=n

FILES:=$(LINUX_DIR)/drivers/media/platform/sunxi/sun6i-csi/sun6i-csi.ko
AUTOLOAD:=$(call AutoLoad,70,sun6i-csi)
$(call AddDepends/camera)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--- a/arch/arm/boot/dts/sun8i-h3.dtsi
+++ b/arch/arm/boot/dts/sun8i-h3.dtsi
@@ -194,6 +194,7 @@
resets = <&ccu RST_BUS_VE>;
interrupts = <GIC_SPI 58 IRQ_TYPE_LEVEL_HIGH>;
allwinner,sram = <&ve_sram 1>;
+ status = "disabled";
};

crypto: crypto@1c15000 {

0 comments on commit 8e90a56

Please sign in to comment.