summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoy Cho <joy.cho@hardkernel.com>2020-12-02 04:55:24 +0300
committerJoy Cho <joy.cho@hardkernel.com>2020-12-02 10:36:03 +0300
commit2efc5159499a0bfd9dfc6a116394fb4f85dfa551 (patch)
tree66b2010c5726dcdd09baa0578bb0d51a181462fb
parent85021bf0ff251ef24be2b12cda7c2bd8264b8ff5 (diff)
downloadu-boot-2efc5159499a0bfd9dfc6a116394fb4f85dfa551.tar.xz
ODROID-GOA: Support sound command for test in production
Change-Id: I098fc8db69760bc6643c3b745d758a3630f227db
-rw-r--r--configs/odroidgoa-spi_defconfig8
-rw-r--r--configs/odroidgoa_defconfig8
-rw-r--r--drivers/sound/rockchip-sound.c12
3 files changed, 26 insertions, 2 deletions
diff --git a/configs/odroidgoa-spi_defconfig b/configs/odroidgoa-spi_defconfig
index 2141b1fd29..1fd330f447 100644
--- a/configs/odroidgoa-spi_defconfig
+++ b/configs/odroidgoa-spi_defconfig
@@ -589,6 +589,7 @@ CONFIG_CMD_LED=y
# CONFIG_CMD_GETTIME is not set
CONFIG_CMD_MISC=y
CONFIG_CMD_TIMER=y
+CONFIG_CMD_SOUND=y
# CONFIG_CMD_QFW is not set
# CONFIG_CMD_TERMINAL is not set
# CONFIG_CMD_UUID is not set
@@ -1099,7 +1100,12 @@ CONFIG_SYS_NS16550=y
#
# Sound support
#
-# CONFIG_SOUND is not set
+CONFIG_SOUND=y
+# CONFIG_I2S is not set
+# CONFIG_I2S_SAMSUNG is not set
+CONFIG_I2S_ROCKCHIP=y
+CONFIG_SOUND_RK817=y
+CONFIG_SOUND_ROCKCHIP=y
CONFIG_SPI=y
CONFIG_DM_SPI=y
CONFIG_SPI_MEM=y
diff --git a/configs/odroidgoa_defconfig b/configs/odroidgoa_defconfig
index ff8f52c39e..40dc05a1ff 100644
--- a/configs/odroidgoa_defconfig
+++ b/configs/odroidgoa_defconfig
@@ -589,6 +589,7 @@ CONFIG_CMD_LED=y
# CONFIG_CMD_GETTIME is not set
CONFIG_CMD_MISC=y
CONFIG_CMD_TIMER=y
+CONFIG_CMD_SOUND=y
# CONFIG_CMD_QFW is not set
# CONFIG_CMD_TERMINAL is not set
# CONFIG_CMD_UUID is not set
@@ -1099,7 +1100,12 @@ CONFIG_SYS_NS16550=y
#
# Sound support
#
-# CONFIG_SOUND is not set
+CONFIG_SOUND=y
+# CONFIG_I2S is not set
+# CONFIG_I2S_SAMSUNG is not set
+CONFIG_I2S_ROCKCHIP=y
+CONFIG_SOUND_RK817=y
+CONFIG_SOUND_ROCKCHIP=y
CONFIG_SPI=y
CONFIG_DM_SPI=y
CONFIG_SPI_MEM=y
diff --git a/drivers/sound/rockchip-sound.c b/drivers/sound/rockchip-sound.c
index cb26eeba4f..1b0721936c 100644
--- a/drivers/sound/rockchip-sound.c
+++ b/drivers/sound/rockchip-sound.c
@@ -13,7 +13,12 @@
#include <sound.h>
#include <asm/arch-rockchip/resource_img.h>
+#ifdef CONFIG_PLATFORM_ODROID_GOADV
+/* about 3 seconds */
+#define WAV_SIZE (512 * 1024) /* BYTE */
+#else
#define WAV_SIZE (5 * 1024 * 1024) /* BYTE */
+#endif
#define SAMPLERATE 44100
static struct udevice *i2s_dev, *codec_dev;
@@ -21,9 +26,16 @@ static struct udevice *i2s_dev, *codec_dev;
static int load_audio_wav(void *buf, const char *wav_name, int size)
{
int ret = 0;
+#ifdef CONFIG_PLATFORM_ODROID_GOADV
+ char cmd[128];
+ sprintf(cmd, "fatload mmc 1:1 %p boot.wav", (void *)buf);
+ if (CMD_RET_SUCCESS == run_command(cmd, 0))
+ ret = 1;
+#else
#ifdef CONFIG_ROCKCHIP_RESOURCE_IMAGE
ret = rockchip_read_resource_file(buf, wav_name, 0, size);
#endif
+#endif
return ret;
}