Git Product home page Git Product logo

cedar's Introduction

Allwinner CedarX Driver for Mainline Linux 6.2.0

VideoEngine driver based on A40i SDK
Ion driver based on Google Android Ion

Install ve driver

Put ve folder file in drivers/staging/media/sunxi/cedar_ve
Add source include to drivers/staging/media/sunxi/Kconfig

# SPDX-License-Identifier: GPL-2.0
config VIDEO_SUNXI
    bool "Allwinner sunXi family Video Devices"
    depends on ARCH_SUNXI || COMPILE_TEST
    help
      If you have an Allwinner SoC based on the sunXi family, say Y.

      Note that this option doesn't include new drivers in the
      kernel: saying N will just cause Kconfig to skip all the
      questions about Allwinner media devices.

if VIDEO_SUNXI

source "drivers/staging/media/sunxi/cedar_ve/Kconfig"

endif

Add obj to drivers/staging/media/sunxi/Makefile

obj-$(CONFIG_VIDEO_SUNXI_CEDAR_VE)    += cedar_ve/

Install ion support

Put ion folder file in drivers/staging/android/
Add source include to drivers/staging/Kconfig

source "drivers/staging/android/Kconfig"

Add obj to drivers/staging/Makefile

obj-$(CONFIG_ANDROID)		+= android/

Add obj to drivers/staging/android/Makefile

obj-$(CONFIG_VIDEO_SUNXI_CEDAR_ION) += ion/

Add source include to drivers/staging/android/Kconfig in the if ANDROID condition.

# SPDX-License-Identifier: GPL-2.0
menu "Android"

config ANDROID
    bool "Android Drivers"
    default y if ARCH_SUNXI
    help
      Enable support for various drivers needed on the Android platform

if ANDROID

config ASHMEM
    bool "Enable the Anonymous Shared Memory Subsystem"
    depends on SHMEM
    help
      The ashmem subsystem is a new shared memory allocator, similar to
      POSIX SHM but with different behavior and sporting a simpler
      file-based API.

      It is, in theory, a good memory allocator for low-memory devices,
      because it can discard shared memory units when under memory pressure.

source "drivers/staging/android/ion/Kconfig"

endif # if ANDROID

endmenu

DeviceTree

Example for Allwinner H3

(NOTE: The "7" in the example represents CLK_PLL_VE because CLK_PLL_VE is not exported in sun8i-h3-ccu.h.)
(For different soc here CLK_PLL_VE number can be different. You must check it again by your self OR LINUX KERNEL MAY CRASH.)
(Example, for Allwinner A40i, it's "9" in ccu-sun8i-r40.h, not "7".)

/ {
    reserved-memory {
        #address-cells = <1>;
        #size-cells = <1>;
        ranges;

        cma_pool: cma@4a000000 {
            compatible = "shared-dma-pool";
            size = <0x6000000>;
            alloc-ranges = <0x4a000000 0x6000000>;
            reusable;
            linux,cma-default;
        };

        ion_carveout: vecarveout@50600000 {
            compatible = "ion-region";
            size = <0xFA00000>;
            alloc-ranges = <0x50600000 0xFA00000>;
            no-map;
        };
    };

    ve: ve@1c0e000 {
        compatible = "allwinner,sunxi-cedar-ve";
        reg = <0x01c0e000 0x1000>,
            <0x01c00000 0x10>,
            <0x01c20000 0x800>;
        clocks = <&ccu 7>, <&ccu CLK_VE>, 
                <&ccu CLK_DRAM_VE>, <&ccu CLK_BUS_VE>;
        clock-names = "pll", "mod", "ram", "ahb";
        resets = <&ccu RST_BUS_VE>;
        interrupts = <GIC_SPI 58 IRQ_TYPE_LEVEL_HIGH>;
        allwinner,sram = <&ve_sram 1>;
    };
            
    ion: ion {
        compatible = "allwinner,sunxi-ion";
        status = "disabled";
        heap_carveout@0{
            compatible = "allwinner,carveout";
            heap-name  = "carveout";
            heap-id    = <0x4>;
            heap-base  = <0x50600000>;
            heap-size  = <0xFA00000>;
            heap-type  = "ion_carveout";
            memory-region = <&ion_carveout>;
        };
    };
}

Enable ion

&ion {
	status = "okay";
};

Compile

Enable Driver in

> Device Drivers > Staging drivers > Android
[*]  Android Drivers
<*>    Allwinner CedarX Ion Driver

> Device Drivers > Staging drivers > Media staging drivers
[*]  Allwinner sunXi family Video Devices
[M]  Allwinner CedarX VideoEngine Driver

... and here we go.

Userspace library

https://github.com/aodzip/libcedarc

cedar's People

Contributors

angelic47 avatar aodzip avatar ssp97 avatar thesnowfield avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.