summaryrefslogtreecommitdiffstats
path: root/meta-agl-bsp/meta-rcar-gen3/recipes-kernel/linux/files/0004-ADSP-enable-and-add-sound-hardware-abstraction.patch
blob: e8ea125e92f276e185397287eb574db708d955e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
The ADSP on Renesas SoCs required a reserved memory area to become
enabled, and this needs to be done manually.

This patch adds sound hardware abstraction information for the m3ulcb
and m3ulcb-kf (kingfisher) device trees. This is helpful on-board the
ADSP for dynamically determining sound hardware at runtime, allowing
single binaries to be used between the two boards. 

Future work will incorporate the h3ulcb and Salvator boards into the
abstraction.

Signed-off-by: Ronan Le Martret <ronan.lemartret@iot.bzh>
Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
---
diff --git a/arch/arm64/boot/dts/renesas/r8a7796-m3ulcb.dts b/arch/arm64/boot/dts/renesas/r8a7796-m3ulcb.dts
index 1cd64c1b3b31..71e59da3528d 100644
--- a/arch/arm64/boot/dts/renesas/r8a7796-m3ulcb.dts
+++ b/arch/arm64/boot/dts/renesas/r8a7796-m3ulcb.dts
@@ -42,11 +42,18 @@
 			reg = <0x00000000 0x54000000 0x0 0x03000000>;
 		};
 
+		/* For Audio DSP */
+		adsp_reserved: linux,adsp {
+			compatible = "shared-dma-pool";
+			reusable;
+			reg = <0x00000000 0x57000000 0x0 0x01000000>;
+		};
+
 		/* global autoconfigured region for contiguous allocations */
 		linux,cma@57000000 {
 			compatible = "shared-dma-pool";
 			reusable;
-			reg = <0x00000000 0x57000000 0x0 0x19000000>;
+			reg = <0x00000000 0x58000000 0x0 0x18000000>;
 			linux,cma-default;
 		};
 
@@ -110,6 +117,42 @@
 		      "dclkin.0", "dclkin.1", "dclkin.2";
 };
 
+&adsp {
+	status = "okay";
+	clock-frequency = <12288000 11289600>;
+	audio-clocks = <22579200 24576000>;
+	memory-region = <&adsp_reserved>;
+
+	/* ADSP playback setting for ak4613 */
+	adsp_playback0: adsp,playback {
+		mode  = "i2s";
+		clock-mode = "master";
+		bus-width = <16>;
+		ssi = <0>;
+		bus-if = <0>;
+		channels = <2>;
+		pin-share-ssi = <1>;
+	};
+
+	/* ADSP capture setting for ak4613 */
+	adsp_capture0: adsp,capture {
+		mode  = "i2s";
+		clock-mode = "slave";
+		bus-width = <16>;
+		ssi = <1>;
+		bus-if = <0>;
+		channels = <2>;
+		pin-share-ssi = <0>;
+	};
+	
+	adsp,ports {
+		port@0 {
+			playback = <&adsp_playback0>;
+			capture  = <&adsp_capture0>;
+		};
+	};
+};
+
 &vspb {
 	status = "okay";
 };
;x11" DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit" PREFERRED_VERSION_wayland-ivi-extension ?= "2.0.%" # Prefer GStreamer 1.10.x by default PREFERRED_VERSION_gstreamer1.0 ?= "1.12.%" PREFERRED_VERSION_gstreamer1.0-plugins-bad ?= "1.12.%" PREFERRED_VERSION_gstreamer1.0-plugins-base ?= "1.12.%" PREFERRED_VERSION_gstreamer1.0-plugins-good ?= "1.12.%" PREFERRED_VERSION_gstreamer1.0-plugins-ugly ?= "1.12.%" PREFERRED_VERSION_gstreamer1.0-libav ?= "1.12.%" PREFERRED_VERSION_gstreamer1.0-omx ?= "1.12.%" # Prefer libjpeg-turbo PREFERRED_PROVIDER_jpeg = "libjpeg-turbo" # using multiple BSP layers causes dangling bbappends in meta-agl-bsp # turn it into a warning #BB_DANGLINGAPPENDS_WARNONLY = "1" # enforce security-related compiler flags by default require conf/distro/include/security_flags.inc # required overrides, upstreamed but not merged yet: # http://lists.openembedded.org/pipermail/openembedded-devel/2016-June/107727.html SECURITY_CFLAGS_pn-llvm3.3 = "" SECURITY_LDFLAGS_remove_pn-llvm3.3 = "-fstack-protector-strong" SECURITY_STRINGFORMAT_pn-gpm = "" SECURITY_CFLAGS_pn-libdbus-c++ = "" SECURITY_LDFLAGS_pn-libdbus-c++ = "" # more than 2 targets fail to compile these with the SECURITY compiler flags: # Bug tracked as SPEC-593 SECURITY_CFLAGS_pn-mozjs = "" SECURITY_LDFLAGS_pn-mozjs = "" SECURITY_CFLAGS_pn-gpm = "" SECURITY_LDFLAGS_pn-gpm = "" SECURITY_CFLAGS_pn-libatasmart = "" SECURITY_LDFLAGS_pn-libatasmart = "" # Not yet upstreamed; should be submitted. SECURITY_CFLAGS_pn-qtwebengine = "${SECURITY_NO_PIE_CFLAGS}" #Redefined USER_CLASSES #Disable prelink. It is unmaintained and likely will go away. #default: USER_CLASSES ?= "buildstats image-mklibs image-prelink" USER_CLASSES = "buildstats image-mklibs" # AGL uses 4 optimization levels # 2 for ARM 32bit # - a high and a medium setting for the CCARGS # - the high setting is default (needs >= cortex-a15) # - the medium setting is enabled with: DISTRO_FEATURES_append = " agl-medium-arm-compiler " # 1 for ARM 64bit / AARCH64 # 1 for x86-64 require conf/distro/include/${TARGET_ARCH}-tune.inc # Generic qemu and qemuboot (runqemu) enhancements # check qemuboot.bbclass # - use 2G RAM by default QB_MEM ?= "-m 2048" # use pulseaudio on the host side - off as qemu-native is built with alsa #QB_AUDIO_DRV = "pa" # expose a virtual 'hda' sound card to the guest (arm/aarch64/x86-64) QB_AUDIO_OPT = "-soundhw hda" # Board templates can add extra IMAGE_FSTYPES through this. # It is added (late) through the AGL image recipes. AGL_EXTRA_IMAGE_FSTYPES ??= "" AGL_EXTRA_INITRAMFS_FSTYPES ??= "" # # Default IMAGE FSTYPES compressed tarball + ext4.xz AGL_DEFAULT_IMAGE_FSTYPES ?= "tar.xz ${@bb.utils.contains('DISTRO_FEATURES', 'AGLCI', 'ext4.xz', 'ext4', d)}" AGL_DEFAULT_INITRAMFS_FSTYPES ?= "ext4.gz" # DEFAULT IMAGE_FSTYPES for AGL (no - BSPs should not set this) # IMAGE_FSTYPES := "${AGL_DEFAULT_IMAGE_FSTYPES} ${AGL_EXTRA_IMAGE_FSTYPES}" INITRAMFS_FSTYPES := "${AGL_DEFAULT_INITRAMFS_FSTYPES} ${AGL_EXTRA_INITRAMFS_FSTYPES}" # # THE FUTURE is 'wic' # IMAGE_FSTYPES_append = " wic" # enable the packagemanagement IMAGE_FEATURES =+ "package-management" PACKAGE_FEED_URIS = "http://192.168.7.1:8000/tmp/deploy/" PACKAGE_FEED_BASE_PATHS = "rpm" PACKAGE_FEED_ARCHS = "" #${PACKAGE_ARCHS}" # Fix for rpm metadata clash between nativesdk-cmake and nativesdk-qtbase-tools # (revalidate after 2017-10-15, 2018-06-12: still required) DIRFILES_pn-nativesdk-cmake = "1"