diff --git a/arch/arm/src/lc823450/lc823450_cpupause.c b/arch/arm/src/lc823450/lc823450_cpupause.c index a8f663e6d8..10b4a0baf2 100644 --- a/arch/arm/src/lc823450/lc823450_cpupause.c +++ b/arch/arm/src/lc823450/lc823450_cpupause.c @@ -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; diff --git a/arch/arm/src/lc823450/lc823450_gpio.c b/arch/arm/src/lc823450/lc823450_gpio.c index a9c6d06b50..dde194ac83 100644 --- a/arch/arm/src/lc823450/lc823450_gpio.c +++ b/arch/arm/src/lc823450/lc823450_gpio.c @@ -54,6 +54,10 @@ # include #endif +#ifdef CONFIG_SMP +# include +#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)) diff --git a/arch/arm/src/lc823450/lc823450_serial.c b/arch/arm/src/lc823450/lc823450_serial.c index eba588f38b..5ddeb324df 100644 --- a/arch/arm/src/lc823450/lc823450_serial.c +++ b/arch/arm/src/lc823450/lc823450_serial.c @@ -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 } /**************************************************************************** diff --git a/configs/lc823450-xgevk/README.txt b/configs/lc823450-xgevk/README.txt index bed898a495..6c4e95e6f5 100644 --- a/configs/lc823450-xgevk/README.txt +++ b/configs/lc823450-xgevk/README.txt @@ -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 ^^^^ diff --git a/configs/lc823450-xgevk/audio/defconfig b/configs/lc823450-xgevk/audio/defconfig index fb2fb238e0..af21efe27e 100644 --- a/configs/lc823450-xgevk/audio/defconfig +++ b/configs/lc823450-xgevk/audio/defconfig @@ -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