Commit Graph

4059 Commits

Author SHA1 Message Date
Alexander Lunev
f7c8875fd7 sdio,stm32h7: fixed an issue with not starting IDMA data transfer in case of IO_RW_EXTENDED command (CMD53);
corrected setting SDMMC_DCTRL.DTMODE field for block data transfers ending on block count
and for block data transfers ending with STOP_TRANSMISSION command;
stm32_sdio: added more debug messages
2021-06-21 02:47:46 -05:00
Fotis Panagiotopoulos
b16de69e56 syslog: Added channel close callback. 2021-06-18 00:47:09 -05:00
Xiang Xiao
80157b8782 syslog/ramlog: Remove the duplication of \n->\r\n conversion
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I5497f3ab40a55c5c08ba893e1186b93915cef03a
2021-06-17 06:22:28 -07:00
retogaeh
d54b2126a0 Update drivers/analog/adc.c
Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com>
2021-06-16 04:58:06 -07:00
GAEHWILER Reto
b9fba3edae stm32h7 fix adc port to handle overrun and the DR's fifo, adapt adc driver
* port didn't know about data-register fifo
* port didn't handle overrun condition
* driver could get stuck if interrupts were skipped due to saturation
2021-06-16 04:58:06 -07:00
Xiang Xiao
2e49e1bc5c mtd: Add MTDIOC_FLUSH IOCTL like MTDIOC_XIPBASE
since the old design reuse BIOC_FLUSH for
MTD device which make some confusion

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-06-15 13:26:45 -03:00
Yuichi Nakamura
8d722709cd usbmsc: Add USBMSC_NOT_STALL_BULKEP for RP2040 workaround
The new configuration CONFIG_USBMSC_NOT_STALL_BULKEP avoids to go into
stall state when :
- Receiving SCSI_CMD_INQUIRY with flags or pagecode != 0
- Receiving SCSI_CMD_MODESENSE6 and return the result data shorter than
  the requested data size.
Instead of stall, it just ignores the error condition.

Originally the usb driver goes into the stall under the conditions
mentioned above to inform to the USB host that the requested SCSI feature
is not supported, or the result data is shorter than the requested data
size.
But, at this moment, RP2040 USB device driver cannot handle entering and
leaving stall state of the bulk endpoints well.  Once stalls, the host -
device communication stops and cannot be resumed.

I have investigated to solve the issue and found that the existing
RP2040 USB device driver implementation, TinyUSB
(https://github.com/hathach/tinyusb) mass-storage class driver doesn't
enter the stall state like the treatment of this patch.

So, I introduce this new configuration as the RP2040 workaround.
In the future, when the RP2040 USB device driver is fixed and can handle
the bulk endpoint stall correctly, this patch should be reverted.
2021-06-14 09:05:19 -03:00
chao.an
50f415d529 net/telnet: fix a potential busyloop if rxbuffer writes faster than read
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-06-13 05:06:54 -05:00
Xiang Xiao
7ff6aac43a serial/pty: Initialize the terminal setting as a console
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ie80a22b7a074d048435524d86f0ca7fc7a20e756
2021-06-12 09:52:05 +09:00
Xiang Xiao
4e038c1724 serial/pty: Don't return -NOSYS if pollfd::events equals 0
since the caller is free not to monitor any event

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ib957be1b1b5a686faea0196bc9069e0908a492eb
2021-06-11 08:22:41 -07:00
Fotis Panagiotopoulos
b73dc0f166 syslog: Added separator in file logs. 2021-06-09 10:09:04 -05:00
Xiang Xiao
5b2a17b892 Include assert.h in necessary place
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-06-08 13:06:08 -07:00
Fotis Panagiotopoulos
37ec290a11 Syslog file rotations number is configurable. 2021-06-08 04:12:48 -05:00
Alan C. Assis
3859031a6b Fix ht16k33 driver to support multi-modules 2021-06-07 01:08:11 -05:00
Xiang Xiao
f7c0d46ed8 serial: Remove the unnecessary err_out label 2021-06-07 07:55:14 +09:00
Masayuki Ishikawa
3ccef09b4e drivers: serial: Remove an unnecessary critical section (cs) for SMP
Summary:
- I thought this cs is needed to avoid data corruption
- For example, while executing uart_xmitchar() in the interrupt
  handler on CPU0, an application running on CPU1 can call
  uart_putxmitchar() via write()->uart_write().
- In this case, taking xmit.sem in uart_write() will wait for CPU0
  to finish uart_xmitchar() because CPU0 has already taken a cs
  in uart_xmitchar() then nxsem_wait() on CPU0 takes a new cs
  inside (and release the cs when returning but it's OK)
- Then uart_write() on CPU1 disables UART TX, so uart_xmitchar()
  on CPU0 will not be called while executing uart_write() on CPU1.
- So this critical section in uart_putxmitchar() can be removed.

Impact:
- None

Testing:
- Tested with spresense:wifi_smp, esp32-devkitc:smp

Reported-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2021-06-05 22:33:09 -05:00
Alan C. Assis
54134507ff lcd: Add support to Holtek HT16K33 as 14-segment display controller 2021-06-05 20:32:04 -05:00
Gustavo Henrique Nihei
0b3c2c7603 spi: Refactor SPI Slave interface prefix to sync with I2C Slave 2021-06-05 04:50:34 -07:00
Gustavo Henrique Nihei
91b1de4a67 drivers/spi: Include missing assert.h header 2021-06-05 04:50:34 -07:00
Fotis Panagiotopoulos
216194d31b Added automatic log rotation, when log file is opened. 2021-06-03 15:57:28 -03:00
Xiang Xiao
2e54df0f35 Don't include assert.h from public header file
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-06-03 08:36:03 -07:00
Fotis Panagiotopoulos
e189d83e11 SYSLOG channel add functions return handle to the channel. 2021-06-03 08:36:15 -05:00
Masayuki Ishikawa
822002d347 drivers: audio: Apply CXD56_PHYSADDR to cxd56.c
Summary:
- This commit converts data to the physical address for DMA transfer.

Impact:
- cxd56.c only

Testing
- Tested with nxplayer and nxrecorder

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2021-06-02 22:13:10 -05:00
Xiang Xiao
81e63e3a63 serial: Remove the unnecessary critical section in uart_pollnotify
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-06-02 15:46:53 -07:00
Jiuzhu Dong
ed6b257fa4 syslog: support ramlog, up_putc, rpmsg_syslog coexist
N/A

Change-Id: Ia58c7e195da7ad48f3018a131a78b2f01f94e741
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-06-02 08:45:20 -05:00
Jiuzhu Dong
01ff3604b0 syslog/Kconfig: support config multi syslog channel
delete choice for select syslog log device

Change-Id: Ifc02e687526506afac46febec375062949869356
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-06-02 08:45:20 -05:00
Jiuzhu Dong
e21fddbb34 syslog/emerg: fix bug about printing LOG_EMERG log from iob buffer
The patch is related to: commit 5f7c98b6e1

Author: Xiang Xiao <xiaoxiang@xiaomi.com>
Date:   Mon May 17 22:38:22 2021 +0800

    drivers/syslog: Remove emergstream implementation and caller

    since emergstream always call syslog_force, but syslog_force is designed
    for the interrupt context, and then doesn't mean any emergency thing.
    On the other hand, emergstream has other bad side effect:
    1.Can't output to file or dev channel
    2.Can't work well with the interrupt buffer

    Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-06-02 10:25:19 -03:00
Jiuzhu Dong
aeb7ed8c53 syslog/ramlog: initialize g_sysdev based on the current ramlog buffer
by ramlog_initbuf();
Algorithm: Scan the entire ramlog buffer, the position of the head
is the first byte is not empty and second byte is empty. The position
of the tail is the first byte is empty and second byte is not empty.

Change-Id: Ieb9161bd670481cd335e9a901287cd5e589f0849
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-06-01 15:16:45 -03:00
Jiuzhu Dong
ec38d0ce98 syslog/ramlog: save ramlog to fixed section
we can reload ramlog after hot reboot.

Change-Id: Iee7c105a2358075302121d6bf0047bc54d07e9a6
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-06-01 15:16:45 -03:00
Jiuzhu Dong
4ae6862bbe syslog: fix bug about syslog_default_write
Change-Id: I6d8b5bce8071f11b1903fe1fa0fe8dbc34bf3a09
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-06-01 12:44:17 -05:00
Masayuki Ishikawa
ab7ceb26e0 drivers: wireless: Remove ASSERT() in _check_pkt_q_empty() in gs2200m.c
Summary:
- During Wi-Fi stress test, sometimes ASSERT() happens in gs2200m.c
- This commit removes the ASSERT() but calls _remove_all_pkt()
  for a workaround.

Impact:
- None

Testing:
- Tested with spresense:wifi_smp

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2021-05-31 21:27:28 -05:00
Xiang Xiao
d7f96003cf Don't include debug.h from public header file
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-06-01 06:42:02 +09:00
Gustavo Henrique Nihei
8a41d849df drivers/spi: Change prefix to a more intuitive "spislave" 2021-05-31 07:54:08 -07:00
chao.an
99bfd355c7 serial/uart/h4: add bt h4 uart serial driver
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-05-31 09:50:54 -03:00
chao.an
6c69b12000 wireless/bluetooth: decoupling bt_driver_s and bt_buf_s
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-05-31 09:50:54 -03:00
Alin Jerpelea
13e4f9b6b2 drivers: update licenses to Apache
Gregory Nutt is the copyright holder for those files and he has submitted the
SGA as a result we can migrate the licenses to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-05-31 02:58:08 -05:00
Jiuzhu Dong
c06bc9eebd sim_addrenv: support add addrenv dynamically multiple times.
N/A

Change-Id: Ie34f6c59bc16fb147c7103978253dbe9403990d3
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-05-30 23:28:40 -05:00
Gustavo Henrique Nihei
57723eaedf drivers/spi: Add SPI Slave character device driver 2021-05-27 12:13:48 -03:00
Masayuki Ishikawa
59ab8151cc drivers: serial: Remove unnecessary DEBUGASSERT in serial.c
Summary:
- This commit removes unnecessary DEBUGASSERT in serial.c

Impact:
- None

Testing:
- Tested with sabre-6quad (QEMU) and sim

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2021-05-26 23:20:29 -03:00
Sebastien Lorquet
a35f0675e1 user correct printf specifiers
fix long line
2021-05-26 09:30:05 -03:00
me@me.net
85b0faed21 fix typo in pca9555 2021-05-25 16:13:48 +01:00
Xiang Xiao
001e7c3e76 sched: Don't include nuttx/sched.h inside sched.h
But let nuttx/sched.h include sched.h instead to
avoid expose nuttx kernel API to userspace.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-05-24 12:11:53 +09:00
SPRESENSE
139f1f1548 drivers/modem/altair: Fix behavior when a reset packet conflicts with a send packet
Even in the case of a conflict between a reset packet
and a send packet, the send size is compared and the
larger size is sent as the payload.
2021-05-19 12:15:59 +02:00
SPRESENSE
4b1fddec8a drivers/mtd/smart.c: Recover the missing link of directory entry
When creating the next chain of directory entries, (1) add the position
of next entry to the current sector, and then (2) update the sector of
next entry. If the power is turned off between (1) and (2), the next
entry will not be found, and the chain of directory entries will break.
It causes the SmartFS file system corruption, and we will not be able
to add files.

To avoid this issue, in checking the filesystem by smart_fsck_directory,
if the sector of next entry does not exist, update the sector of
directory entry to invalidate the field of next entry.
2021-05-19 11:02:50 +02:00
Xiang Xiao
5f7c98b6e1 drivers/syslog: Remove emergstream implementation and caller
since emergstream always call syslog_force, but syslog_force is designed
for the interrupt context, and then doesn't mean any emergency thing.
On the other hand, emergstream has other bad side effect:
1.Can't output to file or dev channel
2.Can't work well with the interrupt buffer

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-05-18 09:26:28 -03:00
Alan C. Assis
4c74f46afe Add basic support for MCP23017 I/O Expander 2021-05-16 12:48:52 -05:00
Jiuzhu Dong
73cc1f8884 driver/rtc: add config CONFIG_RTC_RPMSG_SERVER to
N/A
select rtc rpmsg role.

Change-Id: I7f9053b070593573caa5d988c6a2e13593da6bc5
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-05-15 14:33:52 -03:00
Jiuzhu Dong
f082893b9a driver/rtc: add config RTC_RPMSG_SERVER_NAME to
specified the name of remote proc(rpmsg server)

Change-Id: I0086bb43727a2bbb5e68f88907b5e4608182ef9c
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-05-15 14:33:52 -03:00
Jiuzhu Dong
018cf26605 lirc: fix bug about lirc_raw_event
N/A

Change-Id: If00d0a7e4e4f9a0d9119b6a170cffd993f23f71a
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-05-15 09:47:28 -07:00
Jiuzhu Dong
ff567124d3 driver/syslog: add config SYSLOG_RPMSG_SERVER_NAME to
N/A

specified the name of remote proc(rpmsg server)

Change-Id: Ie270d651071e87a40a80ab489597ae18db9814f0
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-05-15 09:39:57 -03:00