Merged in masayuki2009/nuttx.nuttx/lc823450_smp_audio (pull request #547)

lc823450 smp audio

* arch/arm/src/lc823450: Remove a workaround in up_cpu_paused()

    Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

* arch/arm/src/lc823450: Introduce g_gpio_lock to improve write performance in SMP mode.

    NOTE: This is a tentative solution and should be replaced with more generic one.

    Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

* arch/arm/src/lc823450: Add a workaround in up_txready() to avoid data corruption.

    Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

* configs/lc823450-xgevk: Enable CONFIG_SMP for audio

    Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

* configs/lc823450-xgevk: Update README.txt regarding SMP audio

    Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

Approved-by: Gregory Nutt <gnutt@nuttx.org>
This commit is contained in:
Masayuki Ishikawa 2017-11-27 07:20:54 +00:00 committed by Gregory Nutt
parent 43a221f308
commit fb49472ec8
5 changed files with 45 additions and 29 deletions

View File

@ -185,9 +185,6 @@ int up_cpu_paused(int cpu)
up_restorestate(tcb->xcp.regs);
/* FIXME */
up_udelay(500);
spin_unlock(&g_cpu_wait[cpu]);
return OK;

View File

@ -54,6 +54,10 @@
# include <nuttx/ioex.h>
#endif
#ifdef CONFIG_SMP
# include <nuttx/spinlock.h>
#endif
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
@ -75,6 +79,10 @@ static FAR struct ioex_dev_s *g_ioex_dev;
static FAR struct vgpio_ops_s *vgpio_ops[GPIO_VIRTUAL_NUM];
#endif /* CONFIG_LC823450_VGPIO */
#ifdef CONFIG_SMP
static volatile spinlock_t g_gpio_lock;
#endif
/****************************************************************************
* Private Functions
****************************************************************************/
@ -400,24 +408,34 @@ void lc823450_gpio_write(uint16_t gpiocfg, bool value)
regaddr = lc823450_get_gpio_data(port);
#ifdef CONFIG_SMP
flags = up_irq_save();
spin_lock(&g_gpio_lock);
#else
flags = enter_critical_section();
#endif
/* Write the value (0 or 1). To the data register */
regval = getreg32(regaddr);
if (value)
{
regval |= (1 << pin);
}
else
{
regval &= ~(1 << pin);
}
if (value)
{
regval |= (1 << pin);
}
else
{
regval &= ~(1 << pin);
}
putreg32(regval, regaddr);
putreg32(regval, regaddr);
leave_critical_section(flags);
#ifdef CONFIG_SMP
spin_unlock(&g_gpio_lock);
up_irq_restore(flags);
#else
leave_critical_section(flags);
#endif
}
#ifdef CONFIG_IOEX
else if (port <= (GPIO_PORTEX >> GPIO_PORT_SHIFT))

View File

@ -1007,7 +1007,11 @@ static bool up_txready(struct uart_dev_s *dev)
}
#endif /* CONFIG_DEV_CONSOLE_SWITCH */
#ifndef CONFIG_SMP
return ((up_serialin(priv, UART_USR) & UART_USR_TXFULL) == 0);
#else
return (UART_USFS_TXFF_LV(up_serialin(priv, UART_USFS)) <= 1);
#endif
}
/****************************************************************************

View File

@ -200,10 +200,6 @@ To play WAV file on uSD card,
nxplayer> play /mnt/sd1/sample.wav
nxplayer> volume 50
Currently nxplayer does not work in SMP mode.
up_assert: Assertion failed at file:chip/lc823450_cpupause.c line: 279 task: wm8776
TODO
^^^^

View File

@ -1,23 +1,20 @@
# CONFIG_AUDIO_FORMAT_MP3 is not set
# CONFIG_NSH_ARGCAT is not set
# CONFIG_NX_DISABLE_1BPP is not set
# CONFIG_SPI_EXCHANGE is not set
CONFIG_AQM_1248A=y
CONFIG_ARCH_BOARD_LC823450_XGEVK=y
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="lc823450-xgevk"
CONFIG_ARCH_BOARD_LC823450_XGEVK=y
CONFIG_ARCH_CHIP_LC823450=y
CONFIG_ARCH_FLOAT_H=y
CONFIG_ARCH_INTERRUPTSTACK=2048
CONFIG_ARCH_STDARG_H=y
CONFIG_ARCH="arm"
CONFIG_AUDIO_BUFFER_NUMBYTES=1024
CONFIG_AUDIO_EXCLUDE_BALANCE=y
CONFIG_AUDIO_EXCLUDE_FFORWARD=y
CONFIG_AUDIO_EXCLUDE_TONE=y
# CONFIG_AUDIO_FORMAT_MP3 is not set
CONFIG_AUDIO_WM8776=y
CONFIG_AUDIO=y
CONFIG_BOARD_LOOPSPERMSEC=12061
CONFIG_BOARDCTL_RESET=y
CONFIG_BOARD_LOOPSPERMSEC=12061
CONFIG_BUILTIN=y
CONFIG_C99_BOOL8=y
CONFIG_CODECS_HASH_MD5=y
@ -37,15 +34,16 @@ CONFIG_EXAMPLES_NXHELLO_BPP=1
CONFIG_EXAMPLES_NXHELLO=y
CONFIG_EXAMPLES_OSTEST=y
CONFIG_EXAMPLES_PIPE=y
CONFIG_EXAMPLES_SMP=y
CONFIG_EXPERIMENTAL=y
CONFIG_FAT_LCNAMES=y
CONFIG_FAT_LFN=y
CONFIG_FS_FAT=y
CONFIG_FS_FATTIME=y
CONFIG_FS_FAT=y
CONFIG_FS_PROCFS=y
CONFIG_I2C_RESET=y
CONFIG_I2C=y
CONFIG_I2CTOOL_MAXBUS=1
CONFIG_I2C=y
CONFIG_I2S=y
CONFIG_INTELHEX_BINARY=y
CONFIG_LC823450_I2C0=y
@ -69,6 +67,7 @@ CONFIG_NETUTILS_CODECS=y
CONFIG_NFILE_DESCRIPTORS=45
CONFIG_NFILE_STREAMS=8
CONFIG_NSH_ARCHINIT=y
# CONFIG_NSH_ARGCAT is not set
CONFIG_NSH_BUILTIN_APPS=y
CONFIG_NSH_CMDOPT_DD_STATS=y
CONFIG_NSH_DISABLE_BASENAME=y
@ -88,9 +87,10 @@ CONFIG_NSH_LINELEN=128
CONFIG_NSH_MAXARGUMENTS=10
CONFIG_NSH_READLINE=y
CONFIG_NX_BLOCKING=y
CONFIG_NX=y
# CONFIG_NX_DISABLE_1BPP is not set
CONFIG_NXFONT_MONO5X8=y
CONFIG_NXPLAYER_DEFAULT_MEDIADIR="/mnt/sd1"
CONFIG_NX=y
CONFIG_PIPES=y
CONFIG_POSIX_SPAWN_PROXY_STACKSIZE=2048
CONFIG_PREALLOC_MQ_MSGS=4
@ -107,14 +107,15 @@ CONFIG_RTC=y
CONFIG_SCHED_ATEXIT=y
CONFIG_SCHED_CHILD_STATUS=y
CONFIG_SCHED_HAVE_PARENT=y
CONFIG_SCHED_HPWORK=y
CONFIG_SCHED_HPWORKPRIORITY=192
CONFIG_SCHED_ONEXIT_MAX=32
CONFIG_SCHED_ONEXIT=y
CONFIG_SCHED_STARTHOOK=y
CONFIG_SCHED_WAITPID=y
CONFIG_SDCLONE_DISABLE=y
CONFIG_SERIAL_TERMIOS=y
CONFIG_SMP_NCPUS=2
CONFIG_SMP=y
# CONFIG_SPI_EXCHANGE is not set
CONFIG_SPI=y
CONFIG_START_DAY=3
CONFIG_START_MONTH=10