rockchip: sound: Add support for sound on chromebook_jerry
Subsystems (4)
cover rockchip: sound: Add support for sound on chromebook_jerry
Sound support for jerry was never included in the initial port. Now that sound has been converted to driver model it seems like a good opportunity to fill this gap. Jerry uses an audio codec that is already supported by U-Boot.
Add the required drivers and enable the config so that 'sound play 500 400' can be used to play a beep. Also enable logging for this board.
Simon Glass (4):
rockchip: rk3288: Add i2s pinctrl and clock support
rockchip: Add an I2S driver
rockchip: Add a sound driver
sound: rockchip: Add sound support for jerry
arch/arm/dts/rk3288-veyron-jerry.dts | 12 ++ arch/arm/dts/rk3288-veyron.dtsi | 1 + arch/arm/dts/rk3288.dtsi | 1 + .../include/asm/arch-rockchip/cru_rk3288.h | 8 + .../include/asm/arch-rockchip/grf_rk3288.h | 96 +++++++++++ arch/arm/include/asm/arch-rockchip/periph.h | 1 + configs/chromebook_jerry_defconfig | 7 + drivers/clk/rockchip/clk_rk3288.c | 48 ++++++ drivers/pinctrl/rockchip/pinctrl_rk3288.c | 14 ++ drivers/sound/Kconfig | 9 ++ drivers/sound/Makefile | 1 + drivers/sound/rockchip_i2s.c | 149 ++++++++++++++++++ drivers/sound/rockchip_sound.c | 132 ++++++++++++++++ 13 files changed, 479 insertions(+) create mode 100644 drivers/sound/rockchip_i2s.c create mode 100644 drivers/sound/rockchip_sound.c
Signature · 1 line
2.20.1.415.g653613c723-goog
PATCH 1/4 rockchip: rk3288: Add i2s pinctrl and clock support
Add support for setting pinctrl and clock for I2S on rk3288. This allows the sound driver to operate. These settings were created by rkmux.py
---
.../include/asm/arch-rockchip/cru_rk3288.h | 8 ++ .../include/asm/arch-rockchip/grf_rk3288.h | 96 +++++++++++++++++++ arch/arm/include/asm/arch-rockchip/periph.h | 1 + drivers/clk/rockchip/clk_rk3288.c | 48 ++++++++++ drivers/pinctrl/rockchip/pinctrl_rk3288.c | 14 +++ 5 files changed, 167 insertions(+)
arch/arm/include/asm/arch-rockchip/cru_rk3288.h +8 -0
@@ -75,6 +75,14 @@ enum { MMC0_DIV_MASK = 0x3f << MMC0_DIV_SHIFT, }; +/* CRU_CLKSEL8_CON */ +enum { +I2S0_FRAC_DENOM_SHIFT =0 , +I2S0_FRAC_DENOM_MASK =0xffff <<I2S0_FRAC_DENOM_SHIFT , +I2S0_FRAC_NUMER_SHIFT =16 , +I2S0_FRAC_NUMER_MASK =0xffffu <<I2S0_FRAC_NUMER_SHIFT , +}; +/* CRU_CLKSEL12_CON */ enum {EMMC_PLL_SHIFT =0xe ,
arch/arm/include/asm/arch-rockchip/grf_rk3288.h +96 -0
108 lines not on this page · raw message
arch/arm/include/asm/arch-rockchip/periph.h +1 -0
@@ -45,6 +45,7 @@ enum periph_id {PERIPH_ID_HDMI ,PERIPH_ID_GMAC ,PERIPH_ID_SFC , +PERIPH_ID_I2S , PERIPH_ID_COUNT,
drivers/clk/rockchip/clk_rk3288.c +48 -0
66 lines not on this page · raw message
drivers/pinctrl/rockchip/pinctrl_rk3288.c +14 -0
@@ -531,6 +531,17 @@ static void pinctrl_rk3288_hdmi_config(struct rk3288_grf *grf, int hdmi_id) break; } } + +static void pinctrl_rk3288_i2s_config (struct rk3288_grf *grf) +{ +rk_setreg (&grf->gpio6a_iomux,GPIO6A4_I2S_SDO0 <<GPIO6A4_SHIFT | +GPIO6A3_I2S_SDI <<GPIO6A3_SHIFT | +GPIO6A2_I2S_LRCKTX <<GPIO6A2_SHIFT | +GPIO6A1_I2S_LRCKRX <<GPIO6A1_SHIFT | +GPIO6A0_I2S_SCLK <<GPIO6A0_SHIFT ); +rk_setreg (&grf->gpio6b_iomux,GPIO6B0_I2S_CLK <<GPIO6B0_SHIFT ); +rk_setreg (&grf->io_vsel,AUDIO_V18SEL_1_8V <<AUDIO_V18SEL_SHIFT ); +}#endif static int rk3288_pinctrl_request (struct udevice *dev,int func,int flags)
@@ -567,6 +578,9 @@ static int rk3288_pinctrl_request(struct udevice *dev, int func, int flags)pinctrl_rk3288_uart_config (priv->grf, func);break ;#ifndef CONFIG_SPL_BUILD +case PERIPH_ID_I2S : +pinctrl_rk3288_i2s_config (priv->grf); +break ;case PERIPH_ID_LCDC0 :case PERIPH_ID_LCDC1 :pinctrl_rk3288_lcdc_config (priv->grf, func);
Signature · 1 line
2.20.1.415.g653613c723-goog
PATCH 1/4 rockchip: rk3288: Add i2s pinctrl and clock support
Quoted 4 lines
Add support for setting pinctrl and clock for I2S on rk3288. This allows the sound driver to operate. These settings were created by
rkmux.pySigned-off-by Simon Glass <[email protected]>
Quoted 9 lines
---
.../include/asm/arch-rockchip/cru_rk3288.h | 8 ++ .../include/asm/arch-rockchip/grf_rk3288.h | 96 +++++++++++++++++++ arch/arm/include/asm/arch-rockchip/periph.h | 1 + drivers/clk/rockchip/clk_rk3288.c | 48 ++++++++++ drivers/pinctrl/rockchip/pinctrl_rk3288.c | 14 +++ 5 files changed, 167 insertions(+)
PATCH 1/4 rockchip: rk3288: Add i2s pinctrl and clock support
In reply to Simon GlassQuoted 5 lines
Add support for setting pinctrl and clock for I2S on rk3288. This allows the sound driver to operate. These settings were created by
rkmux.pySigned-off-by Simon Glass <[email protected]>Reviewed-by Philipp Tomsich <[email protected]>
Quoted 9 lines
---
.../include/asm/arch-rockchip/cru_rk3288.h | 8 ++ .../include/asm/arch-rockchip/grf_rk3288.h | 96 +++++++++++++++++++ arch/arm/include/asm/arch-rockchip/periph.h | 1 + drivers/clk/rockchip/clk_rk3288.c | 48 ++++++++++ drivers/pinctrl/rockchip/pinctrl_rk3288.c | 14 +++ 5 files changed, 167 insertions(+)
Applied to u-boot-rockchip, thanks!
PATCH 2/4 rockchip: Add an I2S driver
In reply to Simon GlassAdd a driver for I2S which allows audio data to be sent from the SoC to the audio codec. The sample rate and other settings are hard-coded for now as there is no suitable device-tree binding available.
---
drivers/sound/Kconfig | 9 +++ drivers/sound/Makefile | 1 + drivers/sound/rockchip_i2s.c | 149 +++++++++++++++++++++++++++++++++++ 3 files changed, 159 insertions(+) create mode 100644 drivers/sound/rockchip_i2s.c
drivers/sound/Kconfig +9 -0
@@ -21,6 +21,15 @@ config I2S I2S. It calls either of the two supported codecs (no use is made of driver model at present). +config I2S_ROCKCHIP + bool "Enable I2S support for Rockchip SoCs" + depends on I2S + help + Rockchip SoCs support an I2S interface for sending audio data to an + audio codec. This option enables support for this, using one of the + available audio codec drivers. This driver does not make use of + DMA, but writes each word directly to the hardware. + config I2S_SAMSUNG bool "Enable I2C support for Samsung SoCs" depends on I2S
drivers/sound/Makefile +1 -0
@@ -9,6 +9,7 @@ obj-$(CONFIG_SOUND) += i2s-uclass.o obj-$(CONFIG_SOUND) += sound-uclass.o obj-$(CONFIG_I2S_SAMSUNG) += samsung-i2s.o obj-$(CONFIG_SOUND_SANDBOX) += sandbox.o +obj-$(CONFIG_I2S_ROCKCHIP) += rockchip_i2s.o obj-$(CONFIG_I2S_SAMSUNG) += samsung_sound.o obj-$(CONFIG_I2S_TEGRA) += tegra_ahub.o tegra_i2s.o tegra_sound.o obj-$(CONFIG_SOUND_WM8994) += wm8994.o
drivers/sound/rockchip_i2s.c new file +149 -0
149 lines not on this page · raw message
Signature · 1 line
2.20.1.415.g653613c723-goog
PATCH 2/4 rockchip: Add an I2S driver
Quoted 4 lines
Add a driver for I2S which allows audio data to be sent from the SoC to the audio codec. The sample rate and other settings are hard-coded for now as there is no suitable device-tree binding available.
Quoted 9 lines
Signed-off-by Simon Glass <[email protected]>---
drivers/sound/Kconfig | 9 +++ drivers/sound/Makefile | 1 + drivers/sound/rockchip_i2s.c | 149 +++++++++++++++++++++++++++++++++++ 3 files changed, 159 insertions(+) create mode 100644 drivers/sound/rockchip_i2s.c
PATCH 2/4 rockchip: Add an I2S driver
In reply to Simon GlassQuoted 6 lines
Add a driver for I2S which allows audio data to be sent from the SoC to the audio codec. The sample rate and other settings are hard-coded for now as there is no suitable device-tree binding available.
Signed-off-by Simon Glass <[email protected]>Reviewed-by Philipp Tomsich <[email protected]>
Quoted 8 lines
---
drivers/sound/Kconfig | 9 +++ drivers/sound/Makefile | 1 + drivers/sound/rockchip_i2s.c | 149 +++++++++++++++++++++++++++++++++++ 3 files changed, 159 insertions(+) create mode 100644 drivers/sound/rockchip_i2s.c
Applied to u-boot-rockchip, thanks!
PATCH 3/4 rockchip: Add a sound driver
In reply to Simon GlassAdd a sound driver for rk3288 supporting chromebook_jerry. This uses the I2S driver, and existing audio codec and the clock/pinmux support.
---
drivers/sound/Makefile | 2 +- drivers/sound/rockchip_sound.c | 132 +++++++++++++++++++++++++++++++++ 2 files changed, 133 insertions(+), 1 deletion(-) create mode 100644 drivers/sound/rockchip_sound.c
drivers/sound/Makefile +1 -1
@@ -9,7 +9,7 @@ obj-$(CONFIG_SOUND) += i2s-uclass.o obj-$(CONFIG_SOUND) += sound-uclass.o obj-$(CONFIG_I2S_SAMSUNG) += samsung-i2s.o obj-$(CONFIG_SOUND_SANDBOX) += sandbox.o -obj-$(CONFIG_I2S_ROCKCHIP) += rockchip_i2s.o +obj-$(CONFIG_I2S_ROCKCHIP) += rockchip_i2s.o rockchip_sound.o obj-$(CONFIG_I2S_SAMSUNG) += samsung_sound.o obj-$(CONFIG_I2S_TEGRA) += tegra_ahub.o tegra_i2s.o tegra_sound.o obj-$(CONFIG_SOUND_WM8994) += wm8994.o
drivers/sound/rockchip_sound.c new file +132 -0
132 lines not on this page · raw message
Signature · 1 line
2.20.1.415.g653613c723-goog
PATCH 3/4 rockchip: Add a sound driver
Quoted 11 lines
Add a sound driver for rk3288 supporting
chromebook_jerry. This uses the I2S driver, and existing audio codec and the clock/pinmux support.Signed-off-by Simon Glass <[email protected]>---
drivers/sound/Makefile | 2 +- drivers/sound/rockchip_sound.c | 132 +++++++++++++++++++++++++++++++++ 2 files changed, 133 insertions(+), 1 deletion(-) create mode 100644 drivers/sound/rockchip_sound.c
PATCH 3/4 rockchip: Add a sound driver
In reply to Simon GlassQuoted 12 lines
Add a sound driver for rk3288 supporting
chromebook_jerry. This uses the I2S driver, and existing audio codec and the clock/pinmux support.Signed-off-by Simon Glass <[email protected]>Reviewed-by Philipp Tomsich <[email protected]>---
drivers/sound/Makefile | 2 +- drivers/sound/rockchip_sound.c | 132 +++++++++++++++++++++++++++++++++ 2 files changed, 133 insertions(+), 1 deletion(-) create mode 100644 drivers/sound/rockchip_sound.c
Applied to u-boot-rockchip, thanks!
PATCH 4/4 sound: rockchip: Add sound support for jerry
In reply to Simon GlassJerry uses a max98090 audio codec and the internal SoC I2S peripheral. Enable sound support and add the required device-tree pieces.
---
arch/arm/dts/rk3288-veyron-jerry.dts | 12 ++++++++++++ arch/arm/dts/rk3288-veyron.dtsi | 1 + arch/arm/dts/rk3288.dtsi | 1 + configs/chromebook_jerry_defconfig | 7 +++++++ 4 files changed, 21 insertions(+)
arch/arm/dts/rk3288-veyron-jerry.dts +12 -0
@@ -52,6 +52,18 @@ vin-supply = <&vcc33_sys>; startup-delay-us = <15000>; }; + + sound { + compatible = "rockchip,audio-max98090-jerry"; + + cpu { + sound-dai = <&i2s 0>; + }; + + codec { + sound-dai = <&max98090 0>; + }; + }; }; &dmc {
arch/arm/dts/rk3288-veyron.dtsi +1 -0
@@ -484,6 +484,7 @@ max98090: max98090 at 10 { compatible = "maxim,max98090"; reg = <0x10>; + #sound-dai-cells = <0>; interrupt-parent = <&gpio6>; interrupts = <7 IRQ_TYPE_EDGE_FALLING>; pinctrl-names = "default";
arch/arm/dts/rk3288.dtsi +1 -0
@@ -649,6 +649,7 @@ interrupts = <GIC_SPI 85 IRQ_TYPE_LEVEL_HIGH>; #address-cells = <1>; #size-cells = <0>; + #sound-dai-cells = <1>; dmas = <&dmac_bus_s 0>, <&dmac_bus_s 1>; dma-names = "tx", "rx"; clock-names = "i2s_hclk", "i2s_clk";
configs/chromebook_jerry_defconfig +7 -0
@@ -14,6 +14,8 @@ CONFIG_DEBUG_UART=y CONFIG_NR_DRAM_BANKS=1 # CONFIG_ANDROID_BOOT_IMAGE is not set CONFIG_SILENT_CONSOLE=y +CONFIG_LOG=y +CONFIG_LOG_DEFAULT_LEVEL=7 CONFIG_DEFAULT_FDT_FILE="rk3288-veyron-jerry.dtb" # CONFIG_DISPLAY_CPUINFO is not set CONFIG_DISPLAY_BOARDINFO_LATE=y
@@ -32,6 +34,7 @@ CONFIG_CMD_USB=y # CONFIG_CMD_SETEXPR is not set CONFIG_CMD_CACHE=y CONFIG_CMD_TIME=y +CONFIG_CMD_SOUND=y CONFIG_CMD_PMIC=y CONFIG_CMD_REGULATOR=y # CONFIG_SPL_DOS_PARTITION is not set
@@ -76,6 +79,10 @@ CONFIG_RAM=y CONFIG_SPL_RAM=y CONFIG_DEBUG_UART_SHIFT=2 CONFIG_ROCKCHIP_SERIAL=y +CONFIG_SOUND=y +CONFIG_I2S=y +CONFIG_I2S_ROCKCHIP=y +CONFIG_SOUND_MAX98090=y CONFIG_ROCKCHIP_SPI=y CONFIG_SYSRESET=y CONFIG_USB=y
Signature · 1 line
2.20.1.415.g653613c723-goog
PATCH 4/4 sound: rockchip: Add sound support for jerry
Quoted 12 lines
Jerry uses a max98090 audio codec and the internal SoC I2S peripheral. Enable sound support and add the required device-tree pieces.
Signed-off-by Simon Glass <[email protected]>---
arch/arm/dts/rk3288-veyron-jerry.dts | 12 ++++++++++++ arch/arm/dts/rk3288-veyron.dtsi | 1 + arch/arm/dts/rk3288.dtsi | 1 + configs/chromebook_jerry_defconfig | 7 +++++++ 4 files changed, 21 insertions(+)
PATCH 4/4 sound: rockchip: Add sound support for jerry
In reply to Simon GlassQuoted 5 lines
Jerry uses a max98090 audio codec and the internal SoC I2S peripheral. Enable sound support and add the required device-tree pieces.
Signed-off-by Simon Glass <[email protected]>Reviewed-by Philipp Tomsich <[email protected]>
Quoted 8 lines
---
arch/arm/dts/rk3288-veyron-jerry.dts | 12 ++++++++++++ arch/arm/dts/rk3288-veyron.dtsi | 1 + arch/arm/dts/rk3288.dtsi | 1 + configs/chromebook_jerry_defconfig | 7 +++++++ 4 files changed, 21 insertions(+)
Applied to u-boot-rockchip, thanks!
cover rockchip: sound: Add support for sound on chromebook_jerry
In reply to Simon GlassQuoted 12 lines · Simon Glass
Sound support for jerry was never included in the initial port. Now that sound has been converted to driver model it seems like a good opportunity to fill this gap. Jerry uses an audio codec that is already supported by U-Boot.
Add the required drivers and enable the config so that 'sound play 500 400' can be used to play a beep. Also enable logging for this board.
I hope to find time to add support for the RK3399 (which has a sufficiently closely related I2S controller)—and possibly even the RK3368—and for the SGTL5000 codec that we have on the Haikou reference baseboard.
If you don’t hear anything by mid-January, feel free to poke me. Philipp.
cover rockchip: sound: Add support for sound on chromebook_jerry
Hi Philipp,
Quoted 10 lines · Philipp Tomsich
Quoted 10 lines · Simon Glass
Sound support for jerry was never included in the initial port. Now that sound has been converted to driver model it seems like a good opportunity to fill this gap. Jerry uses an audio codec that is already supported by U-Boot.
Quoted 7 lines
Quoted 3 lines
Add the required drivers and enable the config so that 'sound play 500 400' can be used to play a beep. Also enable logging for this board.
I hope to find time to add support for the RK3399 (which has a sufficiently closely related I2S controller)—and possibly even the RK3368—and for the SGTL5000 codec that we have on the Haikou reference baseboard.
Sounds good! Really interested to see how the API works out.
I have been meaning to add support for kevin but have not got to it.
- Simon
Quoted 3 lines
If you don’t hear anything by mid-January, feel free to poke me. Philipp.