mirror of
https://github.com/home-assistant/operating-system.git
synced 2025-07-28 07:26:28 +00:00
odroid-c2: Initial Support
Working: * Ethernet * Resize of Data * RAUC boot marking/fetching * CMD Line into HASSOS and Linux Partially working: * USB (requires 1+ devices in at boot. Seems to be a kernel/dt issue.) Untested: * RAUC Update * HDMI Not working: * Homeassistant ** We see: hassio > ha info The HTTP request failed with the error: Get http://hassio/homeassistant/info: dial tcp 172.30.32.2:80: getsockopt: connection refused
This commit is contained in:
parent
5c8f8bea48
commit
11088580c5
@ -3,3 +3,4 @@ source "$BR2_EXTERNAL_HASSOS_PATH/package/libapparmor/Config.in"
|
||||
source "$BR2_EXTERNAL_HASSOS_PATH/package/apparmor/Config.in"
|
||||
source "$BR2_EXTERNAL_HASSOS_PATH/package/bluetooth-bcm43xx/Config.in"
|
||||
source "$BR2_EXTERNAL_HASSOS_PATH/package/bluetooth-rtl8723/Config.in"
|
||||
source "$BR2_EXTERNAL_HASSOS_PATH/package/hardkernel-sbl/Config.in"
|
||||
|
13
buildroot-external/board/odroidc2/info
Normal file
13
buildroot-external/board/odroidc2/info
Normal file
@ -0,0 +1,13 @@
|
||||
BOARD_ID=odroidc2
|
||||
BOARD_NAME="Hardkernel Odroid-C2"
|
||||
CHASSIS=embedded
|
||||
BOOTLOADER=uboot
|
||||
KERNEL_FILE=Image
|
||||
BOOT_ENV=/mnt/boot/uboot.env
|
||||
BOOT_ENV_OFF=0x0000
|
||||
BOOT_ENV_SIZE=0x2000
|
||||
PART_BOOT=/dev/disk/by-partuuid/0d3e0000-01
|
||||
PART_KERNEL_0=/dev/disk/by-partuuid/0d3e0000-05
|
||||
PART_KERNEL_1=/dev/disk/by-partuuid/0d3e0000-07
|
||||
PART_SYSTEM_0=/dev/disk/by-partuuid/0d3e0000-06
|
||||
PART_SYSTEM_1=/dev/disk/by-partuuid/0d3e0000-08
|
6796
buildroot-external/board/odroidc2/kernel.config
Normal file
6796
buildroot-external/board/odroidc2/kernel.config
Normal file
File diff suppressed because it is too large
Load Diff
53
buildroot-external/board/odroidc2/post-image.sh
Executable file
53
buildroot-external/board/odroidc2/post-image.sh
Executable file
@ -0,0 +1,53 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
SCRIPT_DIR=${BR2_EXTERNAL_HASSOS_PATH}/scripts
|
||||
BOARD_DIR="$(dirname $0)"
|
||||
BOOT_DATA=${BINARIES_DIR}/boot
|
||||
|
||||
. ${SCRIPT_DIR}/hdd-image.sh
|
||||
. ${SCRIPT_DIR}/name.sh
|
||||
. ${SCRIPT_DIR}/ota.sh
|
||||
. ${BR2_EXTERNAL_HASSOS_PATH}/info
|
||||
. ${BOARD_DIR}/info
|
||||
|
||||
# Init boot data
|
||||
rm -rf ${BOOT_DATA}
|
||||
mkdir -p ${BOOT_DATA}
|
||||
|
||||
cp ${BINARIES_DIR}/boot.scr ${BOOT_DATA}/boot.scr
|
||||
cp ${BINARIES_DIR}/meson-gxbb-odroidc2.dtb ${BOOT_DATA}/meson-gxbb-odroidc2.dtb
|
||||
|
||||
# Update Boot options
|
||||
(
|
||||
echo -n -e "\x41\xD9\x12\xFF"
|
||||
echo -n -e "\x00\x00"
|
||||
) > ${BOOT_DATA}/uboot.env
|
||||
|
||||
# Update Boot options
|
||||
(
|
||||
echo "kernel=u-boot.bin"
|
||||
echo "disable_splash=1"
|
||||
echo "dtparam=audio=on"
|
||||
echo "arm_64bit=1"
|
||||
) > ${BOOT_DATA}/config.txt
|
||||
|
||||
echo "console=ttyS0,115200n8 console=tty0" > ${BOOT_DATA}/cmdline.txt
|
||||
|
||||
function make_bootable() {
|
||||
local BL1="${BINARIES_DIR}/bl1.bin.hardkernel"
|
||||
local UBOOT_GXBB="${BINARIES_DIR}/u-boot.gxbb"
|
||||
local hdd_img="$(hassos_image_name img)"
|
||||
|
||||
dd if=${BL1} of=${hdd_img} conv=notrunc bs=1 count=442
|
||||
dd if=${BL1} of=${hdd_img} conv=notrunc bs=512 skip=1 seek=1
|
||||
dd if=${UBOOT_GXBB} of=${hdd_img} conv=notrunc bs=512 seek=97
|
||||
}
|
||||
|
||||
# Create other layers
|
||||
prepare_disk_image
|
||||
|
||||
create_disk_mbr 2
|
||||
make_bootable
|
||||
convert_disk_image_gz
|
||||
create_ota_update
|
227
buildroot-external/board/odroidc2/uboot-boot.sh
Normal file
227
buildroot-external/board/odroidc2/uboot-boot.sh
Normal file
@ -0,0 +1,227 @@
|
||||
###################################################
|
||||
# Changes made to this are overwritten every time there's a new upgrade
|
||||
# To make your changes permanent change it on
|
||||
# boot.ini.default
|
||||
# After changing it on boot.ini.default run the bootini command to
|
||||
# rewrite this file with your personal permanent settings.
|
||||
# Documentation: http://odroid.com/dokuwiki/doku.php?id=en:c2_persistent_bootini
|
||||
########################################################################
|
||||
|
||||
# Possible screen resolutions
|
||||
# Uncomment only a single Line! The line with setenv written.
|
||||
# At least one mode must be selected.
|
||||
|
||||
# Custom modeline!
|
||||
# To use custom modeline you need to disable all the below resolutions
|
||||
# and setup your own!
|
||||
# For more information check our wiki:
|
||||
# http://odroid.com/dokuwiki/doku.php?id=en:c2_hdmi_autosetting
|
||||
# Example below:
|
||||
# setenv m "custombuilt"
|
||||
# setenv modeline "1920,1200,154000,74040,60,1920,1968,2000,2080,1200,1202,1208,1235,1,0,1"
|
||||
|
||||
# 480 Lines (720x480)
|
||||
# setenv m "480i60hz" # Interlaced 60Hz
|
||||
# setenv m "480i_rpt" # Interlaced for Rear Projection Televisions 60Hz
|
||||
# setenv m "480p60hz" # 480 Progressive 60Hz
|
||||
# setenv m "480p_rpt" # 480 Progressive for Rear Projection Televisions 60Hz
|
||||
|
||||
# 576 Lines (720x576)
|
||||
# setenv m "576i50hz" # Interlaced 50Hz
|
||||
# setenv m "576i_rpt" # Interlaced for Rear Projection Televisions 50Hz
|
||||
# setenv m "576p50hz" # Progressive 50Hz
|
||||
# setenv m "576p_rpt" # Progressive for Rear Projection Televisions 50Hz
|
||||
|
||||
# 720 Lines (1280x720)
|
||||
# setenv m "720p50hz" # 50Hz
|
||||
# setenv m "720p60hz" # 60Hz
|
||||
|
||||
# 1080 Lines (1920x1080)
|
||||
# setenv m "1080i60hz" # Interlaced 60Hz
|
||||
setenv m "1080p60hz" # Progressive 60Hz
|
||||
# setenv m "1080i50hz" # Interlaced 50Hz
|
||||
# setenv m "1080p50hz" # Progressive 50Hz
|
||||
# setenv m "1080p24hz" # Progressive 24Hz
|
||||
|
||||
# 4K (3840x2160)
|
||||
# setenv m "2160p30hz" # Progressive 30Hz
|
||||
# setenv m "2160p25hz" # Progressive 25Hz
|
||||
# setenv m "2160p24hz" # Progressive 24Hz
|
||||
# setenv m "smpte24hz" # Progressive 24Hz SMPTE
|
||||
# setenv m "2160p50hz" # Progressive 50Hz
|
||||
# setenv m "2160p60hz" # Progressive 60Hz
|
||||
# setenv m "2160p50hz420" # Progressive 50Hz with YCbCr 4:2:0 (Requires TV/Monitor that supports it)
|
||||
# setenv m "2160p60hz420" # Progressive 60Hz with YCbCr 4:2:0 (Requires TV/Monitor that supports it)
|
||||
|
||||
### VESA modes ###
|
||||
# setenv m "640x480p60hz"
|
||||
# setenv m "800x480p60hz"
|
||||
# setenv m "480x800p60hz"
|
||||
# setenv m "800x600p60hz"
|
||||
# setenv m "1024x600p60hz"
|
||||
# setenv m "1024x768p60hz"
|
||||
# setenv m "1280x800p60hz"
|
||||
# setenv m "1280x1024p60hz"
|
||||
# setenv m "1360x768p60hz"
|
||||
# setenv m "1440x900p60hz"
|
||||
# setenv m "1600x900p60hz"
|
||||
# setenv m "1680x1050p60hz"
|
||||
# setenv m "1600x1200p60hz"
|
||||
# setenv m "1920x1200p60hz"
|
||||
# setenv m "2560x1080p60hz"
|
||||
# setenv m "2560x1440p60hz"
|
||||
# setenv m "2560x1600p60hz"
|
||||
# setenv m "3440x1440p60hz"
|
||||
|
||||
# HDMI BPP Mode
|
||||
setenv m_bpp "32"
|
||||
# setenv m_bpp "24"
|
||||
# setenv m_bpp "16"
|
||||
|
||||
# HDMI DVI/VGA modes
|
||||
# By default its set to HDMI, if needed change below.
|
||||
# Uncomment only a single Line.
|
||||
# setenv vout "dvi"
|
||||
# setenv vout "vga"
|
||||
|
||||
# HDMI HotPlug Detection control
|
||||
# Allows you to force HDMI thinking that the cable is connected.
|
||||
# true = HDMI will believe that cable is always connected
|
||||
# false = will let board/monitor negotiate the connection status
|
||||
setenv hpd "true"
|
||||
# setenv hpd "false"
|
||||
|
||||
# Monitor output
|
||||
# Controls if HDMI PHY should output anything to the monitor
|
||||
#setenv monitor_onoff "false" # true or false
|
||||
|
||||
# Server Mode (aka. No Graphics)
|
||||
# Setting nographics to 1 will disable all video subsystem
|
||||
# This mode is ideal of server type usage. (Saves ~300Mb of RAM)
|
||||
setenv nographics "0"
|
||||
|
||||
# Meson Timer
|
||||
# 1 - Meson Timer
|
||||
# 0 - Arch Timer
|
||||
# Using meson_timer improves the video playback however it breaks KVM (virtualization).
|
||||
# Using arch timer allows KVM/Virtualization to work however you'll experience poor video
|
||||
#setenv mesontimer "1"
|
||||
|
||||
# UHS (Ultra High Speed) MicroSD mode enable/disable
|
||||
#setenv disableuhs "false"
|
||||
|
||||
# MicroSD Card Detection enable/disable
|
||||
# Force the MMC controlled to believe that a card is connected.
|
||||
#setenv mmc_removable "true"
|
||||
|
||||
# USB Multi WebCam tweak
|
||||
# Only enable this if you use it.
|
||||
#setenv usbmulticam "false"
|
||||
|
||||
# Default Console Device Setting
|
||||
#setenv condev "console=ttyS0,115200n8 console=tty0" # on both
|
||||
|
||||
# CPU Frequency / Cores control
|
||||
###########################################
|
||||
### WARNING!!! WARNING!!! WARNING!!!
|
||||
# Before changing anything here please read the wiki entry:
|
||||
# http://odroid.com/dokuwiki/doku.php?id=en:c2_set_cpu_freq
|
||||
#
|
||||
# MAX CPU's
|
||||
# setenv maxcpus "1"
|
||||
# setenv maxcpus "2"
|
||||
# setenv maxcpus "3"
|
||||
setenv maxcpus "4"
|
||||
|
||||
# MAX Frequency
|
||||
# setenv max_freq "2016" # 2.016GHz
|
||||
# setenv max_freq "1944" # 1.944GHz
|
||||
# setenv max_freq "1944" # 1.944GHz
|
||||
# setenv max_freq "1920" # 1.920GHz
|
||||
# setenv max_freq "1896" # 1.896GHz
|
||||
# setenv max_freq "1752" # 1.752GHz
|
||||
# setenv max_freq "1680" # 1.680GHz
|
||||
# setenv max_freq "1656" # 1.656GHz
|
||||
setenv max_freq "1536" # 1.536GHz
|
||||
|
||||
|
||||
|
||||
###########################################
|
||||
|
||||
|
||||
test -n "${BOOT_ORDER}" || setenv BOOT_ORDER "A B"
|
||||
test -n "${BOOT_A_LEFT}" || setenv BOOT_A_LEFT 3
|
||||
test -n "${BOOT_B_LEFT}" || setenv BOOT_B_LEFT 3
|
||||
|
||||
# HassOS bootargs
|
||||
setenv bootargs_hassos "no_console_suspend hdmimode=${m} m_bpp=${m_bpp} net.ifnames=0 elevator=noop disablehpd=${hpd} max_freq=${max_freq} maxcpus=${maxcpus} zram.enabled=1 zram.num_devices=3 apparmor=1 security=apparmor cgroup_enable=memory"
|
||||
|
||||
# HassOS system A/B
|
||||
#setenv bootargs_a "root=PARTUUID=0d3e0000-06 rootfstype=squashfs ro"
|
||||
#setenv bootargs_b "root=PARTUUID=0d3e0000-08 rootfstype=squashfs ro"
|
||||
|
||||
#setenv bootargs_a "root=/dev/mmcblk1p6 rootfstype=squashfs ro rootwait"
|
||||
#setenv bootargs_b "root=/dev/mmcblk1p8 rootfstype=squashfs ro rootwait"
|
||||
|
||||
setenv bootargs_a "root=PARTUUID=0d3e0000-06 rootfstype=squashfs ro rootwait"
|
||||
setenv bootargs_b "root=PARTUUID=0d3e0000-08 rootfstype=squashfs ro rootwait"
|
||||
|
||||
# Preserve origin bootargs
|
||||
setenv bootargs_odroidc2
|
||||
setenv fdt_org "0x1000000"
|
||||
# Load extraargs
|
||||
fileenv mmc 0:1 ${fdt_org} cmdline.txt cmdline
|
||||
fatload mmc 0:1 ${fdt_org} meson-gxbb-odroidc2.dtb
|
||||
fdt addr ${fdt_org}
|
||||
#fdt get value bootargs_odroidc2 /chosen bootargs
|
||||
|
||||
|
||||
# logical volumes get numbered after physical ones.
|
||||
# 1. boot
|
||||
# 2. Extended partition
|
||||
# 3. Overlay
|
||||
# 4. Data
|
||||
# 5. KernelA
|
||||
# 6. SystemA
|
||||
# 7. KernelB
|
||||
# 8. SystemB
|
||||
# 9. BootInfo
|
||||
setenv bootargs
|
||||
for BOOT_SLOT in "${BOOT_ORDER}"; do
|
||||
if test "x${bootargs}" != "x"; then
|
||||
# skip remaining slots
|
||||
elif test "x${BOOT_SLOT}" = "xA"; then
|
||||
if test ${BOOT_A_LEFT} -gt 0; then
|
||||
setexpr BOOT_A_LEFT ${BOOT_A_LEFT} - 1
|
||||
echo "Found valid slot A, ${BOOT_A_LEFT} attempts remaining"
|
||||
setenv load_kernel "ext4load mmc 0:5 ${kernel_addr_r} Image"
|
||||
setenv bootargs "${bootargs_hassos} ${bootargs_a} rauc.slot=A ${cmdline}"
|
||||
fi
|
||||
elif test "x${BOOT_SLOT}" = "xB"; then
|
||||
if test ${BOOT_B_LEFT} -gt 0; then
|
||||
setexpr BOOT_B_LEFT ${BOOT_B_LEFT} - 1
|
||||
echo "Found valid slot B, ${BOOT_B_LEFT} attempts remaining"
|
||||
setenv load_kernel "ext4load mmc 0:7 ${kernel_addr_r} Image"
|
||||
setenv bootargs "${bootargs_hassos} ${bootargs_b} rauc.slot=B ${cmdline}"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
setenv fdt_addr
|
||||
if test -n "${bootargs}"; then
|
||||
saveenv
|
||||
else
|
||||
echo "No valid slot found, resetting tries to 3"
|
||||
setenv BOOT_A_LEFT 3
|
||||
setenv BOOT_B_LEFT 3
|
||||
saveenv
|
||||
reset
|
||||
fi
|
||||
|
||||
echo "Loading kernel"
|
||||
run load_kernel
|
||||
echo " Starting kernel"
|
||||
booti ${kernel_addr_r} - ${fdt_org}
|
||||
|
||||
echo "Fails on boot"
|
||||
reset
|
17
buildroot-external/board/odroidc2/uboot.config
Normal file
17
buildroot-external/board/odroidc2/uboot.config
Normal file
@ -0,0 +1,17 @@
|
||||
# CONFIG_USB_STORAGE is not set
|
||||
CONFIG_ENV_IS_IN_FAT=y
|
||||
CONFIG_ENV_FAT_INTERFACE="mmc"
|
||||
CONFIG_ENV_FAT_DEVICE_AND_PART="0:1"
|
||||
CONFIG_ENV_FAT_FILE="uboot.env"
|
||||
# CONFIG_LOCALVERSION_AUTO is not set
|
||||
CONFIG_DISTRO_DEFAULTS=y
|
||||
# CONFIG_EXPERT is not set
|
||||
# CONFIG_DISPLAY_CPUINFO is not set
|
||||
# CONFIG_DISPLAY_BOARDINFO is not set
|
||||
CONFIG_SYS_PROMPT="HassOS> "
|
||||
CONFIG_DOS_PARTITION=y
|
||||
# CONFIG_ISO_PARTITION is not set
|
||||
# CONFIG_EFI_PARTITION is not set
|
||||
CONFIG_FS_EXT4=y
|
||||
CONFIG_CONSOLE_SCROLL_LINES=10
|
||||
CONFIG_CMD_SETEXPR=y
|
95
buildroot-external/configs/odroidc2_defconfig
Normal file
95
buildroot-external/configs/odroidc2_defconfig
Normal file
@ -0,0 +1,95 @@
|
||||
BR2_aarch64=y
|
||||
BR2_DL_DIR="/cache/dl"
|
||||
BR2_CCACHE=y
|
||||
BR2_CCACHE_DIR="/cache/cc"
|
||||
BR2_GLOBAL_PATCH_DIR="$(BR2_EXTERNAL_HASSOS_PATH)/patches"
|
||||
BR2_TOOLCHAIN_BUILDROOT_GLIBC=y
|
||||
BR2_GCC_VERSION_7_X=y
|
||||
BR2_TOOLCHAIN_BUILDROOT_CXX=y
|
||||
BR2_TARGET_GENERIC_HOSTNAME="hassio"
|
||||
BR2_TARGET_GENERIC_ISSUE="Welcome to HassOS"
|
||||
BR2_INIT_SYSTEMD=y
|
||||
BR2_TARGET_GENERIC_GETTY_PORT="tty1"
|
||||
# BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW is not set
|
||||
BR2_ROOTFS_OVERLAY="$(BR2_EXTERNAL_HASSOS_PATH)/rootfs-overlay"
|
||||
BR2_ROOTFS_POST_BUILD_SCRIPT="$(BR2_EXTERNAL_HASSOS_PATH)/scripts/post-build.sh"
|
||||
BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_HASSOS_PATH)/board/odroidc2/post-image.sh"
|
||||
BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_EXTERNAL_HASSOS_PATH)/board/odroidc2"
|
||||
BR2_LINUX_KERNEL=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.17.12"
|
||||
BR2_LINUX_KERNEL_PATCH="$(BR2_EXTERNAL_HASSOS_PATH)/kernel/patches/odroidc2/4_17"
|
||||
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_HASSOS_PATH)/board/odroidc2/kernel.config"
|
||||
BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL_HASSOS_PATH)/kernel/hassos-4_17.config"
|
||||
BR2_LINUX_KERNEL_LZ4=y
|
||||
BR2_LINUX_KERNEL_DTS_SUPPORT=y
|
||||
BR2_LINUX_KERNEL_INTREE_DTS_NAME="amlogic/meson-gxbb-odroidc2"
|
||||
BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
|
||||
BR2_LINUX_KERNEL_NEEDS_HOST_LIBELF=y
|
||||
BR2_PACKAGE_BUSYBOX_CONFIG="$(BR2_EXTERNAL_HASSOS_PATH)/busybox.config"
|
||||
BR2_PACKAGE_BUSYBOX_INDIVIDUAL_BINARIES=y
|
||||
BR2_PACKAGE_JQ=y
|
||||
BR2_PACKAGE_E2FSPROGS=y
|
||||
BR2_PACKAGE_E2FSPROGS_RESIZE2FS=y
|
||||
BR2_PACKAGE_SQUASHFS=y
|
||||
BR2_PACKAGE_GPTFDISK=y
|
||||
BR2_PACKAGE_GPTFDISK_SGDISK=y
|
||||
BR2_PACKAGE_UBOOT_TOOLS=y
|
||||
BR2_PACKAGE_CA_CERTIFICATES=y
|
||||
BR2_PACKAGE_LIBDNET=y
|
||||
BR2_PACKAGE_LIBCGROUP=y
|
||||
BR2_PACKAGE_LIBCGROUP_TOOLS=y
|
||||
BR2_PACKAGE_AVAHI=y
|
||||
# BR2_PACKAGE_AVAHI_AUTOIPD is not set
|
||||
BR2_PACKAGE_AVAHI_DAEMON=y
|
||||
BR2_PACKAGE_AVAHI_LIBDNSSD_COMPATIBILITY=y
|
||||
BR2_PACKAGE_BLUEZ5_UTILS=y
|
||||
BR2_PACKAGE_BLUEZ5_UTILS_CLIENT=y
|
||||
BR2_PACKAGE_BLUEZ5_UTILS_DEPRECATED=y
|
||||
BR2_PACKAGE_DHCP=y
|
||||
BR2_PACKAGE_DHCP_CLIENT=y
|
||||
BR2_PACKAGE_DROPBEAR=y
|
||||
# BR2_PACKAGE_DROPBEAR_CLIENT is not set
|
||||
# BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set
|
||||
BR2_PACKAGE_NETWORK_MANAGER=y
|
||||
BR2_PACKAGE_NETWORK_MANAGER_MODEM_MANAGER=y
|
||||
BR2_PACKAGE_TINI=y
|
||||
BR2_PACKAGE_DOCKER_ENGINE=y
|
||||
BR2_PACKAGE_RAUC=y
|
||||
BR2_PACKAGE_RAUC_NETWORK=y
|
||||
# BR2_PACKAGE_SYSTEMD_HWDB is not set
|
||||
# BR2_PACKAGE_SYSTEMD_NETWORKD is not set
|
||||
BR2_PACKAGE_SYSTEMD_RANDOMSEED=y
|
||||
# BR2_PACKAGE_SYSTEMD_RESOLVED is not set
|
||||
BR2_PACKAGE_UTIL_LINUX_PARTX=y
|
||||
BR2_PACKAGE_UTIL_LINUX_ZRAMCTL=y
|
||||
BR2_TARGET_ROOTFS_SQUASHFS=y
|
||||
BR2_TARGET_ROOTFS_SQUASHFS4_LZ4=y
|
||||
# BR2_TARGET_ROOTFS_TAR is not set
|
||||
BR2_TARGET_UBOOT=y
|
||||
BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
|
||||
BR2_TARGET_UBOOT_CUSTOM_VERSION=y
|
||||
BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2018.07"
|
||||
BR2_TARGET_UBOOT_BOARD_DEFCONFIG="odroid-c2"
|
||||
BR2_TARGET_UBOOT_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL_HASSOS_PATH)/board/odroidc2/uboot.config"
|
||||
BR2_TARGET_UBOOT_BOOT_SCRIPT=y
|
||||
BR2_TARGET_UBOOT_BOOT_SCRIPT_SOURCE="$(BR2_EXTERNAL_HASSOS_PATH)/board/odroidc2/uboot-boot.sh"
|
||||
BR2_PACKAGE_HOST_DOSFSTOOLS=y
|
||||
BR2_PACKAGE_HOST_E2FSPROGS=y
|
||||
BR2_PACKAGE_HOST_GPTFDISK=y
|
||||
BR2_PACKAGE_HOST_MTOOLS=y
|
||||
BR2_PACKAGE_HOST_RAUC=y
|
||||
BR2_PACKAGE_HASSOS=y
|
||||
BR2_PACKAGE_HASSOS_SUPERVISOR="homeassistant/aarch64-hassio-supervisor"
|
||||
BR2_PACKAGE_HASSOS_SUPERVISOR_VERSION="123"
|
||||
BR2_PACKAGE_HASSOS_SUPERVISOR_ARGS="-e HOMEASSISTANT_REPOSITORY=homeassistant/aarch64-homeassistant"
|
||||
BR2_PACKAGE_HASSOS_SUPERVISOR_PROFILE="hassio-supervisor"
|
||||
BR2_PACKAGE_HASSOS_SUPERVISOR_PROFILE_URL="http://s3.amazonaws.com/hassio-version/apparmor.txt"
|
||||
BR2_PACKAGE_HASSOS_CLI="homeassistant/aarch64-hassio-cli"
|
||||
BR2_PACKAGE_HASSOS_CLI_VERSION="6"
|
||||
BR2_PACKAGE_HASSOS_CLI_ARGS="--network=hassio --add-host hassio:172.30.32.2"
|
||||
BR2_PACKAGE_HASSOS_CLI_PROFILE="docker-default"
|
||||
BR2_PACKAGE_HASSOS_APPARMOR_DIR="supervisor/apparmor"
|
||||
BR2_PACKAGE_APPARMOR=y
|
||||
BR2_PACKAGE_HARDKERNEL_SBL=y
|
@ -23,6 +23,8 @@ CONFIG_CGROUP_CPUACCT=y
|
||||
CONFIG_CGROUP_PERF=y
|
||||
CONFIG_NET_CLS_CGROUP=y
|
||||
CONFIG_CGROUP_NET_PRIO=y
|
||||
CONFIG_CGROUP_BPF=y
|
||||
CONFIG_BPF_SYSCALL=y
|
||||
|
||||
CONFIG_MEMCG=y
|
||||
CONFIG_MEMCG_SWAP=y
|
||||
|
102
buildroot-external/kernel/hassos-4_17.config
Normal file
102
buildroot-external/kernel/hassos-4_17.config
Normal file
@ -0,0 +1,102 @@
|
||||
CONFIG_KERNEL_LZ4=y
|
||||
CONFIG_CMDLINE=""
|
||||
|
||||
CONFIG_ZRAM=y
|
||||
CONFIG_ZSMALLOC=y
|
||||
|
||||
CONFIG_POSIX_MQUEUE=y
|
||||
CONFIG_CFQ_GROUP_IOSCHED=y
|
||||
CONFIG_CFS_BANDWIDTH=y
|
||||
CONFIG_FAIR_GROUP_SCHED=y
|
||||
CONFIG_RT_GROUP_SCHED=y
|
||||
CONFIG_NET_SCHED=y
|
||||
|
||||
CONFIG_CGROUPS=y
|
||||
CONFIG_BLK_CGROUP=y
|
||||
CONFIG_BLK_DEV_THROTTLING=y
|
||||
CONFIG_CGROUP_SCHED=y
|
||||
CONFIG_CGROUP_PIDS=y
|
||||
CONFIG_CGROUP_FREEZER=y
|
||||
CONFIG_CGROUP_HUGETLB=y
|
||||
CONFIG_CGROUP_DEVICE=y
|
||||
CONFIG_CGROUP_CPUACCT=y
|
||||
CONFIG_CGROUP_PERF=y
|
||||
CONFIG_NET_CLS_CGROUP=y
|
||||
CONFIG_CGROUP_NET_PRIO=y
|
||||
CONFIG_CGROUP_BPF=y
|
||||
CONFIG_BPF_SYSCALL=y
|
||||
|
||||
CONFIG_MEMCG=y
|
||||
CONFIG_MEMCG_SWAP=y
|
||||
|
||||
CONFIG_NAMESPACES=y
|
||||
CONFIG_USER_NS=y
|
||||
CONFIG_PID_NS=y
|
||||
CONFIG_IPC_NS=y
|
||||
CONFIG_UTS_NS=y
|
||||
|
||||
CONFIG_NETDEVICES=y
|
||||
CONFIG_DUMMY=y
|
||||
CONFIG_MACVLAN=y
|
||||
CONFIG_IPVLAN=y
|
||||
CONFIG_VXLAN=y
|
||||
|
||||
CONFIG_INET=y
|
||||
CONFIG_IPV6=y
|
||||
CONFIG_INET_ESP=y
|
||||
CONFIG_INET_XFRM_MODE_TRANSPORT=y
|
||||
CONFIG_NETCONSOLE=y
|
||||
CONFIG_VETH=y
|
||||
CONFIG_NETFILTER=y
|
||||
CONFIG_NF_CONNTRACK=y
|
||||
CONFIG_NF_NAT=y
|
||||
CONFIG_NF_NAT_NEEDED=y
|
||||
CONFIG_NF_CONNTRACK_IPV4=y
|
||||
CONFIG_NF_CONNTRACK_FTP=y
|
||||
CONFIG_NF_CONNTRACK_TFTP=y
|
||||
CONFIG_NETFILTER_ADVANCED=y
|
||||
CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=y
|
||||
CONFIG_NETFILTER_XT_MATCH_CONNTRACK=y
|
||||
CONFIG_NETFILTER_XT_MATCH_IPVS=y
|
||||
CONFIG_IP_VS=y
|
||||
CONFIG_IP_VS_RR=y
|
||||
CONFIG_IP_VS_NFCT=y
|
||||
CONFIG_IP_NF_IPTABLES=y
|
||||
CONFIG_IP_NF_FILTER=y
|
||||
CONFIG_IP_NF_NAT=y
|
||||
CONFIG_IP_NF_TARGET_MASQUERADE=y
|
||||
CONFIG_BRIDGE=y
|
||||
CONFIG_BRIDGE_NETFILTER=y
|
||||
CONFIG_XFRM=y
|
||||
CONFIG_XFRM_USER=y
|
||||
CONFIG_XFRM_ALGO=y
|
||||
CONFIG_NET_L3_MASTER_DEV=y
|
||||
|
||||
CONFIG_EXT4_FS=y
|
||||
CONFIG_EXT4_FS_POSIX_ACL=y
|
||||
CONFIG_EXT4_FS_SECURITY=y
|
||||
CONFIG_OVERLAY_FS=y
|
||||
CONFIG_MSDOS_FS=y
|
||||
CONFIG_VFAT_FS=y
|
||||
CONFIG_SQUASHFS=y
|
||||
CONFIG_SQUASHFS_XATTR=y
|
||||
CONFIG_SQUASHFS_LZ4=y
|
||||
|
||||
# CONFIG_SECCOMP is not set
|
||||
CONFIG_SECURITY=y
|
||||
CONFIG_SECURITY_APPARMOR=y
|
||||
CONFIG_SECURITY_APPARMOR_BOOTPARAM_VALUE=1
|
||||
CONFIG_KEYS=y
|
||||
|
||||
CONFIG_CRYPTO_CCM=y
|
||||
CONFIG_CRYPTO_GCM=y
|
||||
CONFIG_CRYPTO_CMAC=y
|
||||
CONFIG_CRYPTO_ARC4=y
|
||||
CONFIG_CRYPTO_LZ4=y
|
||||
|
||||
CONFIG_PARTITION_ADVANCED=y
|
||||
CONFIG_EFI_PARTITION=y
|
||||
|
||||
# CONFIG_LOGO is not set
|
||||
# CONFIG_VIRTUALIZATION is not set
|
||||
# CONFIG_DEBUG_STACK_USAGE is not set
|
@ -0,0 +1,38 @@
|
||||
From 8f8bc3e5930cde1958cb90258dc7f29373c0d1ca Mon Sep 17 00:00:00 2001
|
||||
From: Neil Armstrong <narmstrong@baylibre.com>
|
||||
Date: Wed, 28 Feb 2018 16:07:18 +0100
|
||||
Subject: [PATCH 01/14] drm/meson: Call drm_crtc_vblank_on /
|
||||
drm_crtc_vblank_off
|
||||
|
||||
Make sure that the CRTC code will call the enable/disable_vblank hooks.
|
||||
|
||||
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
|
||||
---
|
||||
drivers/gpu/drm/meson/meson_crtc.c | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/drivers/gpu/drm/meson/meson_crtc.c b/drivers/gpu/drm/meson/meson_crtc.c
|
||||
index 0552020..7c0bdc8 100644
|
||||
--- a/drivers/gpu/drm/meson/meson_crtc.c
|
||||
+++ b/drivers/gpu/drm/meson/meson_crtc.c
|
||||
@@ -102,6 +102,8 @@ static void meson_crtc_atomic_enable(struct drm_crtc *crtc,
|
||||
priv->io_base + _REG(VPP_MISC));
|
||||
|
||||
priv->viu.osd1_enabled = true;
|
||||
+
|
||||
+ drm_crtc_vblank_on(crtc);
|
||||
}
|
||||
|
||||
static void meson_crtc_atomic_disable(struct drm_crtc *crtc,
|
||||
@@ -110,6 +112,8 @@ static void meson_crtc_atomic_disable(struct drm_crtc *crtc,
|
||||
struct meson_crtc *meson_crtc = to_meson_crtc(crtc);
|
||||
struct meson_drm *priv = meson_crtc->priv;
|
||||
|
||||
+ drm_crtc_vblank_off(crtc);
|
||||
+
|
||||
priv->viu.osd1_enabled = false;
|
||||
priv->viu.osd1_commit = false;
|
||||
|
||||
--
|
||||
2.7.4
|
||||
|
@ -0,0 +1,23 @@
|
||||
From 13253828e625fad26802c497672d1ebc2588a61e Mon Sep 17 00:00:00 2001
|
||||
From: Jerome Brunet <jbrunet@baylibre.com>
|
||||
Date: Tue, 14 Feb 2017 19:18:04 +0100
|
||||
Subject: [PATCH 02/14] drm/meson: select dw-hdmi i2s audio for meson hdmi
|
||||
|
||||
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
|
||||
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
|
||||
---
|
||||
drivers/gpu/drm/meson/Kconfig | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/drivers/gpu/drm/meson/Kconfig b/drivers/gpu/drm/meson/Kconfig
|
||||
index 3ce51d8..02d400b 100644
|
||||
--- a/drivers/gpu/drm/meson/Kconfig
|
||||
+++ b/drivers/gpu/drm/meson/Kconfig
|
||||
@@ -13,3 +13,4 @@ config DRM_MESON_DW_HDMI
|
||||
depends on DRM_MESON
|
||||
default y if DRM_MESON
|
||||
select DRM_DW_HDMI
|
||||
+ select DRM_DW_HDMI_I2S_AUDIO
|
||||
--
|
||||
2.7.4
|
||||
|
@ -0,0 +1,312 @@
|
||||
From 0d24a1c3cd2bc015eb3c22e7b1322ab39a5f8dda Mon Sep 17 00:00:00 2001
|
||||
From: Jerome Brunet <jbrunet@baylibre.com>
|
||||
Date: Thu, 30 Mar 2017 11:49:55 +0200
|
||||
Subject: [PATCH 03/14] ASoC: meson: add meson audio core driver
|
||||
|
||||
This patch adds support for the audio core driver for the Amlogic Meson SoC
|
||||
family. The purpose of this driver is to properly reset the audio block and
|
||||
provide register access for the different devices scattered in this address
|
||||
space. This includes output and input DMAs, pcm, i2s and spdif dai, card
|
||||
level routing, internal codec for the gxl variant
|
||||
|
||||
For more information, please refer to the section 5 of the public datasheet
|
||||
of the S905 (gxbb). This datasheet is available here: [0].
|
||||
|
||||
[0]: http://dn.odroid.com/S905/DataSheet/S905_Public_Datasheet_V1.1.4.pdf
|
||||
|
||||
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
|
||||
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
|
||||
---
|
||||
sound/soc/Kconfig | 1 +
|
||||
sound/soc/Makefile | 1 +
|
||||
sound/soc/meson/Kconfig | 9 ++
|
||||
sound/soc/meson/Makefile | 3 +
|
||||
sound/soc/meson/audio-core.c | 190 +++++++++++++++++++++++++++++++++++++++++++
|
||||
sound/soc/meson/audio-core.h | 28 +++++++
|
||||
6 files changed, 232 insertions(+)
|
||||
create mode 100644 sound/soc/meson/Kconfig
|
||||
create mode 100644 sound/soc/meson/Makefile
|
||||
create mode 100644 sound/soc/meson/audio-core.c
|
||||
create mode 100644 sound/soc/meson/audio-core.h
|
||||
|
||||
diff --git a/sound/soc/Kconfig b/sound/soc/Kconfig
|
||||
index 41af6b9..1cf11cf 100644
|
||||
--- a/sound/soc/Kconfig
|
||||
+++ b/sound/soc/Kconfig
|
||||
@@ -57,6 +57,7 @@ source "sound/soc/kirkwood/Kconfig"
|
||||
source "sound/soc/img/Kconfig"
|
||||
source "sound/soc/intel/Kconfig"
|
||||
source "sound/soc/mediatek/Kconfig"
|
||||
+source "sound/soc/meson/Kconfig"
|
||||
source "sound/soc/mxs/Kconfig"
|
||||
source "sound/soc/pxa/Kconfig"
|
||||
source "sound/soc/qcom/Kconfig"
|
||||
diff --git a/sound/soc/Makefile b/sound/soc/Makefile
|
||||
index 8d92492..4d642ea 100644
|
||||
--- a/sound/soc/Makefile
|
||||
+++ b/sound/soc/Makefile
|
||||
@@ -38,6 +38,7 @@ obj-$(CONFIG_SND_SOC) += jz4740/
|
||||
obj-$(CONFIG_SND_SOC) += img/
|
||||
obj-$(CONFIG_SND_SOC) += intel/
|
||||
obj-$(CONFIG_SND_SOC) += mediatek/
|
||||
+obj-$(CONFIG_SND_SOC) += meson/
|
||||
obj-$(CONFIG_SND_SOC) += mxs/
|
||||
obj-$(CONFIG_SND_SOC) += nuc900/
|
||||
obj-$(CONFIG_SND_SOC) += omap/
|
||||
diff --git a/sound/soc/meson/Kconfig b/sound/soc/meson/Kconfig
|
||||
new file mode 100644
|
||||
index 0000000..216c850
|
||||
--- /dev/null
|
||||
+++ b/sound/soc/meson/Kconfig
|
||||
@@ -0,0 +1,9 @@
|
||||
+menuconfig SND_SOC_MESON
|
||||
+ tristate "ASoC support for Amlogic Meson SoCs"
|
||||
+ depends on ARCH_MESON || COMPILE_TEST
|
||||
+ select MFD_CORE
|
||||
+ select REGMAP_MMIO
|
||||
+ help
|
||||
+ Say Y or M if you want to add support for codecs attached to
|
||||
+ the Amlogic Meson SoCs Audio interfaces. You will also need to
|
||||
+ select the audio interfaces to support below.
|
||||
diff --git a/sound/soc/meson/Makefile b/sound/soc/meson/Makefile
|
||||
new file mode 100644
|
||||
index 0000000..22028ab
|
||||
--- /dev/null
|
||||
+++ b/sound/soc/meson/Makefile
|
||||
@@ -0,0 +1,3 @@
|
||||
+snd-soc-meson-audio-core-objs := audio-core.o
|
||||
+
|
||||
+obj-$(CONFIG_SND_SOC_MESON) += snd-soc-meson-audio-core.o
|
||||
diff --git a/sound/soc/meson/audio-core.c b/sound/soc/meson/audio-core.c
|
||||
new file mode 100644
|
||||
index 0000000..99993ec
|
||||
--- /dev/null
|
||||
+++ b/sound/soc/meson/audio-core.c
|
||||
@@ -0,0 +1,190 @@
|
||||
+/*
|
||||
+ * Copyright (C) 2017 BayLibre, SAS
|
||||
+ * Author: Jerome Brunet <jbrunet@baylibre.com>
|
||||
+ * Copyright (C) 2017 Amlogic, Inc. All rights reserved.
|
||||
+ *
|
||||
+ * 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.
|
||||
+ *
|
||||
+ * This program is distributed in the hope that it will be useful, but
|
||||
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
+ * General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License
|
||||
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
+ */
|
||||
+
|
||||
+#include <linux/clk.h>
|
||||
+#include <linux/mfd/core.h>
|
||||
+#include <linux/module.h>
|
||||
+#include <linux/of.h>
|
||||
+#include <linux/platform_device.h>
|
||||
+#include <linux/regmap.h>
|
||||
+#include <linux/reset.h>
|
||||
+
|
||||
+#include "audio-core.h"
|
||||
+
|
||||
+#define DRV_NAME "meson-audio-core"
|
||||
+
|
||||
+static const char * const acore_clock_names[] = { "aiu_top",
|
||||
+ "aiu_glue",
|
||||
+ "audin" };
|
||||
+
|
||||
+static int meson_acore_init_clocks(struct device *dev)
|
||||
+{
|
||||
+ struct clk *clock;
|
||||
+ int i, ret;
|
||||
+
|
||||
+ for (i = 0; i < ARRAY_SIZE(acore_clock_names); i++) {
|
||||
+ clock = devm_clk_get(dev, acore_clock_names[i]);
|
||||
+ if (IS_ERR(clock)) {
|
||||
+ if (PTR_ERR(clock) != -EPROBE_DEFER)
|
||||
+ dev_err(dev, "Failed to get %s clock\n",
|
||||
+ acore_clock_names[i]);
|
||||
+ return PTR_ERR(clock);
|
||||
+ }
|
||||
+
|
||||
+ ret = clk_prepare_enable(clock);
|
||||
+ if (ret) {
|
||||
+ dev_err(dev, "Failed to enable %s clock\n",
|
||||
+ acore_clock_names[i]);
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ ret = devm_add_action_or_reset(dev,
|
||||
+ (void(*)(void *))clk_disable_unprepare,
|
||||
+ clock);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static const char * const acore_reset_names[] = { "aiu",
|
||||
+ "audin" };
|
||||
+
|
||||
+static int meson_acore_init_resets(struct device *dev)
|
||||
+{
|
||||
+ struct reset_control *reset;
|
||||
+ int i, ret;
|
||||
+
|
||||
+ for (i = 0; i < ARRAY_SIZE(acore_reset_names); i++) {
|
||||
+ reset = devm_reset_control_get_exclusive(dev,
|
||||
+ acore_reset_names[i]);
|
||||
+ if (IS_ERR(reset)) {
|
||||
+ if (PTR_ERR(reset) != -EPROBE_DEFER)
|
||||
+ dev_err(dev, "Failed to get %s reset\n",
|
||||
+ acore_reset_names[i]);
|
||||
+ return PTR_ERR(reset);
|
||||
+ }
|
||||
+
|
||||
+ ret = reset_control_reset(reset);
|
||||
+ if (ret) {
|
||||
+ dev_err(dev, "Failed to pulse %s reset\n",
|
||||
+ acore_reset_names[i]);
|
||||
+ return ret;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static const struct regmap_config meson_acore_regmap_config = {
|
||||
+ .reg_bits = 32,
|
||||
+ .val_bits = 32,
|
||||
+ .reg_stride = 4,
|
||||
+};
|
||||
+
|
||||
+static const struct mfd_cell meson_acore_devs[] = {
|
||||
+ {
|
||||
+ .name = "meson-i2s-dai",
|
||||
+ .of_compatible = "amlogic,meson-i2s-dai",
|
||||
+ },
|
||||
+ {
|
||||
+ .name = "meson-spdif-dai",
|
||||
+ .of_compatible = "amlogic,meson-spdif-dai",
|
||||
+ },
|
||||
+ {
|
||||
+ .name = "meson-aiu-i2s-dma",
|
||||
+ .of_compatible = "amlogic,meson-aiu-i2s-dma",
|
||||
+ },
|
||||
+ {
|
||||
+ .name = "meson-aiu-spdif-dma",
|
||||
+ .of_compatible = "amlogic,meson-aiu-spdif-dma",
|
||||
+ },
|
||||
+};
|
||||
+
|
||||
+static int meson_acore_probe(struct platform_device *pdev)
|
||||
+{
|
||||
+ struct device *dev = &pdev->dev;
|
||||
+ struct meson_audio_core_data *data;
|
||||
+ struct resource *res;
|
||||
+ void __iomem *regs;
|
||||
+ int ret;
|
||||
+
|
||||
+ data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
|
||||
+ if (!data)
|
||||
+ return -ENOMEM;
|
||||
+ platform_set_drvdata(pdev, data);
|
||||
+
|
||||
+ ret = meson_acore_init_clocks(dev);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+ ret = meson_acore_init_resets(dev);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+ res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "aiu");
|
||||
+ regs = devm_ioremap_resource(dev, res);
|
||||
+ if (IS_ERR(regs))
|
||||
+ return PTR_ERR(regs);
|
||||
+
|
||||
+ data->aiu = devm_regmap_init_mmio(dev, regs,
|
||||
+ &meson_acore_regmap_config);
|
||||
+ if (IS_ERR(data->aiu)) {
|
||||
+ dev_err(dev, "Couldn't create the AIU regmap\n");
|
||||
+ return PTR_ERR(data->aiu);
|
||||
+ }
|
||||
+
|
||||
+ res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "audin");
|
||||
+ regs = devm_ioremap_resource(dev, res);
|
||||
+ if (IS_ERR(regs))
|
||||
+ return PTR_ERR(regs);
|
||||
+
|
||||
+ data->audin = devm_regmap_init_mmio(dev, regs,
|
||||
+ &meson_acore_regmap_config);
|
||||
+ if (IS_ERR(data->audin)) {
|
||||
+ dev_err(dev, "Couldn't create the AUDIN regmap\n");
|
||||
+ return PTR_ERR(data->audin);
|
||||
+ }
|
||||
+
|
||||
+ return devm_mfd_add_devices(dev, PLATFORM_DEVID_AUTO, meson_acore_devs,
|
||||
+ ARRAY_SIZE(meson_acore_devs), NULL, 0,
|
||||
+ NULL);
|
||||
+}
|
||||
+
|
||||
+static const struct of_device_id meson_acore_of_match[] = {
|
||||
+ { .compatible = "amlogic,meson-audio-core", },
|
||||
+ { .compatible = "amlogic,meson-gxbb-audio-core", },
|
||||
+ { .compatible = "amlogic,meson-gxl-audio-core", },
|
||||
+ {}
|
||||
+};
|
||||
+MODULE_DEVICE_TABLE(of, meson_acore_of_match);
|
||||
+
|
||||
+static struct platform_driver meson_acore_pdrv = {
|
||||
+ .probe = meson_acore_probe,
|
||||
+ .driver = {
|
||||
+ .name = DRV_NAME,
|
||||
+ .of_match_table = meson_acore_of_match,
|
||||
+ },
|
||||
+};
|
||||
+module_platform_driver(meson_acore_pdrv);
|
||||
+
|
||||
+MODULE_DESCRIPTION("Meson Audio Core Driver");
|
||||
+MODULE_AUTHOR("Jerome Brunet <jbrunet@baylibre.com>");
|
||||
+MODULE_LICENSE("GPL v2");
|
||||
diff --git a/sound/soc/meson/audio-core.h b/sound/soc/meson/audio-core.h
|
||||
new file mode 100644
|
||||
index 0000000..6e7a24c
|
||||
--- /dev/null
|
||||
+++ b/sound/soc/meson/audio-core.h
|
||||
@@ -0,0 +1,28 @@
|
||||
+/*
|
||||
+ * Copyright (C) 2017 BayLibre, SAS
|
||||
+ * Author: Jerome Brunet <jbrunet@baylibre.com>
|
||||
+ * Copyright (C) 2017 Amlogic, Inc. All rights reserved.
|
||||
+ *
|
||||
+ * 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.
|
||||
+ *
|
||||
+ * This program is distributed in the hope that it will be useful, but
|
||||
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
+ * General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License
|
||||
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
+ */
|
||||
+
|
||||
+#ifndef _MESON_AUDIO_CORE_H_
|
||||
+#define _MESON_AUDIO_CORE_H_
|
||||
+
|
||||
+struct meson_audio_core_data {
|
||||
+ struct regmap *aiu;
|
||||
+ struct regmap *audin;
|
||||
+};
|
||||
+
|
||||
+#endif /* _MESON_AUDIO_CORE_H_ */
|
||||
--
|
||||
2.7.4
|
||||
|
@ -0,0 +1,361 @@
|
||||
From 04b110f288ec7436b0d714b090498562ab93c04b Mon Sep 17 00:00:00 2001
|
||||
From: Jerome Brunet <jbrunet@baylibre.com>
|
||||
Date: Thu, 30 Mar 2017 12:00:10 +0200
|
||||
Subject: [PATCH 04/14] ASoC: meson: add register definitions
|
||||
|
||||
Add the register definition for the AIU and AUDIN blocks
|
||||
|
||||
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
|
||||
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
|
||||
---
|
||||
sound/soc/meson/aiu-regs.h | 182 +++++++++++++++++++++++++++++++++++++++++++
|
||||
sound/soc/meson/audin-regs.h | 148 +++++++++++++++++++++++++++++++++++
|
||||
2 files changed, 330 insertions(+)
|
||||
create mode 100644 sound/soc/meson/aiu-regs.h
|
||||
create mode 100644 sound/soc/meson/audin-regs.h
|
||||
|
||||
diff --git a/sound/soc/meson/aiu-regs.h b/sound/soc/meson/aiu-regs.h
|
||||
new file mode 100644
|
||||
index 0000000..67391e6
|
||||
--- /dev/null
|
||||
+++ b/sound/soc/meson/aiu-regs.h
|
||||
@@ -0,0 +1,182 @@
|
||||
+/*
|
||||
+ * Copyright (C) 2017 BayLibre, SAS
|
||||
+ * Author: Jerome Brunet <jbrunet@baylibre.com>
|
||||
+ * Copyright (C) 2017 Amlogic, Inc. All rights reserved.
|
||||
+ *
|
||||
+ * 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.
|
||||
+ *
|
||||
+ * This program is distributed in the hope that it will be useful, but
|
||||
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
+ * General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License
|
||||
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
+ */
|
||||
+
|
||||
+#ifndef _AIU_REGS_H_
|
||||
+#define _AIU_REGS_H_
|
||||
+
|
||||
+#define AIU_958_BPF 0x000
|
||||
+#define AIU_958_BRST 0x004
|
||||
+#define AIU_958_LENGTH 0x008
|
||||
+#define AIU_958_PADDSIZE 0x00C
|
||||
+#define AIU_958_MISC 0x010
|
||||
+#define AIU_958_FORCE_LEFT 0x014 /* Unknown */
|
||||
+#define AIU_958_DISCARD_NUM 0x018
|
||||
+#define AIU_958_DCU_FF_CTRL 0x01C
|
||||
+#define AIU_958_CHSTAT_L0 0x020
|
||||
+#define AIU_958_CHSTAT_L1 0x024
|
||||
+#define AIU_958_CTRL 0x028
|
||||
+#define AIU_958_RPT 0x02C
|
||||
+#define AIU_I2S_MUTE_SWAP 0x030
|
||||
+#define AIU_I2S_SOURCE_DESC 0x034
|
||||
+#define AIU_I2S_MED_CTRL 0x038
|
||||
+#define AIU_I2S_MED_THRESH 0x03C
|
||||
+#define AIU_I2S_DAC_CFG 0x040
|
||||
+#define AIU_I2S_SYNC 0x044 /* Unknown */
|
||||
+#define AIU_I2S_MISC 0x048
|
||||
+#define AIU_I2S_OUT_CFG 0x04C
|
||||
+#define AIU_I2S_FF_CTRL 0x050 /* Unknown */
|
||||
+#define AIU_RST_SOFT 0x054
|
||||
+#define AIU_CLK_CTRL 0x058
|
||||
+#define AIU_MIX_ADCCFG 0x05C
|
||||
+#define AIU_MIX_CTRL 0x060
|
||||
+#define AIU_CLK_CTRL_MORE 0x064
|
||||
+#define AIU_958_POP 0x068
|
||||
+#define AIU_MIX_GAIN 0x06C
|
||||
+#define AIU_958_SYNWORD1 0x070
|
||||
+#define AIU_958_SYNWORD2 0x074
|
||||
+#define AIU_958_SYNWORD3 0x078
|
||||
+#define AIU_958_SYNWORD1_MASK 0x07C
|
||||
+#define AIU_958_SYNWORD2_MASK 0x080
|
||||
+#define AIU_958_SYNWORD3_MASK 0x084
|
||||
+#define AIU_958_FFRDOUT_THD 0x088
|
||||
+#define AIU_958_LENGTH_PER_PAUSE 0x08C
|
||||
+#define AIU_958_PAUSE_NUM 0x090
|
||||
+#define AIU_958_PAUSE_PAYLOAD 0x094
|
||||
+#define AIU_958_AUTO_PAUSE 0x098
|
||||
+#define AIU_958_PAUSE_PD_LENGTH 0x09C
|
||||
+#define AIU_CODEC_DAC_LRCLK_CTRL 0x0A0
|
||||
+#define AIU_CODEC_ADC_LRCLK_CTRL 0x0A4
|
||||
+#define AIU_HDMI_CLK_DATA_CTRL 0x0A8
|
||||
+#define AIU_CODEC_CLK_DATA_CTRL 0x0AC
|
||||
+#define AIU_ACODEC_CTRL 0x0B0
|
||||
+#define AIU_958_CHSTAT_R0 0x0C0
|
||||
+#define AIU_958_CHSTAT_R1 0x0C4
|
||||
+#define AIU_958_VALID_CTRL 0x0C8
|
||||
+#define AIU_AUDIO_AMP_REG0 0x0F0 /* Unknown */
|
||||
+#define AIU_AUDIO_AMP_REG1 0x0F4 /* Unknown */
|
||||
+#define AIU_AUDIO_AMP_REG2 0x0F8 /* Unknown */
|
||||
+#define AIU_AUDIO_AMP_REG3 0x0FC /* Unknown */
|
||||
+#define AIU_AIFIFO2_CTRL 0x100
|
||||
+#define AIU_AIFIFO2_STATUS 0x104
|
||||
+#define AIU_AIFIFO2_GBIT 0x108
|
||||
+#define AIU_AIFIFO2_CLB 0x10C
|
||||
+#define AIU_CRC_CTRL 0x110
|
||||
+#define AIU_CRC_STATUS 0x114
|
||||
+#define AIU_CRC_SHIFT_REG 0x118
|
||||
+#define AIU_CRC_IREG 0x11C
|
||||
+#define AIU_CRC_CAL_REG1 0x120
|
||||
+#define AIU_CRC_CAL_REG0 0x124
|
||||
+#define AIU_CRC_POLY_COEF1 0x128
|
||||
+#define AIU_CRC_POLY_COEF0 0x12C
|
||||
+#define AIU_CRC_BIT_SIZE1 0x130
|
||||
+#define AIU_CRC_BIT_SIZE0 0x134
|
||||
+#define AIU_CRC_BIT_CNT1 0x138
|
||||
+#define AIU_CRC_BIT_CNT0 0x13C
|
||||
+#define AIU_AMCLK_GATE_HI 0x140
|
||||
+#define AIU_AMCLK_GATE_LO 0x144
|
||||
+#define AIU_AMCLK_MSR 0x148
|
||||
+#define AIU_AUDAC_CTRL0 0x14C /* Unknown */
|
||||
+#define AIU_DELTA_SIGMA0 0x154 /* Unknown */
|
||||
+#define AIU_DELTA_SIGMA1 0x158 /* Unknown */
|
||||
+#define AIU_DELTA_SIGMA2 0x15C /* Unknown */
|
||||
+#define AIU_DELTA_SIGMA3 0x160 /* Unknown */
|
||||
+#define AIU_DELTA_SIGMA4 0x164 /* Unknown */
|
||||
+#define AIU_DELTA_SIGMA5 0x168 /* Unknown */
|
||||
+#define AIU_DELTA_SIGMA6 0x16C /* Unknown */
|
||||
+#define AIU_DELTA_SIGMA7 0x170 /* Unknown */
|
||||
+#define AIU_DELTA_SIGMA_LCNTS 0x174 /* Unknown */
|
||||
+#define AIU_DELTA_SIGMA_RCNTS 0x178 /* Unknown */
|
||||
+#define AIU_MEM_I2S_START_PTR 0x180
|
||||
+#define AIU_MEM_I2S_RD_PTR 0x184
|
||||
+#define AIU_MEM_I2S_END_PTR 0x188
|
||||
+#define AIU_MEM_I2S_MASKS 0x18C
|
||||
+#define AIU_MEM_I2S_CONTROL 0x190
|
||||
+#define AIU_MEM_IEC958_START_PTR 0x194
|
||||
+#define AIU_MEM_IEC958_RD_PTR 0x198
|
||||
+#define AIU_MEM_IEC958_END_PTR 0x19C
|
||||
+#define AIU_MEM_IEC958_MASKS 0x1A0
|
||||
+#define AIU_MEM_IEC958_CONTROL 0x1A4
|
||||
+#define AIU_MEM_AIFIFO2_START_PTR 0x1A8
|
||||
+#define AIU_MEM_AIFIFO2_CURR_PTR 0x1AC
|
||||
+#define AIU_MEM_AIFIFO2_END_PTR 0x1B0
|
||||
+#define AIU_MEM_AIFIFO2_BYTES_AVAIL 0x1B4
|
||||
+#define AIU_MEM_AIFIFO2_CONTROL 0x1B8
|
||||
+#define AIU_MEM_AIFIFO2_MAN_WP 0x1BC
|
||||
+#define AIU_MEM_AIFIFO2_MAN_RP 0x1C0
|
||||
+#define AIU_MEM_AIFIFO2_LEVEL 0x1C4
|
||||
+#define AIU_MEM_AIFIFO2_BUF_CNTL 0x1C8
|
||||
+#define AIU_MEM_I2S_MAN_WP 0x1CC
|
||||
+#define AIU_MEM_I2S_MAN_RP 0x1D0
|
||||
+#define AIU_MEM_I2S_LEVEL 0x1D4
|
||||
+#define AIU_MEM_I2S_BUF_CNTL 0x1D8
|
||||
+#define AIU_MEM_I2S_BUF_WRAP_COUNT 0x1DC
|
||||
+#define AIU_MEM_I2S_MEM_CTL 0x1E0
|
||||
+#define AIU_MEM_IEC958_MEM_CTL 0x1E4
|
||||
+#define AIU_MEM_IEC958_WRAP_COUNT 0x1E8
|
||||
+#define AIU_MEM_IEC958_IRQ_LEVEL 0x1EC
|
||||
+#define AIU_MEM_IEC958_MAN_WP 0x1F0
|
||||
+#define AIU_MEM_IEC958_MAN_RP 0x1F4
|
||||
+#define AIU_MEM_IEC958_LEVEL 0x1F8
|
||||
+#define AIU_MEM_IEC958_BUF_CNTL 0x1FC
|
||||
+#define AIU_AIFIFO_CTRL 0x200
|
||||
+#define AIU_AIFIFO_STATUS 0x204
|
||||
+#define AIU_AIFIFO_GBIT 0x208
|
||||
+#define AIU_AIFIFO_CLB 0x20C
|
||||
+#define AIU_MEM_AIFIFO_START_PTR 0x210
|
||||
+#define AIU_MEM_AIFIFO_CURR_PTR 0x214
|
||||
+#define AIU_MEM_AIFIFO_END_PTR 0x218
|
||||
+#define AIU_MEM_AIFIFO_BYTES_AVAIL 0x21C
|
||||
+#define AIU_MEM_AIFIFO_CONTROL 0x220
|
||||
+#define AIU_MEM_AIFIFO_MAN_WP 0x224
|
||||
+#define AIU_MEM_AIFIFO_MAN_RP 0x228
|
||||
+#define AIU_MEM_AIFIFO_LEVEL 0x22C
|
||||
+#define AIU_MEM_AIFIFO_BUF_CNTL 0x230
|
||||
+#define AIU_MEM_AIFIFO_BUF_WRAP_COUNT 0x234
|
||||
+#define AIU_MEM_AIFIFO2_BUF_WRAP_COUNT 0x238
|
||||
+#define AIU_MEM_AIFIFO_MEM_CTL 0x23C
|
||||
+#define AIFIFO_TIME_STAMP_CNTL 0x240
|
||||
+#define AIFIFO_TIME_STAMP_SYNC_0 0x244
|
||||
+#define AIFIFO_TIME_STAMP_SYNC_1 0x248
|
||||
+#define AIFIFO_TIME_STAMP_0 0x24C
|
||||
+#define AIFIFO_TIME_STAMP_1 0x250
|
||||
+#define AIFIFO_TIME_STAMP_2 0x254
|
||||
+#define AIFIFO_TIME_STAMP_3 0x258
|
||||
+#define AIFIFO_TIME_STAMP_LENGTH 0x25C
|
||||
+#define AIFIFO2_TIME_STAMP_CNTL 0x260
|
||||
+#define AIFIFO2_TIME_STAMP_SYNC_0 0x264
|
||||
+#define AIFIFO2_TIME_STAMP_SYNC_1 0x268
|
||||
+#define AIFIFO2_TIME_STAMP_0 0x26C
|
||||
+#define AIFIFO2_TIME_STAMP_1 0x270
|
||||
+#define AIFIFO2_TIME_STAMP_2 0x274
|
||||
+#define AIFIFO2_TIME_STAMP_3 0x278
|
||||
+#define AIFIFO2_TIME_STAMP_LENGTH 0x27C
|
||||
+#define IEC958_TIME_STAMP_CNTL 0x280
|
||||
+#define IEC958_TIME_STAMP_SYNC_0 0x284
|
||||
+#define IEC958_TIME_STAMP_SYNC_1 0x288
|
||||
+#define IEC958_TIME_STAMP_0 0x28C
|
||||
+#define IEC958_TIME_STAMP_1 0x290
|
||||
+#define IEC958_TIME_STAMP_2 0x294
|
||||
+#define IEC958_TIME_STAMP_3 0x298
|
||||
+#define IEC958_TIME_STAMP_LENGTH 0x29C
|
||||
+#define AIU_MEM_AIFIFO2_MEM_CTL 0x2A0
|
||||
+#define AIU_I2S_CBUS_DDR_CNTL 0x2A4
|
||||
+#define AIU_I2S_CBUS_DDR_WDATA 0x2A8
|
||||
+#define AIU_I2S_CBUS_DDR_ADDR 0x2AC
|
||||
+
|
||||
+#endif /* _AIU_REGS_H_ */
|
||||
diff --git a/sound/soc/meson/audin-regs.h b/sound/soc/meson/audin-regs.h
|
||||
new file mode 100644
|
||||
index 0000000..f224610
|
||||
--- /dev/null
|
||||
+++ b/sound/soc/meson/audin-regs.h
|
||||
@@ -0,0 +1,148 @@
|
||||
+/*
|
||||
+ * Copyright (C) 2017 BayLibre, SAS
|
||||
+ * Author: Jerome Brunet <jbrunet@baylibre.com>
|
||||
+ * Copyright (C) 2017 Amlogic, Inc. All rights reserved.
|
||||
+ *
|
||||
+ * 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.
|
||||
+ *
|
||||
+ * This program is distributed in the hope that it will be useful, but
|
||||
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
+ * General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License
|
||||
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
+ */
|
||||
+
|
||||
+#ifndef _AUDIN_REGS_H_
|
||||
+#define _AUDIN_REGS_H_
|
||||
+
|
||||
+/*
|
||||
+ * Note :
|
||||
+ * Datasheet issue page 196
|
||||
+ * AUDIN_MUTE_VAL 0x35 => impossible: Already assigned to AUDIN_FIFO1_PTR
|
||||
+ * AUDIN_FIFO1_PTR is more likely to be correct here since surrounding registers
|
||||
+ * also deal with AUDIN_FIFO1
|
||||
+ *
|
||||
+ * Clarification needed from Amlogic
|
||||
+ */
|
||||
+
|
||||
+#define AUDIN_SPDIF_MODE 0x000
|
||||
+#define AUDIN_SPDIF_FS_CLK_RLTN 0x004
|
||||
+#define AUDIN_SPDIF_CHNL_STS_A 0x008
|
||||
+#define AUDIN_SPDIF_CHNL_STS_B 0x00C
|
||||
+#define AUDIN_SPDIF_MISC 0x010
|
||||
+#define AUDIN_SPDIF_NPCM_PCPD 0x014
|
||||
+#define AUDIN_SPDIF_END 0x03C /* Unknown */
|
||||
+#define AUDIN_I2SIN_CTRL 0x040
|
||||
+#define AUDIN_SOURCE_SEL 0x044
|
||||
+#define AUDIN_DECODE_FORMAT 0x048
|
||||
+#define AUDIN_DECODE_CONTROL_STATUS 0x04C
|
||||
+#define AUDIN_DECODE_CHANNEL_STATUS_A_0 0x050
|
||||
+#define AUDIN_DECODE_CHANNEL_STATUS_A_1 0x054
|
||||
+#define AUDIN_DECODE_CHANNEL_STATUS_A_2 0x058
|
||||
+#define AUDIN_DECODE_CHANNEL_STATUS_A_3 0x05C
|
||||
+#define AUDIN_DECODE_CHANNEL_STATUS_A_4 0x060
|
||||
+#define AUDIN_DECODE_CHANNEL_STATUS_A_5 0x064
|
||||
+#define AUDIN_FIFO0_START 0x080
|
||||
+#define AUDIN_FIFO0_END 0x084
|
||||
+#define AUDIN_FIFO0_PTR 0x088
|
||||
+#define AUDIN_FIFO0_INTR 0x08C
|
||||
+#define AUDIN_FIFO0_RDPTR 0x090
|
||||
+#define AUDIN_FIFO0_CTRL 0x094
|
||||
+#define AUDIN_FIFO0_CTRL1 0x098
|
||||
+#define AUDIN_FIFO0_LVL0 0x09C
|
||||
+#define AUDIN_FIFO0_LVL1 0x0A0
|
||||
+#define AUDIN_FIFO0_LVL2 0x0A4
|
||||
+#define AUDIN_FIFO0_REQID 0x0C0
|
||||
+#define AUDIN_FIFO0_WRAP 0x0C4
|
||||
+#define AUDIN_FIFO1_START 0x0CC
|
||||
+#define AUDIN_FIFO1_END 0x0D0
|
||||
+#define AUDIN_FIFO1_PTR 0x0D4
|
||||
+#define AUDIN_FIFO1_INTR 0x0D8
|
||||
+#define AUDIN_FIFO1_RDPTR 0x0DC
|
||||
+#define AUDIN_FIFO1_CTRL 0x0E0
|
||||
+#define AUDIN_FIFO1_CTRL1 0x0E4
|
||||
+#define AUDIN_FIFO1_LVL0 0x100
|
||||
+#define AUDIN_FIFO1_LVL1 0x104
|
||||
+#define AUDIN_FIFO1_LVL2 0x108
|
||||
+#define AUDIN_FIFO1_REQID 0x10C
|
||||
+#define AUDIN_FIFO1_WRAP 0x110
|
||||
+#define AUDIN_FIFO2_START 0x114
|
||||
+#define AUDIN_FIFO2_END 0x118
|
||||
+#define AUDIN_FIFO2_PTR 0x11C
|
||||
+#define AUDIN_FIFO2_INTR 0x120
|
||||
+#define AUDIN_FIFO2_RDPTR 0x124
|
||||
+#define AUDIN_FIFO2_CTRL 0x128
|
||||
+#define AUDIN_FIFO2_CTRL1 0x12C
|
||||
+#define AUDIN_FIFO2_LVL0 0x130
|
||||
+#define AUDIN_FIFO2_LVL1 0x134
|
||||
+#define AUDIN_FIFO2_LVL2 0x138
|
||||
+#define AUDIN_FIFO2_REQID 0x13C
|
||||
+#define AUDIN_FIFO2_WRAP 0x140
|
||||
+#define AUDIN_INT_CTRL 0x144
|
||||
+#define AUDIN_FIFO_INT 0x148
|
||||
+#define PCMIN_CTRL0 0x180
|
||||
+#define PCMIN_CTRL1 0x184
|
||||
+#define PCMIN1_CTRL0 0x188
|
||||
+#define PCMIN1_CTRL1 0x18C
|
||||
+#define PCMOUT_CTRL0 0x1C0
|
||||
+#define PCMOUT_CTRL1 0x1C4
|
||||
+#define PCMOUT_CTRL2 0x1C8
|
||||
+#define PCMOUT_CTRL3 0x1CC
|
||||
+#define PCMOUT1_CTRL0 0x1D0
|
||||
+#define PCMOUT1_CTRL1 0x1D4
|
||||
+#define PCMOUT1_CTRL2 0x1D8
|
||||
+#define PCMOUT1_CTRL3 0x1DC
|
||||
+#define AUDOUT_CTRL 0x200
|
||||
+#define AUDOUT_CTRL1 0x204
|
||||
+#define AUDOUT_BUF0_STA 0x208
|
||||
+#define AUDOUT_BUF0_EDA 0x20C
|
||||
+#define AUDOUT_BUF0_WPTR 0x210
|
||||
+#define AUDOUT_BUF1_STA 0x214
|
||||
+#define AUDOUT_BUF1_EDA 0x218
|
||||
+#define AUDOUT_BUF1_WPTR 0x21C
|
||||
+#define AUDOUT_FIFO_RPTR 0x220
|
||||
+#define AUDOUT_INTR_PTR 0x224
|
||||
+#define AUDOUT_FIFO_STS 0x228
|
||||
+#define AUDOUT1_CTRL 0x240
|
||||
+#define AUDOUT1_CTRL1 0x244
|
||||
+#define AUDOUT1_BUF0_STA 0x248
|
||||
+#define AUDOUT1_BUF0_EDA 0x24C
|
||||
+#define AUDOUT1_BUF0_WPTR 0x250
|
||||
+#define AUDOUT1_BUF1_STA 0x254
|
||||
+#define AUDOUT1_BUF1_EDA 0x258
|
||||
+#define AUDOUT1_BUF1_WPTR 0x25C
|
||||
+#define AUDOUT1_FIFO_RPTR 0x260
|
||||
+#define AUDOUT1_INTR_PTR 0x264
|
||||
+#define AUDOUT1_FIFO_STS 0x268
|
||||
+#define AUDIN_HDMI_MEAS_CTRL 0x280
|
||||
+#define AUDIN_HDMI_MEAS_CYCLES_M1 0x284
|
||||
+#define AUDIN_HDMI_MEAS_INTR_MASKN 0x288
|
||||
+#define AUDIN_HDMI_MEAS_INTR_STAT 0x28C
|
||||
+#define AUDIN_HDMI_REF_CYCLES_STAT_0 0x290
|
||||
+#define AUDIN_HDMI_REF_CYCLES_STAT_1 0x294
|
||||
+#define AUDIN_HDMIRX_AFIFO_STAT 0x298
|
||||
+#define AUDIN_FIFO0_PIO_STS 0x2C0
|
||||
+#define AUDIN_FIFO0_PIO_RDL 0x2C4
|
||||
+#define AUDIN_FIFO0_PIO_RDH 0x2C8
|
||||
+#define AUDIN_FIFO1_PIO_STS 0x2CC
|
||||
+#define AUDIN_FIFO1_PIO_RDL 0x2D0
|
||||
+#define AUDIN_FIFO1_PIO_RDH 0x2D4
|
||||
+#define AUDIN_FIFO2_PIO_STS 0x2D8
|
||||
+#define AUDIN_FIFO2_PIO_RDL 0x2DC
|
||||
+#define AUDIN_FIFO2_PIO_RDH 0x2E0
|
||||
+#define AUDOUT_FIFO_PIO_STS 0x2E4
|
||||
+#define AUDOUT_FIFO_PIO_WRL 0x2E8
|
||||
+#define AUDOUT_FIFO_PIO_WRH 0x2EC
|
||||
+#define AUDOUT1_FIFO_PIO_STS 0x2F0 /* Unknown */
|
||||
+#define AUDOUT1_FIFO_PIO_WRL 0x2F4 /* Unknown */
|
||||
+#define AUDOUT1_FIFO_PIO_WRH 0x2F8 /* Unknown */
|
||||
+#define AUD_RESAMPLE_CTRL0 0x2FC
|
||||
+#define AUD_RESAMPLE_CTRL1 0x300
|
||||
+#define AUD_RESAMPLE_STATUS 0x304
|
||||
+
|
||||
+#endif /* _AUDIN_REGS_H_ */
|
||||
--
|
||||
2.7.4
|
||||
|
@ -0,0 +1,417 @@
|
||||
From 298241f7155bfeed607b68840950c4d193cbaf55 Mon Sep 17 00:00:00 2001
|
||||
From: Jerome Brunet <jbrunet@baylibre.com>
|
||||
Date: Thu, 30 Mar 2017 12:14:40 +0200
|
||||
Subject: [PATCH 05/14] ASoC: meson: add aiu i2s dma support
|
||||
|
||||
Add support for the i2s output dma which is part of the AIU block
|
||||
|
||||
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
|
||||
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
|
||||
---
|
||||
sound/soc/meson/Kconfig | 7 +
|
||||
sound/soc/meson/Makefile | 2 +
|
||||
sound/soc/meson/aiu-i2s-dma.c | 367 ++++++++++++++++++++++++++++++++++++++++++
|
||||
3 files changed, 376 insertions(+)
|
||||
create mode 100644 sound/soc/meson/aiu-i2s-dma.c
|
||||
|
||||
diff --git a/sound/soc/meson/Kconfig b/sound/soc/meson/Kconfig
|
||||
index 216c850..ad31a11 100644
|
||||
--- a/sound/soc/meson/Kconfig
|
||||
+++ b/sound/soc/meson/Kconfig
|
||||
@@ -7,3 +7,10 @@ menuconfig SND_SOC_MESON
|
||||
Say Y or M if you want to add support for codecs attached to
|
||||
the Amlogic Meson SoCs Audio interfaces. You will also need to
|
||||
select the audio interfaces to support below.
|
||||
+
|
||||
+config SND_SOC_MESON_I2S
|
||||
+ tristate "Meson i2s interface"
|
||||
+ depends on SND_SOC_MESON
|
||||
+ help
|
||||
+ Say Y or M if you want to add support for i2s dma driver for Amlogic
|
||||
+ Meson SoCs.
|
||||
diff --git a/sound/soc/meson/Makefile b/sound/soc/meson/Makefile
|
||||
index 22028ab..273f275 100644
|
||||
--- a/sound/soc/meson/Makefile
|
||||
+++ b/sound/soc/meson/Makefile
|
||||
@@ -1,3 +1,5 @@
|
||||
snd-soc-meson-audio-core-objs := audio-core.o
|
||||
+snd-soc-meson-aiu-i2s-dma-objs := aiu-i2s-dma.o
|
||||
|
||||
obj-$(CONFIG_SND_SOC_MESON) += snd-soc-meson-audio-core.o
|
||||
+obj-$(CONFIG_SND_SOC_MESON_I2S) += snd-soc-meson-aiu-i2s-dma.o
|
||||
diff --git a/sound/soc/meson/aiu-i2s-dma.c b/sound/soc/meson/aiu-i2s-dma.c
|
||||
new file mode 100644
|
||||
index 0000000..bab950d
|
||||
--- /dev/null
|
||||
+++ b/sound/soc/meson/aiu-i2s-dma.c
|
||||
@@ -0,0 +1,367 @@
|
||||
+/*
|
||||
+ * Copyright (C) 2017 BayLibre, SAS
|
||||
+ * Author: Jerome Brunet <jbrunet@baylibre.com>
|
||||
+ * Copyright (C) 2017 Amlogic, Inc. All rights reserved.
|
||||
+ *
|
||||
+ * 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.
|
||||
+ *
|
||||
+ * This program is distributed in the hope that it will be useful, but
|
||||
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
+ * General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License
|
||||
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
+ */
|
||||
+
|
||||
+#include <linux/clk.h>
|
||||
+#include <linux/mfd/syscon.h>
|
||||
+#include <linux/module.h>
|
||||
+#include <linux/of.h>
|
||||
+#include <linux/platform_device.h>
|
||||
+#include <linux/regmap.h>
|
||||
+
|
||||
+#include <sound/pcm_params.h>
|
||||
+#include <sound/soc.h>
|
||||
+
|
||||
+#include "aiu-regs.h"
|
||||
+#include "audio-core.h"
|
||||
+
|
||||
+#define DRV_NAME "meson-aiu-i2s-dma"
|
||||
+
|
||||
+struct aiu_i2s_dma {
|
||||
+ struct meson_audio_core_data *core;
|
||||
+ struct clk *fast;
|
||||
+ int irq;
|
||||
+};
|
||||
+
|
||||
+#define AIU_MEM_I2S_BUF_CNTL_INIT BIT(0)
|
||||
+#define AIU_MEM_I2S_CONTROL_INIT BIT(0)
|
||||
+#define AIU_MEM_I2S_CONTROL_FILL_EN BIT(1)
|
||||
+#define AIU_MEM_I2S_CONTROL_EMPTY_EN BIT(2)
|
||||
+#define AIU_MEM_I2S_CONTROL_MODE_16BIT BIT(6)
|
||||
+#define AIU_MEM_I2S_CONTROL_BUSY BIT(7)
|
||||
+#define AIU_MEM_I2S_CONTROL_DATA_READY BIT(8)
|
||||
+#define AIU_MEM_I2S_CONTROL_LEVEL_CNTL BIT(9)
|
||||
+#define AIU_MEM_I2S_MASKS_IRQ_BLOCK_MASK GENMASK(31, 16)
|
||||
+#define AIU_MEM_I2S_MASKS_IRQ_BLOCK(n) ((n) << 16)
|
||||
+#define AIU_MEM_I2S_MASKS_CH_MEM_MASK GENMASK(15, 8)
|
||||
+#define AIU_MEM_I2S_MASKS_CH_MEM(ch) ((ch) << 8)
|
||||
+#define AIU_MEM_I2S_MASKS_CH_RD_MASK GENMASK(7, 0)
|
||||
+#define AIU_MEM_I2S_MASKS_CH_RD(ch) ((ch) << 0)
|
||||
+#define AIU_RST_SOFT_I2S_FAST_DOMAIN BIT(0)
|
||||
+#define AIU_RST_SOFT_I2S_SLOW_DOMAIN BIT(1)
|
||||
+
|
||||
+/*
|
||||
+ * The DMA works by i2s "blocks" (or DMA burst). The burst size and the memory
|
||||
+ * layout expected depends on the mode of operation.
|
||||
+ *
|
||||
+ * - Normal mode: The channels are expected to be packed in 32 bytes groups
|
||||
+ * interleaved the buffer. AIU_MEM_I2S_MASKS_CH_MEM is a bitfield representing
|
||||
+ * the channels present in memory. AIU_MEM_I2S_MASKS_CH_MEM represents the
|
||||
+ * channels read by the DMA. This is very flexible but the unsual memory layout
|
||||
+ * makes it less easy to deal with. The burst size is 32 bytes times the number
|
||||
+ * of channels read.
|
||||
+ *
|
||||
+ * - Split mode:
|
||||
+ * Classical channel interleaved frame organisation. In this mode,
|
||||
+ * AIU_MEM_I2S_MASKS_CH_MEM and AIU_MEM_I2S_MASKS_CH_MEM must be set to 0xff and
|
||||
+ * the burst size is fixed to 256 bytes. The input can be either 2 or 8
|
||||
+ * channels.
|
||||
+ *
|
||||
+ * The following driver implements the split mode.
|
||||
+ */
|
||||
+
|
||||
+#define AIU_I2S_DMA_BURST 256
|
||||
+
|
||||
+static struct snd_pcm_hardware aiu_i2s_dma_hw = {
|
||||
+ .info = (SNDRV_PCM_INFO_INTERLEAVED |
|
||||
+ SNDRV_PCM_INFO_MMAP |
|
||||
+ SNDRV_PCM_INFO_MMAP_VALID |
|
||||
+ SNDRV_PCM_INFO_PAUSE),
|
||||
+
|
||||
+ .formats = (SNDRV_PCM_FMTBIT_S16_LE |
|
||||
+ SNDRV_PCM_FMTBIT_S24_LE |
|
||||
+ SNDRV_PCM_FMTBIT_S32_LE),
|
||||
+
|
||||
+ /*
|
||||
+ * TODO: The DMA can change the endianness, the msb position
|
||||
+ * and deal with unsigned - support this later on
|
||||
+ */
|
||||
+
|
||||
+ .rate_min = 8000,
|
||||
+ .rate_max = 192000,
|
||||
+ .channels_min = 2,
|
||||
+ .channels_max = 8,
|
||||
+ .period_bytes_min = AIU_I2S_DMA_BURST,
|
||||
+ .period_bytes_max = AIU_I2S_DMA_BURST * 65535,
|
||||
+ .periods_min = 2,
|
||||
+ .periods_max = UINT_MAX,
|
||||
+ .buffer_bytes_max = 1 * 1024 * 1024,
|
||||
+ .fifo_size = 0,
|
||||
+};
|
||||
+
|
||||
+static struct aiu_i2s_dma *aiu_i2s_dma_priv(struct snd_pcm_substream *s)
|
||||
+{
|
||||
+ struct snd_soc_pcm_runtime *rtd = s->private_data;
|
||||
+
|
||||
+ return snd_soc_platform_get_drvdata(rtd->platform);
|
||||
+}
|
||||
+
|
||||
+static snd_pcm_uframes_t
|
||||
+aiu_i2s_dma_pointer(struct snd_pcm_substream *substream)
|
||||
+{
|
||||
+ struct snd_pcm_runtime *runtime = substream->runtime;
|
||||
+ struct aiu_i2s_dma *priv = aiu_i2s_dma_priv(substream);
|
||||
+ unsigned int addr;
|
||||
+ int ret;
|
||||
+
|
||||
+ ret = regmap_read(priv->core->aiu, AIU_MEM_I2S_RD_PTR,
|
||||
+ &addr);
|
||||
+ if (ret)
|
||||
+ return 0;
|
||||
+
|
||||
+ return bytes_to_frames(runtime, addr - (unsigned int)runtime->dma_addr);
|
||||
+}
|
||||
+
|
||||
+static void __dma_enable(struct aiu_i2s_dma *priv, bool enable)
|
||||
+{
|
||||
+ unsigned int en_mask = (AIU_MEM_I2S_CONTROL_FILL_EN |
|
||||
+ AIU_MEM_I2S_CONTROL_EMPTY_EN);
|
||||
+
|
||||
+ regmap_update_bits(priv->core->aiu, AIU_MEM_I2S_CONTROL, en_mask,
|
||||
+ enable ? en_mask : 0);
|
||||
+
|
||||
+}
|
||||
+
|
||||
+static int aiu_i2s_dma_trigger(struct snd_pcm_substream *substream, int cmd)
|
||||
+{
|
||||
+ struct aiu_i2s_dma *priv = aiu_i2s_dma_priv(substream);
|
||||
+
|
||||
+ switch (cmd) {
|
||||
+ case SNDRV_PCM_TRIGGER_START:
|
||||
+ case SNDRV_PCM_TRIGGER_RESUME:
|
||||
+ case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
|
||||
+ __dma_enable(priv, true);
|
||||
+ break;
|
||||
+ case SNDRV_PCM_TRIGGER_SUSPEND:
|
||||
+ case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
|
||||
+ case SNDRV_PCM_TRIGGER_STOP:
|
||||
+ __dma_enable(priv, false);
|
||||
+ break;
|
||||
+ default:
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static void __dma_init_mem(struct aiu_i2s_dma *priv)
|
||||
+{
|
||||
+ regmap_update_bits(priv->core->aiu, AIU_MEM_I2S_CONTROL,
|
||||
+ AIU_MEM_I2S_CONTROL_INIT,
|
||||
+ AIU_MEM_I2S_CONTROL_INIT);
|
||||
+ regmap_update_bits(priv->core->aiu, AIU_MEM_I2S_BUF_CNTL,
|
||||
+ AIU_MEM_I2S_BUF_CNTL_INIT,
|
||||
+ AIU_MEM_I2S_BUF_CNTL_INIT);
|
||||
+
|
||||
+ regmap_update_bits(priv->core->aiu, AIU_MEM_I2S_CONTROL,
|
||||
+ AIU_MEM_I2S_CONTROL_INIT,
|
||||
+ 0);
|
||||
+ regmap_update_bits(priv->core->aiu, AIU_MEM_I2S_BUF_CNTL,
|
||||
+ AIU_MEM_I2S_BUF_CNTL_INIT,
|
||||
+ 0);
|
||||
+}
|
||||
+
|
||||
+static int aiu_i2s_dma_prepare(struct snd_pcm_substream *substream)
|
||||
+{
|
||||
+ struct aiu_i2s_dma *priv = aiu_i2s_dma_priv(substream);
|
||||
+
|
||||
+ __dma_init_mem(priv);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int aiu_i2s_dma_hw_params(struct snd_pcm_substream *substream,
|
||||
+ struct snd_pcm_hw_params *params)
|
||||
+{
|
||||
+ struct snd_pcm_runtime *runtime = substream->runtime;
|
||||
+ struct aiu_i2s_dma *priv = aiu_i2s_dma_priv(substream);
|
||||
+ int ret;
|
||||
+ u32 burst_num, mem_ctl;
|
||||
+ dma_addr_t end_ptr;
|
||||
+
|
||||
+ ret = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(params));
|
||||
+ if (ret < 0)
|
||||
+ return ret;
|
||||
+
|
||||
+ /* Setup memory layout */
|
||||
+ if (params_physical_width(params) == 16)
|
||||
+ mem_ctl = AIU_MEM_I2S_CONTROL_MODE_16BIT;
|
||||
+ else
|
||||
+ mem_ctl = 0;
|
||||
+
|
||||
+ regmap_update_bits(priv->core->aiu, AIU_MEM_I2S_CONTROL,
|
||||
+ AIU_MEM_I2S_CONTROL_MODE_16BIT,
|
||||
+ mem_ctl);
|
||||
+
|
||||
+ /* Initialize memory pointers */
|
||||
+ regmap_write(priv->core->aiu, AIU_MEM_I2S_START_PTR, runtime->dma_addr);
|
||||
+ regmap_write(priv->core->aiu, AIU_MEM_I2S_RD_PTR, runtime->dma_addr);
|
||||
+
|
||||
+ /* The end pointer is the address of the last valid block */
|
||||
+ end_ptr = runtime->dma_addr + runtime->dma_bytes - AIU_I2S_DMA_BURST;
|
||||
+ regmap_write(priv->core->aiu, AIU_MEM_I2S_END_PTR, end_ptr);
|
||||
+
|
||||
+ /* Memory masks */
|
||||
+ burst_num = params_period_bytes(params) / AIU_I2S_DMA_BURST;
|
||||
+ regmap_write(priv->core->aiu, AIU_MEM_I2S_MASKS,
|
||||
+ AIU_MEM_I2S_MASKS_CH_RD(0xff) |
|
||||
+ AIU_MEM_I2S_MASKS_CH_MEM(0xff) |
|
||||
+ AIU_MEM_I2S_MASKS_IRQ_BLOCK(burst_num));
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int aiu_i2s_dma_hw_free(struct snd_pcm_substream *substream)
|
||||
+{
|
||||
+ return snd_pcm_lib_free_pages(substream);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+static irqreturn_t aiu_i2s_dma_irq_block(int irq, void *dev_id)
|
||||
+{
|
||||
+ struct snd_pcm_substream *playback = dev_id;
|
||||
+
|
||||
+ snd_pcm_period_elapsed(playback);
|
||||
+
|
||||
+ return IRQ_HANDLED;
|
||||
+}
|
||||
+
|
||||
+static int aiu_i2s_dma_open(struct snd_pcm_substream *substream)
|
||||
+{
|
||||
+ struct aiu_i2s_dma *priv = aiu_i2s_dma_priv(substream);
|
||||
+ int ret;
|
||||
+
|
||||
+ snd_soc_set_runtime_hwparams(substream, &aiu_i2s_dma_hw);
|
||||
+
|
||||
+ /*
|
||||
+ * Make sure the buffer and period size are multiple of the DMA burst
|
||||
+ * size
|
||||
+ */
|
||||
+ ret = snd_pcm_hw_constraint_step(substream->runtime, 0,
|
||||
+ SNDRV_PCM_HW_PARAM_BUFFER_BYTES,
|
||||
+ AIU_I2S_DMA_BURST);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+ ret = snd_pcm_hw_constraint_step(substream->runtime, 0,
|
||||
+ SNDRV_PCM_HW_PARAM_PERIOD_BYTES,
|
||||
+ AIU_I2S_DMA_BURST);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+ /* Request the I2S DDR irq */
|
||||
+ ret = request_irq(priv->irq, aiu_i2s_dma_irq_block, 0,
|
||||
+ DRV_NAME, substream);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+ /* Power up the i2s fast domain - can't write the registers w/o it */
|
||||
+ ret = clk_prepare_enable(priv->fast);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+ /* Make sure the dma is initially disabled */
|
||||
+ __dma_enable(priv, false);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int aiu_i2s_dma_close(struct snd_pcm_substream *substream)
|
||||
+{
|
||||
+ struct aiu_i2s_dma *priv = aiu_i2s_dma_priv(substream);
|
||||
+
|
||||
+ clk_disable_unprepare(priv->fast);
|
||||
+ free_irq(priv->irq, substream);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static const struct snd_pcm_ops aiu_i2s_dma_ops = {
|
||||
+ .open = aiu_i2s_dma_open,
|
||||
+ .close = aiu_i2s_dma_close,
|
||||
+ .ioctl = snd_pcm_lib_ioctl,
|
||||
+ .hw_params = aiu_i2s_dma_hw_params,
|
||||
+ .hw_free = aiu_i2s_dma_hw_free,
|
||||
+ .prepare = aiu_i2s_dma_prepare,
|
||||
+ .pointer = aiu_i2s_dma_pointer,
|
||||
+ .trigger = aiu_i2s_dma_trigger,
|
||||
+};
|
||||
+
|
||||
+static int aiu_i2s_dma_new(struct snd_soc_pcm_runtime *rtd)
|
||||
+{
|
||||
+ struct snd_card *card = rtd->card->snd_card;
|
||||
+ size_t size = aiu_i2s_dma_hw.buffer_bytes_max;
|
||||
+
|
||||
+ return snd_pcm_lib_preallocate_pages_for_all(rtd->pcm,
|
||||
+ SNDRV_DMA_TYPE_DEV,
|
||||
+ card->dev, size, size);
|
||||
+}
|
||||
+
|
||||
+struct snd_soc_platform_driver aiu_i2s_platform = {
|
||||
+ .ops = &aiu_i2s_dma_ops,
|
||||
+ .pcm_new = aiu_i2s_dma_new,
|
||||
+};
|
||||
+
|
||||
+static int aiu_i2s_dma_probe(struct platform_device *pdev)
|
||||
+{
|
||||
+ struct device *dev = &pdev->dev;
|
||||
+ struct aiu_i2s_dma *priv;
|
||||
+
|
||||
+ priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
|
||||
+ if (!priv)
|
||||
+ return -ENOMEM;
|
||||
+
|
||||
+ platform_set_drvdata(pdev, priv);
|
||||
+ priv->core = dev_get_drvdata(dev->parent);
|
||||
+
|
||||
+ priv->fast = devm_clk_get(dev, "fast");
|
||||
+ if (IS_ERR(priv->fast)) {
|
||||
+ if (PTR_ERR(priv->fast) != -EPROBE_DEFER)
|
||||
+ dev_err(dev, "Can't get i2s fast domain clock\n");
|
||||
+ return PTR_ERR(priv->fast);
|
||||
+ }
|
||||
+
|
||||
+ priv->irq = platform_get_irq(pdev, 0);
|
||||
+ if (priv->irq <= 0) {
|
||||
+ dev_err(dev, "Can't get i2s ddr irq\n");
|
||||
+ return priv->irq;
|
||||
+ }
|
||||
+
|
||||
+ return snd_soc_register_platform(dev, &aiu_i2s_platform);
|
||||
+}
|
||||
+
|
||||
+static const struct of_device_id aiu_i2s_dma_of_match[] = {
|
||||
+ { .compatible = "amlogic,meson-aiu-i2s-dma", },
|
||||
+ { .compatible = "amlogic,meson-gxbb-aiu-i2s-dma", },
|
||||
+ { .compatible = "amlogic,meson-gxl-aiu-i2s-dma", },
|
||||
+ {}
|
||||
+};
|
||||
+MODULE_DEVICE_TABLE(of, aiu_i2s_dma_of_match);
|
||||
+
|
||||
+static struct platform_driver aiu_i2s_dma_pdrv = {
|
||||
+ .probe = aiu_i2s_dma_probe,
|
||||
+ .driver = {
|
||||
+ .name = DRV_NAME,
|
||||
+ .of_match_table = aiu_i2s_dma_of_match,
|
||||
+ },
|
||||
+};
|
||||
+module_platform_driver(aiu_i2s_dma_pdrv);
|
||||
+
|
||||
+MODULE_DESCRIPTION("Meson AIU i2s DMA ASoC Driver");
|
||||
+MODULE_AUTHOR("Jerome Brunet <jbrunet@baylibre.com>");
|
||||
+MODULE_LICENSE("GPL v2");
|
||||
--
|
||||
2.7.4
|
||||
|
@ -0,0 +1,515 @@
|
||||
From 583f1a4a1120f751a26f7c78218e54e449930308 Mon Sep 17 00:00:00 2001
|
||||
From: Jerome Brunet <jbrunet@baylibre.com>
|
||||
Date: Thu, 30 Mar 2017 12:17:27 +0200
|
||||
Subject: [PATCH 06/14] ASoC: meson: add initial i2s dai support
|
||||
|
||||
Add support for the i2s dai found on Amlogic Meson SoC family.
|
||||
With this initial implementation, only playback is supported.
|
||||
Capture will be part of furture work.
|
||||
|
||||
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
|
||||
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
|
||||
---
|
||||
sound/soc/meson/Kconfig | 2 +-
|
||||
sound/soc/meson/Makefile | 2 +
|
||||
sound/soc/meson/i2s-dai.c | 465 ++++++++++++++++++++++++++++++++++++++++++++++
|
||||
3 files changed, 468 insertions(+), 1 deletion(-)
|
||||
create mode 100644 sound/soc/meson/i2s-dai.c
|
||||
|
||||
diff --git a/sound/soc/meson/Kconfig b/sound/soc/meson/Kconfig
|
||||
index ad31a11..604c9e2 100644
|
||||
--- a/sound/soc/meson/Kconfig
|
||||
+++ b/sound/soc/meson/Kconfig
|
||||
@@ -12,5 +12,5 @@ config SND_SOC_MESON_I2S
|
||||
tristate "Meson i2s interface"
|
||||
depends on SND_SOC_MESON
|
||||
help
|
||||
- Say Y or M if you want to add support for i2s dma driver for Amlogic
|
||||
+ Say Y or M if you want to add support for i2s driver for Amlogic
|
||||
Meson SoCs.
|
||||
diff --git a/sound/soc/meson/Makefile b/sound/soc/meson/Makefile
|
||||
index 273f275..ea06dde 100644
|
||||
--- a/sound/soc/meson/Makefile
|
||||
+++ b/sound/soc/meson/Makefile
|
||||
@@ -1,5 +1,7 @@
|
||||
snd-soc-meson-audio-core-objs := audio-core.o
|
||||
snd-soc-meson-aiu-i2s-dma-objs := aiu-i2s-dma.o
|
||||
+snd-soc-meson-i2s-dai-objs := i2s-dai.o
|
||||
|
||||
obj-$(CONFIG_SND_SOC_MESON) += snd-soc-meson-audio-core.o
|
||||
obj-$(CONFIG_SND_SOC_MESON_I2S) += snd-soc-meson-aiu-i2s-dma.o
|
||||
+obj-$(CONFIG_SND_SOC_MESON_I2S) += snd-soc-meson-i2s-dai.o
|
||||
diff --git a/sound/soc/meson/i2s-dai.c b/sound/soc/meson/i2s-dai.c
|
||||
new file mode 100644
|
||||
index 0000000..1008af8
|
||||
--- /dev/null
|
||||
+++ b/sound/soc/meson/i2s-dai.c
|
||||
@@ -0,0 +1,465 @@
|
||||
+/*
|
||||
+ * Copyright (C) 2017 BayLibre, SAS
|
||||
+ * Author: Jerome Brunet <jbrunet@baylibre.com>
|
||||
+ * Copyright (C) 2017 Amlogic, Inc. All rights reserved.
|
||||
+ *
|
||||
+ * 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.
|
||||
+ *
|
||||
+ * This program is distributed in the hope that it will be useful, but
|
||||
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
+ * General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License
|
||||
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
+ */
|
||||
+
|
||||
+#include <linux/clk.h>
|
||||
+#include <linux/mfd/syscon.h>
|
||||
+#include <linux/module.h>
|
||||
+#include <linux/of.h>
|
||||
+#include <linux/platform_device.h>
|
||||
+#include <linux/regmap.h>
|
||||
+
|
||||
+#include <sound/pcm_params.h>
|
||||
+#include <sound/soc.h>
|
||||
+#include <sound/soc-dai.h>
|
||||
+
|
||||
+#include "aiu-regs.h"
|
||||
+#include "audio-core.h"
|
||||
+
|
||||
+#define DRV_NAME "meson-i2s-dai"
|
||||
+
|
||||
+struct meson_i2s_dai {
|
||||
+ struct meson_audio_core_data *core;
|
||||
+ struct clk *mclk;
|
||||
+ struct clk *bclks;
|
||||
+ struct clk *iface;
|
||||
+ struct clk *fast;
|
||||
+ bool bclks_idle;
|
||||
+};
|
||||
+
|
||||
+#define AIU_CLK_CTRL_I2S_DIV_EN BIT(0)
|
||||
+#define AIU_CLK_CTRL_I2S_DIV_MASK GENMASK(3, 2)
|
||||
+#define AIU_CLK_CTRL_AOCLK_POLARITY_MASK BIT(6)
|
||||
+#define AIU_CLK_CTRL_AOCLK_POLARITY_NORMAL (0 << 6)
|
||||
+#define AIU_CLK_CTRL_AOCLK_POLARITY_INVERTED (1 << 6)
|
||||
+#define AIU_CLK_CTRL_ALRCLK_POLARITY_MASK BIT(7)
|
||||
+#define AIU_CLK_CTRL_ALRCLK_POLARITY_NORMAL (0 << 7)
|
||||
+#define AIU_CLK_CTRL_ALRCLK_POLARITY_INVERTED (1 << 7)
|
||||
+#define AIU_CLK_CTRL_ALRCLK_SKEW_MASK GENMASK(9, 8)
|
||||
+#define AIU_CLK_CTRL_ALRCLK_LEFT_J (0 << 8)
|
||||
+#define AIU_CLK_CTRL_ALRCLK_I2S (1 << 8)
|
||||
+#define AIU_CLK_CTRL_ALRCLK_RIGHT_J (2 << 8)
|
||||
+#define AIU_CLK_CTRL_MORE_I2S_DIV_MASK GENMASK(5, 0)
|
||||
+#define AIU_CLK_CTRL_MORE_I2S_DIV(div) (((div) - 1) << 0)
|
||||
+#define AIU_CODEC_DAC_LRCLK_CTRL_DIV_MASK GENMASK(11, 0)
|
||||
+#define AIU_CODEC_DAC_LRCLK_CTRL_DIV(div) (((div) - 1) << 0)
|
||||
+#define AIU_I2S_DAC_CFG_PAYLOAD_SIZE_MASK GENMASK(1, 0)
|
||||
+#define AIU_I2S_DAC_CFG_AOCLK_32 (0 << 0)
|
||||
+#define AIU_I2S_DAC_CFG_AOCLK_48 (2 << 0)
|
||||
+#define AIU_I2S_DAC_CFG_AOCLK_64 (3 << 0)
|
||||
+#define AIU_I2S_MISC_HOLD_EN BIT(2)
|
||||
+#define AIU_I2S_SOURCE_DESC_MODE_8CH BIT(0)
|
||||
+#define AIU_I2S_SOURCE_DESC_MODE_24BIT BIT(5)
|
||||
+#define AIU_I2S_SOURCE_DESC_MODE_32BIT BIT(9)
|
||||
+#define AIU_I2S_SOURCE_DESC_MODE_SPLIT BIT(11)
|
||||
+
|
||||
+static void __hold(struct meson_i2s_dai *priv, bool enable)
|
||||
+{
|
||||
+ regmap_update_bits(priv->core->aiu, AIU_I2S_MISC,
|
||||
+ AIU_I2S_MISC_HOLD_EN,
|
||||
+ enable ? AIU_I2S_MISC_HOLD_EN : 0);
|
||||
+}
|
||||
+
|
||||
+static void __divider_enable(struct meson_i2s_dai *priv, bool enable)
|
||||
+{
|
||||
+ regmap_update_bits(priv->core->aiu, AIU_CLK_CTRL,
|
||||
+ AIU_CLK_CTRL_I2S_DIV_EN,
|
||||
+ enable ? AIU_CLK_CTRL_I2S_DIV_EN : 0);
|
||||
+}
|
||||
+
|
||||
+static void __playback_start(struct meson_i2s_dai *priv)
|
||||
+{
|
||||
+ __divider_enable(priv, true);
|
||||
+ __hold(priv, false);
|
||||
+}
|
||||
+
|
||||
+static void __playback_stop(struct meson_i2s_dai *priv, bool clk_force)
|
||||
+{
|
||||
+ __hold(priv, true);
|
||||
+ /* Disable the bit clks if necessary */
|
||||
+ if (clk_force || !priv->bclks_idle)
|
||||
+ __divider_enable(priv, false);
|
||||
+}
|
||||
+
|
||||
+static int meson_i2s_dai_trigger(struct snd_pcm_substream *substream, int cmd,
|
||||
+ struct snd_soc_dai *dai)
|
||||
+{
|
||||
+ struct meson_i2s_dai *priv = snd_soc_dai_get_drvdata(dai);
|
||||
+ bool clk_force_stop = false;
|
||||
+
|
||||
+ switch (cmd) {
|
||||
+ case SNDRV_PCM_TRIGGER_START:
|
||||
+ case SNDRV_PCM_TRIGGER_RESUME:
|
||||
+ case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
|
||||
+ __playback_start(priv);
|
||||
+ return 0;
|
||||
+
|
||||
+ case SNDRV_PCM_TRIGGER_STOP:
|
||||
+ case SNDRV_PCM_TRIGGER_SUSPEND:
|
||||
+ clk_force_stop = true;
|
||||
+ case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
|
||||
+ __playback_stop(priv, clk_force_stop);
|
||||
+ return 0;
|
||||
+
|
||||
+ default:
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static int __bclks_set_rate(struct meson_i2s_dai *priv, unsigned int srate,
|
||||
+ unsigned int width)
|
||||
+{
|
||||
+ unsigned int fs;
|
||||
+
|
||||
+ /* Get the oversampling factor */
|
||||
+ fs = DIV_ROUND_CLOSEST(clk_get_rate(priv->mclk), srate);
|
||||
+
|
||||
+ /*
|
||||
+ * This DAI is usually connected to the dw-hdmi which does not support
|
||||
+ * bclk being 32 * lrclk or 48 * lrclk
|
||||
+ * Restrict to blck = 64 * lrclk
|
||||
+ */
|
||||
+ if (fs % 64)
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ /* Set the divider between lrclk and bclk */
|
||||
+ regmap_update_bits(priv->core->aiu, AIU_I2S_DAC_CFG,
|
||||
+ AIU_I2S_DAC_CFG_PAYLOAD_SIZE_MASK,
|
||||
+ AIU_I2S_DAC_CFG_AOCLK_64);
|
||||
+
|
||||
+ regmap_update_bits(priv->core->aiu, AIU_CODEC_DAC_LRCLK_CTRL,
|
||||
+ AIU_CODEC_DAC_LRCLK_CTRL_DIV_MASK,
|
||||
+ AIU_CODEC_DAC_LRCLK_CTRL_DIV(64));
|
||||
+
|
||||
+ /* Use CLK_MORE for the i2s divider */
|
||||
+ regmap_update_bits(priv->core->aiu, AIU_CLK_CTRL,
|
||||
+ AIU_CLK_CTRL_I2S_DIV_MASK,
|
||||
+ 0);
|
||||
+
|
||||
+ regmap_update_bits(priv->core->aiu, AIU_CLK_CTRL_MORE,
|
||||
+ AIU_CLK_CTRL_MORE_I2S_DIV_MASK,
|
||||
+ AIU_CLK_CTRL_MORE_I2S_DIV(fs / 64));
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int __setup_desc(struct meson_i2s_dai *priv, unsigned int width,
|
||||
+ unsigned int channels)
|
||||
+{
|
||||
+ u32 desc = 0;
|
||||
+
|
||||
+ switch (width) {
|
||||
+ case 24:
|
||||
+ /*
|
||||
+ * For some reason, 24 bits wide audio don't play well
|
||||
+ * if the 32 bits mode is not set
|
||||
+ */
|
||||
+ desc |= (AIU_I2S_SOURCE_DESC_MODE_24BIT |
|
||||
+ AIU_I2S_SOURCE_DESC_MODE_32BIT);
|
||||
+ break;
|
||||
+ case 16:
|
||||
+ break;
|
||||
+
|
||||
+ default:
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
+ switch (channels) {
|
||||
+ case 2: /* Nothing to do */
|
||||
+ break;
|
||||
+ case 8:
|
||||
+ /* TODO: Still requires testing ... */
|
||||
+ desc |= AIU_I2S_SOURCE_DESC_MODE_8CH;
|
||||
+ break;
|
||||
+ default:
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
+ regmap_update_bits(priv->core->aiu, AIU_I2S_SOURCE_DESC,
|
||||
+ AIU_I2S_SOURCE_DESC_MODE_8CH |
|
||||
+ AIU_I2S_SOURCE_DESC_MODE_24BIT |
|
||||
+ AIU_I2S_SOURCE_DESC_MODE_32BIT,
|
||||
+ desc);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int meson_i2s_dai_hw_params(struct snd_pcm_substream *substream,
|
||||
+ struct snd_pcm_hw_params *params,
|
||||
+ struct snd_soc_dai *dai)
|
||||
+{
|
||||
+ struct meson_i2s_dai *priv = snd_soc_dai_get_drvdata(dai);
|
||||
+ unsigned int width = params_width(params);
|
||||
+ unsigned int channels = params_channels(params);
|
||||
+ unsigned int rate = params_rate(params);
|
||||
+ int ret;
|
||||
+
|
||||
+ ret = __setup_desc(priv, width, channels);
|
||||
+ if (ret) {
|
||||
+ dev_err(dai->dev, "Unable set to set i2s description\n");
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ ret = __bclks_set_rate(priv, rate, width);
|
||||
+ if (ret) {
|
||||
+ dev_err(dai->dev, "Unable set to the i2s clock rates\n");
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int meson_i2s_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
|
||||
+{
|
||||
+ struct meson_i2s_dai *priv = snd_soc_dai_get_drvdata(dai);
|
||||
+ u32 val;
|
||||
+
|
||||
+ if ((fmt & SND_SOC_DAIFMT_MASTER_MASK) != SND_SOC_DAIFMT_CBS_CFS)
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ /* DAI output mode */
|
||||
+ switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
|
||||
+ case SND_SOC_DAIFMT_I2S:
|
||||
+ val = AIU_CLK_CTRL_ALRCLK_I2S;
|
||||
+ break;
|
||||
+ case SND_SOC_DAIFMT_LEFT_J:
|
||||
+ val = AIU_CLK_CTRL_ALRCLK_LEFT_J;
|
||||
+ break;
|
||||
+ case SND_SOC_DAIFMT_RIGHT_J:
|
||||
+ val = AIU_CLK_CTRL_ALRCLK_RIGHT_J;
|
||||
+ break;
|
||||
+ default:
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
+ regmap_update_bits(priv->core->aiu, AIU_CLK_CTRL,
|
||||
+ AIU_CLK_CTRL_ALRCLK_SKEW_MASK,
|
||||
+ val);
|
||||
+
|
||||
+ /* DAI clock polarity */
|
||||
+ switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
|
||||
+ case SND_SOC_DAIFMT_IB_IF:
|
||||
+ /* Invert both clocks */
|
||||
+ val = AIU_CLK_CTRL_ALRCLK_POLARITY_INVERTED |
|
||||
+ AIU_CLK_CTRL_AOCLK_POLARITY_INVERTED;
|
||||
+ break;
|
||||
+ case SND_SOC_DAIFMT_IB_NF:
|
||||
+ /* Invert bit clock */
|
||||
+ val = AIU_CLK_CTRL_ALRCLK_POLARITY_NORMAL |
|
||||
+ AIU_CLK_CTRL_AOCLK_POLARITY_INVERTED;
|
||||
+ break;
|
||||
+ case SND_SOC_DAIFMT_NB_IF:
|
||||
+ /* Invert frame clock */
|
||||
+ val = AIU_CLK_CTRL_ALRCLK_POLARITY_INVERTED |
|
||||
+ AIU_CLK_CTRL_AOCLK_POLARITY_NORMAL;
|
||||
+ break;
|
||||
+ case SND_SOC_DAIFMT_NB_NF:
|
||||
+ /* Normal clocks */
|
||||
+ val = AIU_CLK_CTRL_ALRCLK_POLARITY_NORMAL |
|
||||
+ AIU_CLK_CTRL_AOCLK_POLARITY_NORMAL;
|
||||
+ break;
|
||||
+ default:
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
+ regmap_update_bits(priv->core->aiu, AIU_CLK_CTRL,
|
||||
+ AIU_CLK_CTRL_ALRCLK_POLARITY_MASK |
|
||||
+ AIU_CLK_CTRL_AOCLK_POLARITY_MASK,
|
||||
+ val);
|
||||
+
|
||||
+ switch (fmt & SND_SOC_DAIFMT_CLOCK_MASK) {
|
||||
+ case SND_SOC_DAIFMT_CONT:
|
||||
+ priv->bclks_idle = true;
|
||||
+ break;
|
||||
+ case SND_SOC_DAIFMT_GATED:
|
||||
+ priv->bclks_idle = false;
|
||||
+ break;
|
||||
+ default:
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int meson_i2s_dai_set_sysclk(struct snd_soc_dai *dai, int clk_id,
|
||||
+ unsigned int freq, int dir)
|
||||
+{
|
||||
+ struct meson_i2s_dai *priv = snd_soc_dai_get_drvdata(dai);
|
||||
+ int ret;
|
||||
+
|
||||
+ if (WARN_ON(clk_id != 0))
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ if (dir == SND_SOC_CLOCK_IN)
|
||||
+ return 0;
|
||||
+
|
||||
+ ret = clk_set_rate(priv->mclk, freq);
|
||||
+ if (ret) {
|
||||
+ dev_err(dai->dev, "Failed to set sysclk to %uHz", freq);
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int meson_i2s_dai_startup(struct snd_pcm_substream *substream,
|
||||
+ struct snd_soc_dai *dai)
|
||||
+{
|
||||
+ struct meson_i2s_dai *priv = snd_soc_dai_get_drvdata(dai);
|
||||
+ int ret;
|
||||
+
|
||||
+ /* Power up the i2s fast domain - can't write the registers w/o it */
|
||||
+ ret = clk_prepare_enable(priv->fast);
|
||||
+ if (ret)
|
||||
+ goto out_clk_fast;
|
||||
+
|
||||
+ /* Make sure nothing gets out of the DAI yet */
|
||||
+ __hold(priv, true);
|
||||
+
|
||||
+ /* I2S encoder needs the mixer interface gate */
|
||||
+ ret = clk_prepare_enable(priv->iface);
|
||||
+ if (ret)
|
||||
+ goto out_clk_iface;
|
||||
+
|
||||
+ /* Enable the i2s master clock */
|
||||
+ ret = clk_prepare_enable(priv->mclk);
|
||||
+ if (ret)
|
||||
+ goto out_mclk;
|
||||
+
|
||||
+ /* Enable the bit clock gate */
|
||||
+ ret = clk_prepare_enable(priv->bclks);
|
||||
+ if (ret)
|
||||
+ goto out_bclks;
|
||||
+
|
||||
+ /* Make sure the interface expect a memory layout we can work with */
|
||||
+ regmap_update_bits(priv->core->aiu, AIU_I2S_SOURCE_DESC,
|
||||
+ AIU_I2S_SOURCE_DESC_MODE_SPLIT,
|
||||
+ AIU_I2S_SOURCE_DESC_MODE_SPLIT);
|
||||
+
|
||||
+ return 0;
|
||||
+
|
||||
+out_bclks:
|
||||
+ clk_disable_unprepare(priv->mclk);
|
||||
+out_mclk:
|
||||
+ clk_disable_unprepare(priv->iface);
|
||||
+out_clk_iface:
|
||||
+ clk_disable_unprepare(priv->fast);
|
||||
+out_clk_fast:
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static void meson_i2s_dai_shutdown(struct snd_pcm_substream *substream,
|
||||
+ struct snd_soc_dai *dai)
|
||||
+{
|
||||
+ struct meson_i2s_dai *priv = snd_soc_dai_get_drvdata(dai);
|
||||
+
|
||||
+ clk_disable_unprepare(priv->bclks);
|
||||
+ clk_disable_unprepare(priv->mclk);
|
||||
+ clk_disable_unprepare(priv->iface);
|
||||
+ clk_disable_unprepare(priv->fast);
|
||||
+}
|
||||
+
|
||||
+static const struct snd_soc_dai_ops meson_i2s_dai_ops = {
|
||||
+ .startup = meson_i2s_dai_startup,
|
||||
+ .shutdown = meson_i2s_dai_shutdown,
|
||||
+ .trigger = meson_i2s_dai_trigger,
|
||||
+ .hw_params = meson_i2s_dai_hw_params,
|
||||
+ .set_fmt = meson_i2s_dai_set_fmt,
|
||||
+ .set_sysclk = meson_i2s_dai_set_sysclk,
|
||||
+};
|
||||
+
|
||||
+static struct snd_soc_dai_driver meson_i2s_dai = {
|
||||
+ .playback = {
|
||||
+ .stream_name = "Playback",
|
||||
+ .channels_min = 2,
|
||||
+ .channels_max = 8,
|
||||
+ .rates = SNDRV_PCM_RATE_8000_192000,
|
||||
+ .formats = (SNDRV_PCM_FMTBIT_S16_LE |
|
||||
+ SNDRV_PCM_FMTBIT_S24_LE)
|
||||
+ },
|
||||
+ .ops = &meson_i2s_dai_ops,
|
||||
+};
|
||||
+
|
||||
+static const struct snd_soc_component_driver meson_i2s_dai_component = {
|
||||
+ .name = DRV_NAME,
|
||||
+};
|
||||
+
|
||||
+static int meson_i2s_dai_probe(struct platform_device *pdev)
|
||||
+{
|
||||
+ struct device *dev = &pdev->dev;
|
||||
+ struct meson_i2s_dai *priv;
|
||||
+
|
||||
+ priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
|
||||
+ if (!priv)
|
||||
+ return -ENOMEM;
|
||||
+
|
||||
+ platform_set_drvdata(pdev, priv);
|
||||
+ priv->core = dev_get_drvdata(dev->parent);
|
||||
+
|
||||
+ priv->fast = devm_clk_get(dev, "fast");
|
||||
+ if (IS_ERR(priv->fast)) {
|
||||
+ if (PTR_ERR(priv->fast) != -EPROBE_DEFER)
|
||||
+ dev_err(dev, "Can't get the i2s fast domain clock\n");
|
||||
+ return PTR_ERR(priv->fast);
|
||||
+ }
|
||||
+
|
||||
+ priv->iface = devm_clk_get(dev, "iface");
|
||||
+ if (IS_ERR(priv->iface)) {
|
||||
+ if (PTR_ERR(priv->iface) != -EPROBE_DEFER)
|
||||
+ dev_err(dev, "Can't get i2s dai clock gate\n");
|
||||
+ return PTR_ERR(priv->iface);
|
||||
+ }
|
||||
+
|
||||
+ priv->bclks = devm_clk_get(dev, "bclks");
|
||||
+ if (IS_ERR(priv->bclks)) {
|
||||
+ if (PTR_ERR(priv->bclks) != -EPROBE_DEFER)
|
||||
+ dev_err(dev, "Can't get bit clocks gate\n");
|
||||
+ return PTR_ERR(priv->bclks);
|
||||
+ }
|
||||
+
|
||||
+ priv->mclk = devm_clk_get(dev, "mclk");
|
||||
+ if (IS_ERR(priv->mclk)) {
|
||||
+ if (PTR_ERR(priv->mclk) != -EPROBE_DEFER)
|
||||
+ dev_err(dev, "failed to get the i2s master clock\n");
|
||||
+ return PTR_ERR(priv->mclk);
|
||||
+ }
|
||||
+
|
||||
+ return devm_snd_soc_register_component(dev, &meson_i2s_dai_component,
|
||||
+ &meson_i2s_dai, 1);
|
||||
+}
|
||||
+
|
||||
+static const struct of_device_id meson_i2s_dai_of_match[] = {
|
||||
+ { .compatible = "amlogic,meson-i2s-dai", },
|
||||
+ { .compatible = "amlogic,meson-gxbb-i2s-dai", },
|
||||
+ { .compatible = "amlogic,meson-gxl-i2s-dai", },
|
||||
+ {}
|
||||
+};
|
||||
+MODULE_DEVICE_TABLE(of, meson_i2s_dai_of_match);
|
||||
+
|
||||
+static struct platform_driver meson_i2s_dai_pdrv = {
|
||||
+ .probe = meson_i2s_dai_probe,
|
||||
+ .driver = {
|
||||
+ .name = DRV_NAME,
|
||||
+ .of_match_table = meson_i2s_dai_of_match,
|
||||
+ },
|
||||
+};
|
||||
+module_platform_driver(meson_i2s_dai_pdrv);
|
||||
+
|
||||
+MODULE_DESCRIPTION("Meson i2s DAI ASoC Driver");
|
||||
+MODULE_AUTHOR("Jerome Brunet <jbrunet@baylibre.com>");
|
||||
+MODULE_LICENSE("GPL v2");
|
||||
--
|
||||
2.7.4
|
||||
|
@ -0,0 +1,55 @@
|
||||
From 7833a66101aabad7f882fdf6dee62c7de9c3c71b Mon Sep 17 00:00:00 2001
|
||||
From: Jerome Brunet <jbrunet@baylibre.com>
|
||||
Date: Fri, 7 Jul 2017 17:39:21 +0200
|
||||
Subject: [PATCH 07/14] snd: meson: activate HDMI audio path
|
||||
|
||||
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
|
||||
---
|
||||
sound/soc/meson/i2s-dai.c | 22 ++++++++++++++++++++++
|
||||
1 file changed, 22 insertions(+)
|
||||
|
||||
diff --git a/sound/soc/meson/i2s-dai.c b/sound/soc/meson/i2s-dai.c
|
||||
index 1008af8..63fe098 100644
|
||||
--- a/sound/soc/meson/i2s-dai.c
|
||||
+++ b/sound/soc/meson/i2s-dai.c
|
||||
@@ -56,8 +56,19 @@ struct meson_i2s_dai {
|
||||
#define AIU_CLK_CTRL_ALRCLK_RIGHT_J (2 << 8)
|
||||
#define AIU_CLK_CTRL_MORE_I2S_DIV_MASK GENMASK(5, 0)
|
||||
#define AIU_CLK_CTRL_MORE_I2S_DIV(div) (((div) - 1) << 0)
|
||||
+#define AIU_CLK_CTRL_MORE_HDMI_TX_SEL_MASK BIT(6)
|
||||
+#define AIU_CLK_CTRL_MORE_HDMI_TX_I958_CLK (0 << 6)
|
||||
+#define AIU_CLK_CTRL_MORE_HDMI_TX_INT_CLK (1 << 6)
|
||||
#define AIU_CODEC_DAC_LRCLK_CTRL_DIV_MASK GENMASK(11, 0)
|
||||
#define AIU_CODEC_DAC_LRCLK_CTRL_DIV(div) (((div) - 1) << 0)
|
||||
+#define AIU_HDMI_CLK_DATA_CTRL_CLK_SEL_MASK GENMASK(1, 0)
|
||||
+#define AIU_HDMI_CLK_DATA_CTRL_CLK_DISABLE (0 << 0)
|
||||
+#define AIU_HDMI_CLK_DATA_CTRL_CLK_PCM (1 << 0)
|
||||
+#define AIU_HDMI_CLK_DATA_CTRL_CLK_I2S (2 << 0)
|
||||
+#define AIU_HDMI_CLK_DATA_CTRL_DATA_SEL_MASK GENMASK(5, 4)
|
||||
+#define AIU_HDMI_CLK_DATA_CTRL_DATA_MUTE (0 << 4)
|
||||
+#define AIU_HDMI_CLK_DATA_CTRL_DATA_PCM (1 << 4)
|
||||
+#define AIU_HDMI_CLK_DATA_CTRL_DATA_I2S (2 << 4)
|
||||
#define AIU_I2S_DAC_CFG_PAYLOAD_SIZE_MASK GENMASK(1, 0)
|
||||
#define AIU_I2S_DAC_CFG_AOCLK_32 (0 << 0)
|
||||
#define AIU_I2S_DAC_CFG_AOCLK_48 (2 << 0)
|
||||
@@ -221,6 +232,17 @@ static int meson_i2s_dai_hw_params(struct snd_pcm_substream *substream,
|
||||
return ret;
|
||||
}
|
||||
|
||||
+ /* Quick and dirty hack for HDMI */
|
||||
+ regmap_update_bits(priv->core->aiu, AIU_HDMI_CLK_DATA_CTRL,
|
||||
+ AIU_HDMI_CLK_DATA_CTRL_CLK_SEL_MASK |
|
||||
+ AIU_HDMI_CLK_DATA_CTRL_DATA_SEL_MASK,
|
||||
+ AIU_HDMI_CLK_DATA_CTRL_CLK_I2S |
|
||||
+ AIU_HDMI_CLK_DATA_CTRL_DATA_I2S);
|
||||
+
|
||||
+ regmap_update_bits(priv->core->aiu, AIU_CLK_CTRL_MORE,
|
||||
+ AIU_CLK_CTRL_MORE_HDMI_TX_SEL_MASK,
|
||||
+ AIU_CLK_CTRL_MORE_HDMI_TX_INT_CLK);
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
||||
--
|
||||
2.7.4
|
||||
|
@ -0,0 +1,28 @@
|
||||
From a57412582a1528fdd3c3d23039051af156191726 Mon Sep 17 00:00:00 2001
|
||||
From: Jerome Brunet <jbrunet@baylibre.com>
|
||||
Date: Mon, 13 Nov 2017 12:02:59 +0100
|
||||
Subject: [PATCH 08/14] ARM64: defconfig: add CONFIG_MESON_EFUSE
|
||||
|
||||
Turn on CONFIG_MESON_EFUSE as module
|
||||
|
||||
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
|
||||
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
|
||||
---
|
||||
arch/arm64/configs/defconfig | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
|
||||
index ecf6137..572f3b3 100644
|
||||
--- a/arch/arm64/configs/defconfig
|
||||
+++ b/arch/arm64/configs/defconfig
|
||||
@@ -597,6 +597,7 @@ CONFIG_QCOM_L3_PMU=y
|
||||
CONFIG_MESON_EFUSE=m
|
||||
CONFIG_QCOM_QFPROM=y
|
||||
CONFIG_UNIPHIER_EFUSE=y
|
||||
+CONFIG_MESON_EFUSE=m
|
||||
CONFIG_TEE=y
|
||||
CONFIG_OPTEE=y
|
||||
CONFIG_ARM_SCPI_PROTOCOL=y
|
||||
--
|
||||
2.7.4
|
||||
|
@ -0,0 +1,47 @@
|
||||
From a0893a96459257d4ff3db0359bd37e700044a2ce Mon Sep 17 00:00:00 2001
|
||||
From: Jerome Brunet <jbrunet@baylibre.com>
|
||||
Date: Mon, 13 Nov 2017 12:09:40 +0100
|
||||
Subject: [PATCH 09/14] ARM64: defconfig: enable CEC support
|
||||
|
||||
Turn on CONFIG_CEC_SUPPORT and CONFIG_CEC_PLATFORM_DRIVERS
|
||||
Turn on CONFIG_VIDEO_MESON_AO_CEC as module
|
||||
Turn on CONFIG_DRM_DW_HDMI_CEC as module
|
||||
|
||||
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
|
||||
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
|
||||
---
|
||||
arch/arm64/configs/defconfig | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
|
||||
index 572f3b3..43716e1 100644
|
||||
--- a/arch/arm64/configs/defconfig
|
||||
+++ b/arch/arm64/configs/defconfig
|
||||
@@ -384,6 +384,7 @@ CONFIG_MEDIA_SUPPORT=m
|
||||
CONFIG_MEDIA_CAMERA_SUPPORT=y
|
||||
CONFIG_MEDIA_ANALOG_TV_SUPPORT=y
|
||||
CONFIG_MEDIA_DIGITAL_TV_SUPPORT=y
|
||||
+CONFIG_MEDIA_CEC_SUPPORT=y
|
||||
CONFIG_MEDIA_CONTROLLER=y
|
||||
CONFIG_MEDIA_RC_SUPPORT=y
|
||||
CONFIG_RC_CORE=m
|
||||
@@ -398,6 +399,8 @@ CONFIG_VIDEO_SAMSUNG_S5P_MFC=m
|
||||
CONFIG_VIDEO_SAMSUNG_EXYNOS_GSC=m
|
||||
CONFIG_VIDEO_RENESAS_FCP=m
|
||||
CONFIG_VIDEO_RENESAS_VSP1=m
|
||||
+CONFIG_CEC_PLATFORM_DRIVERS=y
|
||||
+CONFIG_VIDEO_MESON_AO_CEC=m
|
||||
CONFIG_DRM=m
|
||||
CONFIG_DRM_NOUVEAU=m
|
||||
CONFIG_DRM_EXYNOS=m
|
||||
@@ -419,6 +422,7 @@ CONFIG_DRM_RCAR_VSP=y
|
||||
CONFIG_DRM_TEGRA=m
|
||||
CONFIG_DRM_PANEL_SIMPLE=m
|
||||
CONFIG_DRM_I2C_ADV7511=m
|
||||
+CONFIG_DRM_DW_HDMI_CEC=m
|
||||
CONFIG_DRM_VC4=m
|
||||
CONFIG_DRM_HISI_HIBMC=m
|
||||
CONFIG_DRM_HISI_KIRIN=m
|
||||
--
|
||||
2.7.4
|
||||
|
@ -0,0 +1,31 @@
|
||||
From e3fec781d3684fa264dfd68877b59b70a30f8929 Mon Sep 17 00:00:00 2001
|
||||
From: Jerome Brunet <jbrunet@baylibre.com>
|
||||
Date: Fri, 31 Mar 2017 15:55:03 +0200
|
||||
Subject: [PATCH 10/14] ARM64: defconfig: enable audio support for meson SoCs
|
||||
as module
|
||||
|
||||
Add audio support for meson SoCs. This includes the audio core
|
||||
driver and the i2s output interface
|
||||
|
||||
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
|
||||
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
|
||||
---
|
||||
arch/arm64/configs/defconfig | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
|
||||
index 43716e1..639cb12 100644
|
||||
--- a/arch/arm64/configs/defconfig
|
||||
+++ b/arch/arm64/configs/defconfig
|
||||
@@ -440,6 +440,8 @@ CONFIG_SOUND=y
|
||||
CONFIG_SND=y
|
||||
CONFIG_SND_SOC=y
|
||||
CONFIG_SND_BCM2835_SOC_I2S=m
|
||||
+CONFIG_SND_SOC_MESON=m
|
||||
+CONFIG_SND_SOC_MESON_I2S=m
|
||||
CONFIG_SND_SOC_SAMSUNG=y
|
||||
CONFIG_SND_SOC_RCAR=m
|
||||
CONFIG_SND_SOC_AK4613=m
|
||||
--
|
||||
2.7.4
|
||||
|
@ -0,0 +1,124 @@
|
||||
From c9a242f21d67baf22cb113ba37e9f77b96ba1027 Mon Sep 17 00:00:00 2001
|
||||
From: Jerome Brunet <jbrunet@baylibre.com>
|
||||
Date: Wed, 20 Sep 2017 17:22:47 +0200
|
||||
Subject: [PATCH 11/14] ARM64: dts: meson-gx: add audio controller nodes
|
||||
|
||||
Add audio controller nodes for Amlogic meson gxl.
|
||||
This includes the audio-core node, the i2s DAI and i2s
|
||||
aiu DMAs.
|
||||
|
||||
Audio on this SoC family is still a work in progress. More nodes are likely
|
||||
to be added later on (pcm DAIs, input DMAs, SPDIF etc ...)
|
||||
|
||||
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
|
||||
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
|
||||
---
|
||||
arch/arm64/boot/dts/amlogic/meson-gx.dtsi | 22 ++++++++++++++++++++++
|
||||
arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | 23 +++++++++++++++++++++++
|
||||
arch/arm64/boot/dts/amlogic/meson-gxl.dtsi | 23 +++++++++++++++++++++++
|
||||
3 files changed, 68 insertions(+)
|
||||
|
||||
diff --git a/arch/arm64/boot/dts/amlogic/meson-gx.dtsi b/arch/arm64/boot/dts/amlogic/meson-gx.dtsi
|
||||
index 3c31e21..e4ebc87 100644
|
||||
--- a/arch/arm64/boot/dts/amlogic/meson-gx.dtsi
|
||||
+++ b/arch/arm64/boot/dts/amlogic/meson-gx.dtsi
|
||||
@@ -197,6 +197,28 @@
|
||||
#reset-cells = <1>;
|
||||
};
|
||||
|
||||
+ audio: audio@5400 {
|
||||
+ compatible = "amlogic,meson-audio-core";
|
||||
+ reg = <0x0 0x5400 0x0 0x2ac>,
|
||||
+ <0x0 0xa000 0x0 0x304>;
|
||||
+ reg-names = "aiu", "audin";
|
||||
+ status = "disabled";
|
||||
+
|
||||
+ aiu_i2s_dma: aiu_i2s_dma {
|
||||
+ #sound-dai-cells = <0>;
|
||||
+ compatible = "amlogic,meson-aiu-i2s-dma";
|
||||
+ interrupts = <GIC_SPI 48 IRQ_TYPE_EDGE_RISING>;
|
||||
+ status = "disabled";
|
||||
+ };
|
||||
+
|
||||
+ i2s_dai: i2s_dai {
|
||||
+ #sound-dai-cells = <0>;
|
||||
+ compatible = "amlogic,meson-i2s-dai";
|
||||
+ status = "disabled";
|
||||
+ };
|
||||
+
|
||||
+ };
|
||||
+
|
||||
uart_A: serial@84c0 {
|
||||
compatible = "amlogic,meson-gx-uart";
|
||||
reg = <0x0 0x84c0 0x0 0x18>;
|
||||
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
|
||||
index 562c26a..67d794b 100644
|
||||
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
|
||||
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
|
||||
@@ -702,6 +702,29 @@
|
||||
<0>; /* Do Nothing */
|
||||
};
|
||||
|
||||
+&audio {
|
||||
+ clocks = <&clkc CLKID_AIU>,
|
||||
+ <&clkc CLKID_AIU_GLUE>,
|
||||
+ <&clkc CLKID_I2S_SPDIF>;
|
||||
+ clock-names = "aiu_top", "aiu_glue", "audin";
|
||||
+ resets = <&reset RESET_AIU>,
|
||||
+ <&reset RESET_AUDIN>;
|
||||
+ reset-names = "aiu", "audin";
|
||||
+};
|
||||
+
|
||||
+&aiu_i2s_dma {
|
||||
+ clocks = <&clkc CLKID_I2S_OUT>;
|
||||
+ clock-names = "fast";
|
||||
+};
|
||||
+
|
||||
+&i2s_dai {
|
||||
+ clocks = <&clkc CLKID_I2S_OUT>,
|
||||
+ <&clkc CLKID_MIXER_IFACE>,
|
||||
+ <&clkc CLKID_AOCLK_GATE>,
|
||||
+ <&clkc CLKID_CTS_AMCLK>;
|
||||
+ clock-names = "fast", "iface", "bclks", "mclk";
|
||||
+};
|
||||
+
|
||||
&saradc {
|
||||
compatible = "amlogic,meson-gxbb-saradc", "amlogic,meson-saradc";
|
||||
clocks = <&xtal>,
|
||||
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi
|
||||
index dba365e..0a41e2e 100644
|
||||
--- a/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi
|
||||
+++ b/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi
|
||||
@@ -711,6 +711,29 @@
|
||||
<0>; /* Do Nothing */
|
||||
};
|
||||
|
||||
+&audio {
|
||||
+ clocks = <&clkc CLKID_AIU>,
|
||||
+ <&clkc CLKID_AIU_GLUE>,
|
||||
+ <&clkc CLKID_I2S_SPDIF>;
|
||||
+ clock-names = "aiu_top", "aiu_glue", "audin";
|
||||
+ resets = <&reset RESET_AIU>,
|
||||
+ <&reset RESET_AUDIN>;
|
||||
+ reset-names = "aiu", "audin";
|
||||
+};
|
||||
+
|
||||
+&aiu_i2s_dma {
|
||||
+ clocks = <&clkc CLKID_I2S_OUT>;
|
||||
+ clock-names = "fast";
|
||||
+};
|
||||
+
|
||||
+&i2s_dai {
|
||||
+ clocks = <&clkc CLKID_I2S_OUT>,
|
||||
+ <&clkc CLKID_MIXER_IFACE>,
|
||||
+ <&clkc CLKID_AOCLK_GATE>,
|
||||
+ <&clkc CLKID_CTS_AMCLK>;
|
||||
+ clock-names = "fast", "iface", "bclks", "mclk";
|
||||
+};
|
||||
+
|
||||
&saradc {
|
||||
compatible = "amlogic,meson-gxl-saradc", "amlogic,meson-saradc";
|
||||
clocks = <&xtal>,
|
||||
--
|
||||
2.7.4
|
||||
|
@ -0,0 +1,26 @@
|
||||
From fb45bc4b076c17a3f9c1dab64e652dce752371c2 Mon Sep 17 00:00:00 2001
|
||||
From: Jerome Brunet <jbrunet@baylibre.com>
|
||||
Date: Wed, 20 Sep 2017 18:01:26 +0200
|
||||
Subject: [PATCH 12/14] ARM64: dts: meson-gxl: add sound-dai-cells to HDMI node
|
||||
|
||||
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
|
||||
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
|
||||
---
|
||||
arch/arm64/boot/dts/amlogic/meson-gxl.dtsi | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi
|
||||
index 0a41e2e..a11ac15 100644
|
||||
--- a/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi
|
||||
+++ b/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi
|
||||
@@ -265,6 +265,7 @@
|
||||
<&clkc CLKID_CLK81>,
|
||||
<&clkc CLKID_GCLK_VENCI_INT0>;
|
||||
clock-names = "isfr", "iahb", "venci";
|
||||
+ #sound-dai-cells = <0>;
|
||||
};
|
||||
|
||||
&hiubus {
|
||||
--
|
||||
2.7.4
|
||||
|
@ -0,0 +1,630 @@
|
||||
From e6794244bc4c59ffcf1ed4cbb452836dca10ad55 Mon Sep 17 00:00:00 2001
|
||||
From: Jerome Brunet <jbrunet@baylibre.com>
|
||||
Date: Wed, 20 Sep 2017 18:10:08 +0200
|
||||
Subject: [PATCH 13/14] ARM64: dts: meson: activate hdmi audio HDMI enabled
|
||||
boards
|
||||
|
||||
This patch activate audio over HDMI on selected boards
|
||||
|
||||
Please note that this audio support is based on WIP changes
|
||||
This should be considered as preview and it does not reflect
|
||||
the audio I expect to see merged
|
||||
|
||||
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
|
||||
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
|
||||
---
|
||||
.../arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi | 37 +++++++++++++++++++++
|
||||
.../boot/dts/amlogic/meson-gxbb-nexbox-a95x.dts | 38 ++++++++++++++++++++++
|
||||
.../arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts | 37 +++++++++++++++++++++
|
||||
arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi | 37 +++++++++++++++++++++
|
||||
arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi | 37 +++++++++++++++++++++
|
||||
.../dts/amlogic/meson-gxl-s905x-khadas-vim.dts | 37 +++++++++++++++++++++
|
||||
.../dts/amlogic/meson-gxl-s905x-libretech-cc.dts | 37 +++++++++++++++++++++
|
||||
.../dts/amlogic/meson-gxl-s905x-nexbox-a95x.dts | 37 +++++++++++++++++++++
|
||||
.../boot/dts/amlogic/meson-gxl-s905x-p212.dts | 37 +++++++++++++++++++++
|
||||
.../boot/dts/amlogic/meson-gxm-khadas-vim2.dts | 37 +++++++++++++++++++++
|
||||
.../arm64/boot/dts/amlogic/meson-gxm-nexbox-a1.dts | 37 +++++++++++++++++++++
|
||||
11 files changed, 408 insertions(+)
|
||||
|
||||
diff --git a/arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi b/arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi
|
||||
index 88e712e..7256912 100644
|
||||
--- a/arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi
|
||||
+++ b/arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi
|
||||
@@ -95,6 +95,31 @@
|
||||
};
|
||||
};
|
||||
};
|
||||
+
|
||||
+ sound {
|
||||
+ compatible = "simple-audio-card";
|
||||
+ simple-audio-card,name = "meson-gx-preview";
|
||||
+ status = "okay";
|
||||
+
|
||||
+ simple-audio-card,dai-link@0 {
|
||||
+ /* HDMI Output */
|
||||
+ format = "i2s";
|
||||
+ mclk-fs = <256>;
|
||||
+ bitclock-master = <&i2s_dai>;
|
||||
+ frame-master = <&i2s_dai>;
|
||||
+ plat {
|
||||
+ sound-dai = <&aiu_i2s_dma>;
|
||||
+ };
|
||||
+
|
||||
+ cpu {
|
||||
+ sound-dai = <&i2s_dai>;
|
||||
+ };
|
||||
+
|
||||
+ codec {
|
||||
+ sound-dai = <&hdmi_tx>;
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
};
|
||||
|
||||
&cec_AO {
|
||||
@@ -104,6 +129,18 @@
|
||||
hdmi-phandle = <&hdmi_tx>;
|
||||
};
|
||||
|
||||
+&audio {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&aiu_i2s_dma {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&i2s_dai {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
&cvbs_vdac_port {
|
||||
cvbs_vdac_out: endpoint {
|
||||
remote-endpoint = <&cvbs_connector_in>;
|
||||
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-nexbox-a95x.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-nexbox-a95x.dts
|
||||
index 4cf7f6e..43586e9 100644
|
||||
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-nexbox-a95x.dts
|
||||
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-nexbox-a95x.dts
|
||||
@@ -119,6 +119,31 @@
|
||||
clock-names = "ext_clock";
|
||||
};
|
||||
|
||||
+ sound {
|
||||
+ compatible = "simple-audio-card";
|
||||
+ simple-audio-card,name = "meson-gx-preview";
|
||||
+ status = "okay";
|
||||
+
|
||||
+ simple-audio-card,dai-link@0 {
|
||||
+ /* HDMI Output */
|
||||
+ format = "i2s";
|
||||
+ mclk-fs = <256>;
|
||||
+ bitclock-master = <&i2s_dai>;
|
||||
+ frame-master = <&i2s_dai>;
|
||||
+ plat {
|
||||
+ sound-dai = <&aiu_i2s_dma>;
|
||||
+ };
|
||||
+
|
||||
+ cpu {
|
||||
+ sound-dai = <&i2s_dai>;
|
||||
+ };
|
||||
+
|
||||
+ codec {
|
||||
+ sound-dai = <&hdmi_tx>;
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
cvbs-connector {
|
||||
compatible = "composite-video-connector";
|
||||
|
||||
@@ -154,6 +179,19 @@
|
||||
hdmi-phandle = <&hdmi_tx>;
|
||||
};
|
||||
|
||||
+
|
||||
+&audio {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&aiu_i2s_dma {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&i2s_dai {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
ðmac {
|
||||
status = "okay";
|
||||
pinctrl-0 = <ð_rmii_pins>;
|
||||
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
|
||||
index 54954b3..b24d2f7 100644
|
||||
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
|
||||
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
|
||||
@@ -110,6 +110,31 @@
|
||||
};
|
||||
};
|
||||
};
|
||||
+
|
||||
+ sound {
|
||||
+ compatible = "simple-audio-card";
|
||||
+ simple-audio-card,name = "meson-gx-preview";
|
||||
+ status = "okay";
|
||||
+
|
||||
+ simple-audio-card,dai-link@0 {
|
||||
+ /* HDMI Output */
|
||||
+ format = "i2s";
|
||||
+ mclk-fs = <256>;
|
||||
+ bitclock-master = <&i2s_dai>;
|
||||
+ frame-master = <&i2s_dai>;
|
||||
+ plat {
|
||||
+ sound-dai = <&aiu_i2s_dma>;
|
||||
+ };
|
||||
+
|
||||
+ cpu {
|
||||
+ sound-dai = <&i2s_dai>;
|
||||
+ };
|
||||
+
|
||||
+ codec {
|
||||
+ sound-dai = <&hdmi_tx>;
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
};
|
||||
|
||||
&cec_AO {
|
||||
@@ -119,6 +144,18 @@
|
||||
hdmi-phandle = <&hdmi_tx>;
|
||||
};
|
||||
|
||||
+&audio {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&aiu_i2s_dma {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&i2s_dai {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
ðmac {
|
||||
status = "okay";
|
||||
pinctrl-0 = <ð_rgmii_pins>;
|
||||
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi
|
||||
index ce86226..f89a094 100644
|
||||
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi
|
||||
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi
|
||||
@@ -113,6 +113,31 @@
|
||||
};
|
||||
};
|
||||
};
|
||||
+
|
||||
+ sound {
|
||||
+ compatible = "simple-audio-card";
|
||||
+ simple-audio-card,name = "meson-gx-preview";
|
||||
+ status = "okay";
|
||||
+
|
||||
+ simple-audio-card,dai-link@0 {
|
||||
+ /* HDMI Output */
|
||||
+ format = "i2s";
|
||||
+ mclk-fs = <256>;
|
||||
+ bitclock-master = <&i2s_dai>;
|
||||
+ frame-master = <&i2s_dai>;
|
||||
+ plat {
|
||||
+ sound-dai = <&aiu_i2s_dma>;
|
||||
+ };
|
||||
+
|
||||
+ cpu {
|
||||
+ sound-dai = <&i2s_dai>;
|
||||
+ };
|
||||
+
|
||||
+ codec {
|
||||
+ sound-dai = <&hdmi_tx>;
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
};
|
||||
|
||||
&cec_AO {
|
||||
@@ -122,6 +147,18 @@
|
||||
hdmi-phandle = <&hdmi_tx>;
|
||||
};
|
||||
|
||||
+&audio {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&aiu_i2s_dma {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&i2s_dai {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
&cvbs_vdac_port {
|
||||
cvbs_vdac_out: endpoint {
|
||||
remote-endpoint = <&cvbs_connector_in>;
|
||||
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi
|
||||
index 70325b2..b3b6ce7 100644
|
||||
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi
|
||||
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi
|
||||
@@ -105,6 +105,43 @@
|
||||
};
|
||||
};
|
||||
};
|
||||
+
|
||||
+ sound {
|
||||
+ compatible = "simple-audio-card";
|
||||
+ simple-audio-card,name = "meson-gx-preview";
|
||||
+ status = "okay";
|
||||
+
|
||||
+ simple-audio-card,dai-link@0 {
|
||||
+ /* HDMI Output */
|
||||
+ format = "i2s";
|
||||
+ mclk-fs = <256>;
|
||||
+ bitclock-master = <&i2s_dai>;
|
||||
+ frame-master = <&i2s_dai>;
|
||||
+ plat {
|
||||
+ sound-dai = <&aiu_i2s_dma>;
|
||||
+ };
|
||||
+
|
||||
+ cpu {
|
||||
+ sound-dai = <&i2s_dai>;
|
||||
+ };
|
||||
+
|
||||
+ codec {
|
||||
+ sound-dai = <&hdmi_tx>;
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&audio {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&aiu_i2s_dma {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&i2s_dai {
|
||||
+ status = "okay";
|
||||
};
|
||||
|
||||
&cec_AO {
|
||||
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts
|
||||
index d32cf38..1b2171d 100644
|
||||
--- a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts
|
||||
+++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts
|
||||
@@ -65,6 +65,31 @@
|
||||
};
|
||||
};
|
||||
};
|
||||
+
|
||||
+ sound {
|
||||
+ compatible = "simple-audio-card";
|
||||
+ simple-audio-card,name = "meson-gx-preview";
|
||||
+ status = "okay";
|
||||
+
|
||||
+ simple-audio-card,dai-link@0 {
|
||||
+ /* HDMI Output */
|
||||
+ format = "i2s";
|
||||
+ mclk-fs = <256>;
|
||||
+ bitclock-master = <&i2s_dai>;
|
||||
+ frame-master = <&i2s_dai>;
|
||||
+ plat {
|
||||
+ sound-dai = <&aiu_i2s_dma>;
|
||||
+ };
|
||||
+
|
||||
+ cpu {
|
||||
+ sound-dai = <&i2s_dai>;
|
||||
+ };
|
||||
+
|
||||
+ codec {
|
||||
+ sound-dai = <&hdmi_tx>;
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
};
|
||||
|
||||
&cec_AO {
|
||||
@@ -74,6 +99,18 @@
|
||||
hdmi-phandle = <&hdmi_tx>;
|
||||
};
|
||||
|
||||
+&audio {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&aiu_i2s_dma {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&i2s_dai {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
&hdmi_tx {
|
||||
status = "okay";
|
||||
pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>;
|
||||
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts
|
||||
index 3e3eb31..9717c83 100644
|
||||
--- a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts
|
||||
+++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts
|
||||
@@ -84,6 +84,31 @@
|
||||
regulator-always-on;
|
||||
};
|
||||
|
||||
+ sound {
|
||||
+ compatible = "simple-audio-card";
|
||||
+ simple-audio-card,name = "meson-gx-preview";
|
||||
+ status = "okay";
|
||||
+
|
||||
+ simple-audio-card,dai-link@0 {
|
||||
+ /* HDMI Output */
|
||||
+ format = "i2s";
|
||||
+ mclk-fs = <256>;
|
||||
+ bitclock-master = <&i2s_dai>;
|
||||
+ frame-master = <&i2s_dai>;
|
||||
+ plat {
|
||||
+ sound-dai = <&aiu_i2s_dma>;
|
||||
+ };
|
||||
+
|
||||
+ cpu {
|
||||
+ sound-dai = <&i2s_dai>;
|
||||
+ };
|
||||
+
|
||||
+ codec {
|
||||
+ sound-dai = <&hdmi_tx>;
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
vcc_3v3: regulator-vcc_3v3 {
|
||||
compatible = "regulator-fixed";
|
||||
regulator-name = "VCC_3V3";
|
||||
@@ -130,6 +155,18 @@
|
||||
hdmi-phandle = <&hdmi_tx>;
|
||||
};
|
||||
|
||||
+&audio {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&aiu_i2s_dma {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&i2s_dai {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
&cvbs_vdac_port {
|
||||
cvbs_vdac_out: endpoint {
|
||||
remote-endpoint = <&cvbs_connector_in>;
|
||||
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-nexbox-a95x.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-nexbox-a95x.dts
|
||||
index 6739697..1c2f629 100644
|
||||
--- a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-nexbox-a95x.dts
|
||||
+++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-nexbox-a95x.dts
|
||||
@@ -102,6 +102,31 @@
|
||||
};
|
||||
};
|
||||
};
|
||||
+
|
||||
+ sound {
|
||||
+ compatible = "simple-audio-card";
|
||||
+ simple-audio-card,name = "meson-gx-preview";
|
||||
+ status = "okay";
|
||||
+
|
||||
+ simple-audio-card,dai-link@0 {
|
||||
+ /* HDMI Output */
|
||||
+ format = "i2s";
|
||||
+ mclk-fs = <256>;
|
||||
+ bitclock-master = <&i2s_dai>;
|
||||
+ frame-master = <&i2s_dai>;
|
||||
+ plat {
|
||||
+ sound-dai = <&aiu_i2s_dma>;
|
||||
+ };
|
||||
+
|
||||
+ cpu {
|
||||
+ sound-dai = <&i2s_dai>;
|
||||
+ };
|
||||
+
|
||||
+ codec {
|
||||
+ sound-dai = <&hdmi_tx>;
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
};
|
||||
|
||||
&cec_AO {
|
||||
@@ -111,6 +136,18 @@
|
||||
hdmi-phandle = <&hdmi_tx>;
|
||||
};
|
||||
|
||||
+&audio {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&aiu_i2s_dma {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&i2s_dai {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
&cvbs_vdac_port {
|
||||
cvbs_vdac_out: endpoint {
|
||||
remote-endpoint = <&cvbs_connector_in>;
|
||||
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dts
|
||||
index 5896e8a..0258237 100644
|
||||
--- a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dts
|
||||
+++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dts
|
||||
@@ -32,6 +32,31 @@
|
||||
};
|
||||
};
|
||||
};
|
||||
+
|
||||
+ sound {
|
||||
+ compatible = "simple-audio-card";
|
||||
+ simple-audio-card,name = "meson-gx-preview";
|
||||
+ status = "okay";
|
||||
+
|
||||
+ simple-audio-card,dai-link@0 {
|
||||
+ /* HDMI Output */
|
||||
+ format = "i2s";
|
||||
+ mclk-fs = <256>;
|
||||
+ bitclock-master = <&i2s_dai>;
|
||||
+ frame-master = <&i2s_dai>;
|
||||
+ plat {
|
||||
+ sound-dai = <&aiu_i2s_dma>;
|
||||
+ };
|
||||
+
|
||||
+ cpu {
|
||||
+ sound-dai = <&i2s_dai>;
|
||||
+ };
|
||||
+
|
||||
+ codec {
|
||||
+ sound-dai = <&hdmi_tx>;
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
};
|
||||
|
||||
&cec_AO {
|
||||
@@ -41,6 +66,18 @@
|
||||
hdmi-phandle = <&hdmi_tx>;
|
||||
};
|
||||
|
||||
+&audio {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&aiu_i2s_dma {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&i2s_dai {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
&cvbs_vdac_port {
|
||||
cvbs_vdac_out: endpoint {
|
||||
remote-endpoint = <&cvbs_connector_in>;
|
||||
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts b/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts
|
||||
index 0868da4..22707af 100644
|
||||
--- a/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts
|
||||
+++ b/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts
|
||||
@@ -85,6 +85,31 @@
|
||||
};
|
||||
};
|
||||
|
||||
+ sound {
|
||||
+ compatible = "simple-audio-card";
|
||||
+ simple-audio-card,name = "meson-gx-preview";
|
||||
+ status = "okay";
|
||||
+
|
||||
+ simple-audio-card,dai-link@0 {
|
||||
+ /* HDMI Output */
|
||||
+ format = "i2s";
|
||||
+ mclk-fs = <256>;
|
||||
+ bitclock-master = <&i2s_dai>;
|
||||
+ frame-master = <&i2s_dai>;
|
||||
+ plat {
|
||||
+ sound-dai = <&aiu_i2s_dma>;
|
||||
+ };
|
||||
+
|
||||
+ cpu {
|
||||
+ sound-dai = <&i2s_dai>;
|
||||
+ };
|
||||
+
|
||||
+ codec {
|
||||
+ sound-dai = <&hdmi_tx>;
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
pwmleds {
|
||||
compatible = "pwm-leds";
|
||||
|
||||
@@ -205,6 +230,18 @@
|
||||
hdmi-phandle = <&hdmi_tx>;
|
||||
};
|
||||
|
||||
+&audio {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&aiu_i2s_dma {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&i2s_dai {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
&cpu0 {
|
||||
#cooling-cells = <2>;
|
||||
};
|
||||
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxm-nexbox-a1.dts b/arch/arm64/boot/dts/amlogic/meson-gxm-nexbox-a1.dts
|
||||
index f7a1cff..1af4891 100644
|
||||
--- a/arch/arm64/boot/dts/amlogic/meson-gxm-nexbox-a1.dts
|
||||
+++ b/arch/arm64/boot/dts/amlogic/meson-gxm-nexbox-a1.dts
|
||||
@@ -75,6 +75,31 @@
|
||||
};
|
||||
};
|
||||
};
|
||||
+
|
||||
+ sound {
|
||||
+ compatible = "simple-audio-card";
|
||||
+ simple-audio-card,name = "meson-gx-preview";
|
||||
+ status = "okay";
|
||||
+
|
||||
+ simple-audio-card,dai-link@0 {
|
||||
+ /* HDMI Output */
|
||||
+ format = "i2s";
|
||||
+ mclk-fs = <256>;
|
||||
+ bitclock-master = <&i2s_dai>;
|
||||
+ frame-master = <&i2s_dai>;
|
||||
+ plat {
|
||||
+ sound-dai = <&aiu_i2s_dma>;
|
||||
+ };
|
||||
+
|
||||
+ cpu {
|
||||
+ sound-dai = <&i2s_dai>;
|
||||
+ };
|
||||
+
|
||||
+ codec {
|
||||
+ sound-dai = <&hdmi_tx>;
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
};
|
||||
|
||||
&cec_AO {
|
||||
@@ -84,6 +109,18 @@
|
||||
hdmi-phandle = <&hdmi_tx>;
|
||||
};
|
||||
|
||||
+&audio {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&aiu_i2s_dma {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&i2s_dai {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
&cvbs_vdac_port {
|
||||
cvbs_vdac_out: endpoint {
|
||||
remote-endpoint = <&cvbs_connector_in>;
|
||||
--
|
||||
2.7.4
|
||||
|
@ -0,0 +1,41 @@
|
||||
From 40979f4df1a3bbe110b3fe2ace1524dc559ad4e8 Mon Sep 17 00:00:00 2001
|
||||
From: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
|
||||
Date: Thu, 12 Jan 2017 01:38:26 +0100
|
||||
Subject: [PATCH 71/79] ARM64: dts: meson-gxbb: allow child devices on the USB
|
||||
controller
|
||||
|
||||
Add the size and adress cells to the USB controllers to allow specifying
|
||||
child devices (for example the USB hub on the Odroid-C2 which must be
|
||||
taken out of reset to work).
|
||||
|
||||
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
|
||||
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
|
||||
---
|
||||
arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
|
||||
index dc0eb44..912c4dc 100644
|
||||
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
|
||||
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
|
||||
@@ -73,6 +73,8 @@
|
||||
|
||||
usb0: usb@c9000000 {
|
||||
compatible = "amlogic,meson-gxbb-usb", "snps,dwc2";
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <0>;
|
||||
reg = <0x0 0xc9000000 0x0 0x40000>;
|
||||
interrupts = <GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&clkc CLKID_USB0_DDR_BRIDGE>;
|
||||
@@ -85,6 +87,8 @@
|
||||
|
||||
usb1: usb@c9100000 {
|
||||
compatible = "amlogic,meson-gxbb-usb", "snps,dwc2";
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <0>;
|
||||
reg = <0x0 0xc9100000 0x0 0x40000>;
|
||||
interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&clkc CLKID_USB1_DDR_BRIDGE>;
|
||||
--
|
||||
1.9.1
|
||||
|
@ -0,0 +1,30 @@
|
||||
From bfb97011c691e09c54a6d5e98b6a81493893d185 Mon Sep 17 00:00:00 2001
|
||||
From: Koen Kooi <koen@dominion.thruhere.net>
|
||||
Date: Tue, 29 May 2018 17:27:24 +0200
|
||||
Subject: [PATCH 14/14] clk: meson: audio-divider: fix divider
|
||||
|
||||
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
|
||||
|
||||
%% original patch: 0017-fix-audio-picked-from-LE-slack.patch
|
||||
|
||||
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
|
||||
---
|
||||
drivers/clk/meson/clk-audio-divider.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/clk/meson/clk-audio-divider.c b/drivers/clk/meson/clk-audio-divider.c
|
||||
index f7ab5b1..9779c04 100644
|
||||
--- a/drivers/clk/meson/clk-audio-divider.c
|
||||
+++ b/drivers/clk/meson/clk-audio-divider.c
|
||||
@@ -62,7 +62,7 @@ static unsigned long audio_divider_recalc_rate(struct clk_hw *hw,
|
||||
struct meson_clk_audio_div_data *adiv = meson_clk_audio_div_data(clk);
|
||||
unsigned long divider;
|
||||
|
||||
- divider = meson_parm_read(clk->map, &adiv->div);
|
||||
+ divider = meson_parm_read(clk->map, &adiv->div) + 1;
|
||||
|
||||
return DIV_ROUND_UP_ULL((u64)parent_rate, divider);
|
||||
}
|
||||
--
|
||||
2.7.4
|
||||
|
@ -0,0 +1,150 @@
|
||||
From patchwork Thu Jul 26 14:13:58 2018
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 7bit
|
||||
X-Patchwork-Submitter: Neil Armstrong <narmstrong@baylibre.com>
|
||||
X-Patchwork-Id: 10545963
|
||||
Return-Path:
|
||||
<linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org>
|
||||
Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org
|
||||
[172.30.200.125])
|
||||
by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2F8C514E0
|
||||
for <patchwork-linux-amlogic@patchwork.kernel.org>;
|
||||
Thu, 26 Jul 2018 14:14:21 +0000 (UTC)
|
||||
Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1])
|
||||
by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D1A32B3CB
|
||||
for <patchwork-linux-amlogic@patchwork.kernel.org>;
|
||||
Thu, 26 Jul 2018 14:14:21 +0000 (UTC)
|
||||
Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486)
|
||||
id 106602B3CD; Thu, 26 Jul 2018 14:14:21 +0000 (UTC)
|
||||
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
|
||||
pdx-wl-mail.web.codeaurora.org
|
||||
X-Spam-Level:
|
||||
X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED,
|
||||
DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1
|
||||
Received: from bombadil.infradead.org (bombadil.infradead.org
|
||||
[198.137.202.133])
|
||||
(using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits))
|
||||
(No client certificate requested)
|
||||
by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5D6162B3CB
|
||||
for <patchwork-linux-amlogic@patchwork.kernel.org>;
|
||||
Thu, 26 Jul 2018 14:14:20 +0000 (UTC)
|
||||
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
|
||||
d=lists.infradead.org; s=bombadil.20170209; h=Sender:
|
||||
Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe:
|
||||
List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date:
|
||||
Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date:
|
||||
Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:
|
||||
References:List-Owner; bh=462LbOcgKlVCBbNX+w0EPUQwbBYVnGiTqoWx8XQAgKc=; b=InP
|
||||
6tAv0Bh5FEZ2enTfatoZJeyWgo7fxfE/GlnjKRgKKLSN/rlEYS+c6nLKz5f/L5lmj+UudFCKNRV3C
|
||||
pBRPMKeRXOgeZ0UKJz795nwyqp97mgReZG148XgHXOm5vXrubjPNbUOReQyeV689rOrd2HibJYKv4
|
||||
mtIVc3Wd5CdGvVkjsSsrkggn1gjoT5Its6YUVtCzDEZdC+TvmggPVrhu7Ytml8FE6EzDSszmNZxjm
|
||||
dVfTsKKCuyk6tEgo7pMRBJvgtxhP9kz8c1cllgXJb3DtKTgw0bVwyqTtTvUTIip5wR+x1t9SIkGI3
|
||||
GT+LCCzHAj1SJmg82rThA/II0okKEYg==;
|
||||
Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org)
|
||||
by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux))
|
||||
id 1fih23-0004Lu-IS; Thu, 26 Jul 2018 14:14:19 +0000
|
||||
Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443])
|
||||
by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux))
|
||||
id 1fih1x-00045L-1Z
|
||||
for linux-amlogic@lists.infradead.org; Thu, 26 Jul 2018 14:14:17 +0000
|
||||
Received: by mail-wr1-x443.google.com with SMTP id h14-v6so1875801wrw.13
|
||||
for <linux-amlogic@lists.infradead.org>;
|
||||
Thu, 26 Jul 2018 07:14:02 -0700 (PDT)
|
||||
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||||
d=baylibre-com.20150623.gappssmtp.com; s=20150623;
|
||||
h=from:to:cc:subject:date:message-id;
|
||||
bh=q1bbeBlbA5yGzCz3LYX30EBNKRjem+abrzOXES8zWXI=;
|
||||
b=ELKUZomUJ2W+Gkf92t2sb8t4JHUOvuFi2hXV1O60cjJvOt6f73EJtjj/+6WQetDynE
|
||||
WhPB/bCR4V8Yfxv9fkFOOIROaZx1NjYfuo/wFbDwacuI6/K1Ku7mVaKLW/SG9q1NzIHm
|
||||
MufFfhtUAQk8uDrXI0nSRQ3xX+bumZgz+1ly/3/iFhFCtlBjpL5geWKroA/xeYQqLqzm
|
||||
hfpf/CVK+Bhbsp5OyaaJuE4wOzlkeYRlunZpPh59jBLL8bweNPNmaSwUgECfYteqFe4e
|
||||
8NjG7f7GGOfdMlumUgQjlQueswxQ5EoDAmMiNLCetMv1d1CBZqW6tE5SCreiuZc507yq
|
||||
sGbg==
|
||||
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||||
d=1e100.net; s=20161025;
|
||||
h=x-gm-message-state:from:to:cc:subject:date:message-id;
|
||||
bh=q1bbeBlbA5yGzCz3LYX30EBNKRjem+abrzOXES8zWXI=;
|
||||
b=r+KUmkdpC4rK0qMEmPO2iFUHoW0tZr9ygjIPYV1VpeIsYfnd1MwQbfa4MJF8RhXYub
|
||||
sBULtuLSHApThhNnJbC5MLU84PbSEGgG0ypKZHL4zQNg0+HdgCtE9ANMUhOmz1JklRBC
|
||||
MYxi/CwxD9hqjt0W6/TkEWHlDX+/c14xCvGc2YDKvIHS5+SHfgfQZoybWEJA8avBZUo4
|
||||
0fvly6c+bZKIarBFkS/CqUP8N3qq3UtzanYM2YZs4pRi6psfZE6qWKjeUc0QjAjusm/b
|
||||
009g20mbrffEjJqmGqJDWZmwrr+C7aEvG52UBkDp78vAo3/vmoPp+3ccdEYlLtJYSqZY
|
||||
OtsQ==
|
||||
X-Gm-Message-State: AOUpUlEgZxMDqqjmqbCZcwzrW7N2rv2bzb5uWb6Jywg/L+TKu1gyOCI1
|
||||
W4ILQdHP066Jjx7wA32kPlkcBFEdCvU=
|
||||
X-Google-Smtp-Source:
|
||||
AAOMgpe93TLLgQwrspDx2cZNGsFdcQgZgKHP2X5DwtPFX+IvCEGOM5lASYCFgL6auT9Ok4MFbst98w==
|
||||
X-Received: by 2002:adf:b2a7:: with SMTP id
|
||||
g36-v6mr1725501wrd.218.1532614441450;
|
||||
Thu, 26 Jul 2018 07:14:01 -0700 (PDT)
|
||||
Received: from bender.baylibre.local ([90.63.244.31])
|
||||
by smtp.gmail.com with ESMTPSA id j9-v6sm3558062wrv.5.2018.07.26.07.14.00
|
||||
(version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);
|
||||
Thu, 26 Jul 2018 07:14:00 -0700 (PDT)
|
||||
From: Neil Armstrong <narmstrong@baylibre.com>
|
||||
To: khilman@baylibre.com
|
||||
Subject: [PATCH] arm64: dts: meson: Switch simple-mfd and syscon order
|
||||
Date: Thu, 26 Jul 2018 16:13:58 +0200
|
||||
Message-Id: <1532614438-7207-1-git-send-email-narmstrong@baylibre.com>
|
||||
X-Mailer: git-send-email 2.7.4
|
||||
X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3
|
||||
X-CRM114-CacheID: sfid-20180726_071413_516444_B274C81F
|
||||
X-CRM114-Status: GOOD ( 11.08 )
|
||||
X-BeenThere: linux-amlogic@lists.infradead.org
|
||||
X-Mailman-Version: 2.1.21
|
||||
Precedence: list
|
||||
List-Id: <linux-amlogic.lists.infradead.org>
|
||||
List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-amlogic>,
|
||||
<mailto:linux-amlogic-request@lists.infradead.org?subject=unsubscribe>
|
||||
List-Archive: <http://lists.infradead.org/pipermail/linux-amlogic/>
|
||||
List-Post: <mailto:linux-amlogic@lists.infradead.org>
|
||||
List-Help: <mailto:linux-amlogic-request@lists.infradead.org?subject=help>
|
||||
List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-amlogic>,
|
||||
<mailto:linux-amlogic-request@lists.infradead.org?subject=subscribe>
|
||||
Cc: linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org,
|
||||
linux-arm-kernel@lists.infradead.org,
|
||||
Neil Armstrong <narmstrong@baylibre.com>
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset="us-ascii"
|
||||
Sender: "linux-amlogic" <linux-amlogic-bounces@lists.infradead.org>
|
||||
Errors-To:
|
||||
linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org
|
||||
X-Virus-Scanned: ClamAV using ClamSMTP
|
||||
|
||||
The order between "syscon" and "simple-mfd" is important because in these
|
||||
particular cases, the node needs to be first a "simple-mfd" to expose
|
||||
it's sub-nodes, and later on a "syscon" to permit other nodes to access
|
||||
this register space through the "syscon" mechanism.
|
||||
|
||||
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
|
||||
---
|
||||
This also has a consequence for U-Boot since the U-Boot DM is much simpler
|
||||
and can only associate a single device to a node, thus here we want these
|
||||
nodes to be an mfd bus to be able to probe the sub-nodes.
|
||||
|
||||
arch/arm64/boot/dts/amlogic/meson-gx.dtsi | 4 ++--
|
||||
2 files changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/arch/arm64/boot/dts/amlogic/meson-gx.dtsi b/arch/arm64/boot/dts/amlogic/meson-gx.dtsi
|
||||
index b8dc4db..d88699f 100644
|
||||
--- a/arch/arm64/boot/dts/amlogic/meson-gx.dtsi
|
||||
+++ b/arch/arm64/boot/dts/amlogic/meson-gx.dtsi
|
||||
@@ -344,7 +344,7 @@
|
||||
ranges = <0x0 0x0 0x0 0xc8100000 0x0 0x100000>;
|
||||
|
||||
sysctrl_AO: sys-ctrl@0 {
|
||||
- compatible = "amlogic,meson-gx-ao-sysctrl", "syscon", "simple-mfd";
|
||||
+ compatible = "amlogic,meson-gx-ao-sysctrl", "simple-mfd", "syscon";
|
||||
reg = <0x0 0x0 0x0 0x100>;
|
||||
|
||||
pwrc_vpu: power-controller-vpu {
|
||||
@@ -431,7 +431,7 @@
|
||||
ranges = <0x0 0x0 0x0 0xc883c000 0x0 0x2000>;
|
||||
|
||||
sysctrl: system-controller@0 {
|
||||
- compatible = "amlogic,meson-gx-hhi-sysctrl", "syscon", "simple-mfd";
|
||||
+ compatible = "amlogic,meson-gx-hhi-sysctrl", "simple-mfd", "syscon";
|
||||
reg = <0 0 0 0x400>;
|
||||
};
|
||||
|
@ -0,0 +1,227 @@
|
||||
From patchwork Thu Jul 26 13:59:16 2018
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 7bit
|
||||
X-Patchwork-Submitter: Neil Armstrong <narmstrong@baylibre.com>
|
||||
X-Patchwork-Id: 10545929
|
||||
Return-Path:
|
||||
<linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org>
|
||||
Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org
|
||||
[172.30.200.125])
|
||||
by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C19401822
|
||||
for <patchwork-linux-amlogic@patchwork.kernel.org>;
|
||||
Thu, 26 Jul 2018 13:59:35 +0000 (UTC)
|
||||
Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1])
|
||||
by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ABEFC2B356
|
||||
for <patchwork-linux-amlogic@patchwork.kernel.org>;
|
||||
Thu, 26 Jul 2018 13:59:35 +0000 (UTC)
|
||||
Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486)
|
||||
id 9FF912B35F; Thu, 26 Jul 2018 13:59:35 +0000 (UTC)
|
||||
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
|
||||
pdx-wl-mail.web.codeaurora.org
|
||||
X-Spam-Level:
|
||||
X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED,
|
||||
DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1
|
||||
Received: from bombadil.infradead.org (bombadil.infradead.org
|
||||
[198.137.202.133])
|
||||
(using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits))
|
||||
(No client certificate requested)
|
||||
by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 17ADC2B356
|
||||
for <patchwork-linux-amlogic@patchwork.kernel.org>;
|
||||
Thu, 26 Jul 2018 13:59:35 +0000 (UTC)
|
||||
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
|
||||
d=lists.infradead.org; s=bombadil.20170209; h=Sender:
|
||||
Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe:
|
||||
List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date:
|
||||
Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date:
|
||||
Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:
|
||||
References:List-Owner; bh=EqHWs/6uUjSeIR2wSdG11qTBruxOvITHjRwkGFmKmio=; b=m6/
|
||||
RmzuHrAUPELBKQV2xaA2bgGqNZa8cDwOTJjsbOhZ/vPNg/g0e+Obi4cyCvpxNQsgoowfNnwkzWCgN
|
||||
CfxUGmVcY2ewmZufbyjgmeZ5nlfNM0rwHvWdojwx3SiykHXlGb0XPtIBWVX01ZHqqu1SfYKD/lWHg
|
||||
iAWz8WiywRUyV+LfZMm/cFumRjUmUYLfBIOkkBgT6ET5l7t8c+QRdcqhw5LFYpLGYFxPxqEdrzzoD
|
||||
cGQhIrM+pfhgvLdYoviaL7PUcTRxEwDKyEFOOTXq9e/bas2gnIE/tcpnvh1MD0onk+poKeKjFkSPw
|
||||
pkkQ3BTo1ZhioAtQcc+0xg8n0GsHEfA==;
|
||||
Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org)
|
||||
by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux))
|
||||
id 1fignm-0005Ux-G9; Thu, 26 Jul 2018 13:59:34 +0000
|
||||
Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244])
|
||||
by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux))
|
||||
id 1fignj-0005RP-Bf
|
||||
for linux-amlogic@lists.infradead.org; Thu, 26 Jul 2018 13:59:32 +0000
|
||||
Received: by mail-wm0-x244.google.com with SMTP id o11-v6so2073153wmh.2
|
||||
for <linux-amlogic@lists.infradead.org>;
|
||||
Thu, 26 Jul 2018 06:59:20 -0700 (PDT)
|
||||
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||||
d=baylibre-com.20150623.gappssmtp.com; s=20150623;
|
||||
h=from:to:cc:subject:date:message-id;
|
||||
bh=m9CCiwR/zhrqNdJ6Qi86kfoFuPrHTGpOo/Cqk2c9lMw=;
|
||||
b=NZkza4yogigBBOi5izjgx9CAY1ce3IXfSFLxmUy1TB4UQovCnPBny2wWmuPPw5D2Xn
|
||||
Fkdxi2tLXl9aP+jeqy6Z6IsjNtfouzYYkn8U4lRNi7nXCqE6pd5oURI8dP6p5c98Ys6K
|
||||
dam+D8uxPrX0AIzAnKOdI8aUWWBafjRDcFJSI4a3yWWlVKtZSUpbhq8K55GsLRxZniBm
|
||||
4dI6ieTTm1fNilkW4e3yvUV1ldZr4EQB6L7DBb+wZQX9LPblJ8o0ZgrGKiIBE/siPC7T
|
||||
ZRsqjkB/Dq5/chQ254R3gqx2Mt5ibXU7/SSYJxP6khIb7Rs/vnCyuLyyO79Jrvwl7Rn7
|
||||
lpnA==
|
||||
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||||
d=1e100.net; s=20161025;
|
||||
h=x-gm-message-state:from:to:cc:subject:date:message-id;
|
||||
bh=m9CCiwR/zhrqNdJ6Qi86kfoFuPrHTGpOo/Cqk2c9lMw=;
|
||||
b=XcCjbrFV/RtJwynsZyk1FsiSwm2Uu2VV2ea0pgUVfsKquDE/R3FyLSlzlBCOPZuFBg
|
||||
dEgZpEOnd6es6gEHGaBXYSv34Ovq4xpB3r5c8pz2EWpmJ257pG4VkPVLrm/om2iBEdsO
|
||||
bd4EM+TZh/E06Obvr8I4Di+rgc8cpJaJMCq5S++uyneQswclwPj/odwCwxwEuLRc1AEQ
|
||||
uBFYWon12mgkw/fhkszFwXPjelgMtoqXQ1myBYdTXKSSdohhhDpnbU+1gT32jKKIx9rO
|
||||
jua0ooXDbMirhs8yYe5HBHt8Uytxm0k2KtI8jGZeBJKzbKfee9Rj2+nya52SD7zApGEE
|
||||
Wv4Q==
|
||||
X-Gm-Message-State: AOUpUlGUbZE1KLrOMmp9WikSS8sT5jnb7zw85sthjUIGi5iGui4wob4p
|
||||
Th81mKR6r2Q75bTqQYDn+hTeSg==
|
||||
X-Google-Smtp-Source:
|
||||
AAOMgpdIZHKdxLrmyYhJum/5Lv0enqEOOoxtxcAtew9b7WQ3g8SRQ1Lkhv8AyyfbQkYIIPYSHmOwbg==
|
||||
X-Received: by 2002:a1c:c4ce:: with SMTP id
|
||||
u197-v6mr1656860wmf.10.1532613559582;
|
||||
Thu, 26 Jul 2018 06:59:19 -0700 (PDT)
|
||||
Received: from bender.baylibre.local ([90.63.244.31])
|
||||
by smtp.gmail.com with ESMTPSA id s7-v6sm1754942wru.96.2018.07.26.06.59.18
|
||||
(version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);
|
||||
Thu, 26 Jul 2018 06:59:18 -0700 (PDT)
|
||||
From: Neil Armstrong <narmstrong@baylibre.com>
|
||||
To: khilman@baylibre.com,
|
||||
carlo@caione.org
|
||||
Subject: [PATCH] firmware: meson_sm: Add serial number sysfs entry
|
||||
Date: Thu, 26 Jul 2018 15:59:16 +0200
|
||||
Message-Id: <1532613556-5398-1-git-send-email-narmstrong@baylibre.com>
|
||||
X-Mailer: git-send-email 2.7.4
|
||||
X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3
|
||||
X-CRM114-CacheID: sfid-20180726_065931_398092_3628DF7A
|
||||
X-CRM114-Status: GOOD ( 12.04 )
|
||||
X-BeenThere: linux-amlogic@lists.infradead.org
|
||||
X-Mailman-Version: 2.1.21
|
||||
Precedence: list
|
||||
List-Id: <linux-amlogic.lists.infradead.org>
|
||||
List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-amlogic>,
|
||||
<mailto:linux-amlogic-request@lists.infradead.org?subject=unsubscribe>
|
||||
List-Archive: <http://lists.infradead.org/pipermail/linux-amlogic/>
|
||||
List-Post: <mailto:linux-amlogic@lists.infradead.org>
|
||||
List-Help: <mailto:linux-amlogic-request@lists.infradead.org?subject=help>
|
||||
List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-amlogic>,
|
||||
<mailto:linux-amlogic-request@lists.infradead.org?subject=subscribe>
|
||||
Cc: linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org,
|
||||
linux-arm-kernel@lists.infradead.org,
|
||||
Neil Armstrong <narmstrong@baylibre.com>
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset="us-ascii"
|
||||
Sender: "linux-amlogic" <linux-amlogic-bounces@lists.infradead.org>
|
||||
Errors-To:
|
||||
linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org
|
||||
X-Virus-Scanned: ClamAV using ClamSMTP
|
||||
|
||||
The Amlogic Meson SoC Secure Monitor implements a call to retrieve an unique
|
||||
SoC ID starting from the GX Family and all new families.
|
||||
|
||||
The serial number is simply exposed as a sysfs entry under the firmware
|
||||
sysfs directory.
|
||||
|
||||
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
|
||||
---
|
||||
drivers/firmware/meson/meson_sm.c | 56 +++++++++++++++++++++++++++++++++
|
||||
include/linux/firmware/meson/meson_sm.h | 1 +
|
||||
2 files changed, 57 insertions(+)
|
||||
|
||||
diff --git a/drivers/firmware/meson/meson_sm.c b/drivers/firmware/meson/meson_sm.c
|
||||
index 0ec2ca8..29fbc81 100644
|
||||
--- a/drivers/firmware/meson/meson_sm.c
|
||||
+++ b/drivers/firmware/meson/meson_sm.c
|
||||
@@ -24,6 +24,7 @@
|
||||
#include <linux/printk.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/sizes.h>
|
||||
+ #include <linux/slab.h>
|
||||
|
||||
#include <linux/firmware/meson/meson_sm.h>
|
||||
|
||||
@@ -48,6 +49,7 @@ struct meson_sm_chip gxbb_chip = {
|
||||
CMD(SM_EFUSE_READ, 0x82000030),
|
||||
CMD(SM_EFUSE_WRITE, 0x82000031),
|
||||
CMD(SM_EFUSE_USER_MAX, 0x82000033),
|
||||
+ CMD(SM_GET_CHIP_ID, 0x82000044),
|
||||
{ /* sentinel */ },
|
||||
},
|
||||
};
|
||||
@@ -214,6 +216,57 @@ int meson_sm_call_write(void *buffer, unsigned int size, unsigned int cmd_index,
|
||||
}
|
||||
EXPORT_SYMBOL(meson_sm_call_write);
|
||||
|
||||
+#define SM_CHIP_ID_LENGTH 119
|
||||
+#define SM_CHIP_ID_OFFSET 4
|
||||
+#define SM_CHIP_ID_SIZE 12
|
||||
+
|
||||
+static ssize_t serial_show(struct device *dev, struct device_attribute *attr,
|
||||
+ char *buf)
|
||||
+{
|
||||
+ uint8_t *id_buf;
|
||||
+ int ret;
|
||||
+
|
||||
+ id_buf = kmalloc(SM_CHIP_ID_LENGTH, GFP_KERNEL);
|
||||
+ if (!id_buf)
|
||||
+ return -ENOMEM;
|
||||
+
|
||||
+ ret = meson_sm_call_read(id_buf, SM_CHIP_ID_LENGTH, SM_GET_CHIP_ID,
|
||||
+ 0, 0, 0, 0, 0);
|
||||
+ if (ret < 0) {
|
||||
+ kfree(id_buf);
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ ret = sprintf(buf, "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x\n",
|
||||
+ id_buf[SM_CHIP_ID_OFFSET + 0],
|
||||
+ id_buf[SM_CHIP_ID_OFFSET + 1],
|
||||
+ id_buf[SM_CHIP_ID_OFFSET + 2],
|
||||
+ id_buf[SM_CHIP_ID_OFFSET + 3],
|
||||
+ id_buf[SM_CHIP_ID_OFFSET + 4],
|
||||
+ id_buf[SM_CHIP_ID_OFFSET + 5],
|
||||
+ id_buf[SM_CHIP_ID_OFFSET + 6],
|
||||
+ id_buf[SM_CHIP_ID_OFFSET + 7],
|
||||
+ id_buf[SM_CHIP_ID_OFFSET + 8],
|
||||
+ id_buf[SM_CHIP_ID_OFFSET + 9],
|
||||
+ id_buf[SM_CHIP_ID_OFFSET + 10],
|
||||
+ id_buf[SM_CHIP_ID_OFFSET + 11]);
|
||||
+
|
||||
+ kfree(id_buf);
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static DEVICE_ATTR_RO(serial);
|
||||
+
|
||||
+static struct attribute *meson_sm_sysfs_attributes[] = {
|
||||
+ &dev_attr_serial.attr,
|
||||
+ NULL,
|
||||
+};
|
||||
+
|
||||
+static const struct attribute_group meson_sm_sysfs_attr_group = {
|
||||
+ .attrs = meson_sm_sysfs_attributes,
|
||||
+};
|
||||
+
|
||||
static const struct of_device_id meson_sm_ids[] = {
|
||||
{ .compatible = "amlogic,meson-gxbb-sm", .data = &gxbb_chip },
|
||||
{ /* sentinel */ },
|
||||
@@ -242,6 +295,9 @@ static int __init meson_sm_probe(struct platform_device *pdev)
|
||||
fw.chip = chip;
|
||||
pr_info("secure-monitor enabled\n");
|
||||
|
||||
+ if (sysfs_create_group(&pdev->dev.kobj, &meson_sm_sysfs_attr_group))
|
||||
+ goto out_in_base;
|
||||
+
|
||||
return 0;
|
||||
|
||||
out_in_base:
|
||||
diff --git a/include/linux/firmware/meson/meson_sm.h b/include/linux/firmware/meson/meson_sm.h
|
||||
index 37a5eae..f98c20d 100644
|
||||
--- a/include/linux/firmware/meson/meson_sm.h
|
||||
+++ b/include/linux/firmware/meson/meson_sm.h
|
||||
@@ -17,6 +17,7 @@ enum {
|
||||
SM_EFUSE_READ,
|
||||
SM_EFUSE_WRITE,
|
||||
SM_EFUSE_USER_MAX,
|
||||
+ SM_GET_CHIP_ID,
|
||||
};
|
||||
|
||||
struct meson_sm_firmware;
|
@ -0,0 +1,31 @@
|
||||
From 7b5a69bf5bad992249aa39a96360fe90ccde9cd5 Mon Sep 17 00:00:00 2001
|
||||
From: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
|
||||
Date: Thu, 12 Jan 2017 01:39:20 +0100
|
||||
Subject: [PATCH] ARM64: dts: meson-gxbb-odroidc2: take USB hub out of reset
|
||||
|
||||
This takes the USB hub out of reset, otherwise the hub is not working.
|
||||
|
||||
Fixes: 5a0803bd5ae ("ARM64: dts: meson-gxbb-odroidc2: Enable USB Nodes")
|
||||
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
|
||||
---
|
||||
arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts | 7 +++++++
|
||||
1 file changed, 7 insertions(+)
|
||||
|
||||
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
|
||||
index c80d3a9139078..02360872c0859 100644
|
||||
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
|
||||
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
|
||||
@@ -199,6 +199,13 @@
|
||||
|
||||
&usb1 {
|
||||
status = "okay";
|
||||
+
|
||||
+ hub@1 {
|
||||
+ compatible = "usb5e3,610";
|
||||
+ reg = <1>;
|
||||
+ reset-gpios = <&gpio GPIOAO_4 GPIO_ACTIVE_LOW>;
|
||||
+ reset-duration-us = <3000>;
|
||||
+ };
|
||||
};
|
||||
|
||||
/* SD */
|
@ -0,0 +1,14 @@
|
||||
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
|
||||
index d147c853a..dbde670ba 100644
|
||||
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
|
||||
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
|
||||
@@ -246,7 +246,8 @@
|
||||
};
|
||||
|
||||
&scpi_clocks {
|
||||
- status = "disabled";
|
||||
+ /* Works only with new blobs that have limited DVFS table */
|
||||
+ status = "okay";
|
||||
};
|
||||
|
||||
/* SD */
|
24
buildroot-external/package/hardkernel-sbl/Config.in
Normal file
24
buildroot-external/package/hardkernel-sbl/Config.in
Normal file
@ -0,0 +1,24 @@
|
||||
config BR2_PACKAGE_HARDKERNEL_SBL
|
||||
bool "Hardkernel Secure Boot Loader"
|
||||
depends on BR2_TARGET_UBOOT
|
||||
help
|
||||
Augment uboot for secure loading on hardkernel targets.
|
||||
|
||||
if BR2_PACKAGE_HARDKERNEL_SBL
|
||||
choice
|
||||
prompt "Target"
|
||||
default BR2_PACKAGE_HARDKERNEL_SBL_ODROID_C2
|
||||
|
||||
config BR2_PACKAGE_HARDKERNEL_SBL_ODROID_C2
|
||||
bool "Odroid-C2"
|
||||
help
|
||||
For the Odroid-C2
|
||||
|
||||
config BR2_PACKAGE_HARDKERNEL_SBL_ODROID_XU4
|
||||
bool "Odroid-XU4"
|
||||
help
|
||||
For the Odroid-XU4. NOT YET IMPLEMENTED!!
|
||||
|
||||
endchoice
|
||||
|
||||
endif
|
39
buildroot-external/package/hardkernel-sbl/hardkernel-sbl.mk
Normal file
39
buildroot-external/package/hardkernel-sbl/hardkernel-sbl.mk
Normal file
@ -0,0 +1,39 @@
|
||||
################################################################################
|
||||
#
|
||||
# hardkernel secure boot loader
|
||||
#
|
||||
################################################################################
|
||||
|
||||
HARDKERNEL_SBL_VERSION = 205c7b3259559283161703a1a200b787c2c445a5
|
||||
HARDKERNEL_SBL_SOURCE = $(HARDKERNEL_SBL_VERSION).tar.gz
|
||||
HARDKERNEL_SBL_SITE = https://github.com/hardkernel/u-boot/archive
|
||||
HARDKERNEL_SBL_LICENSE = GPL-2.0+
|
||||
HARDKERNEL_SBL_LICENSE_FILES = Licenses/gpl-2.0.txt
|
||||
HARDKERNEL_SBL_INSTALL_IMAGES = YES
|
||||
HARDKERNEL_SBL_DEPENDENCIES = uboot
|
||||
|
||||
|
||||
ifeq ($(BR2_PACKAGE_HARDKERNEL_SBL_ODROID_C2),y)
|
||||
HARDKERNEL_SBL_BINS += sd_fuse/bl1.bin.hardkernel \
|
||||
u-boot.gxbb
|
||||
define HARDKERNEL_SBL_BUILD_CMDS
|
||||
$(@D)/fip/fip_create --bl30 $(@D)/fip/gxb/bl30.bin \
|
||||
--bl301 $(@D)/fip/gxb/bl301.bin \
|
||||
--bl31 $(@D)/fip/gxb/bl31.bin \
|
||||
--bl33 $(BINARIES_DIR)/u-boot.bin \
|
||||
$(@D)/fip.bin
|
||||
cat $(@D)/fip/gxb/bl2.package $(@D)/fip.bin > $(@D)/boot_new.bin
|
||||
$(@D)/fip/gxb/aml_encrypt_gxb --bootsig \
|
||||
--input $(@D)/boot_new.bin \
|
||||
--output $(@D)/u-boot.img
|
||||
dd if=$(@D)/u-boot.img of=$(@D)/u-boot.gxbb bs=512 skip=96
|
||||
endef
|
||||
endif
|
||||
|
||||
define HARDKERNEL_SBL_INSTALL_IMAGES_CMDS
|
||||
$(foreach f,$(HARDKERNEL_SBL_BINS), \
|
||||
cp -dpf $(@D)/$(f) $(BINARIES_DIR)/
|
||||
)
|
||||
endef
|
||||
|
||||
$(eval $(generic-package))
|
@ -3,18 +3,38 @@ set -e
|
||||
|
||||
DEVICE_CHILD="$(findfs LABEL="hassos-data")"
|
||||
DEVICE_ROOT="/dev/$(lsblk -no pkname ${DEVICE_CHILD})"
|
||||
PART_NUM="$(sgdisk -p ${DEVICE_ROOT} | awk '/hassos-data/ { print $1 }')"
|
||||
PART_NUM="${DEVICE_CHILD: -1}"
|
||||
|
||||
# Need resize
|
||||
if [ $(sgdisk -E ${DEVICE_ROOT}) -le 2048 ]; then
|
||||
echo "[INFO] No resize of data partition needed"
|
||||
exit
|
||||
# Disk is MBR
|
||||
if sfdisk -dq ${DEVICE_ROOT} | grep -q 'label: dos'; then
|
||||
# Need resize
|
||||
UNUSED=$(sfdisk -Fq ${DEVICE_ROOT} | cut -d " " -f 3 | tail -1)
|
||||
if [ -z "${UNUSED}" ]; then
|
||||
echo "[INFO] No resize of data partition needed"
|
||||
exit
|
||||
fi
|
||||
if [ ${UNUSED} -le 2048 ]; then
|
||||
echo "[INFO] No resize of data partition needed"
|
||||
exit
|
||||
fi
|
||||
|
||||
echo ", +" | sfdisk -N ${PART_NUM} ${DEVICE_ROOT} --force
|
||||
sfdisk -V ${DEVICE_ROOT}
|
||||
else
|
||||
|
||||
# Need resize
|
||||
if [ $(sgdisk -E ${DEVICE_ROOT}) -le 2048 ]; then
|
||||
echo "[INFO] No resize of data partition needed"
|
||||
exit
|
||||
fi
|
||||
|
||||
# Resize & Reload partition
|
||||
echo "[INFO] Update hassos-data partition ${PART_NUM}"
|
||||
sgdisk -e ${DEVICE_ROOT}
|
||||
sgdisk -d ${PART_NUM} -n ${PART_NUM}:0:0 -c ${PART_NUM}:"hassos-data" -t ${PART_NUM}:"0FC63DAF-8483-4772-8E79-3D69D8477DE4" -u ${PART_NUM}:"a52a4597-fa3a-4851-aefd-2fbe9f849079" ${DEVICE_ROOT}
|
||||
sgdisk -v ${DEVICE_ROOT}
|
||||
fi
|
||||
|
||||
# Resize & Reload partition
|
||||
echo "[INFO] Update hassos-data partition ${PART_NUM}"
|
||||
sgdisk -e ${DEVICE_ROOT}
|
||||
sgdisk -d ${PART_NUM} -n ${PART_NUM}:0:0 -c ${PART_NUM}:"hassos-data" -t ${PART_NUM}:"0FC63DAF-8483-4772-8E79-3D69D8477DE4" -u ${PART_NUM}:"a52a4597-fa3a-4851-aefd-2fbe9f849079" ${DEVICE_ROOT}
|
||||
partx -u ${DEVICE_ROOT}
|
||||
|
||||
# Resize filesystem
|
||||
|
@ -18,6 +18,27 @@ OVERLAY_SIZE=96M
|
||||
DATA_SIZE=1G
|
||||
|
||||
|
||||
function size2sectors() {
|
||||
s=0
|
||||
for v in "${@}"
|
||||
do
|
||||
let s+=$(echo $v | awk \
|
||||
'BEGIN{IGNORECASE = 1}
|
||||
function printsectors(n,b,p) {printf "%u\n", n*b^p/512}
|
||||
/B$/{ printsectors($1, 1, 0)};
|
||||
/K(iB)?$/{printsectors($1, 2, 10)};
|
||||
/M(iB)?$/{printsectors($1, 2, 20)};
|
||||
/G(iB)?$/{printsectors($1, 2, 30)};
|
||||
/T(iB)?$/{printsectors($1, 2, 40)};
|
||||
/KB$/{ printsectors($1, 10, 3)};
|
||||
/MB$/{ printsectors($1, 10, 6)};
|
||||
/GB$/{ printsectors($1, 10, 9)};
|
||||
/TB$/{ printsectors($1, 10, 12)}')
|
||||
done
|
||||
echo $s
|
||||
}
|
||||
|
||||
|
||||
function get_boot_size() {
|
||||
if [ "${BOOT_SYS}" == "spl" ]; then
|
||||
echo "${BOOT_SIZE[1]}"
|
||||
@ -154,6 +175,75 @@ function create_disk_image() {
|
||||
}
|
||||
|
||||
|
||||
function create_disk_mbr() {
|
||||
local disk_layout="${BINARIES_DIR}/disk.layout"
|
||||
local boot_img="${BINARIES_DIR}/boot.vfat"
|
||||
local rootfs_img="${BINARIES_DIR}/rootfs.squashfs"
|
||||
local overlay_img="${BINARIES_DIR}/overlay.ext4"
|
||||
local data_img="${BINARIES_DIR}/data.ext4"
|
||||
local kernel_img="${BINARIES_DIR}/kernel.ext4"
|
||||
local hdd_img="$(hassos_image_name img)"
|
||||
local hdd_count=${1:-2}
|
||||
|
||||
# Write new image & MBR
|
||||
dd if=/dev/zero of=${hdd_img} bs=1G count=${hdd_count}
|
||||
|
||||
local boot_start=2048
|
||||
|
||||
let boot_size=$(size2sectors ${BOOT_SIZE})+2
|
||||
let kernel0_size=$(size2sectors ${KERNEL_SIZE})+2
|
||||
let system0_size=$(size2sectors ${SYSTEM_SIZE})+2
|
||||
let kernel1_size=$(size2sectors ${KERNEL_SIZE})+2
|
||||
let system1_size=$(size2sectors ${SYSTEM_SIZE})+2
|
||||
let bootstate_size=$(size2sectors ${BOOTSTATE_SIZE})+2
|
||||
let overlay_size=$(size2sectors ${OVERLAY_SIZE})+2
|
||||
let data_size=$(size2sectors ${DATA_SIZE})+2
|
||||
let extended_size=${kernel0_size}+${system0_size}+${kernel1_size}+${system1_size}+${bootstate_size}+2
|
||||
|
||||
|
||||
let extended_start=${boot_start}+${boot_size}+1
|
||||
let kernel0_start=${extended_start}+1 # we add one here for the extended header.
|
||||
let system0_start=${kernel0_start}+${kernel0_size}+1
|
||||
let kernel1_start=${system0_start}+${system0_size}+1
|
||||
let system1_start=${kernel1_start}+${kernel1_size}+1
|
||||
let bootstate_start=${system1_start}+${system1_size}+1
|
||||
let overlay_start=${extended_start}+${extended_size}+1
|
||||
let data_start=${overlay_start}+${overlay_size}+1
|
||||
|
||||
|
||||
let boot_offset=${boot_start}
|
||||
let kernel_offset=${kernel0_start}
|
||||
let rootfs_offset=${system0_start}
|
||||
let overlay_offset=${overlay_start}
|
||||
let data_offset=${data_start}
|
||||
# Update disk layout
|
||||
(
|
||||
echo "label: dos"
|
||||
echo "label-id: 0x0d3e0000"
|
||||
echo "unit: sectors"
|
||||
echo "hassos-boot : start= ${boot_start}, size= ${boot_size}, type=c, bootable" #create the boot partition
|
||||
echo "hassos-extended : start= ${extended_start}, size= ${extended_size}, type=5" #Make an extended partition
|
||||
echo "hassos-kernela : start= ${kernel0_start}, size= ${kernel0_size}, type=83" #Make a logical partition
|
||||
echo "hassos-systema : start= ${system0_start}, size= ${system0_size}, type=83" #Make a logical partition
|
||||
echo "hassos-kernelb : start= ${kernel1_start} size= ${kernel1_size}, type=83" #Make a logical partition
|
||||
echo "hassos-systemb : start= ${system1_start}, size= ${system1_size}, type=83" #Make a logical partition
|
||||
echo "hassos-bootstate : start= ${bootstate_start}, size= ${bootstate_size}, type=83" #Make a logical partition
|
||||
echo "hassos-overlay : start= ${overlay_start}, size= ${overlay_size}, type=83" #Make a logical partition
|
||||
echo "hassos-data : start= ${data_start}, size= ${data_size}, type=83" #Make a logical partition
|
||||
) > ${disk_layout}
|
||||
|
||||
# Update Labels
|
||||
sfdisk ${hdd_img} < ${disk_layout}
|
||||
|
||||
# Write Images
|
||||
dd if=${boot_img} of=${hdd_img} conv=notrunc bs=512 obs=512 seek=${boot_offset}
|
||||
dd if=${kernel_img} of=${hdd_img} conv=notrunc bs=512 obs=512 seek=${kernel_offset}
|
||||
dd if=${rootfs_img} of=${hdd_img} conv=notrunc bs=512 obs=512 seek=${rootfs_offset}
|
||||
dd if=${overlay_img} of=${hdd_img} conv=notrunc bs=512 obs=512 seek=${overlay_offset}
|
||||
dd if=${data_img} of=${hdd_img} conv=notrunc bs=512 obs=512 seek=${data_offset}
|
||||
}
|
||||
|
||||
|
||||
function fix_disk_image_mbr() {
|
||||
local hdd_img="$(hassos_image_name img)"
|
||||
|
||||
|
@ -44,5 +44,9 @@ function create_ota_update() {
|
||||
) >> ${rauc_folder}/manifest.raucm
|
||||
fi
|
||||
|
||||
if [ ! -f "${key}" ]; then
|
||||
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout ${key} -out ${cert} -outform PEM -batch
|
||||
fi
|
||||
|
||||
rauc bundle -d --cert=${cert} --key=${key} ${rauc_folder} ${ota_file}
|
||||
}
|
||||
|
@ -20,9 +20,10 @@ function _create_rauc_header() {
|
||||
|
||||
|
||||
function _write_rauc_boot() {
|
||||
local boot_device=${1}
|
||||
(
|
||||
echo "[slot.boot.0]"
|
||||
echo "device=/dev/disk/by-partlabel/hassos-boot"
|
||||
echo "device=${boot_device}"
|
||||
echo "type=vfat"
|
||||
) >> ${TARGET_DIR}/etc/rauc/system.conf
|
||||
|
||||
@ -32,24 +33,26 @@ function _write_rauc_boot() {
|
||||
|
||||
(
|
||||
echo "[slot.spl.0]"
|
||||
echo "device=/dev/disk/by-partlabel/hassos-boot"
|
||||
echo "device=${boot_device}"
|
||||
echo "type=raw"
|
||||
) >> ${TARGET_DIR}/etc/rauc/system.conf
|
||||
}
|
||||
|
||||
|
||||
function _write_rauc_system() {
|
||||
local slot_num=${1}
|
||||
local slot_name=${2}
|
||||
local kernel_device=${1}
|
||||
local system_device=${2}
|
||||
local slot_num=${3}
|
||||
local slot_name=${4}
|
||||
|
||||
(
|
||||
echo "[slot.kernel.${slot_num}]"
|
||||
echo "device=/dev/disk/by-partlabel/hassos-kernel${slot_num}"
|
||||
echo "device=${kernel_device}"
|
||||
echo "type=ext4"
|
||||
echo "bootname=${slot_name}"
|
||||
|
||||
echo "[slot.rootfs.${slot_num}]"
|
||||
echo "device=/dev/disk/by-partlabel/hassos-system${slot_num}"
|
||||
echo "device=${system_device}"
|
||||
echo "type=raw"
|
||||
echo "parent=kernel.${slot_num}"
|
||||
) >> ${TARGET_DIR}/etc/rauc/system.conf
|
||||
@ -57,12 +60,18 @@ function _write_rauc_system() {
|
||||
|
||||
|
||||
function write_rauc_config() {
|
||||
local boot_d="${PART_BOOT:-/dev/disk/by-partlabel/hassos-boot}"
|
||||
local kernel_d0="${PART_KERNEL_0:-/dev/disk/by-partlabel/hassos-kernel0}"
|
||||
local system_d0="${PART_SYSTEM_0:-/dev/disk/by-partlabel/hassos-system0}"
|
||||
local kernel_d1="${PART_KERNEL_1:-/dev/disk/by-partlabel/hassos-kernel1}"
|
||||
local system_d1="${PART_SYSTEM_1:-/dev/disk/by-partlabel/hassos-system1}"
|
||||
|
||||
mkdir -p ${TARGET_DIR}/etc/rauc
|
||||
|
||||
_create_rauc_header
|
||||
_write_rauc_boot
|
||||
_write_rauc_system 0 A
|
||||
_write_rauc_system 1 B
|
||||
_write_rauc_boot "${boot_d}"
|
||||
_write_rauc_system "${kernel_d0}" "${system_d0}" 0 A
|
||||
_write_rauc_system "${kernel_d1}" "${system_d1}" 1 B
|
||||
}
|
||||
|
||||
|
||||
@ -76,10 +85,11 @@ function install_rauc_certs() {
|
||||
|
||||
|
||||
function install_bootloader_config() {
|
||||
local boot_env="${BOOT_ENV:-/dev/disk/by-partlabel/hassos-bootstate}"
|
||||
local boot_env_off="${BOOT_ENV_OFF:-0x0000}"
|
||||
if [ "${BOOTLOADER}" == "uboot" ]; then
|
||||
echo -e "/dev/disk/by-partlabel/hassos-bootstate\t0x00\t${BOOT_ENV_SIZE}" > ${TARGET_DIR}/etc/fw_env.config
|
||||
echo -e "${boot_env}\t${boot_env_off}\t${BOOT_ENV_SIZE}" > ${TARGET_DIR}/etc/fw_env.config
|
||||
else
|
||||
cp ${BR2_EXTERNAL_HASSOS_PATH}/misc/barebox-state-efi.dtb ${TARGET_DIR}/etc/barebox-state.dtb
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,7 @@ config BR2_PACKAGE_HOST_LINUX_HEADERS
|
||||
choice
|
||||
prompt "Kernel Headers"
|
||||
default BR2_KERNEL_HEADERS_AS_KERNEL if BR2_LINUX_KERNEL
|
||||
default BR2_KERNEL_HEADERS_4_16
|
||||
default BR2_KERNEL_HEADERS_4_17
|
||||
help
|
||||
Select the kernel version to get headers from.
|
||||
|
||||
@ -71,6 +71,10 @@ config BR2_KERNEL_HEADERS_4_16
|
||||
bool "Linux 4.16.x kernel headers"
|
||||
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_16
|
||||
|
||||
config BR2_KERNEL_HEADERS_4_17
|
||||
bool "Linux 4.16.x kernel headers"
|
||||
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_17
|
||||
|
||||
config BR2_KERNEL_HEADERS_VERSION
|
||||
bool "Manually specified Linux version"
|
||||
|
||||
@ -93,6 +97,10 @@ choice
|
||||
This is used to hide/show some packages that have strict
|
||||
requirements on the version of kernel headers.
|
||||
|
||||
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_17
|
||||
bool "4.17.x"
|
||||
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_17
|
||||
|
||||
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_16
|
||||
bool "4.16.x"
|
||||
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_16
|
||||
@ -259,4 +267,5 @@ config BR2_DEFAULT_KERNEL_HEADERS
|
||||
default "4.14.56" if BR2_KERNEL_HEADERS_4_14
|
||||
default "4.15.18" if BR2_KERNEL_HEADERS_4_15
|
||||
default "4.16.17" if BR2_KERNEL_HEADERS_4_16
|
||||
default "4.17.12" if BR2_KERNEL_HEADERS_4_17
|
||||
default BR2_DEFAULT_KERNEL_VERSION if BR2_KERNEL_HEADERS_VERSION
|
||||
|
@ -341,10 +341,15 @@ config BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_16
|
||||
bool
|
||||
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_15
|
||||
|
||||
config BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_17
|
||||
bool
|
||||
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_16
|
||||
|
||||
# This order guarantees that the highest version is set, as kconfig
|
||||
# stops affecting a value on the first matching default.
|
||||
config BR2_TOOLCHAIN_HEADERS_AT_LEAST
|
||||
string
|
||||
default "4.17" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_17
|
||||
default "4.16" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_16
|
||||
default "4.15" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_15
|
||||
default "4.14" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_14
|
||||
|
Loading…
x
Reference in New Issue
Block a user