All of lore.kernel.org
 help / color / mirror / Atom feed
* [RESEND PATCH 00/16] Nokia RX-51: Fix USB TTY console and enable it
@ 2021-02-05 19:11 Pali Rohár
  2021-02-05 19:11 ` [RESEND PATCH 01/16] serial: usbtty: Fix puts function Pali Rohár
                   ` (16 more replies)
  0 siblings, 17 replies; 69+ messages in thread
From: Pali Rohár @ 2021-02-05 19:11 UTC (permalink / raw)
  To: u-boot

This series contain resensed patches from two patch series:
* Nokia RX-51: Fix USB TTY console and enable it
* usbtty/musb: Fix file transfers
They are rebased on top of master branch.

This patch series fix usbtty code (serial console via USB peripheral
mode), fix underlying musb peripheral code, fix compilation of
CONFIG_USB_DEVICE (used by usbtty), remove unused Nokia RX-51 code to
decrease size of U-Boot binary and finally enable usbtty serial console
for Nokia RX-51.

With this patch series debugging of Nokia RX-51 can be done also via USB
serial console.

It fixes also stability of musb code and allows usage of file transfers
via Kermit protocol on Nokia RX-51. Kermit file transfer via U-Boot loadb
command is stable on Nokia N900 and gives about 52kB/s transfer rate.

On computer this serial console is accessible via /dev/ttyACM0 device.

Pali Roh?r (16):
  serial: usbtty: Fix puts function
  serial: usbtty: Send urb data in correct order
  usb: musb: Fix compilation of gadget code
  usb: musb: Always clear the data toggle bit when configuring ep
  usb: musb: Fix configuring FIFO for endpoints
  usb: musb: Read value of PERI_RXCSR to 16bit variable
  usb: musb: Fix transmission of bigger buffers
  usb: musb: Fix receiving of bigger buffers
  usb: musb: Fix handling interrupts for EP0 and SET ADDRESS commmand
  usb: musb: Ensure that we set musb dynamic FIFO buffer for every
    endpoint
  usb: gadget: Use dbg_ep0() macro instead of serial_printf()
  arm: omap3: Compile lowlevel_init() function only when it is used
  arm: omap3: Compile s_init() function only when it is used
  Nokia RX-51: Remove function set_muxconf_regs()
  Nokia RX-51: Move content of rx51.h to rx51.c
  Nokia RX-51: Enable usbtty serial console by default

 Makefile                                  |   1 +
 arch/arm/mach-omap2/omap3/board.c         |   3 +
 arch/arm/mach-omap2/omap3/lowlevel_init.S |   6 +-
 board/nokia/rx51/rx51.c                   |  28 +-
 board/nokia/rx51/rx51.h                   | 377 ----------------------
 configs/nokia_rx51_defconfig              |   7 +-
 doc/README.nokia_rx51                     |  15 +-
 drivers/serial/usbtty.c                   |  16 +-
 drivers/usb/gadget/ep0.c                  |  16 +-
 drivers/usb/musb/musb_core.c              |  12 +-
 drivers/usb/musb/musb_udc.c               |  61 ++--
 include/configs/nokia_rx51.h              |  21 +-
 12 files changed, 82 insertions(+), 481 deletions(-)
 delete mode 100644 board/nokia/rx51/rx51.h

-- 
2.20.1

^ permalink raw reply	[flat|nested] 69+ messages in thread

* [RESEND PATCH 01/16] serial: usbtty: Fix puts function
  2021-02-05 19:11 [RESEND PATCH 00/16] Nokia RX-51: Fix USB TTY console and enable it Pali Rohár
@ 2021-02-05 19:11 ` Pali Rohár
  2021-02-06 13:49   ` Lukasz Majewski
  2021-02-05 19:11 ` [RESEND PATCH 02/16] serial: usbtty: Send urb data in correct order Pali Rohár
                   ` (15 subsequent siblings)
  16 siblings, 1 reply; 69+ messages in thread
From: Pali Rohár @ 2021-02-05 19:11 UTC (permalink / raw)
  To: u-boot

This function has incorrect implementation of prepending CR prior LF.
Without this patch it prepended CR prior whole string which is going to be
written and let LF without leading CR. Fix this issue by inserting CR at
correct place to make output on usbtty serial console more readable.

Signed-off-by: Pali Roh?r <pali@kernel.org>
---
 drivers/serial/usbtty.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/serial/usbtty.c b/drivers/serial/usbtty.c
index f1c1a260da..02f8edf200 100644
--- a/drivers/serial/usbtty.c
+++ b/drivers/serial/usbtty.c
@@ -500,8 +500,8 @@ void usbtty_puts(struct stdio_dev *dev, const char *str)
 		n = next_nl_pos (str);
 
 		if (str[n] == '\n') {
-			__usbtty_puts("\r", 1);
-			__usbtty_puts(str, n + 1);
+			__usbtty_puts(str, n);
+			__usbtty_puts("\r\n", 2);
 			str += (n + 1);
 			len -= (n + 1);
 		} else {
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 69+ messages in thread

* [RESEND PATCH 02/16] serial: usbtty: Send urb data in correct order
  2021-02-05 19:11 [RESEND PATCH 00/16] Nokia RX-51: Fix USB TTY console and enable it Pali Rohár
  2021-02-05 19:11 ` [RESEND PATCH 01/16] serial: usbtty: Fix puts function Pali Rohár
@ 2021-02-05 19:11 ` Pali Rohár
  2021-02-06 13:56   ` Lukasz Majewski
  2021-02-05 19:11 ` [RESEND PATCH 03/16] usb: musb: Fix compilation of gadget code Pali Rohár
                   ` (14 subsequent siblings)
  16 siblings, 1 reply; 69+ messages in thread
From: Pali Rohár @ 2021-02-05 19:11 UTC (permalink / raw)
  To: u-boot

Function next_urb() selects the last urb data buffer from linked list to
which next data from usbtty puts should be appended.

But to check if TX data still exists it is needed to look at the first urb
data buffer from linked list. So check for endpoint->tx_urb (first from the
linked list) instead of current_urb (the last from the linked list).

Successful call to udc_endpoint_write() may invalidate active urb and
allocate new in queue which invalidate pointer returned by next_urb()
function.

So call next_urb() prior putting data into urb buffer and call it every
time after using udc_endpoint_write() function to prevent sending data from
usbtty puts in incorrect order.

This patch fixes issue that usbtty code does not transmit data when they
are waiting in the tx queue.

Signed-off-by: Pali Roh?r <pali@kernel.org>
---
 drivers/serial/usbtty.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/serial/usbtty.c b/drivers/serial/usbtty.c
index 02f8edf200..4f4eb02de0 100644
--- a/drivers/serial/usbtty.c
+++ b/drivers/serial/usbtty.c
@@ -849,17 +849,9 @@ static int write_buffer (circbuf_t * buf)
 			&endpoint_instance[tx_endpoint];
 	struct urb *current_urb = NULL;
 
-	current_urb = next_urb (device_instance, endpoint);
-
-	if (!current_urb) {
-		TTYERR ("current_urb is NULL, buf->size %d\n",
-		buf->size);
-		return 0;
-	}
-
 	/* TX data still exists - send it now
 	 */
-	if(endpoint->sent < current_urb->actual_length){
+	if(endpoint->sent < endpoint->tx_urb->actual_length){
 		if(udc_endpoint_write (endpoint)){
 			/* Write pre-empted by RX */
 			return -1;
@@ -878,6 +870,8 @@ static int write_buffer (circbuf_t * buf)
 		 */
 		while (buf->size > 0) {
 
+			current_urb = next_urb (device_instance, endpoint);
+
 			dest = (char*)current_urb->buffer +
 				current_urb->actual_length;
 
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 69+ messages in thread

* [RESEND PATCH 03/16] usb: musb: Fix compilation of gadget code
  2021-02-05 19:11 [RESEND PATCH 00/16] Nokia RX-51: Fix USB TTY console and enable it Pali Rohár
  2021-02-05 19:11 ` [RESEND PATCH 01/16] serial: usbtty: Fix puts function Pali Rohár
  2021-02-05 19:11 ` [RESEND PATCH 02/16] serial: usbtty: Send urb data in correct order Pali Rohár
@ 2021-02-05 19:11 ` Pali Rohár
  2021-02-06 13:57   ` Lukasz Majewski
  2021-02-05 19:12 ` [RESEND PATCH 04/16] usb: musb: Always clear the data toggle bit when configuring ep Pali Rohár
                   ` (13 subsequent siblings)
  16 siblings, 1 reply; 69+ messages in thread
From: Pali Rohár @ 2021-02-05 19:11 UTC (permalink / raw)
  To: u-boot

musb udc code depends on usb gadget code provided by CONFIG_USB_DEVICE and
defined in drivers/usb/gadget/Makefile. But this Makefile is not included
into U-Boot build when CONFIG_USB_GADGET is not set. As CONFIG_USB_DEVICE
cannot be enabled together with CONFIG_USB_GADGET it means that dependency
for musb udc code is not compiled during build. Fix it by including
drivers/usb/gadget dependency also when CONFIG_USB_DEVICE is set.

This patch fixes compile errors:

arm-linux-gnueabi-ld.bfd: drivers/usb/musb/built-in.o: in function `musb_peri_ep0_rx':
u-boot/drivers/usb/musb/musb_udc.c: undefined reference to `ep0_recv_setup'
arm-linux-gnueabi-ld.bfd: drivers/usb/musb/built-in.o: in function `musb_peri_ep0_idle':
u-boot/drivers/usb/musb/musb_udc.c: undefined reference to `ep0_recv_setup'
arm-linux-gnueabi-ld.bfd: drivers/usb/musb/built-in.o: in function `musb_peri_ep0_zero_data_request':
u-boot/drivers/usb/musb/musb_udc.c: undefined reference to `usbd_device_event_irq'
arm-linux-gnueabi-ld.bfd: drivers/usb/musb/built-in.o: in function `musb_peri_ep0_idle':
u-boot/drivers/usb/musb/musb_udc.c: undefined reference to `ep0_recv_setup'
arm-linux-gnueabi-ld.bfd: drivers/usb/musb/built-in.o: in function `musb_peri_ep0_rx':
u-boot/drivers/usb/musb/musb_udc.c: undefined reference to `usbd_rcv_complete'
arm-linux-gnueabi-ld.bfd: drivers/usb/musb/built-in.o: in function `musb_peri_rx_ep':
u-boot/drivers/usb/musb/musb_udc.c: undefined reference to `usbd_rcv_complete'
arm-linux-gnueabi-ld.bfd: drivers/usb/musb/built-in.o: in function `udc_endpoint_write':
u-boot/drivers/usb/musb/musb_udc.c: undefined reference to `usbd_tx_complete'
arm-linux-gnueabi-ld.bfd: drivers/usb/musb/built-in.o: in function `udc_irq':
u-boot/drivers/usb/musb/musb_udc.c: undefined reference to `usbd_device_event_irq'
arm-linux-gnueabi-ld.bfd: u-boot/drivers/usb/musb/musb_udc.c: undefined reference to `usbd_device_event_irq'
arm-linux-gnueabi-ld.bfd: u-boot/drivers/usb/musb/musb_udc.c: undefined reference to `usbd_device_event_irq'
arm-linux-gnueabi-ld.bfd: u-boot/drivers/usb/musb/musb_udc.c: undefined reference to `usbd_device_event_irq'
arm-linux-gnueabi-ld.bfd: u-boot/drivers/usb/musb/musb_udc.c: undefined reference to `usbd_device_event_irq'
arm-linux-gnueabi-ld.bfd: drivers/usb/musb/built-in.o:u-boot/drivers/usb/musb/musb_udc.c: more undefined references to `usbd_device_event_irq' follow
arm-linux-gnueabi-ld.bfd: drivers/usb/musb/built-in.o: in function `udc_setup_ep':
u-boot/drivers/usb/musb/musb_udc.c: undefined reference to `usbd_alloc_urb'
arm-linux-gnueabi-ld.bfd: drivers/usb/musb/built-in.o: in function `udc_startup_events':
u-boot/drivers/usb/musb/musb_udc.c: undefined reference to `usbd_device_event_irq'
arm-linux-gnueabi-ld.bfd: u-boot/drivers/usb/musb/musb_udc.c: undefined reference to `usbd_device_event_irq'
arm-linux-gnueabi-ld.bfd: u-boot/drivers/usb/musb/musb_udc.c: undefined reference to `usbd_device_event_irq'
make: *** [Makefile:1762: u-boot] Error 1

Signed-off-by: Pali Roh?r <pali@kernel.org>
---
 Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Makefile b/Makefile
index 23dd11f723..2173344497 100644
--- a/Makefile
+++ b/Makefile
@@ -792,6 +792,7 @@ libs-y += drivers/usb/dwc3/
 libs-y += drivers/usb/common/
 libs-y += drivers/usb/emul/
 libs-y += drivers/usb/eth/
+libs-$(CONFIG_USB_DEVICE) += drivers/usb/gadget/
 libs-$(CONFIG_USB_GADGET) += drivers/usb/gadget/
 libs-$(CONFIG_USB_GADGET) += drivers/usb/gadget/udc/
 libs-y += drivers/usb/host/
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 69+ messages in thread

* [RESEND PATCH 04/16] usb: musb: Always clear the data toggle bit when configuring ep
  2021-02-05 19:11 [RESEND PATCH 00/16] Nokia RX-51: Fix USB TTY console and enable it Pali Rohár
                   ` (2 preceding siblings ...)
  2021-02-05 19:11 ` [RESEND PATCH 03/16] usb: musb: Fix compilation of gadget code Pali Rohár
@ 2021-02-05 19:12 ` Pali Rohár
  2021-02-06 13:58   ` Lukasz Majewski
  2021-02-05 19:12 ` [RESEND PATCH 05/16] usb: musb: Fix configuring FIFO for endpoints Pali Rohár
                   ` (12 subsequent siblings)
  16 siblings, 1 reply; 69+ messages in thread
From: Pali Rohár @ 2021-02-05 19:12 UTC (permalink / raw)
  To: u-boot

Without this patch it was done only when U-Boot was compiled with MUSB Host
Controller. But it is needed also for MUSB Device Controller, otherwise
Device Controller does not work.

Signed-off-by: Pali Roh?r <pali@kernel.org>
---
 drivers/usb/musb/musb_core.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 147b2eb929..cc6dc3839d 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -81,10 +81,8 @@ void musb_configure_ep(const struct musb_epinfo *epinfo, u8 cnt)
 			config_fifo(tx, idx, fifoaddr);
 
 			csr = readw(&musbr->txcsr);
-#if defined(CONFIG_USB_MUSB_HCD)
 			/* clear the data toggle bit */
 			writew(csr | MUSB_TXCSR_CLRDATATOG, &musbr->txcsr);
-#endif
 			/* Flush fifo if required */
 			if (csr & MUSB_TXCSR_TXPKTRDY)
 				writew(csr | MUSB_TXCSR_FLUSHFIFO,
@@ -94,10 +92,8 @@ void musb_configure_ep(const struct musb_epinfo *epinfo, u8 cnt)
 			config_fifo(rx, idx, fifoaddr);
 
 			csr = readw(&musbr->rxcsr);
-#if defined(CONFIG_USB_MUSB_HCD)
 			/* clear the data toggle bit */
 			writew(csr | MUSB_RXCSR_CLRDATATOG, &musbr->rxcsr);
-#endif
 			/* Flush fifo if required */
 			if (csr & MUSB_RXCSR_RXPKTRDY)
 				writew(csr | MUSB_RXCSR_FLUSHFIFO,
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 69+ messages in thread

* [RESEND PATCH 05/16] usb: musb: Fix configuring FIFO for endpoints
  2021-02-05 19:11 [RESEND PATCH 00/16] Nokia RX-51: Fix USB TTY console and enable it Pali Rohár
                   ` (3 preceding siblings ...)
  2021-02-05 19:12 ` [RESEND PATCH 04/16] usb: musb: Always clear the data toggle bit when configuring ep Pali Rohár
@ 2021-02-05 19:12 ` Pali Rohár
  2021-02-06  8:58   ` Pavel Machek
  2021-02-06 14:01   ` Lukasz Majewski
  2021-02-05 19:12 ` [RESEND PATCH 06/16] usb: musb: Read value of PERI_RXCSR to 16bit variable Pali Rohár
                   ` (11 subsequent siblings)
  16 siblings, 2 replies; 69+ messages in thread
From: Pali Rohár @ 2021-02-05 19:12 UTC (permalink / raw)
  To: u-boot

This patch fixes configuring FIFO for one-directional endpoints which have
either RX or TX queue and therefore only one FIFO.

Size of FIFO buffer is 2^(idx+3) bytes and starting address is 2^(addr+3).
Moreover first 64 bytes are reserved for EP0.

Without this patch if FIFO size specified by caller was zero then idx was
incorrectly calculated (expr. ffs(0)-1) and size overflowed in fifosz
register. This register uses has only 4 bits for FIFO size. Moreover
specifying zero size is not possible.

This patch is fixing calculation of start address and buffer size to
minimal value and ensure that it would not overlap with reserved EP0
buffer.

This issue caused loose of packets on USB bus in both directions and
basically usbtty was unusable.

Signed-off-by: Pali Roh?r <pali@kernel.org>

---
Changes in v2:
* Correctly calculate minimal buffer size
* Store into fifoaddr address in musb units (8 bytes)
---
 drivers/usb/musb/musb_core.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index cc6dc3839d..9651f074a4 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -50,7 +50,7 @@ void musb_start(void)
 # define config_fifo(dir, idx, addr) \
 	do { \
 		writeb(idx, &musbr->dir##fifosz); \
-		writew(fifoaddr >> 3, &musbr->dir##fifoadd); \
+		writew(addr, &musbr->dir##fifoadd); \
 	} while (0)
 #endif
 
@@ -66,14 +66,14 @@ void musb_start(void)
 void musb_configure_ep(const struct musb_epinfo *epinfo, u8 cnt)
 {
 	u16 csr;
-	u16 fifoaddr = 64; /* First 64 bytes of FIFO reserved for EP0 */
+	u16 fifoaddr = 64 >> 3; /* First 64 bytes of FIFO reserved for EP0 */
 	u32 fifosize;
 	u8  idx;
 
 	while (cnt--) {
 		/* prepare fifosize to write to register */
 		fifosize = epinfo->epsize >> 3;
-		idx = ffs(fifosize) - 1;
+		idx = fifosize ? ((ffs(fifosize) - 1) & 0xF) : 0;
 
 		writeb(epinfo->epnum, &musbr->index);
 		if (epinfo->epdir) {
@@ -99,7 +99,7 @@ void musb_configure_ep(const struct musb_epinfo *epinfo, u8 cnt)
 				writew(csr | MUSB_RXCSR_FLUSHFIFO,
 					&musbr->rxcsr);
 		}
-		fifoaddr += epinfo->epsize;
+		fifoaddr += 1 << idx;
 		epinfo++;
 	}
 }
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 69+ messages in thread

* [RESEND PATCH 06/16] usb: musb: Read value of PERI_RXCSR to 16bit variable
  2021-02-05 19:11 [RESEND PATCH 00/16] Nokia RX-51: Fix USB TTY console and enable it Pali Rohár
                   ` (4 preceding siblings ...)
  2021-02-05 19:12 ` [RESEND PATCH 05/16] usb: musb: Fix configuring FIFO for endpoints Pali Rohár
@ 2021-02-05 19:12 ` Pali Rohár
  2021-02-06 14:01   ` Lukasz Majewski
  2021-02-05 19:12 ` [RESEND PATCH 07/16] usb: musb: Fix transmission of bigger buffers Pali Rohár
                   ` (10 subsequent siblings)
  16 siblings, 1 reply; 69+ messages in thread
From: Pali Rohár @ 2021-02-05 19:12 UTC (permalink / raw)
  To: u-boot

PERI_RXCSR is 16bit register so store its value into 16bit local variable.

Signed-off-by: Pali Roh?r <pali@kernel.org>
---
 drivers/usb/musb/musb_udc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/musb/musb_udc.c b/drivers/usb/musb/musb_udc.c
index d901f8777c..67d1c56f9a 100644
--- a/drivers/usb/musb/musb_udc.c
+++ b/drivers/usb/musb/musb_udc.c
@@ -629,7 +629,7 @@ static void musb_peri_ep0(void)
 static void musb_peri_rx_ep(unsigned int ep)
 {
 	u16 peri_rxcount;
-	u8 peri_rxcsr = readw(&musbr->ep[ep].epN.rxcsr);
+	u16 peri_rxcsr = readw(&musbr->ep[ep].epN.rxcsr);
 
 	if (!(peri_rxcsr & MUSB_RXCSR_RXPKTRDY)) {
 		if (debug_level > 0)
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 69+ messages in thread

* [RESEND PATCH 07/16] usb: musb: Fix transmission of bigger buffers
  2021-02-05 19:11 [RESEND PATCH 00/16] Nokia RX-51: Fix USB TTY console and enable it Pali Rohár
                   ` (5 preceding siblings ...)
  2021-02-05 19:12 ` [RESEND PATCH 06/16] usb: musb: Read value of PERI_RXCSR to 16bit variable Pali Rohár
@ 2021-02-05 19:12 ` Pali Rohár
  2021-02-06 14:07   ` Lukasz Majewski
  2021-02-05 19:12 ` [RESEND PATCH 08/16] usb: musb: Fix receiving " Pali Rohár
                   ` (9 subsequent siblings)
  16 siblings, 1 reply; 69+ messages in thread
From: Pali Rohár @ 2021-02-05 19:12 UTC (permalink / raw)
  To: u-boot

If udc_endpoint_write() was called with bigger payload which does not fit
into one USB packet it needs to be transmitted in more USB packets. First
packet is transmitted by udc_endpoint_write() call itself and other packets
are put into waiting queue.

Implement function musb_peri_tx() which transmit checks when endpoints are
ready and continue transmitting of waiting queue.

This patch fixes sending e.g. output of printenv command over usbtty serial
console.

Signed-off-by: Pali Roh?r <pali@kernel.org>
---
 drivers/usb/musb/musb_udc.c | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)

diff --git a/drivers/usb/musb/musb_udc.c b/drivers/usb/musb/musb_udc.c
index 67d1c56f9a..28719cc3f6 100644
--- a/drivers/usb/musb/musb_udc.c
+++ b/drivers/usb/musb/musb_udc.c
@@ -708,21 +708,16 @@ static void musb_peri_rx(u16 intr)
 
 static void musb_peri_tx(u16 intr)
 {
+	unsigned int ep;
+
 	/* Check for EP0 */
 	if (0x01 & intr)
 		musb_peri_ep0_tx();
 
-	/*
-	 * Use this in the future when handling epN tx
-	 *
-	 * u8 ep;
-	 *
-	 * for (ep = 1; ep < 16; ep++) {
-	 *	if ((1 << ep) & intr) {
-	 *		/ * handle tx for this endpoint * /
-	 *	}
-	 * }
-	 */
+	for (ep = 1; ep < 16; ep++) {
+		if ((1 << ep) & intr)
+			udc_endpoint_write(GET_ENDPOINT(udc_device, ep));
+	}
 }
 
 void udc_irq(void)
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 69+ messages in thread

* [RESEND PATCH 08/16] usb: musb: Fix receiving of bigger buffers
  2021-02-05 19:11 [RESEND PATCH 00/16] Nokia RX-51: Fix USB TTY console and enable it Pali Rohár
                   ` (6 preceding siblings ...)
  2021-02-05 19:12 ` [RESEND PATCH 07/16] usb: musb: Fix transmission of bigger buffers Pali Rohár
@ 2021-02-05 19:12 ` Pali Rohár
  2021-02-06 14:15   ` Lukasz Majewski
  2021-02-05 19:12 ` [RESEND PATCH 09/16] usb: musb: Fix handling interrupts for EP0 and SET ADDRESS commmand Pali Rohár
                   ` (8 subsequent siblings)
  16 siblings, 1 reply; 69+ messages in thread
From: Pali Rohár @ 2021-02-05 19:12 UTC (permalink / raw)
  To: u-boot

If musb_peri_rx_ep() was called to processed received HW buffer but U-Boot
cannot read it yet (e.g. because U-Boot SW buffer is full) then interrupt
was marked as processed but HW buffer stayed unprocessed.

U-Boot tried to process this buffer again when it receive interrupt again,
but it can receive it only when sender (host) send a new data. As sender
(host) is not going to send a new data until U-Boot process current data
this issue caused a deadlock in case sender (host) is emitting data faster
than U-Boot can process it.

Reading musb intrrx register automatically clears this register and mark
interrupt as processed. So to prevent marking interrupt in U-Boot as
processed and a new variable pending_intrrx which would contain unprocessed
bits of intrrx register.

And as a second step, every time when musb_peri_rx_ep() is called and there
are waiting data to be processed (signaled by MUSB_RXCSR_RXPKTRDY) either
acknowledge sender (via musb_peri_rx_ack()) that whole HW buffer was
processed or set corresponding bit in pending_intrrx that HW buffer was not
fully processed yet and next iteration is required after U-Boot allocate
space for reading HW buffer.

This patch fixes receiving large usb buffers, e.g. file transfer via Kermit
protocol implemented by 'loadb' U-Boot command over usbtty serial console.

Signed-off-by: Pali Roh?r <pali@kernel.org>
---
 drivers/usb/musb/musb_udc.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/musb/musb_udc.c b/drivers/usb/musb/musb_udc.c
index 28719cc3f6..7c74422623 100644
--- a/drivers/usb/musb/musb_udc.c
+++ b/drivers/usb/musb/musb_udc.c
@@ -104,6 +104,8 @@ struct usb_endpoint_instance *ep0_endpoint;
 static struct usb_device_instance *udc_device;
 static int enabled;
 
+u16 pending_intrrx;
+
 #ifdef MUSB_DEBUG
 static void musb_db_regs(void)
 {
@@ -664,7 +666,10 @@ static void musb_peri_rx_ep(unsigned int ep)
 				/* The common musb fifo reader */
 				read_fifo(ep, length, data);
 
-				musb_peri_rx_ack(ep);
+				if (length == peri_rxcount)
+					musb_peri_rx_ack(ep);
+				else
+					pending_intrrx |= (1 << ep);
 
 				/*
 				 * urb's actual_length is updated in
@@ -677,18 +682,24 @@ static void musb_peri_rx_ep(unsigned int ep)
 					serial_printf("ERROR : %s %d no space "
 						      "in rcv buffer\n",
 						      __PRETTY_FUNCTION__, ep);
+
+				pending_intrrx |= (1 << ep);
 			}
 		} else {
 			if (debug_level > 0)
 				serial_printf("ERROR : %s %d problem with "
 					      "endpoint\n",
 					      __PRETTY_FUNCTION__, ep);
+
+			pending_intrrx |= (1 << ep);
 		}
 
 	} else {
 		if (debug_level > 0)
 			serial_printf("ERROR : %s %d with nothing to do\n",
 				      __PRETTY_FUNCTION__, ep);
+
+		musb_peri_rx_ack(ep);
 	}
 }
 
@@ -770,6 +781,9 @@ void udc_irq(void)
 			intrrx = readw(&musbr->intrrx);
 			intrtx = readw(&musbr->intrtx);
 
+			intrrx |= pending_intrrx;
+			pending_intrrx = 0;
+
 			if (intrrx)
 				musb_peri_rx(intrrx);
 
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 69+ messages in thread

* [RESEND PATCH 09/16] usb: musb: Fix handling interrupts for EP0 and SET ADDRESS commmand
  2021-02-05 19:11 [RESEND PATCH 00/16] Nokia RX-51: Fix USB TTY console and enable it Pali Rohár
                   ` (7 preceding siblings ...)
  2021-02-05 19:12 ` [RESEND PATCH 08/16] usb: musb: Fix receiving " Pali Rohár
@ 2021-02-05 19:12 ` Pali Rohár
  2021-02-06 14:17   ` Lukasz Majewski
  2021-02-05 19:12 ` [RESEND PATCH 10/16] usb: musb: Ensure that we set musb dynamic FIFO buffer for every endpoint Pali Rohár
                   ` (7 subsequent siblings)
  16 siblings, 1 reply; 69+ messages in thread
From: Pali Rohár @ 2021-02-05 19:12 UTC (permalink / raw)
  To: u-boot

Interrupt for EP0 is indicated in intrtx register via first bit. It is set
for both RX and TX. First bit in intrrx register is reserved and not set.

So remove calling musb_peri_ep0() function at every iteration of udc_irq()
and musb_peri_rx() and call it only from musb_peri_tx() when correct
interrupt bit in initrtx it set.

Address from SET ADDRESS command must be set to faddr register only after
acknowledging SERV_RXPKTRDY followed by received EP0 interrupt. So prior
calling musb_peri_ep0_set_address() check for EP0 interrupt instead of
(incorrect) MUSB_INTR_SOF interrupt.

This patch fixes issue that host (computer) cannot register U-Boot USB
device and failing with errors:

    usb 1-1: new full-speed USB device number 86 using xhci_hcd
    usb 1-1: Device not responding to setup address.
    usb 1-1: Device not responding to setup address.
    usb 1-1: device not accepting address 86, error -71

U-Boot was writing address to faddr register too early and did not wait for
correct interrupt after which should update address.

Signed-off-by: Pali Roh?r <pali@kernel.org>
---
 drivers/usb/musb/musb_udc.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/usb/musb/musb_udc.c b/drivers/usb/musb/musb_udc.c
index 7c74422623..50d8bc319c 100644
--- a/drivers/usb/musb/musb_udc.c
+++ b/drivers/usb/musb/musb_udc.c
@@ -707,9 +707,7 @@ static void musb_peri_rx(u16 intr)
 {
 	unsigned int ep;
 
-	/* Check for EP0 */
-	if (0x01 & intr)
-		musb_peri_ep0();
+	/* First bit is reserved and does not indicate interrupt for EP0 */
 
 	for (ep = 1; ep < 16; ep++) {
 		if ((1 << ep) & intr)
@@ -721,9 +719,9 @@ static void musb_peri_tx(u16 intr)
 {
 	unsigned int ep;
 
-	/* Check for EP0 */
+	/* Check for EP0: first bit indicates interrupt for both RX and TX */
 	if (0x01 & intr)
-		musb_peri_ep0_tx();
+		musb_peri_ep0();
 
 	for (ep = 1; ep < 16; ep++) {
 		if ((1 << ep) & intr)
@@ -750,8 +748,6 @@ void udc_irq(void)
 			musb_peri_resume();
 		}
 
-		musb_peri_ep0();
-
 		if (MUSB_INTR_RESET & intrusb) {
 			usbd_device_event_irq(udc_device, DEVICE_RESET, 0);
 			musb_peri_reset();
@@ -790,7 +786,7 @@ void udc_irq(void)
 			if (intrtx)
 				musb_peri_tx(intrtx);
 		} else {
-			if (MUSB_INTR_SOF & intrusb) {
+			if (readw(&musbr->intrtx) & 0x1) {
 				u8 faddr;
 				faddr = readb(&musbr->faddr);
 				/*
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 69+ messages in thread

* [RESEND PATCH 10/16] usb: musb: Ensure that we set musb dynamic FIFO buffer for every endpoint
  2021-02-05 19:11 [RESEND PATCH 00/16] Nokia RX-51: Fix USB TTY console and enable it Pali Rohár
                   ` (8 preceding siblings ...)
  2021-02-05 19:12 ` [RESEND PATCH 09/16] usb: musb: Fix handling interrupts for EP0 and SET ADDRESS commmand Pali Rohár
@ 2021-02-05 19:12 ` Pali Rohár
  2021-02-06  9:04   ` Pavel Machek
  2021-02-06 15:18   ` Lukasz Majewski
  2021-02-05 19:12 ` [RESEND PATCH 11/16] usb: gadget: Use dbg_ep0() macro instead of serial_printf() Pali Rohár
                   ` (6 subsequent siblings)
  16 siblings, 2 replies; 69+ messages in thread
From: Pali Rohár @ 2021-02-05 19:12 UTC (permalink / raw)
  To: u-boot

If we do not set FIFO buffer address and size for some endpoint which is in
use then default address 0x0 would be used which is in conflict with FIFO
buffer for endpoint 0 which is at fixed address 0x0. Sharing address space
between more endpoint cause data loss and unexpected errors.

This patch is fixing transmission of characters over usbtty serial console
and allow using of usbtty for debugging purposes on Nokia N900.

Signed-off-by: Pali Roh?r <pali@kernel.org>
---
 drivers/usb/musb/musb_udc.c | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/drivers/usb/musb/musb_udc.c b/drivers/usb/musb/musb_udc.c
index 50d8bc319c..ea1284850e 100644
--- a/drivers/usb/musb/musb_udc.c
+++ b/drivers/usb/musb/musb_udc.c
@@ -875,18 +875,8 @@ void udc_setup_ep(struct usb_device_instance *device, unsigned int id,
 		ep0_endpoint->endpoint_address = 0xff;
 		ep0_urb = usbd_alloc_urb(device, endpoint);
 	} else if (MAX_ENDPOINT >= id) {
-		int ep_addr;
-
-		/* Check the direction */
-		ep_addr = endpoint->endpoint_address;
-		if (USB_DIR_IN == (ep_addr & USB_ENDPOINT_DIR_MASK)) {
-			/* IN */
-			epinfo[(id * 2) + 1].epsize = endpoint->tx_packetSize;
-		} else {
-			/* OUT */
-			epinfo[id * 2].epsize = endpoint->rcv_packetSize;
-		}
-
+		epinfo[(id * 2) + 0].epsize = endpoint->rcv_packetSize;
+		epinfo[(id * 2) + 1].epsize = endpoint->tx_packetSize;
 		musb_configure_ep(&epinfo[0], ARRAY_SIZE(epinfo));
 	} else {
 		if (debug_level > 0)
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 69+ messages in thread

* [RESEND PATCH 11/16] usb: gadget: Use dbg_ep0() macro instead of serial_printf()
  2021-02-05 19:11 [RESEND PATCH 00/16] Nokia RX-51: Fix USB TTY console and enable it Pali Rohár
                   ` (9 preceding siblings ...)
  2021-02-05 19:12 ` [RESEND PATCH 10/16] usb: musb: Ensure that we set musb dynamic FIFO buffer for every endpoint Pali Rohár
@ 2021-02-05 19:12 ` Pali Rohár
  2021-02-06 15:19   ` Lukasz Majewski
  2021-02-05 19:12 ` [RESEND PATCH 12/16] arm: omap3: Compile lowlevel_init() function only when it is used Pali Rohár
                   ` (5 subsequent siblings)
  16 siblings, 1 reply; 69+ messages in thread
From: Pali Rohár @ 2021-02-05 19:12 UTC (permalink / raw)
  To: u-boot

All debug messages from ep0.c except a few are printed by dbg_ep0() macro.
So for remaining few exception use also dbg_ep0() instead of serial_printf().

Signed-off-by: Pali Roh?r <pali@kernel.org>
---
 drivers/usb/gadget/ep0.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/usb/gadget/ep0.c b/drivers/usb/gadget/ep0.c
index 457679f0a4..6624f61b76 100644
--- a/drivers/usb/gadget/ep0.c
+++ b/drivers/usb/gadget/ep0.c
@@ -294,7 +294,7 @@ static int ep0_get_descriptor (struct usb_device_instance *device,
 		{
 			struct usb_string_descriptor *string_descriptor;
 			if (!(string_descriptor = usbd_get_string (index))) {
-				serial_printf("Invalid string index %d\n", index);
+				dbg_ep0(0, "Invalid string index %d\n", index);
 				return -1;
 			}
 			dbg_ep0(3, "string_descriptor: %p length %d", string_descriptor, string_descriptor->bLength);
@@ -302,14 +302,14 @@ static int ep0_get_descriptor (struct usb_device_instance *device,
 		}
 		break;
 	case USB_DESCRIPTOR_TYPE_INTERFACE:
-	serial_printf("USB_DESCRIPTOR_TYPE_INTERFACE - error not implemented\n");
+		dbg_ep0(2, "USB_DESCRIPTOR_TYPE_INTERFACE - error not implemented\n");
 		return -1;
 	case USB_DESCRIPTOR_TYPE_ENDPOINT:
-		serial_printf("USB_DESCRIPTOR_TYPE_ENDPOINT - error not implemented\n");
+		dbg_ep0(2, "USB_DESCRIPTOR_TYPE_ENDPOINT - error not implemented\n");
 		return -1;
 	case USB_DESCRIPTOR_TYPE_HID:
 		{
-			serial_printf("USB_DESCRIPTOR_TYPE_HID - error not implemented\n");
+			dbg_ep0(2, "USB_DESCRIPTOR_TYPE_HID - error not implemented\n");
 			return -1;	/* unsupported at this time */
 #if 0
 			int bNumInterface =
@@ -338,7 +338,7 @@ static int ep0_get_descriptor (struct usb_device_instance *device,
 		break;
 	case USB_DESCRIPTOR_TYPE_REPORT:
 		{
-			serial_printf("USB_DESCRIPTOR_TYPE_REPORT - error not implemented\n");
+			dbg_ep0(2, "USB_DESCRIPTOR_TYPE_REPORT - error not implemented\n");
 			return -1;	/* unsupported at this time */
 #if 0
 			int bNumInterface =
@@ -531,7 +531,7 @@ int ep0_recv_setup (struct urb *urb)
 						   le16_to_cpu (request->wValue) & 0xff);
 
 		case USB_REQ_GET_CONFIGURATION:
-			serial_printf("get config %d\n", device->configuration);
+			dbg_ep0(2, "get config %d\n", device->configuration);
 			return ep0_get_one (device, urb,
 					    device->configuration);
 
@@ -621,14 +621,14 @@ int ep0_recv_setup (struct urb *urb)
 			device->interface = device->alternate = 0;
 
 			/*dbg_ep0(2, "set configuration: %d", device->configuration); */
-			/*serial_printf("DEVICE_CONFIGURED.. event?\n"); */
+			/*dbg_ep0(2, "DEVICE_CONFIGURED.. event?\n"); */
 			return 0;
 
 		case USB_REQ_SET_INTERFACE:
 			device->interface = le16_to_cpu (request->wIndex);
 			device->alternate = le16_to_cpu (request->wValue);
 			/*dbg_ep0(2, "set interface: %d alternate: %d", device->interface, device->alternate); */
-			serial_printf("DEVICE_SET_INTERFACE.. event?\n");
+			dbg_ep0(2, "DEVICE_SET_INTERFACE.. event?\n");
 			return 0;
 
 		case USB_REQ_GET_STATUS:
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 69+ messages in thread

* [RESEND PATCH 12/16] arm: omap3: Compile lowlevel_init() function only when it is used
  2021-02-05 19:11 [RESEND PATCH 00/16] Nokia RX-51: Fix USB TTY console and enable it Pali Rohár
                   ` (10 preceding siblings ...)
  2021-02-05 19:12 ` [RESEND PATCH 11/16] usb: gadget: Use dbg_ep0() macro instead of serial_printf() Pali Rohár
@ 2021-02-05 19:12 ` Pali Rohár
  2021-02-06 15:21   ` Lukasz Majewski
  2021-02-06 15:40   ` Marek Vasut
  2021-02-05 19:12 ` [RESEND PATCH 13/16] arm: omap3: Compile s_init() " Pali Rohár
                   ` (4 subsequent siblings)
  16 siblings, 2 replies; 69+ messages in thread
From: Pali Rohár @ 2021-02-05 19:12 UTC (permalink / raw)
  To: u-boot

Function lowlevel_init() is called only from cpu_init_crit() and this
function is wrapped into #if .. #endif section. So compile also
lowlevel_init() function under same #if condition.

Signed-off-by: Pali Roh?r <pali@kernel.org>
---
 arch/arm/mach-omap2/omap3/lowlevel_init.S | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-omap2/omap3/lowlevel_init.S b/arch/arm/mach-omap2/omap3/lowlevel_init.S
index 2a05b5e521..4fa89418a1 100644
--- a/arch/arm/mach-omap2/omap3/lowlevel_init.S
+++ b/arch/arm/mach-omap2/omap3/lowlevel_init.S
@@ -45,7 +45,7 @@ ENDPROC(do_omap3_emu_romcode_call)
 ENTRY(cpy_clk_code)
 	/* Copy DPLL code into SRAM */
 	adr	r0, go_to_speed		/* copy from start of go_to_speed... */
-	adr	r2, lowlevel_init	/* ... up to start of low_level_init */
+	adr	r2, go_to_speed_end	/* ... up to start of go_to_speed_end */
 next2:
 	ldmia	r0!, {r3 - r10}		/* copy from source address [r0] */
 	stmia	r1!, {r3 - r10}		/* copy to   target address [r1] */
@@ -167,8 +167,11 @@ pll_div_add5:
 pll_div_val5:
 	.word CLSEL1_EMU_VAL
 
+go_to_speed_end:
 #endif
 
+#if !defined(CONFIG_SKIP_LOWLEVEL_INIT) && \
+	!defined(CONFIG_SKIP_LOWLEVEL_INIT_ONLY)
 ENTRY(lowlevel_init)
 	ldr	sp, SRAM_STACK
 	str	ip, [sp]	/* stash ip register */
@@ -187,6 +190,7 @@ ENTRY(lowlevel_init)
 	b	s_init
 
 ENDPROC(lowlevel_init)
+#endif
 
 	/* the literal pools origin */
 	.ltorg
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 69+ messages in thread

* [RESEND PATCH 13/16] arm: omap3: Compile s_init() function only when it is used
  2021-02-05 19:11 [RESEND PATCH 00/16] Nokia RX-51: Fix USB TTY console and enable it Pali Rohár
                   ` (11 preceding siblings ...)
  2021-02-05 19:12 ` [RESEND PATCH 12/16] arm: omap3: Compile lowlevel_init() function only when it is used Pali Rohár
@ 2021-02-05 19:12 ` Pali Rohár
  2021-02-06 15:21   ` Lukasz Majewski
  2021-02-05 19:12 ` [RESEND PATCH 14/16] Nokia RX-51: Remove function set_muxconf_regs() Pali Rohár
                   ` (3 subsequent siblings)
  16 siblings, 1 reply; 69+ messages in thread
From: Pali Rohár @ 2021-02-05 19:12 UTC (permalink / raw)
  To: u-boot

Function s_init() is called only from lowlevel_init(). So compile it only
when function lowlevel_init() is compiled.

Signed-off-by: Pali Roh?r <pali@kernel.org>
---
 arch/arm/mach-omap2/omap3/board.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/mach-omap2/omap3/board.c b/arch/arm/mach-omap2/omap3/board.c
index 4da8df47cc..029bd54595 100644
--- a/arch/arm/mach-omap2/omap3/board.c
+++ b/arch/arm/mach-omap2/omap3/board.c
@@ -179,6 +179,8 @@ void early_system_init(void)
 	hw_data_init();
 }
 
+#if !defined(CONFIG_SKIP_LOWLEVEL_INIT) && \
+	!defined(CONFIG_SKIP_LOWLEVEL_INIT_ONLY)
 /******************************************************************************
  * Routine: s_init
  * Description: Does early system init of muxing and clocks.
@@ -207,6 +209,7 @@ void s_init(void)
 	ehci_clocks_enable();
 #endif
 }
+#endif
 
 #ifdef CONFIG_SPL_BUILD
 void board_init_f(ulong dummy)
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 69+ messages in thread

* [RESEND PATCH 14/16] Nokia RX-51: Remove function set_muxconf_regs()
  2021-02-05 19:11 [RESEND PATCH 00/16] Nokia RX-51: Fix USB TTY console and enable it Pali Rohár
                   ` (12 preceding siblings ...)
  2021-02-05 19:12 ` [RESEND PATCH 13/16] arm: omap3: Compile s_init() " Pali Rohár
@ 2021-02-05 19:12 ` Pali Rohár
  2021-02-06 15:22   ` Lukasz Majewski
  2021-02-05 19:12 ` [RESEND PATCH 15/16] Nokia RX-51: Move content of rx51.h to rx51.c Pali Rohár
                   ` (2 subsequent siblings)
  16 siblings, 1 reply; 69+ messages in thread
From: Pali Rohár @ 2021-02-05 19:12 UTC (permalink / raw)
  To: u-boot

This function is not used and was never called.

This board contains '#define CONFIG_SKIP_LOWLEVEL_INIT' because X-Loader
set everything up, including MUX configuration.

Also this MUX configuration is incorrect and does not match hardware.

So remove this dead, unused and broken code.

This change will decrease size of U-Boot binary.

Signed-off-by: Pali Roh?r <pali@kernel.org>
---
 board/nokia/rx51/rx51.c |  11 --
 board/nokia/rx51/rx51.h | 346 ----------------------------------------
 2 files changed, 357 deletions(-)

diff --git a/board/nokia/rx51/rx51.c b/board/nokia/rx51/rx51.c
index 84739ae129..cb72ffaaa9 100644
--- a/board/nokia/rx51/rx51.c
+++ b/board/nokia/rx51/rx51.c
@@ -467,17 +467,6 @@ int misc_init_r(void)
 	return 0;
 }
 
-/*
- * Routine: set_muxconf_regs
- * Description: Setting up the configuration Mux registers specific to the
- *		hardware. Many pins need to be moved from protect to primary
- *		mode.
- */
-void set_muxconf_regs(void)
-{
-	MUX_RX51();
-}
-
 static unsigned long int twl_wd_time; /* last time of watchdog reset */
 static unsigned long int twl_i2c_lock;
 
diff --git a/board/nokia/rx51/rx51.h b/board/nokia/rx51/rx51.h
index 4eff823a1b..0eddb06219 100644
--- a/board/nokia/rx51/rx51.h
+++ b/board/nokia/rx51/rx51.h
@@ -21,352 +21,6 @@ struct emu_hal_params_rx51 {
 	u32 param4;
 };
 
-/*
- * IEN  - Input Enable
- * IDIS - Input Disable
- * PTD  - Pull type Down
- * PTU  - Pull type Up
- * DIS  - Pull type selection is inactive
- * EN   - Pull type selection is active
- * M0   - Mode 0
- * The commented string gives the final mux configuration for that pin
- */
-#define MUX_RX51() \
-/* SDRC */\
-	MUX_VAL(CP(SDRC_D0),		(IEN  | PTD | DIS | M0)) /*SDRC_D0*/\
-	MUX_VAL(CP(SDRC_D1),		(IEN  | PTD | DIS | M0)) /*SDRC_D1*/\
-	MUX_VAL(CP(SDRC_D2),		(IEN  | PTD | DIS | M0)) /*SDRC_D2*/\
-	MUX_VAL(CP(SDRC_D3),		(IEN  | PTD | DIS | M0)) /*SDRC_D3*/\
-	MUX_VAL(CP(SDRC_D4),		(IEN  | PTD | DIS | M0)) /*SDRC_D4*/\
-	MUX_VAL(CP(SDRC_D5),		(IEN  | PTD | DIS | M0)) /*SDRC_D5*/\
-	MUX_VAL(CP(SDRC_D6),		(IEN  | PTD | DIS | M0)) /*SDRC_D6*/\
-	MUX_VAL(CP(SDRC_D7),		(IEN  | PTD | DIS | M0)) /*SDRC_D7*/\
-	MUX_VAL(CP(SDRC_D8),		(IEN  | PTD | DIS | M0)) /*SDRC_D8*/\
-	MUX_VAL(CP(SDRC_D9),		(IEN  | PTD | DIS | M0)) /*SDRC_D9*/\
-	MUX_VAL(CP(SDRC_D10),		(IEN  | PTD | DIS | M0)) /*SDRC_D10*/\
-	MUX_VAL(CP(SDRC_D11),		(IEN  | PTD | DIS | M0)) /*SDRC_D11*/\
-	MUX_VAL(CP(SDRC_D12),		(IEN  | PTD | DIS | M0)) /*SDRC_D12*/\
-	MUX_VAL(CP(SDRC_D13),		(IEN  | PTD | DIS | M0)) /*SDRC_D13*/\
-	MUX_VAL(CP(SDRC_D14),		(IEN  | PTD | DIS | M0)) /*SDRC_D14*/\
-	MUX_VAL(CP(SDRC_D15),		(IEN  | PTD | DIS | M0)) /*SDRC_D15*/\
-	MUX_VAL(CP(SDRC_D16),		(IEN  | PTD | DIS | M0)) /*SDRC_D16*/\
-	MUX_VAL(CP(SDRC_D17),		(IEN  | PTD | DIS | M0)) /*SDRC_D17*/\
-	MUX_VAL(CP(SDRC_D18),		(IEN  | PTD | DIS | M0)) /*SDRC_D18*/\
-	MUX_VAL(CP(SDRC_D19),		(IEN  | PTD | DIS | M0)) /*SDRC_D19*/\
-	MUX_VAL(CP(SDRC_D20),		(IEN  | PTD | DIS | M0)) /*SDRC_D20*/\
-	MUX_VAL(CP(SDRC_D21),		(IEN  | PTD | DIS | M0)) /*SDRC_D21*/\
-	MUX_VAL(CP(SDRC_D22),		(IEN  | PTD | DIS | M0)) /*SDRC_D22*/\
-	MUX_VAL(CP(SDRC_D23),		(IEN  | PTD | DIS | M0)) /*SDRC_D23*/\
-	MUX_VAL(CP(SDRC_D24),		(IEN  | PTD | DIS | M0)) /*SDRC_D24*/\
-	MUX_VAL(CP(SDRC_D25),		(IEN  | PTD | DIS | M0)) /*SDRC_D25*/\
-	MUX_VAL(CP(SDRC_D26),		(IEN  | PTD | DIS | M0)) /*SDRC_D26*/\
-	MUX_VAL(CP(SDRC_D27),		(IEN  | PTD | DIS | M0)) /*SDRC_D27*/\
-	MUX_VAL(CP(SDRC_D28),		(IEN  | PTD | DIS | M0)) /*SDRC_D28*/\
-	MUX_VAL(CP(SDRC_D29),		(IEN  | PTD | DIS | M0)) /*SDRC_D29*/\
-	MUX_VAL(CP(SDRC_D30),		(IEN  | PTD | DIS | M0)) /*SDRC_D30*/\
-	MUX_VAL(CP(SDRC_D31),		(IEN  | PTD | DIS | M0)) /*SDRC_D31*/\
-	MUX_VAL(CP(SDRC_CLK),		(IEN  | PTD | DIS | M0)) /*SDRC_CLK*/\
-	MUX_VAL(CP(SDRC_DQS0),		(IEN  | PTD | DIS | M0)) /*SDRC_DQS0*/\
-	MUX_VAL(CP(SDRC_DQS1),		(IEN  | PTD | DIS | M0)) /*SDRC_DQS1*/\
-	MUX_VAL(CP(SDRC_DQS2),		(IEN  | PTD | DIS | M0)) /*SDRC_DQS2*/\
-	MUX_VAL(CP(SDRC_DQS3),		(IEN  | PTD | DIS | M0)) /*SDRC_DQS3*/\
-/* GPMC */\
-	MUX_VAL(CP(GPMC_A1),		(IDIS | PTD | DIS | M0)) /*GPMC_A1*/\
-	MUX_VAL(CP(GPMC_A2),		(IDIS | PTD | DIS | M0)) /*GPMC_A2*/\
-	MUX_VAL(CP(GPMC_A3),		(IDIS | PTD | DIS | M0)) /*GPMC_A3*/\
-	MUX_VAL(CP(GPMC_A4),		(IDIS | PTD | DIS | M0)) /*GPMC_A4*/\
-	MUX_VAL(CP(GPMC_A5),		(IDIS | PTD | DIS | M0)) /*GPMC_A5*/\
-	MUX_VAL(CP(GPMC_A6),		(IDIS | PTD | DIS | M0)) /*GPMC_A6*/\
-	MUX_VAL(CP(GPMC_A7),		(IDIS | PTD | DIS | M0)) /*GPMC_A7*/\
-	MUX_VAL(CP(GPMC_A8),		(IDIS | PTD | DIS | M0)) /*GPMC_A8*/\
-	MUX_VAL(CP(GPMC_A9),		(IDIS | PTD | DIS | M0)) /*GPMC_A9*/\
-	MUX_VAL(CP(GPMC_A10),		(IDIS | PTD | DIS | M0)) /*GPMC_A10*/\
-	MUX_VAL(CP(GPMC_D0),		(IEN  | PTD | DIS | M0)) /*GPMC_D0*/\
-	MUX_VAL(CP(GPMC_D1),		(IEN  | PTD | DIS | M0)) /*GPMC_D1*/\
-	MUX_VAL(CP(GPMC_D2),		(IEN  | PTD | DIS | M0)) /*GPMC_D2*/\
-	MUX_VAL(CP(GPMC_D3),		(IEN  | PTD | DIS | M0)) /*GPMC_D3*/\
-	MUX_VAL(CP(GPMC_D4),		(IEN  | PTD | DIS | M0)) /*GPMC_D4*/\
-	MUX_VAL(CP(GPMC_D5),		(IEN  | PTD | DIS | M0)) /*GPMC_D5*/\
-	MUX_VAL(CP(GPMC_D6),		(IEN  | PTD | DIS | M0)) /*GPMC_D6*/\
-	MUX_VAL(CP(GPMC_D7),		(IEN  | PTD | DIS | M0)) /*GPMC_D7*/\
-	MUX_VAL(CP(GPMC_D8),		(IEN  | PTD | DIS | M0)) /*GPMC_D8*/\
-	MUX_VAL(CP(GPMC_D9),		(IEN  | PTD | DIS | M0)) /*GPMC_D9*/\
-	MUX_VAL(CP(GPMC_D10),		(IEN  | PTD | DIS | M0)) /*GPMC_D10*/\
-	MUX_VAL(CP(GPMC_D11),		(IEN  | PTD | DIS | M0)) /*GPMC_D11*/\
-	MUX_VAL(CP(GPMC_D12),		(IEN  | PTD | DIS | M0)) /*GPMC_D12*/\
-	MUX_VAL(CP(GPMC_D13),		(IEN  | PTD | DIS | M0)) /*GPMC_D13*/\
-	MUX_VAL(CP(GPMC_D14),		(IEN  | PTD | DIS | M0)) /*GPMC_D14*/\
-	MUX_VAL(CP(GPMC_D15),		(IEN  | PTD | DIS | M0)) /*GPMC_D15*/\
-	MUX_VAL(CP(GPMC_NCS0),		(IDIS | PTU | EN  | M0)) /*GPMC_nCS0*/\
-	MUX_VAL(CP(GPMC_NCS1),		(IDIS | PTU | EN  | M0)) /*GPMC_nCS1*/\
-	MUX_VAL(CP(GPMC_NCS2),		(IDIS | PTU | EN  | M0)) /*GPMC_nCS2*/\
-	MUX_VAL(CP(GPMC_NCS3),		(IDIS | PTU | EN  | M0)) /*GPMC_nCS3*/\
-	MUX_VAL(CP(GPMC_NCS4),		(IDIS | PTU | EN  | M0)) /*GPMC_nCS4*/\
-	MUX_VAL(CP(GPMC_NCS5),		(IDIS | PTD | DIS | M0)) /*GPMC_nCS5*/\
-	MUX_VAL(CP(GPMC_NCS6),		(IEN  | PTD | DIS | M1)) /*nDMA_REQ2*/\
-	MUX_VAL(CP(GPMC_NCS7),		(IEN  | PTU | EN  | M1)) /*nDMA_REQ3*/\
-	MUX_VAL(CP(GPMC_NBE1),		(IEN  | PTD | DIS | M0)) /*GPMC_nBE1*/\
-	MUX_VAL(CP(GPMC_WAIT2),		(IEN  | PTU | EN  | M0)) /*GPMC_WAIT2*/\
-	MUX_VAL(CP(GPMC_WAIT3),		(IEN  | PTU | EN  | M0)) /*GPMC_WAIT3*/\
-	MUX_VAL(CP(GPMC_CLK),		(IDIS | PTD | DIS | M0)) /*GPMC_CLK*/\
-	MUX_VAL(CP(GPMC_NADV_ALE),	(IDIS | PTD | DIS | M0)) /*GPMC_nADV*/\
-	MUX_VAL(CP(GPMC_NOE),		(IDIS | PTD | DIS | M0)) /*GPMC_nOE*/\
-	MUX_VAL(CP(GPMC_NWE),		(IDIS | PTD | DIS | M0)) /*GPMC_nWE*/\
-	MUX_VAL(CP(GPMC_NBE0_CLE),	(IDIS | PTD | DIS | M0)) /*GPMC_nBE0*/\
-	MUX_VAL(CP(GPMC_NWP),		(IEN  | PTD | DIS | M0)) /*GPMC_nWP*/\
-	MUX_VAL(CP(GPMC_WAIT0),		(IEN  | PTU | EN  | M0)) /*GPMC_WAIT0*/\
-	MUX_VAL(CP(GPMC_WAIT1),		(IEN  | PTU | EN  | M0)) /*GPMC_WAIT1*/\
-/* DSS */\
-	MUX_VAL(CP(DSS_PCLK),		(IDIS | PTD | DIS | M0)) /*DSS_PCLK*/\
-	MUX_VAL(CP(DSS_HSYNC),		(IDIS | PTD | DIS | M0)) /*DSS_HSYNC*/\
-	MUX_VAL(CP(DSS_VSYNC),		(IDIS | PTD | DIS | M0)) /*DSS_VSYNC*/\
-	MUX_VAL(CP(DSS_ACBIAS),		(IDIS | PTD | DIS | M0)) /*DSS_ACBIAS*/\
-	MUX_VAL(CP(DSS_DATA0),		(IDIS | PTD | DIS | M0)) /*DSS_DATA0*/\
-	MUX_VAL(CP(DSS_DATA1),		(IDIS | PTD | DIS | M0)) /*DSS_DATA1*/\
-	MUX_VAL(CP(DSS_DATA2),		(IDIS | PTD | DIS | M0)) /*DSS_DATA2*/\
-	MUX_VAL(CP(DSS_DATA3),		(IDIS | PTD | DIS | M0)) /*DSS_DATA3*/\
-	MUX_VAL(CP(DSS_DATA4),		(IDIS | PTD | DIS | M0)) /*DSS_DATA4*/\
-	MUX_VAL(CP(DSS_DATA5),		(IDIS | PTD | DIS | M0)) /*DSS_DATA5*/\
-	MUX_VAL(CP(DSS_DATA6),		(IDIS | PTD | DIS | M0)) /*DSS_DATA6*/\
-	MUX_VAL(CP(DSS_DATA7),		(IDIS | PTD | DIS | M0)) /*DSS_DATA7*/\
-	MUX_VAL(CP(DSS_DATA8),		(IDIS | PTD | DIS | M0)) /*DSS_DATA8*/\
-	MUX_VAL(CP(DSS_DATA9),		(IDIS | PTD | DIS | M0)) /*DSS_DATA9*/\
-	MUX_VAL(CP(DSS_DATA10),		(IDIS | PTD | DIS | M0)) /*DSS_DATA10*/\
-	MUX_VAL(CP(DSS_DATA11),		(IDIS | PTD | DIS | M0)) /*DSS_DATA11*/\
-	MUX_VAL(CP(DSS_DATA12),		(IDIS | PTD | DIS | M0)) /*DSS_DATA12*/\
-	MUX_VAL(CP(DSS_DATA13),		(IDIS | PTD | DIS | M0)) /*DSS_DATA13*/\
-	MUX_VAL(CP(DSS_DATA14),		(IDIS | PTD | DIS | M0)) /*DSS_DATA14*/\
-	MUX_VAL(CP(DSS_DATA15),		(IDIS | PTD | DIS | M0)) /*DSS_DATA15*/\
-	MUX_VAL(CP(DSS_DATA16),		(IDIS | PTD | DIS | M0)) /*DSS_DATA16*/\
-	MUX_VAL(CP(DSS_DATA17),		(IDIS | PTD | DIS | M0)) /*DSS_DATA17*/\
-	MUX_VAL(CP(DSS_DATA18),		(IDIS | PTD | DIS | M0)) /*DSS_DATA18*/\
-	MUX_VAL(CP(DSS_DATA19),		(IDIS | PTD | DIS | M0)) /*DSS_DATA19*/\
-	MUX_VAL(CP(DSS_DATA20),		(IDIS | PTD | DIS | M0)) /*DSS_DATA20*/\
-	MUX_VAL(CP(DSS_DATA21),		(IDIS | PTD | DIS | M0)) /*DSS_DATA21*/\
-	MUX_VAL(CP(DSS_DATA22),		(IDIS | PTD | DIS | M0)) /*DSS_DATA22*/\
-	MUX_VAL(CP(DSS_DATA23),		(IDIS | PTD | DIS | M0)) /*DSS_DATA23*/\
-/* CAMERA */\
-	MUX_VAL(CP(CAM_HS),		(IEN  | PTU | EN  | M0)) /*CAM_HS*/\
-	MUX_VAL(CP(CAM_VS),		(IEN  | PTU | EN  | M0)) /*CAM_VS*/\
-	MUX_VAL(CP(CAM_XCLKA),		(IDIS | PTD | DIS | M0)) /*CAM_XCLKA*/\
-	MUX_VAL(CP(CAM_PCLK),		(IEN  | PTU | EN  | M0)) /*CAM_PCLK*/\
-	MUX_VAL(CP(CAM_FLD),		(IDIS | PTD | DIS | M4)) /*GPIO_98*/\
-	MUX_VAL(CP(CAM_D0),		(IEN  | PTD | DIS | M0)) /*CAM_D0*/\
-	MUX_VAL(CP(CAM_D1),		(IEN  | PTD | DIS | M0)) /*CAM_D1*/\
-	MUX_VAL(CP(CAM_D2),		(IEN  | PTD | DIS | M0)) /*CAM_D2*/\
-	MUX_VAL(CP(CAM_D3),		(IEN  | PTD | DIS | M0)) /*CAM_D3*/\
-	MUX_VAL(CP(CAM_D4),		(IEN  | PTD | DIS | M0)) /*CAM_D4*/\
-	MUX_VAL(CP(CAM_D5),		(IEN  | PTD | DIS | M0)) /*CAM_D5*/\
-	MUX_VAL(CP(CAM_D6),		(IEN  | PTD | DIS | M0)) /*CAM_D6*/\
-	MUX_VAL(CP(CAM_D7),		(IEN  | PTD | DIS | M0)) /*CAM_D7*/\
-	MUX_VAL(CP(CAM_D8),		(IEN  | PTD | DIS | M0)) /*CAM_D8*/\
-	MUX_VAL(CP(CAM_D9),		(IEN  | PTD | DIS | M0)) /*CAM_D9*/\
-	MUX_VAL(CP(CAM_D10),		(IEN  | PTD | DIS | M0)) /*CAM_D10*/\
-	MUX_VAL(CP(CAM_D11),		(IEN  | PTD | DIS | M0)) /*CAM_D11*/\
-	MUX_VAL(CP(CAM_XCLKB),		(IDIS | PTD | DIS | M0)) /*CAM_XCLKB*/\
-	MUX_VAL(CP(CAM_WEN),		(IEN  | PTD | DIS | M4)) /*GPIO_167*/\
-	MUX_VAL(CP(CAM_STROBE),		(IDIS | PTD | DIS | M0)) /*CAM_STROBE*/\
-	MUX_VAL(CP(CSI2_DX0),		(IEN  | PTD | DIS | M0)) /*CSI2_DX0*/\
-	MUX_VAL(CP(CSI2_DY0),		(IEN  | PTD | DIS | M0)) /*CSI2_DY0*/\
-	MUX_VAL(CP(CSI2_DX1),		(IEN  | PTD | DIS | M0)) /*CSI2_DX1*/\
-	MUX_VAL(CP(CSI2_DY1),		(IEN  | PTD | DIS | M0)) /*CSI2_DY1*/\
-/* Audio Interface */\
-	MUX_VAL(CP(MCBSP2_FSX),		(IEN  | PTD | DIS | M0)) /*McBSP2_FSX*/\
-	MUX_VAL(CP(MCBSP2_CLKX),	(IEN  | PTD | DIS | M0)) /*McBSP2_CLK*/\
-	MUX_VAL(CP(MCBSP2_DR),		(IEN  | PTD | DIS | M0)) /*McBSP2_DR*/\
-	MUX_VAL(CP(MCBSP2_DX),		(IDIS | PTD | DIS | M0)) /*McBSP2_DX*/\
-/* Expansion card */\
-	MUX_VAL(CP(MMC1_CLK),		(IDIS | PTU | EN  | M0)) /*MMC1_CLK*/\
-	MUX_VAL(CP(MMC1_CMD),		(IEN  | PTU | EN  | M0)) /*MMC1_CMD*/\
-	MUX_VAL(CP(MMC1_DAT0),		(IEN  | PTU | EN  | M0)) /*MMC1_DAT0*/\
-	MUX_VAL(CP(MMC1_DAT1),		(IEN  | PTU | EN  | M0)) /*MMC1_DAT1*/\
-	MUX_VAL(CP(MMC1_DAT2),		(IEN  | PTU | EN  | M0)) /*MMC1_DAT2*/\
-	MUX_VAL(CP(MMC1_DAT3),		(IEN  | PTU | EN  | M0)) /*MMC1_DAT3*/\
-	MUX_VAL(CP(MMC1_DAT4),		(IEN  | PTU | EN  | M0)) /*MMC1_DAT4*/\
-	MUX_VAL(CP(MMC1_DAT5),		(IEN  | PTU | EN  | M0)) /*MMC1_DAT5*/\
-	MUX_VAL(CP(MMC1_DAT6),		(IEN  | PTU | EN  | M0)) /*MMC1_DAT6*/\
-	MUX_VAL(CP(MMC1_DAT7),		(IEN  | PTU | EN  | M0)) /*MMC1_DAT7*/\
-/* Wireless LAN */\
-	MUX_VAL(CP(MMC2_CLK),		(IEN  | PTU | EN  | M4)) /*GPIO_130*/\
-	MUX_VAL(CP(MMC2_CMD),		(IEN  | PTU | EN  | M4)) /*GPIO_131*/\
-	MUX_VAL(CP(MMC2_DAT0),		(IEN  | PTU | EN  | M4)) /*GPIO_132*/\
-	MUX_VAL(CP(MMC2_DAT1),		(IEN  | PTU | EN  | M4)) /*GPIO_133*/\
-	MUX_VAL(CP(MMC2_DAT2),		(IEN  | PTU | EN  | M4)) /*GPIO_134*/\
-	MUX_VAL(CP(MMC2_DAT3),		(IEN  | PTU | EN  | M4)) /*GPIO_135*/\
-	MUX_VAL(CP(MMC2_DAT4),		(IEN  | PTU | EN  | M4)) /*GPIO_136*/\
-	MUX_VAL(CP(MMC2_DAT5),		(IEN  | PTU | EN  | M4)) /*GPIO_137*/\
-	MUX_VAL(CP(MMC2_DAT6),		(IEN  | PTU | EN  | M4)) /*GPIO_138*/\
-	MUX_VAL(CP(MMC2_DAT7),		(IEN  | PTU | EN  | M4)) /*GPIO_139*/\
-/* Bluetooth */\
-	MUX_VAL(CP(MCBSP3_DX),		(IEN  | PTD | DIS | M1)) /*UART2_CTS*/\
-	MUX_VAL(CP(MCBSP3_DR),		(IDIS | PTD | DIS | M1)) /*UART2_RTS*/\
-	MUX_VAL(CP(MCBSP3_CLKX),	(IDIS | PTD | DIS | M1)) /*UART2_TX*/\
-	MUX_VAL(CP(MCBSP3_FSX),		(IEN  | PTD | DIS | M1)) /*UART2_RX*/\
-	MUX_VAL(CP(UART2_CTS),		(IEN  | PTD | DIS | M4)) /*GPIO_144*/\
-	MUX_VAL(CP(UART2_RTS),		(IEN  | PTD | DIS | M4)) /*GPIO_145*/\
-	MUX_VAL(CP(UART2_TX),		(IEN  | PTD | DIS | M4)) /*GPIO_146*/\
-	MUX_VAL(CP(UART2_RX),		(IEN  | PTD | DIS | M4)) /*GPIO_147*/\
-/* Modem Interface */\
-	MUX_VAL(CP(UART1_TX),		(IDIS | PTD | DIS | M0)) /*UART1_TX*/\
-	MUX_VAL(CP(UART1_RTS),		(IDIS | PTD | DIS | M4)) /*GPIO_149*/\
-	MUX_VAL(CP(UART1_CTS),		(IDIS | PTD | DIS | M4)) /*GPIO_150*/\
-	MUX_VAL(CP(UART1_RX),		(IEN  | PTD | DIS | M0)) /*UART1_RX*/\
-	MUX_VAL(CP(MCBSP4_CLKX),	(IEN  | PTD | DIS | M1)) /*SSI1_DAT*/\
-	MUX_VAL(CP(MCBSP4_DR),		(IEN  | PTD | DIS | M1)) /*SSI1_FLAG*/\
-	MUX_VAL(CP(MCBSP4_DX),		(IEN  | PTD | DIS | M1)) /*SSI1_RDY*/\
-	MUX_VAL(CP(MCBSP4_FSX),		(IEN  | PTD | DIS | M1)) /*SSI1_WAKE*/\
-	MUX_VAL(CP(MCBSP1_CLKR),	(IDIS | PTD | DIS | M4)) /*GPIO_156*/\
-	MUX_VAL(CP(MCBSP1_FSR),		(IDIS | PTU | EN  | M4)) /*GPIO_157*/\
-	MUX_VAL(CP(MCBSP1_DX),		(IDIS | PTD | DIS | M4)) /*GPIO_158*/\
-	MUX_VAL(CP(MCBSP1_DR),		(IDIS | PTD | DIS | M4)) /*GPIO_159*/\
-	MUX_VAL(CP(MCBSP_CLKS),		(IEN  | PTU | DIS | M0)) /*McBSP_CLKS*/\
-	MUX_VAL(CP(MCBSP1_FSX),		(IDIS | PTD | DIS | M4)) /*GPIO_161*/\
-	MUX_VAL(CP(MCBSP1_CLKX),	(IDIS | PTD | DIS | M4)) /*GPIO_162*/\
-/* Serial Interface */\
-	MUX_VAL(CP(UART3_CTS_RCTX),	(IEN  | PTD | EN  | M0)) /*UART3_CTS*/\
-	MUX_VAL(CP(UART3_RTS_SD),	(IDIS | PTD | DIS | M0)) /*UART3_RTS*/\
-	MUX_VAL(CP(UART3_RX_IRRX),	(IEN  | PTD | DIS | M0)) /*UART3_RX*/\
-	MUX_VAL(CP(UART3_TX_IRTX),	(IDIS | PTD | DIS | M0)) /*UART3_TX*/\
-	MUX_VAL(CP(HSUSB0_CLK),		(IEN  | PTD | DIS | M0)) /*HSUSB0_CLK*/\
-	MUX_VAL(CP(HSUSB0_STP),		(IDIS | PTU | EN  | M0)) /*HSUSB0_STP*/\
-	MUX_VAL(CP(HSUSB0_DIR),		(IEN  | PTD | DIS | M0)) /*HSUSB0_DIR*/\
-	MUX_VAL(CP(HSUSB0_NXT),		(IEN  | PTD | DIS | M0)) /*HSUSB0_NXT*/\
-	MUX_VAL(CP(HSUSB0_DATA0),	(IEN  | PTD | DIS | M0)) /*HSUSB0_DA0*/\
-	MUX_VAL(CP(HSUSB0_DATA1),	(IEN  | PTD | DIS | M0)) /*HSUSB0_DA1*/\
-	MUX_VAL(CP(HSUSB0_DATA2),	(IEN  | PTD | DIS | M0)) /*HSUSB0_DA2*/\
-	MUX_VAL(CP(HSUSB0_DATA3),	(IEN  | PTD | DIS | M0)) /*HSUSB0_DA3*/\
-	MUX_VAL(CP(HSUSB0_DATA4),	(IEN  | PTD | DIS | M0)) /*HSUSB0_DA4*/\
-	MUX_VAL(CP(HSUSB0_DATA5),	(IEN  | PTD | DIS | M0)) /*HSUSB0_DA5*/\
-	MUX_VAL(CP(HSUSB0_DATA6),	(IEN  | PTD | DIS | M0)) /*HSUSB0_DA6*/\
-	MUX_VAL(CP(HSUSB0_DATA7),	(IEN  | PTD | DIS | M0)) /*HSUSB0_DA7*/\
-	MUX_VAL(CP(I2C1_SCL),		(IEN  | PTU | EN  | M0)) /*I2C1_SCL*/\
-	MUX_VAL(CP(I2C1_SDA),		(IEN  | PTU | EN  | M0)) /*I2C1_SDA*/\
-	MUX_VAL(CP(I2C2_SCL),		(IEN  | PTU | EN  | M4)) /*GPIO_168*/\
-	MUX_VAL(CP(I2C2_SDA),		(IEN  | PTU | EN  | M4)) /*GPIO_183*/\
-	MUX_VAL(CP(I2C3_SCL),		(IEN  | PTU | EN  | M0)) /*I2C3_SCL*/\
-	MUX_VAL(CP(I2C3_SDA),		(IEN  | PTU | EN  | M0)) /*I2C3_SDA*/\
-	MUX_VAL(CP(I2C4_SCL),		(IEN  | PTU | EN  | M0)) /*I2C4_SCL*/\
-	MUX_VAL(CP(I2C4_SDA),		(IEN  | PTU | EN  | M0)) /*I2C4_SDA*/\
-	MUX_VAL(CP(HDQ_SIO),		(IDIS | PTU | EN  | M4)) /*GPIO_170*/\
-	MUX_VAL(CP(MCSPI1_CLK),		(IEN  | PTU | EN  | M4)) /*GPIO_171*/\
-	MUX_VAL(CP(MCSPI1_SIMO),	(IEN  | PTU | EN  | M4)) /*GPIO_172*/\
-	MUX_VAL(CP(MCSPI1_SOMI),	(IEN  | PTD | DIS | M0)) /*McSPI1_SOM*/\
-	MUX_VAL(CP(MCSPI1_CS0),		(IEN  | PTD | EN  | M0)) /*McSPI1_CS0*/\
-	MUX_VAL(CP(MCSPI1_CS1),		(IDIS | PTD | EN  | M0)) /*McSPI1_CS1*/\
-	MUX_VAL(CP(MCSPI1_CS2),		(IDIS | PTD | DIS | M4)) /*GPIO_176*/\
-/* USB EHCI (port 2) */\
-	MUX_VAL(CP(MCSPI1_CS3),		(IEN  | PTU | DIS | M3)) /*HSUSB2_DA2*/\
-	MUX_VAL(CP(MCSPI2_CLK),		(IEN  | PTU | DIS | M3)) /*HSUSB2_DA7*/\
-	MUX_VAL(CP(MCSPI2_SIMO),	(IEN  | PTU | DIS | M3)) /*HSUSB2_DA4*/\
-	MUX_VAL(CP(MCSPI2_SOMI),	(IEN  | PTU | DIS | M3)) /*HSUSB2_DA5*/\
-	MUX_VAL(CP(MCSPI2_CS0),		(IEN  | PTU | DIS | M3)) /*HSUSB2_DA6*/\
-	MUX_VAL(CP(MCSPI2_CS1),		(IEN  | PTU | DIS | M3)) /*HSUSB2_DA3*/\
-	MUX_VAL(CP(ETK_D10_ES2),	(IDIS | PTU | DIS | M3)) /*HSUSB2_CLK*/\
-	MUX_VAL(CP(ETK_D11_ES2),	(IDIS | PTU | DIS | M3)) /*HSUSB2_STP*/\
-	MUX_VAL(CP(ETK_D12_ES2),	(IEN  | PTU | DIS | M3)) /*HSUSB2_DIR*/\
-	MUX_VAL(CP(ETK_D13_ES2),	(IEN  | PTU | DIS | M3)) /*HSUSB2_NXT*/\
-	MUX_VAL(CP(ETK_D14_ES2),	(IEN  | PTU | DIS | M3)) /*HSUSB2_DA0*/\
-	MUX_VAL(CP(ETK_D15_ES2),	(IEN  | PTU | DIS | M3)) /*HSUSB2_DA1*/\
-/* Control and debug */\
-	MUX_VAL(CP(SYS_32K),		(IEN  | PTD | DIS | M0)) /*SYS_32K*/\
-	MUX_VAL(CP(SYS_CLKREQ),		(IEN  | PTD | DIS | M0)) /*SYS_CLKREQ*/\
-	MUX_VAL(CP(SYS_NIRQ),		(IEN  | PTU | EN  | M0)) /*SYS_nIRQ*/\
-	MUX_VAL(CP(SYS_BOOT0),		(IEN  | PTD | DIS | M4)) /*GPIO_2*/\
-	MUX_VAL(CP(SYS_BOOT1),		(IEN  | PTD | DIS | M4)) /*GPIO_3*/\
-	MUX_VAL(CP(SYS_BOOT2),		(IEN  | PTD | DIS | M4)) /*MMC1_WP*/\
-	MUX_VAL(CP(SYS_BOOT3),		(IEN  | PTD | DIS | M4)) /*GPIO_5*/\
-	MUX_VAL(CP(SYS_BOOT4),		(IEN  | PTD | DIS | M4)) /*GPIO_6*/\
-	MUX_VAL(CP(SYS_BOOT5),		(IEN  | PTD | DIS | M4)) /*GPIO_7*/\
-	MUX_VAL(CP(SYS_BOOT6),		(IDIS | PTD | DIS | M4)) /*GPIO_8*/\
-	MUX_VAL(CP(SYS_OFF_MODE),	(IEN  | PTD | DIS | M0)) /*SYS_OFF_MD*/\
-	MUX_VAL(CP(SYS_CLKOUT1),	(IEN  | PTD | DIS | M0)) /*SYS_CLKOUT*/\
-	MUX_VAL(CP(SYS_CLKOUT2),	(IEN  | PTU | EN  | M4)) /*GPIO_186*/\
-	MUX_VAL(CP(ETK_CLK_ES2),	(IDIS | PTU | EN  | M3)) /*HSUSB1_STP*/\
-	MUX_VAL(CP(ETK_CTL_ES2),	(IDIS | PTU | DIS | M3)) /*HSUSB1_CLK*/\
-	MUX_VAL(CP(ETK_D0_ES2),		(IEN  | PTU | DIS | M3)) /*HSUSB1_DA0*/\
-	MUX_VAL(CP(ETK_D1_ES2),		(IEN  | PTU | DIS | M3)) /*HSUSB1_DA1*/\
-	MUX_VAL(CP(ETK_D2_ES2),		(IEN  | PTU | DIS | M3)) /*HSUSB1_DA2*/\
-	MUX_VAL(CP(ETK_D3_ES2),		(IEN  | PTU | DIS | M3)) /*HSUSB1_DA7*/\
-	MUX_VAL(CP(ETK_D4_ES2),		(IEN  | PTU | DIS | M3)) /*HSUSB1_DA4*/\
-	MUX_VAL(CP(ETK_D5_ES2),		(IEN  | PTU | DIS | M3)) /*HSUSB1_DA5*/\
-	MUX_VAL(CP(ETK_D6_ES2),		(IEN  | PTU | DIS | M3)) /*HSUSB1_DA6*/\
-	MUX_VAL(CP(ETK_D7_ES2),		(IEN  | PTU | DIS | M3)) /*HSUSB1_DA3*/\
-	MUX_VAL(CP(ETK_D8_ES2),		(IEN  | PTU | DIS | M3)) /*HSUSB1_DIR*/\
-	MUX_VAL(CP(ETK_D9_ES2),		(IEN  | PTU | DIS | M3)) /*HSUSB1_NXT*/\
-	MUX_VAL(CP(D2D_MCAD1),		(IEN  | PTD | EN  | M0)) /*d2d_mcad1*/\
-	MUX_VAL(CP(D2D_MCAD2),		(IEN  | PTD | EN  | M0)) /*d2d_mcad2*/\
-	MUX_VAL(CP(D2D_MCAD3),		(IEN  | PTD | EN  | M0)) /*d2d_mcad3*/\
-	MUX_VAL(CP(D2D_MCAD4),		(IEN  | PTD | EN  | M0)) /*d2d_mcad4*/\
-	MUX_VAL(CP(D2D_MCAD5),		(IEN  | PTD | EN  | M0)) /*d2d_mcad5*/\
-	MUX_VAL(CP(D2D_MCAD6),		(IEN  | PTD | EN  | M0)) /*d2d_mcad6*/\
-	MUX_VAL(CP(D2D_MCAD7),		(IEN  | PTD | EN  | M0)) /*d2d_mcad7*/\
-	MUX_VAL(CP(D2D_MCAD8),		(IEN  | PTD | EN  | M0)) /*d2d_mcad8*/\
-	MUX_VAL(CP(D2D_MCAD9),		(IEN  | PTD | EN  | M0)) /*d2d_mcad9*/\
-	MUX_VAL(CP(D2D_MCAD10),		(IEN  | PTD | EN  | M0)) /*d2d_mcad10*/\
-	MUX_VAL(CP(D2D_MCAD11),		(IEN  | PTD | EN  | M0)) /*d2d_mcad11*/\
-	MUX_VAL(CP(D2D_MCAD12),		(IEN  | PTD | EN  | M0)) /*d2d_mcad12*/\
-	MUX_VAL(CP(D2D_MCAD13),		(IEN  | PTD | EN  | M0)) /*d2d_mcad13*/\
-	MUX_VAL(CP(D2D_MCAD14),		(IEN  | PTD | EN  | M0)) /*d2d_mcad14*/\
-	MUX_VAL(CP(D2D_MCAD15),		(IEN  | PTD | EN  | M0)) /*d2d_mcad15*/\
-	MUX_VAL(CP(D2D_MCAD16),		(IEN  | PTD | EN  | M0)) /*d2d_mcad16*/\
-	MUX_VAL(CP(D2D_MCAD17),		(IEN  | PTD | EN  | M0)) /*d2d_mcad17*/\
-	MUX_VAL(CP(D2D_MCAD18),		(IEN  | PTD | EN  | M0)) /*d2d_mcad18*/\
-	MUX_VAL(CP(D2D_MCAD19),		(IEN  | PTD | EN  | M0)) /*d2d_mcad19*/\
-	MUX_VAL(CP(D2D_MCAD20),		(IEN  | PTD | EN  | M0)) /*d2d_mcad20*/\
-	MUX_VAL(CP(D2D_MCAD21),		(IEN  | PTD | EN  | M0)) /*d2d_mcad21*/\
-	MUX_VAL(CP(D2D_MCAD22),		(IEN  | PTD | EN  | M0)) /*d2d_mcad22*/\
-	MUX_VAL(CP(D2D_MCAD23),		(IEN  | PTD | EN  | M0)) /*d2d_mcad23*/\
-	MUX_VAL(CP(D2D_MCAD24),		(IEN  | PTD | EN  | M0)) /*d2d_mcad24*/\
-	MUX_VAL(CP(D2D_MCAD25),		(IEN  | PTD | EN  | M0)) /*d2d_mcad25*/\
-	MUX_VAL(CP(D2D_MCAD26),		(IEN  | PTD | EN  | M0)) /*d2d_mcad26*/\
-	MUX_VAL(CP(D2D_MCAD27),		(IEN  | PTD | EN  | M0)) /*d2d_mcad27*/\
-	MUX_VAL(CP(D2D_MCAD28),		(IEN  | PTD | EN  | M0)) /*d2d_mcad28*/\
-	MUX_VAL(CP(D2D_MCAD29),		(IEN  | PTD | EN  | M0)) /*d2d_mcad29*/\
-	MUX_VAL(CP(D2D_MCAD30),		(IEN  | PTD | EN  | M0)) /*d2d_mcad30*/\
-	MUX_VAL(CP(D2D_MCAD31),		(IEN  | PTD | EN  | M0)) /*d2d_mcad31*/\
-	MUX_VAL(CP(D2D_MCAD32),		(IEN  | PTD | EN  | M0)) /*d2d_mcad32*/\
-	MUX_VAL(CP(D2D_MCAD33),		(IEN  | PTD | EN  | M0)) /*d2d_mcad33*/\
-	MUX_VAL(CP(D2D_MCAD34),		(IEN  | PTD | EN  | M0)) /*d2d_mcad34*/\
-	MUX_VAL(CP(D2D_MCAD35),		(IEN  | PTD | EN  | M0)) /*d2d_mcad35*/\
-	MUX_VAL(CP(D2D_MCAD36),		(IEN  | PTD | EN  | M0)) /*d2d_mcad36*/\
-	MUX_VAL(CP(D2D_CLK26MI),	(IEN  | PTD | DIS | M0)) /*d2d_clk26m*/\
-	MUX_VAL(CP(D2D_NRESPWRON),	(IEN  | PTD | EN  | M0)) /*d2d_nrespw*/\
-	MUX_VAL(CP(D2D_NRESWARM),	(IEN  | PTU | EN  | M0)) /*d2d_nreswa*/\
-	MUX_VAL(CP(D2D_ARM9NIRQ),	(IEN  | PTD | DIS | M0)) /*d2d_arm9ni*/\
-	MUX_VAL(CP(D2D_UMA2P6FIQ),	(IEN  | PTD | DIS | M0)) /*d2d_uma2p6*/\
-	MUX_VAL(CP(D2D_SPINT),		(IEN  | PTD | EN  | M0)) /*d2d_spint*/\
-	MUX_VAL(CP(D2D_FRINT),		(IEN  | PTD | EN  | M0)) /*d2d_frint*/\
-	MUX_VAL(CP(D2D_DMAREQ0),	(IEN  | PTD | DIS | M0)) /*d2d_dmare0*/\
-	MUX_VAL(CP(D2D_DMAREQ1),	(IEN  | PTD | DIS | M0)) /*d2d_dmare1*/\
-	MUX_VAL(CP(D2D_DMAREQ2),	(IEN  | PTD | DIS | M0)) /*d2d_dmare2*/\
-	MUX_VAL(CP(D2D_DMAREQ3),	(IEN  | PTD | DIS | M0)) /*d2d_dmare3*/\
-	MUX_VAL(CP(D2D_N3GTRST),	(IEN  | PTD | DIS | M0)) /*d2d_n3gtrs*/\
-	MUX_VAL(CP(D2D_N3GTDI),		(IEN  | PTD | DIS | M0)) /*d2d_n3gtdi*/\
-	MUX_VAL(CP(D2D_N3GTDO),		(IEN  | PTD | DIS | M0)) /*d2d_n3gtdo*/\
-	MUX_VAL(CP(D2D_N3GTMS),		(IEN  | PTD | DIS | M0)) /*d2d_n3gtms*/\
-	MUX_VAL(CP(D2D_N3GTCK),		(IEN  | PTD | DIS | M0)) /*d2d_n3gtck*/\
-	MUX_VAL(CP(D2D_N3GRTCK),	(IEN  | PTD | DIS | M0)) /*d2d_n3grtc*/\
-	MUX_VAL(CP(D2D_MSTDBY),		(IEN  | PTU | EN  | M0)) /*d2d_mstdby*/\
-	MUX_VAL(CP(D2D_SWAKEUP),	(IEN  | PTD | EN  | M0)) /*d2d_swakeu*/\
-	MUX_VAL(CP(D2D_IDLEREQ),	(IEN  | PTD | DIS | M0)) /*d2d_idlere*/\
-	MUX_VAL(CP(D2D_IDLEACK),	(IEN  | PTU | EN  | M0)) /*d2d_idleac*/\
-	MUX_VAL(CP(D2D_MWRITE),		(IEN  | PTD | DIS | M0)) /*d2d_mwrite*/\
-	MUX_VAL(CP(D2D_SWRITE),		(IEN  | PTD | DIS | M0)) /*d2d_swrite*/\
-	MUX_VAL(CP(D2D_MREAD),		(IEN  | PTD | DIS | M0)) /*d2d_mread*/\
-	MUX_VAL(CP(D2D_SREAD),		(IEN  | PTD | DIS | M0)) /*d2d_sread*/\
-	MUX_VAL(CP(D2D_MBUSFLAG),	(IEN  | PTD | DIS | M0)) /*d2d_mbusfl*/\
-	MUX_VAL(CP(D2D_SBUSFLAG),	(IEN  | PTD | DIS | M0)) /*d2d_sbusfl*/\
-	MUX_VAL(CP(SDRC_CKE0),		(IDIS | PTU | EN  | M0)) /*sdrc_cke0*/\
-	MUX_VAL(CP(SDRC_CKE1),		(IDIS | PTU | EN  | M0)) /*sdrc_cke1*/
-
-#define MUX_RX51_C() \
-	MUX_VAL(CP(MCBSP3_DX),		(IEN | PTD | DIS | M4)) /*GPIO_140*/\
-	MUX_VAL(CP(MCBSP3_DR),		(IEN | PTD | DIS | M4)) /*GPIO_142*/\
-	MUX_VAL(CP(MCBSP3_CLKX),	(IEN | PTD | DIS | M4)) /*GPIO_141*/\
-	MUX_VAL(CP(UART2_CTS),		(IEN  | PTU | EN  | M0)) /*UART2_CTS*/\
-	MUX_VAL(CP(UART2_RTS),		(IDIS | PTD | DIS | M0)) /*UART2_RTS*/\
-	MUX_VAL(CP(UART2_TX),		(IDIS | PTD | DIS | M0)) /*UART2_TX*/
-
 #define ONENAND_GPMC_CONFIG1_RX51	0xfb001202
 #define ONENAND_GPMC_CONFIG2_RX51	0x00111100
 #define ONENAND_GPMC_CONFIG3_RX51	0x00020200
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 69+ messages in thread

* [RESEND PATCH 15/16] Nokia RX-51: Move content of rx51.h to rx51.c
  2021-02-05 19:11 [RESEND PATCH 00/16] Nokia RX-51: Fix USB TTY console and enable it Pali Rohár
                   ` (13 preceding siblings ...)
  2021-02-05 19:12 ` [RESEND PATCH 14/16] Nokia RX-51: Remove function set_muxconf_regs() Pali Rohár
@ 2021-02-05 19:12 ` Pali Rohár
  2021-02-06 15:23   ` Lukasz Majewski
  2021-02-05 19:12 ` [RESEND PATCH 16/16] Nokia RX-51: Enable usbtty serial console by default Pali Rohár
  2021-02-07 13:50 ` [RESEND v2 PATCH 00/16] Nokia RX-51: Fix USB TTY console and enable it Pali Rohár
  16 siblings, 1 reply; 69+ messages in thread
From: Pali Rohár @ 2021-02-05 19:12 UTC (permalink / raw)
  To: u-boot

After removal of MUX configuration there is no need to have extra rx51.h.

Signed-off-by: Pali Roh?r <pali@kernel.org>
---
 board/nokia/rx51/rx51.c | 17 ++++++++++++++++-
 board/nokia/rx51/rx51.h | 31 -------------------------------
 2 files changed, 16 insertions(+), 32 deletions(-)
 delete mode 100644 board/nokia/rx51/rx51.h

diff --git a/board/nokia/rx51/rx51.c b/board/nokia/rx51/rx51.c
index cb72ffaaa9..0597a94faa 100644
--- a/board/nokia/rx51/rx51.c
+++ b/board/nokia/rx51/rx51.c
@@ -39,9 +39,24 @@
 #include <asm/arch/sys_proto.h>
 #include <asm/arch/mmc_host_def.h>
 
-#include "rx51.h"
 #include "tag_omap.h"
 
+/* Needed for ROM SMC call */
+struct emu_hal_params_rx51 {
+	u32 num_params;
+	u32 param1;
+	u32 param2;
+	u32 param3;
+	u32 param4;
+};
+
+#define ONENAND_GPMC_CONFIG1_RX51	0xfb001202
+#define ONENAND_GPMC_CONFIG2_RX51	0x00111100
+#define ONENAND_GPMC_CONFIG3_RX51	0x00020200
+#define ONENAND_GPMC_CONFIG4_RX51	0x11001102
+#define ONENAND_GPMC_CONFIG5_RX51	0x03101616
+#define ONENAND_GPMC_CONFIG6_RX51	0x90060000
+
 DECLARE_GLOBAL_DATA_PTR;
 
 GraphicDevice gdev;
diff --git a/board/nokia/rx51/rx51.h b/board/nokia/rx51/rx51.h
deleted file mode 100644
index 0eddb06219..0000000000
--- a/board/nokia/rx51/rx51.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * (C) Copyright 2012
- * ?????? ???????? <freemangordon@abv.bg>
- *
- * (C) Copyright 2011-2012
- * Pali Roh?r <pali@kernel.org>
- *
- * (C) Copyright 2008
- * Dirk Behme <dirk.behme@gmail.com>
- */
-#ifndef _RX51_H_
-#define _RX51_H_
-
-/* Needed for ROM SMC call */
-struct emu_hal_params_rx51 {
-	u32 num_params;
-	u32 param1;
-	u32 param2;
-	u32 param3;
-	u32 param4;
-};
-
-#define ONENAND_GPMC_CONFIG1_RX51	0xfb001202
-#define ONENAND_GPMC_CONFIG2_RX51	0x00111100
-#define ONENAND_GPMC_CONFIG3_RX51	0x00020200
-#define ONENAND_GPMC_CONFIG4_RX51	0x11001102
-#define ONENAND_GPMC_CONFIG5_RX51	0x03101616
-#define ONENAND_GPMC_CONFIG6_RX51	0x90060000
-
-#endif
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 69+ messages in thread

* [RESEND PATCH 16/16] Nokia RX-51: Enable usbtty serial console by default
  2021-02-05 19:11 [RESEND PATCH 00/16] Nokia RX-51: Fix USB TTY console and enable it Pali Rohár
                   ` (14 preceding siblings ...)
  2021-02-05 19:12 ` [RESEND PATCH 15/16] Nokia RX-51: Move content of rx51.h to rx51.c Pali Rohár
@ 2021-02-05 19:12 ` Pali Rohár
  2021-02-06  9:10   ` Pavel Machek
  2021-02-06 15:24   ` Lukasz Majewski
  2021-02-07 13:50 ` [RESEND v2 PATCH 00/16] Nokia RX-51: Fix USB TTY console and enable it Pali Rohár
  16 siblings, 2 replies; 69+ messages in thread
From: Pali Rohár @ 2021-02-05 19:12 UTC (permalink / raw)
  To: u-boot

Now when usbtty serial console is fixed in U-Boot enable CONFIG_USB_TTY for
Nokia RX-51 board by default.

Fix also USB product id as U-Boot ignores CONFIG_USBD_PRODUCTID macro and
include U-Boot string into USB product name to indicate usage of U-Boot.

CONFIG_CONSOLE_MUX is already used and U-Boot console is available for
all in/out devices. Therefore there is no need to have separate commands
'run sercon', 'run usbcon' and 'run vgacon', so remove them.

As space for U-Boot is limited to 256kB, disable some other unused options
so CONFIG_USB_TTY can be enabled.

Nokia RX-51 does not have easily accessible UART serial console so the only
option for easy debugging is to use device's keyboard+screen or this usbtty
serial console over USB.

Signed-off-by: Pali Roh?r <pali@kernel.org>
---
 configs/nokia_rx51_defconfig |  7 ++++---
 doc/README.nokia_rx51        | 15 +--------------
 include/configs/nokia_rx51.h | 21 +++++++--------------
 3 files changed, 12 insertions(+), 31 deletions(-)

diff --git a/configs/nokia_rx51_defconfig b/configs/nokia_rx51_defconfig
index 3b782715c7..bce55c4fe5 100644
--- a/configs/nokia_rx51_defconfig
+++ b/configs/nokia_rx51_defconfig
@@ -13,6 +13,7 @@ CONFIG_AUTOBOOT_MENU_SHOW=y
 CONFIG_USE_PREBOOT=y
 CONFIG_PREBOOT="run preboot"
 CONFIG_CONSOLE_MUX=y
+# CONFIG_SYS_DEVICE_NULLDEV is not set
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="Nokia RX-51 # "
 # CONFIG_CMD_BDI is not set
@@ -47,9 +48,11 @@ CONFIG_ENV_OVERWRITE=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 # CONFIG_NET is not set
 CONFIG_DM=y
+# CONFIG_DM_WARN is not set
 # CONFIG_DM_DEVICE_REMOVE is not set
+# CONFIG_DM_SEQ_ALIAS is not set
+# CONFIG_BLOCK_CACHE is not set
 CONFIG_DM_I2C=y
-CONFIG_TWL4030_LED=y
 CONFIG_DM_MMC=y
 # CONFIG_MMC_HW_PARTITIONING is not set
 # CONFIG_MMC_VERBOSE is not set
@@ -59,10 +62,8 @@ CONFIG_CONS_INDEX=3
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_USB=y
-CONFIG_USB_MUSB_HCD=y
 CONFIG_USB_MUSB_UDC=y
 CONFIG_USB_OMAP3=y
-CONFIG_TWL4030_USB=y
 CONFIG_CFB_CONSOLE=y
 CONFIG_CFB_CONSOLE_ANSI=y
 # CONFIG_VGA_AS_SINGLE_DEVICE is not set
diff --git a/doc/README.nokia_rx51 b/doc/README.nokia_rx51
index 320b5efc7d..84d1912ddd 100644
--- a/doc/README.nokia_rx51
+++ b/doc/README.nokia_rx51
@@ -24,8 +24,7 @@ called u-boot-gen-combined. It is available in following repository:
 There is support for hardware watchdog. Hardware watchdog is started by
 NOLO so u-boot must kick watchdog to prevent reboot device (but not very
 often, max every 2 seconds). There is also support for framebuffer display
-output with ANSI escape codes and the N900 HW keyboard input. USB tty works
-but is disabled because it prevents the current Maemo kernel from booting.
+output with ANSI escape codes and the N900 HW keyboard input.
 
 When U-Boot is starting it enable IBE bit in Auxiliary Control Register,
 which is needed for Thumb-2 ISA support. It is workaround for errata 430973.
@@ -49,10 +48,6 @@ Boot from SD or eMMC in this order:
 
 Available additional commands/variables:
 
- * run sercon - Use serial port for control
- * run usbcon - Use usbtty for control
- * run vgacon - Use framebuffer and HW keyboard for control (default)
-
  * run sdboot - Boot from external SD card (see boot order)
  * run emmcboot - Boot from internal eMMC memory (see boot order)
  * run attachboot - Boot attached kernel image (attached to U-Boot binary)
@@ -87,14 +82,6 @@ Additional variables for booting kernel:
  and u-boot standard output is set to serial then setup_console_atag is
  automatically set to 1. So output from Maemo kernel would go to serial port.
 
-USB TTY:
-
- Maemo kernel 2.6.28 will crash if u-boot enable usb tty. So USB TTY is disabled.
- For enabling USB TTY just add this line to file include/configs/nokia_rx51.h
-
- #define CONFIG_USB_TTY
-
-
 UBIFS support:
 
  UBIFS support is disabled, because U-Boot image is too big and cannot be
diff --git a/include/configs/nokia_rx51.h b/include/configs/nokia_rx51.h
index 3f2700d8e2..23368de624 100644
--- a/include/configs/nokia_rx51.h
+++ b/include/configs/nokia_rx51.h
@@ -70,10 +70,12 @@
 
 /* USB device configuration */
 #define CONFIG_USB_DEVICE
+#define CONFIG_USB_TTY
 #define CONFIG_USBD_VENDORID		0x0421
-#define CONFIG_USBD_PRODUCTID		0x01c8
+#define CONFIG_USBD_PRODUCTID_CDCACM	0x01c8
+#define CONFIG_USBD_PRODUCTID_GSERIAL	0x01c8
 #define CONFIG_USBD_MANUFACTURER	"Nokia"
-#define CONFIG_USBD_PRODUCT_NAME	"N900"
+#define CONFIG_USBD_PRODUCT_NAME	"N900 (U-Boot)"
 
 #define GPIO_SLIDE			71
 
@@ -108,15 +110,9 @@ int rx51_kp_getc(struct stdio_dev *sdev);
 /* Environment information */
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	"usbtty=cdc_acm\0" \
-	"stdin=serial,vga\0" \
-	"stdout=serial,vga\0" \
-	"stderr=serial,vga\0" \
-	"setcon=setenv stdin ${con};" \
-		"setenv stdout ${con};" \
-		"setenv stderr ${con}\0" \
-	"sercon=setenv con serial; run setcon\0" \
-	"usbcon=setenv con usbtty; run setcon\0" \
-	"vgacon=setenv con vga; run setcon\0" \
+	"stdin=usbtty,serial,vga\0" \
+	"stdout=usbtty,serial,vga\0" \
+	"stderr=usbtty,serial,vga\0" \
 	"slide=gpio input " __stringify(GPIO_SLIDE) "\0" \
 	"switchmmc=mmc dev ${mmcnum}\0" \
 	"kernaddr=0x82008000\0" \
@@ -198,9 +194,6 @@ int rx51_kp_getc(struct stdio_dev *sdev);
 #define CONFIG_POSTBOOTMENU \
 	"echo;" \
 	"echo Extra commands:;" \
-	"echo run sercon - Use serial port for control.;" \
-	"echo run usbcon - Use usbtty for control.;" \
-	"echo run vgacon - Use framebuffer/keyboard.;" \
 	"echo run sdboot - Boot from SD card slot.;" \
 	"echo run emmcboot - Boot internal eMMC memory.;" \
 	"echo run attachboot - Boot attached kernel image.;" \
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 69+ messages in thread

* [RESEND PATCH 05/16] usb: musb: Fix configuring FIFO for endpoints
  2021-02-05 19:12 ` [RESEND PATCH 05/16] usb: musb: Fix configuring FIFO for endpoints Pali Rohár
@ 2021-02-06  8:58   ` Pavel Machek
  2021-02-06 14:01   ` Lukasz Majewski
  1 sibling, 0 replies; 69+ messages in thread
From: Pavel Machek @ 2021-02-06  8:58 UTC (permalink / raw)
  To: u-boot

On Fri 2021-02-05 20:12:01, Pali Roh?r wrote:
> This patch fixes configuring FIFO for one-directional endpoints which have
> either RX or TX queue and therefore only one FIFO.
> 
> Size of FIFO buffer is 2^(idx+3) bytes and starting address is 2^(addr+3).
> Moreover first 64 bytes are reserved for EP0.
> 
> Without this patch if FIFO size specified by caller was zero then idx was
> incorrectly calculated (expr. ffs(0)-1) and size overflowed in fifosz
> register. This register uses has only 4 bits for FIFO size. Moreover
> specifying zero size is not possible.
> 
> This patch is fixing calculation of start address and buffer size to
> minimal value and ensure that it would not overlap with reserved EP0
> buffer.
> 
> This issue caused loose of packets on USB bus in both directions and
> basically usbtty was unusable.
> 
> Signed-off-by: Pali Roh?r <pali@kernel.org>

1-5: Acked-by: Pavel Machek <pavel@ucw.cz>

-- 
http://www.livejournal.com/~pavelmachek
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210206/91674213/attachment.sig>

^ permalink raw reply	[flat|nested] 69+ messages in thread

* [RESEND PATCH 10/16] usb: musb: Ensure that we set musb dynamic FIFO buffer for every endpoint
  2021-02-05 19:12 ` [RESEND PATCH 10/16] usb: musb: Ensure that we set musb dynamic FIFO buffer for every endpoint Pali Rohár
@ 2021-02-06  9:04   ` Pavel Machek
  2021-02-06 15:18   ` Lukasz Majewski
  1 sibling, 0 replies; 69+ messages in thread
From: Pavel Machek @ 2021-02-06  9:04 UTC (permalink / raw)
  To: u-boot

On Fri 2021-02-05 20:12:06, Pali Roh?r wrote:
> If we do not set FIFO buffer address and size for some endpoint which is in
> use then default address 0x0 would be used which is in conflict with FIFO
> buffer for endpoint 0 which is at fixed address 0x0. Sharing address space
> between more endpoint cause data loss and unexpected errors.
> 
> This patch is fixing transmission of characters over usbtty serial console
> and allow using of usbtty for debugging purposes on Nokia N900.
> 
> Signed-off-by: Pali Roh?r <pali@kernel.org>

6-10: Acked-by: Pavel Machek <pavel@ucw.cz>

Regards,
								Pavel

-- 
http://www.livejournal.com/~pavelmachek
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210206/d1dfdd7e/attachment.sig>

^ permalink raw reply	[flat|nested] 69+ messages in thread

* [RESEND PATCH 16/16] Nokia RX-51: Enable usbtty serial console by default
  2021-02-05 19:12 ` [RESEND PATCH 16/16] Nokia RX-51: Enable usbtty serial console by default Pali Rohár
@ 2021-02-06  9:10   ` Pavel Machek
  2021-02-06 15:24   ` Lukasz Majewski
  1 sibling, 0 replies; 69+ messages in thread
From: Pavel Machek @ 2021-02-06  9:10 UTC (permalink / raw)
  To: u-boot

Hi!

> Now when usbtty serial console is fixed in U-Boot enable CONFIG_USB_TTY for
> Nokia RX-51 board by default.
> 
> Fix also USB product id as U-Boot ignores CONFIG_USBD_PRODUCTID macro and
> include U-Boot string into USB product name to indicate usage of U-Boot.
> 
> CONFIG_CONSOLE_MUX is already used and U-Boot console is available for
> all in/out devices. Therefore there is no need to have separate commands
> 'run sercon', 'run usbcon' and 'run vgacon', so remove them.
> 
> As space for U-Boot is limited to 256kB, disable some other unused options
> so CONFIG_USB_TTY can be enabled.
> 
> Nokia RX-51 does not have easily accessible UART serial console so the only
> option for easy debugging is to use device's keyboard+screen or this usbtty
> serial console over USB.
> 
> Signed-off-by: Pali Roh?r <pali@kernel.org>

10-16: Acked-by: Pavel Machek <pavel@ucw.cz>

Thanks for the series.

You may want to avoid cc-ing the Leste list, as it complains about too
many recipients and bounces.

Best regards,
								Pavel
-- 
http://www.livejournal.com/~pavelmachek
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210206/070108c7/attachment.sig>

^ permalink raw reply	[flat|nested] 69+ messages in thread

* [RESEND PATCH 01/16] serial: usbtty: Fix puts function
  2021-02-05 19:11 ` [RESEND PATCH 01/16] serial: usbtty: Fix puts function Pali Rohár
@ 2021-02-06 13:49   ` Lukasz Majewski
  0 siblings, 0 replies; 69+ messages in thread
From: Lukasz Majewski @ 2021-02-06 13:49 UTC (permalink / raw)
  To: u-boot

On Fri,  5 Feb 2021 20:11:57 +0100
Pali Roh?r <pali@kernel.org> wrote:

> This function has incorrect implementation of prepending CR prior LF.
> Without this patch it prepended CR prior whole string which is going
> to be written and let LF without leading CR. Fix this issue by
> inserting CR at correct place to make output on usbtty serial console
> more readable.
> 
> Signed-off-by: Pali Roh?r <pali@kernel.org>
> ---
>  drivers/serial/usbtty.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/serial/usbtty.c b/drivers/serial/usbtty.c
> index f1c1a260da..02f8edf200 100644
> --- a/drivers/serial/usbtty.c
> +++ b/drivers/serial/usbtty.c
> @@ -500,8 +500,8 @@ void usbtty_puts(struct stdio_dev *dev, const
> char *str) n = next_nl_pos (str);
>  
>  		if (str[n] == '\n') {
> -			__usbtty_puts("\r", 1);
> -			__usbtty_puts(str, n + 1);
> +			__usbtty_puts(str, n);
> +			__usbtty_puts("\r\n", 2);
>  			str += (n + 1);
>  			len -= (n + 1);
>  		} else {

Reviewed-by: Lukasz Majewski <lukma@denx.de>


Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210206/7d73cab8/attachment.sig>

^ permalink raw reply	[flat|nested] 69+ messages in thread

* [RESEND PATCH 02/16] serial: usbtty: Send urb data in correct order
  2021-02-05 19:11 ` [RESEND PATCH 02/16] serial: usbtty: Send urb data in correct order Pali Rohár
@ 2021-02-06 13:56   ` Lukasz Majewski
  0 siblings, 0 replies; 69+ messages in thread
From: Lukasz Majewski @ 2021-02-06 13:56 UTC (permalink / raw)
  To: u-boot

On Fri,  5 Feb 2021 20:11:58 +0100
Pali Roh?r <pali@kernel.org> wrote:

> Function next_urb() selects the last urb data buffer from linked list
> to which next data from usbtty puts should be appended.
> 
> But to check if TX data still exists it is needed to look at the
> first urb data buffer from linked list. So check for endpoint->tx_urb
> (first from the linked list) instead of current_urb (the last from
> the linked list).
> 
> Successful call to udc_endpoint_write() may invalidate active urb and
> allocate new in queue which invalidate pointer returned by next_urb()
> function.
> 
> So call next_urb() prior putting data into urb buffer and call it
> every time after using udc_endpoint_write() function to prevent
> sending data from usbtty puts in incorrect order.
> 
> This patch fixes issue that usbtty code does not transmit data when
> they are waiting in the tx queue.

Reviewed-by: Lukasz Majewski <lukma@denx.de>

> 
> Signed-off-by: Pali Roh?r <pali@kernel.org>
> ---
>  drivers/serial/usbtty.c | 12 +++---------
>  1 file changed, 3 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/serial/usbtty.c b/drivers/serial/usbtty.c
> index 02f8edf200..4f4eb02de0 100644
> --- a/drivers/serial/usbtty.c
> +++ b/drivers/serial/usbtty.c
> @@ -849,17 +849,9 @@ static int write_buffer (circbuf_t * buf)
>  			&endpoint_instance[tx_endpoint];
>  	struct urb *current_urb = NULL;
>  
> -	current_urb = next_urb (device_instance, endpoint);
> -
> -	if (!current_urb) {
> -		TTYERR ("current_urb is NULL, buf->size %d\n",
> -		buf->size);
> -		return 0;
> -	}
> -
>  	/* TX data still exists - send it now
>  	 */
> -	if(endpoint->sent < current_urb->actual_length){
> +	if(endpoint->sent < endpoint->tx_urb->actual_length){
>  		if(udc_endpoint_write (endpoint)){
>  			/* Write pre-empted by RX */
>  			return -1;
> @@ -878,6 +870,8 @@ static int write_buffer (circbuf_t * buf)
>  		 */
>  		while (buf->size > 0) {
>  
> +			current_urb = next_urb (device_instance,
> endpoint); +
>  			dest = (char*)current_urb->buffer +
>  				current_urb->actual_length;
>  




Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210206/bd0ad962/attachment.sig>

^ permalink raw reply	[flat|nested] 69+ messages in thread

* [RESEND PATCH 03/16] usb: musb: Fix compilation of gadget code
  2021-02-05 19:11 ` [RESEND PATCH 03/16] usb: musb: Fix compilation of gadget code Pali Rohár
@ 2021-02-06 13:57   ` Lukasz Majewski
  0 siblings, 0 replies; 69+ messages in thread
From: Lukasz Majewski @ 2021-02-06 13:57 UTC (permalink / raw)
  To: u-boot

On Fri,  5 Feb 2021 20:11:59 +0100
Pali Roh?r <pali@kernel.org> wrote:

> musb udc code depends on usb gadget code provided by
> CONFIG_USB_DEVICE and defined in drivers/usb/gadget/Makefile. But
> this Makefile is not included into U-Boot build when
> CONFIG_USB_GADGET is not set. As CONFIG_USB_DEVICE cannot be enabled
> together with CONFIG_USB_GADGET it means that dependency for musb udc
> code is not compiled during build. Fix it by including
> drivers/usb/gadget dependency also when CONFIG_USB_DEVICE is set.
> 
> This patch fixes compile errors:
> 
> arm-linux-gnueabi-ld.bfd: drivers/usb/musb/built-in.o: in function
> `musb_peri_ep0_rx': u-boot/drivers/usb/musb/musb_udc.c: undefined
> reference to `ep0_recv_setup' arm-linux-gnueabi-ld.bfd:
> drivers/usb/musb/built-in.o: in function `musb_peri_ep0_idle':
> u-boot/drivers/usb/musb/musb_udc.c: undefined reference to
> `ep0_recv_setup' arm-linux-gnueabi-ld.bfd:
> drivers/usb/musb/built-in.o: in function
> `musb_peri_ep0_zero_data_request':
> u-boot/drivers/usb/musb/musb_udc.c: undefined reference to
> `usbd_device_event_irq' arm-linux-gnueabi-ld.bfd:
> drivers/usb/musb/built-in.o: in function `musb_peri_ep0_idle':
> u-boot/drivers/usb/musb/musb_udc.c: undefined reference to
> `ep0_recv_setup' arm-linux-gnueabi-ld.bfd:
> drivers/usb/musb/built-in.o: in function `musb_peri_ep0_rx':
> u-boot/drivers/usb/musb/musb_udc.c: undefined reference to
> `usbd_rcv_complete' arm-linux-gnueabi-ld.bfd:
> drivers/usb/musb/built-in.o: in function `musb_peri_rx_ep':
> u-boot/drivers/usb/musb/musb_udc.c: undefined reference to
> `usbd_rcv_complete' arm-linux-gnueabi-ld.bfd:
> drivers/usb/musb/built-in.o: in function `udc_endpoint_write':
> u-boot/drivers/usb/musb/musb_udc.c: undefined reference to
> `usbd_tx_complete' arm-linux-gnueabi-ld.bfd:
> drivers/usb/musb/built-in.o: in function `udc_irq':
> u-boot/drivers/usb/musb/musb_udc.c: undefined reference to
> `usbd_device_event_irq' arm-linux-gnueabi-ld.bfd:
> u-boot/drivers/usb/musb/musb_udc.c: undefined reference to
> `usbd_device_event_irq' arm-linux-gnueabi-ld.bfd:
> u-boot/drivers/usb/musb/musb_udc.c: undefined reference to
> `usbd_device_event_irq' arm-linux-gnueabi-ld.bfd:
> u-boot/drivers/usb/musb/musb_udc.c: undefined reference to
> `usbd_device_event_irq' arm-linux-gnueabi-ld.bfd:
> u-boot/drivers/usb/musb/musb_udc.c: undefined reference to
> `usbd_device_event_irq' arm-linux-gnueabi-ld.bfd:
> drivers/usb/musb/built-in.o:u-boot/drivers/usb/musb/musb_udc.c: more
> undefined references to `usbd_device_event_irq' follow
> arm-linux-gnueabi-ld.bfd: drivers/usb/musb/built-in.o: in function
> `udc_setup_ep': u-boot/drivers/usb/musb/musb_udc.c: undefined
> reference to `usbd_alloc_urb' arm-linux-gnueabi-ld.bfd:
> drivers/usb/musb/built-in.o: in function `udc_startup_events':
> u-boot/drivers/usb/musb/musb_udc.c: undefined reference to
> `usbd_device_event_irq' arm-linux-gnueabi-ld.bfd:
> u-boot/drivers/usb/musb/musb_udc.c: undefined reference to
> `usbd_device_event_irq' arm-linux-gnueabi-ld.bfd:
> u-boot/drivers/usb/musb/musb_udc.c: undefined reference to
> `usbd_device_event_irq' make: *** [Makefile:1762: u-boot] Error 1
> 

Reviewed-by: Lukasz Majewski <lukma@denx.de>

> Signed-off-by: Pali Roh?r <pali@kernel.org>
> ---
>  Makefile | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/Makefile b/Makefile
> index 23dd11f723..2173344497 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -792,6 +792,7 @@ libs-y += drivers/usb/dwc3/
>  libs-y += drivers/usb/common/
>  libs-y += drivers/usb/emul/
>  libs-y += drivers/usb/eth/
> +libs-$(CONFIG_USB_DEVICE) += drivers/usb/gadget/
>  libs-$(CONFIG_USB_GADGET) += drivers/usb/gadget/
>  libs-$(CONFIG_USB_GADGET) += drivers/usb/gadget/udc/
>  libs-y += drivers/usb/host/




Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210206/2c008037/attachment.sig>

^ permalink raw reply	[flat|nested] 69+ messages in thread

* [RESEND PATCH 04/16] usb: musb: Always clear the data toggle bit when configuring ep
  2021-02-05 19:12 ` [RESEND PATCH 04/16] usb: musb: Always clear the data toggle bit when configuring ep Pali Rohár
@ 2021-02-06 13:58   ` Lukasz Majewski
  0 siblings, 0 replies; 69+ messages in thread
From: Lukasz Majewski @ 2021-02-06 13:58 UTC (permalink / raw)
  To: u-boot

On Fri,  5 Feb 2021 20:12:00 +0100
Pali Roh?r <pali@kernel.org> wrote:

> Without this patch it was done only when U-Boot was compiled with
> MUSB Host Controller. But it is needed also for MUSB Device
> Controller, otherwise Device Controller does not work.
> 

Reviewed-by: Lukasz Majewski <lukma@denx.de>

> Signed-off-by: Pali Roh?r <pali@kernel.org>
> ---
>  drivers/usb/musb/musb_core.c | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/drivers/usb/musb/musb_core.c
> b/drivers/usb/musb/musb_core.c index 147b2eb929..cc6dc3839d 100644
> --- a/drivers/usb/musb/musb_core.c
> +++ b/drivers/usb/musb/musb_core.c
> @@ -81,10 +81,8 @@ void musb_configure_ep(const struct musb_epinfo
> *epinfo, u8 cnt) config_fifo(tx, idx, fifoaddr);
>  
>  			csr = readw(&musbr->txcsr);
> -#if defined(CONFIG_USB_MUSB_HCD)
>  			/* clear the data toggle bit */
>  			writew(csr | MUSB_TXCSR_CLRDATATOG,
> &musbr->txcsr); -#endif
>  			/* Flush fifo if required */
>  			if (csr & MUSB_TXCSR_TXPKTRDY)
>  				writew(csr | MUSB_TXCSR_FLUSHFIFO,
> @@ -94,10 +92,8 @@ void musb_configure_ep(const struct musb_epinfo
> *epinfo, u8 cnt) config_fifo(rx, idx, fifoaddr);
>  
>  			csr = readw(&musbr->rxcsr);
> -#if defined(CONFIG_USB_MUSB_HCD)
>  			/* clear the data toggle bit */
>  			writew(csr | MUSB_RXCSR_CLRDATATOG,
> &musbr->rxcsr); -#endif
>  			/* Flush fifo if required */
>  			if (csr & MUSB_RXCSR_RXPKTRDY)
>  				writew(csr | MUSB_RXCSR_FLUSHFIFO,




Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210206/f1c2c9e6/attachment.sig>

^ permalink raw reply	[flat|nested] 69+ messages in thread

* [RESEND PATCH 05/16] usb: musb: Fix configuring FIFO for endpoints
  2021-02-05 19:12 ` [RESEND PATCH 05/16] usb: musb: Fix configuring FIFO for endpoints Pali Rohár
  2021-02-06  8:58   ` Pavel Machek
@ 2021-02-06 14:01   ` Lukasz Majewski
  1 sibling, 0 replies; 69+ messages in thread
From: Lukasz Majewski @ 2021-02-06 14:01 UTC (permalink / raw)
  To: u-boot

On Fri,  5 Feb 2021 20:12:01 +0100
Pali Roh?r <pali@kernel.org> wrote:

> This patch fixes configuring FIFO for one-directional endpoints which
> have either RX or TX queue and therefore only one FIFO.
> 
> Size of FIFO buffer is 2^(idx+3) bytes and starting address is
> 2^(addr+3). Moreover first 64 bytes are reserved for EP0.
> 
> Without this patch if FIFO size specified by caller was zero then idx
> was incorrectly calculated (expr. ffs(0)-1) and size overflowed in
> fifosz register. This register uses has only 4 bits for FIFO size.
> Moreover specifying zero size is not possible.
> 
> This patch is fixing calculation of start address and buffer size to
> minimal value and ensure that it would not overlap with reserved EP0
> buffer.
> 
> This issue caused loose of packets on USB bus in both directions and
> basically usbtty was unusable.
> 

Reviewed-by: Lukasz Majewski <lukma@denx.de>

> Signed-off-by: Pali Roh?r <pali@kernel.org>
> 
> ---
> Changes in v2:
> * Correctly calculate minimal buffer size
> * Store into fifoaddr address in musb units (8 bytes)
> ---
>  drivers/usb/musb/musb_core.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/usb/musb/musb_core.c
> b/drivers/usb/musb/musb_core.c index cc6dc3839d..9651f074a4 100644
> --- a/drivers/usb/musb/musb_core.c
> +++ b/drivers/usb/musb/musb_core.c
> @@ -50,7 +50,7 @@ void musb_start(void)
>  # define config_fifo(dir, idx, addr) \
>  	do { \
>  		writeb(idx, &musbr->dir##fifosz); \
> -		writew(fifoaddr >> 3, &musbr->dir##fifoadd); \
> +		writew(addr, &musbr->dir##fifoadd); \
>  	} while (0)
>  #endif
>  
> @@ -66,14 +66,14 @@ void musb_start(void)
>  void musb_configure_ep(const struct musb_epinfo *epinfo, u8 cnt)
>  {
>  	u16 csr;
> -	u16 fifoaddr = 64; /* First 64 bytes of FIFO reserved for
> EP0 */
> +	u16 fifoaddr = 64 >> 3; /* First 64 bytes of FIFO reserved
> for EP0 */ u32 fifosize;
>  	u8  idx;
>  
>  	while (cnt--) {
>  		/* prepare fifosize to write to register */
>  		fifosize = epinfo->epsize >> 3;
> -		idx = ffs(fifosize) - 1;
> +		idx = fifosize ? ((ffs(fifosize) - 1) & 0xF) : 0;
>  
>  		writeb(epinfo->epnum, &musbr->index);
>  		if (epinfo->epdir) {
> @@ -99,7 +99,7 @@ void musb_configure_ep(const struct musb_epinfo
> *epinfo, u8 cnt) writew(csr | MUSB_RXCSR_FLUSHFIFO,
>  					&musbr->rxcsr);
>  		}
> -		fifoaddr += epinfo->epsize;
> +		fifoaddr += 1 << idx;
>  		epinfo++;
>  	}
>  }




Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210206/d5717ab3/attachment.sig>

^ permalink raw reply	[flat|nested] 69+ messages in thread

* [RESEND PATCH 06/16] usb: musb: Read value of PERI_RXCSR to 16bit variable
  2021-02-05 19:12 ` [RESEND PATCH 06/16] usb: musb: Read value of PERI_RXCSR to 16bit variable Pali Rohár
@ 2021-02-06 14:01   ` Lukasz Majewski
  0 siblings, 0 replies; 69+ messages in thread
From: Lukasz Majewski @ 2021-02-06 14:01 UTC (permalink / raw)
  To: u-boot

On Fri,  5 Feb 2021 20:12:02 +0100
Pali Roh?r <pali@kernel.org> wrote:

> PERI_RXCSR is 16bit register so store its value into 16bit local
> variable.
> 
> Signed-off-by: Pali Roh?r <pali@kernel.org>
> ---
>  drivers/usb/musb/musb_udc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/musb/musb_udc.c b/drivers/usb/musb/musb_udc.c
> index d901f8777c..67d1c56f9a 100644
> --- a/drivers/usb/musb/musb_udc.c
> +++ b/drivers/usb/musb/musb_udc.c
> @@ -629,7 +629,7 @@ static void musb_peri_ep0(void)
>  static void musb_peri_rx_ep(unsigned int ep)
>  {
>  	u16 peri_rxcount;
> -	u8 peri_rxcsr = readw(&musbr->ep[ep].epN.rxcsr);
> +	u16 peri_rxcsr = readw(&musbr->ep[ep].epN.rxcsr);
>  
>  	if (!(peri_rxcsr & MUSB_RXCSR_RXPKTRDY)) {
>  		if (debug_level > 0)

Reviewed-by: Lukasz Majewski <lukma@denx.de>


Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210206/195bfb06/attachment.sig>

^ permalink raw reply	[flat|nested] 69+ messages in thread

* [RESEND PATCH 07/16] usb: musb: Fix transmission of bigger buffers
  2021-02-05 19:12 ` [RESEND PATCH 07/16] usb: musb: Fix transmission of bigger buffers Pali Rohár
@ 2021-02-06 14:07   ` Lukasz Majewski
  0 siblings, 0 replies; 69+ messages in thread
From: Lukasz Majewski @ 2021-02-06 14:07 UTC (permalink / raw)
  To: u-boot

On Fri,  5 Feb 2021 20:12:03 +0100
Pali Roh?r <pali@kernel.org> wrote:

> If udc_endpoint_write() was called with bigger payload which does not
> fit into one USB packet it needs to be transmitted in more USB
> packets. First packet is transmitted by udc_endpoint_write() call
> itself and other packets are put into waiting queue.
> 
> Implement function musb_peri_tx() which transmit checks when
> endpoints are ready and continue transmitting of waiting queue.
> 
> This patch fixes sending e.g. output of printenv command over usbtty
> serial console.

Reviewed-by: Lukasz Majewski <lukma@denx.de>

> 
> Signed-off-by: Pali Roh?r <pali@kernel.org>
> ---
>  drivers/usb/musb/musb_udc.c | 17 ++++++-----------
>  1 file changed, 6 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/usb/musb/musb_udc.c b/drivers/usb/musb/musb_udc.c
> index 67d1c56f9a..28719cc3f6 100644
> --- a/drivers/usb/musb/musb_udc.c
> +++ b/drivers/usb/musb/musb_udc.c
> @@ -708,21 +708,16 @@ static void musb_peri_rx(u16 intr)
>  
>  static void musb_peri_tx(u16 intr)
>  {
> +	unsigned int ep;
> +
>  	/* Check for EP0 */
>  	if (0x01 & intr)
>  		musb_peri_ep0_tx();
>  
> -	/*
> -	 * Use this in the future when handling epN tx
> -	 *
> -	 * u8 ep;
> -	 *
> -	 * for (ep = 1; ep < 16; ep++) {
> -	 *	if ((1 << ep) & intr) {
> -	 *		/ * handle tx for this endpoint * /
> -	 *	}
> -	 * }
> -	 */
> +	for (ep = 1; ep < 16; ep++) {
> +		if ((1 << ep) & intr)
> +			udc_endpoint_write(GET_ENDPOINT(udc_device,
> ep));
> +	}
>  }
>  
>  void udc_irq(void)




Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210206/9a198c6f/attachment.sig>

^ permalink raw reply	[flat|nested] 69+ messages in thread

* [RESEND PATCH 08/16] usb: musb: Fix receiving of bigger buffers
  2021-02-05 19:12 ` [RESEND PATCH 08/16] usb: musb: Fix receiving " Pali Rohár
@ 2021-02-06 14:15   ` Lukasz Majewski
  0 siblings, 0 replies; 69+ messages in thread
From: Lukasz Majewski @ 2021-02-06 14:15 UTC (permalink / raw)
  To: u-boot

On Fri,  5 Feb 2021 20:12:04 +0100
Pali Roh?r <pali@kernel.org> wrote:

> If musb_peri_rx_ep() was called to processed received HW buffer but
> U-Boot cannot read it yet (e.g. because U-Boot SW buffer is full)
> then interrupt was marked as processed but HW buffer stayed
> unprocessed.
> 
> U-Boot tried to process this buffer again when it receive interrupt
> again, but it can receive it only when sender (host) send a new data.
> As sender (host) is not going to send a new data until U-Boot process
> current data this issue caused a deadlock in case sender (host) is
> emitting data faster than U-Boot can process it.
> 
> Reading musb intrrx register automatically clears this register and
> mark interrupt as processed. So to prevent marking interrupt in
> U-Boot as processed and a new variable pending_intrrx which would
> contain unprocessed bits of intrrx register.
> 
> And as a second step, every time when musb_peri_rx_ep() is called and
> there are waiting data to be processed (signaled by
> MUSB_RXCSR_RXPKTRDY) either acknowledge sender (via
> musb_peri_rx_ack()) that whole HW buffer was processed or set
> corresponding bit in pending_intrrx that HW buffer was not fully
> processed yet and next iteration is required after U-Boot allocate
> space for reading HW buffer.
> 
> This patch fixes receiving large usb buffers, e.g. file transfer via
> Kermit protocol implemented by 'loadb' U-Boot command over usbtty
> serial console.

Reviewed-by: Lukasz Majewski <lukma@denx.de>

> 
> Signed-off-by: Pali Roh?r <pali@kernel.org>
> ---
>  drivers/usb/musb/musb_udc.c | 16 +++++++++++++++-
>  1 file changed, 15 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/musb/musb_udc.c b/drivers/usb/musb/musb_udc.c
> index 28719cc3f6..7c74422623 100644
> --- a/drivers/usb/musb/musb_udc.c
> +++ b/drivers/usb/musb/musb_udc.c
> @@ -104,6 +104,8 @@ struct usb_endpoint_instance *ep0_endpoint;
>  static struct usb_device_instance *udc_device;
>  static int enabled;
>  
> +u16 pending_intrrx;
> +
>  #ifdef MUSB_DEBUG
>  static void musb_db_regs(void)
>  {
> @@ -664,7 +666,10 @@ static void musb_peri_rx_ep(unsigned int ep)
>  				/* The common musb fifo reader */
>  				read_fifo(ep, length, data);
>  
> -				musb_peri_rx_ack(ep);
> +				if (length == peri_rxcount)
> +					musb_peri_rx_ack(ep);
> +				else
> +					pending_intrrx |= (1 << ep);
>  
>  				/*
>  				 * urb's actual_length is updated in
> @@ -677,18 +682,24 @@ static void musb_peri_rx_ep(unsigned int ep)
>  					serial_printf("ERROR : %s %d
> no space " "in rcv buffer\n",
>  						      __PRETTY_FUNCTION__,
> ep); +
> +				pending_intrrx |= (1 << ep);
>  			}
>  		} else {
>  			if (debug_level > 0)
>  				serial_printf("ERROR : %s %d problem
> with " "endpoint\n",
>  					      __PRETTY_FUNCTION__,
> ep); +
> +			pending_intrrx |= (1 << ep);
>  		}
>  
>  	} else {
>  		if (debug_level > 0)
>  			serial_printf("ERROR : %s %d with nothing to
> do\n", __PRETTY_FUNCTION__, ep);
> +
> +		musb_peri_rx_ack(ep);
>  	}
>  }
>  
> @@ -770,6 +781,9 @@ void udc_irq(void)
>  			intrrx = readw(&musbr->intrrx);
>  			intrtx = readw(&musbr->intrtx);
>  
> +			intrrx |= pending_intrrx;
> +			pending_intrrx = 0;
> +
>  			if (intrrx)
>  				musb_peri_rx(intrrx);
>  




Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210206/21a623c9/attachment.sig>

^ permalink raw reply	[flat|nested] 69+ messages in thread

* [RESEND PATCH 09/16] usb: musb: Fix handling interrupts for EP0 and SET ADDRESS commmand
  2021-02-05 19:12 ` [RESEND PATCH 09/16] usb: musb: Fix handling interrupts for EP0 and SET ADDRESS commmand Pali Rohár
@ 2021-02-06 14:17   ` Lukasz Majewski
  0 siblings, 0 replies; 69+ messages in thread
From: Lukasz Majewski @ 2021-02-06 14:17 UTC (permalink / raw)
  To: u-boot

On Fri,  5 Feb 2021 20:12:05 +0100
Pali Roh?r <pali@kernel.org> wrote:

> Interrupt for EP0 is indicated in intrtx register via first bit. It
> is set for both RX and TX. First bit in intrrx register is reserved
> and not set.
> 
> So remove calling musb_peri_ep0() function at every iteration of
> udc_irq() and musb_peri_rx() and call it only from musb_peri_tx()
> when correct interrupt bit in initrtx it set.
> 
> Address from SET ADDRESS command must be set to faddr register only
> after acknowledging SERV_RXPKTRDY followed by received EP0 interrupt.
> So prior calling musb_peri_ep0_set_address() check for EP0 interrupt
> instead of (incorrect) MUSB_INTR_SOF interrupt.
> 
> This patch fixes issue that host (computer) cannot register U-Boot USB
> device and failing with errors:
> 
>     usb 1-1: new full-speed USB device number 86 using xhci_hcd
>     usb 1-1: Device not responding to setup address.
>     usb 1-1: Device not responding to setup address.
>     usb 1-1: device not accepting address 86, error -71
> 
> U-Boot was writing address to faddr register too early and did not
> wait for correct interrupt after which should update address.
> 


Reviewed-by: Lukasz Majewski <lukma@denx.de>

> Signed-off-by: Pali Roh?r <pali@kernel.org>
> ---
>  drivers/usb/musb/musb_udc.c | 12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/usb/musb/musb_udc.c b/drivers/usb/musb/musb_udc.c
> index 7c74422623..50d8bc319c 100644
> --- a/drivers/usb/musb/musb_udc.c
> +++ b/drivers/usb/musb/musb_udc.c
> @@ -707,9 +707,7 @@ static void musb_peri_rx(u16 intr)
>  {
>  	unsigned int ep;
>  
> -	/* Check for EP0 */
> -	if (0x01 & intr)
> -		musb_peri_ep0();
> +	/* First bit is reserved and does not indicate interrupt for
> EP0 */ 
>  	for (ep = 1; ep < 16; ep++) {
>  		if ((1 << ep) & intr)
> @@ -721,9 +719,9 @@ static void musb_peri_tx(u16 intr)
>  {
>  	unsigned int ep;
>  
> -	/* Check for EP0 */
> +	/* Check for EP0: first bit indicates interrupt for both RX
> and TX */ if (0x01 & intr)
> -		musb_peri_ep0_tx();
> +		musb_peri_ep0();
>  
>  	for (ep = 1; ep < 16; ep++) {
>  		if ((1 << ep) & intr)
> @@ -750,8 +748,6 @@ void udc_irq(void)
>  			musb_peri_resume();
>  		}
>  
> -		musb_peri_ep0();
> -
>  		if (MUSB_INTR_RESET & intrusb) {
>  			usbd_device_event_irq(udc_device,
> DEVICE_RESET, 0); musb_peri_reset();
> @@ -790,7 +786,7 @@ void udc_irq(void)
>  			if (intrtx)
>  				musb_peri_tx(intrtx);
>  		} else {
> -			if (MUSB_INTR_SOF & intrusb) {
> +			if (readw(&musbr->intrtx) & 0x1) {
>  				u8 faddr;
>  				faddr = readb(&musbr->faddr);
>  				/*




Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210206/861e8cfa/attachment.sig>

^ permalink raw reply	[flat|nested] 69+ messages in thread

* [RESEND PATCH 10/16] usb: musb: Ensure that we set musb dynamic FIFO buffer for every endpoint
  2021-02-05 19:12 ` [RESEND PATCH 10/16] usb: musb: Ensure that we set musb dynamic FIFO buffer for every endpoint Pali Rohár
  2021-02-06  9:04   ` Pavel Machek
@ 2021-02-06 15:18   ` Lukasz Majewski
  1 sibling, 0 replies; 69+ messages in thread
From: Lukasz Majewski @ 2021-02-06 15:18 UTC (permalink / raw)
  To: u-boot

On Fri,  5 Feb 2021 20:12:06 +0100
Pali Roh?r <pali@kernel.org> wrote:

> If we do not set FIFO buffer address and size for some endpoint which
> is in use then default address 0x0 would be used which is in conflict
> with FIFO buffer for endpoint 0 which is at fixed address 0x0.
> Sharing address space between more endpoint cause data loss and
> unexpected errors.
> 
> This patch is fixing transmission of characters over usbtty serial
> console and allow using of usbtty for debugging purposes on Nokia
> N900.

Reviewed-by: Lukasz Majewski <lukma@denx.de>

> 
> Signed-off-by: Pali Roh?r <pali@kernel.org>
> ---
>  drivers/usb/musb/musb_udc.c | 14 ++------------
>  1 file changed, 2 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/usb/musb/musb_udc.c b/drivers/usb/musb/musb_udc.c
> index 50d8bc319c..ea1284850e 100644
> --- a/drivers/usb/musb/musb_udc.c
> +++ b/drivers/usb/musb/musb_udc.c
> @@ -875,18 +875,8 @@ void udc_setup_ep(struct usb_device_instance
> *device, unsigned int id, ep0_endpoint->endpoint_address = 0xff;
>  		ep0_urb = usbd_alloc_urb(device, endpoint);
>  	} else if (MAX_ENDPOINT >= id) {
> -		int ep_addr;
> -
> -		/* Check the direction */
> -		ep_addr = endpoint->endpoint_address;
> -		if (USB_DIR_IN == (ep_addr & USB_ENDPOINT_DIR_MASK))
> {
> -			/* IN */
> -			epinfo[(id * 2) + 1].epsize =
> endpoint->tx_packetSize;
> -		} else {
> -			/* OUT */
> -			epinfo[id * 2].epsize =
> endpoint->rcv_packetSize;
> -		}
> -
> +		epinfo[(id * 2) + 0].epsize =
> endpoint->rcv_packetSize;
> +		epinfo[(id * 2) + 1].epsize =
> endpoint->tx_packetSize; musb_configure_ep(&epinfo[0],
> ARRAY_SIZE(epinfo)); } else {
>  		if (debug_level > 0)




Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210206/27ac89da/attachment.sig>

^ permalink raw reply	[flat|nested] 69+ messages in thread

* [RESEND PATCH 11/16] usb: gadget: Use dbg_ep0() macro instead of serial_printf()
  2021-02-05 19:12 ` [RESEND PATCH 11/16] usb: gadget: Use dbg_ep0() macro instead of serial_printf() Pali Rohár
@ 2021-02-06 15:19   ` Lukasz Majewski
  0 siblings, 0 replies; 69+ messages in thread
From: Lukasz Majewski @ 2021-02-06 15:19 UTC (permalink / raw)
  To: u-boot

On Fri,  5 Feb 2021 20:12:07 +0100
Pali Roh?r <pali@kernel.org> wrote:

> All debug messages from ep0.c except a few are printed by dbg_ep0()
> macro. So for remaining few exception use also dbg_ep0() instead of
> serial_printf().

Reviewed-by: Lukasz Majewski <lukma@denx.de>

> 
> Signed-off-by: Pali Roh?r <pali@kernel.org>
> ---
>  drivers/usb/gadget/ep0.c | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/usb/gadget/ep0.c b/drivers/usb/gadget/ep0.c
> index 457679f0a4..6624f61b76 100644
> --- a/drivers/usb/gadget/ep0.c
> +++ b/drivers/usb/gadget/ep0.c
> @@ -294,7 +294,7 @@ static int ep0_get_descriptor (struct
> usb_device_instance *device, {
>  			struct usb_string_descriptor
> *string_descriptor; if (!(string_descriptor = usbd_get_string
> (index))) {
> -				serial_printf("Invalid string index
> %d\n", index);
> +				dbg_ep0(0, "Invalid string index
> %d\n", index); return -1;
>  			}
>  			dbg_ep0(3, "string_descriptor: %p length
> %d", string_descriptor, string_descriptor->bLength); @@ -302,14
> +302,14 @@ static int ep0_get_descriptor (struct usb_device_instance
> *device, } break;
>  	case USB_DESCRIPTOR_TYPE_INTERFACE:
> -	serial_printf("USB_DESCRIPTOR_TYPE_INTERFACE - error not
> implemented\n");
> +		dbg_ep0(2, "USB_DESCRIPTOR_TYPE_INTERFACE - error
> not implemented\n"); return -1;
>  	case USB_DESCRIPTOR_TYPE_ENDPOINT:
> -		serial_printf("USB_DESCRIPTOR_TYPE_ENDPOINT - error
> not implemented\n");
> +		dbg_ep0(2, "USB_DESCRIPTOR_TYPE_ENDPOINT - error not
> implemented\n"); return -1;
>  	case USB_DESCRIPTOR_TYPE_HID:
>  		{
> -			serial_printf("USB_DESCRIPTOR_TYPE_HID -
> error not implemented\n");
> +			dbg_ep0(2, "USB_DESCRIPTOR_TYPE_HID - error
> not implemented\n"); return -1;	/* unsupported at this time */
>  #if 0
>  			int bNumInterface =
> @@ -338,7 +338,7 @@ static int ep0_get_descriptor (struct
> usb_device_instance *device, break;
>  	case USB_DESCRIPTOR_TYPE_REPORT:
>  		{
> -			serial_printf("USB_DESCRIPTOR_TYPE_REPORT -
> error not implemented\n");
> +			dbg_ep0(2, "USB_DESCRIPTOR_TYPE_REPORT -
> error not implemented\n"); return -1;	/* unsupported at this
> time */ #if 0
>  			int bNumInterface =
> @@ -531,7 +531,7 @@ int ep0_recv_setup (struct urb *urb)
>  						   le16_to_cpu
> (request->wValue) & 0xff); 
>  		case USB_REQ_GET_CONFIGURATION:
> -			serial_printf("get config %d\n",
> device->configuration);
> +			dbg_ep0(2, "get config %d\n",
> device->configuration); return ep0_get_one (device, urb,
>  					    device->configuration);
>  
> @@ -621,14 +621,14 @@ int ep0_recv_setup (struct urb *urb)
>  			device->interface = device->alternate = 0;
>  
>  			/*dbg_ep0(2, "set configuration: %d",
> device->configuration); */
> -			/*serial_printf("DEVICE_CONFIGURED..
> event?\n"); */
> +			/*dbg_ep0(2, "DEVICE_CONFIGURED..
> event?\n"); */ return 0;
>  
>  		case USB_REQ_SET_INTERFACE:
>  			device->interface = le16_to_cpu
> (request->wIndex); device->alternate = le16_to_cpu (request->wValue);
>  			/*dbg_ep0(2, "set interface: %d alternate:
> %d", device->interface, device->alternate); */
> -			serial_printf("DEVICE_SET_INTERFACE..
> event?\n");
> +			dbg_ep0(2, "DEVICE_SET_INTERFACE..
> event?\n"); return 0;
>  
>  		case USB_REQ_GET_STATUS:




Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210206/665389e2/attachment.sig>

^ permalink raw reply	[flat|nested] 69+ messages in thread

* [RESEND PATCH 12/16] arm: omap3: Compile lowlevel_init() function only when it is used
  2021-02-05 19:12 ` [RESEND PATCH 12/16] arm: omap3: Compile lowlevel_init() function only when it is used Pali Rohár
@ 2021-02-06 15:21   ` Lukasz Majewski
  2021-02-06 15:40   ` Marek Vasut
  1 sibling, 0 replies; 69+ messages in thread
From: Lukasz Majewski @ 2021-02-06 15:21 UTC (permalink / raw)
  To: u-boot

On Fri,  5 Feb 2021 20:12:08 +0100
Pali Roh?r <pali@kernel.org> wrote:

> Function lowlevel_init() is called only from cpu_init_crit() and this
> function is wrapped into #if .. #endif section. So compile also
> lowlevel_init() function under same #if condition.
> 
> Signed-off-by: Pali Roh?r <pali@kernel.org>
> ---
>  arch/arm/mach-omap2/omap3/lowlevel_init.S | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mach-omap2/omap3/lowlevel_init.S
> b/arch/arm/mach-omap2/omap3/lowlevel_init.S index
> 2a05b5e521..4fa89418a1 100644 ---
> a/arch/arm/mach-omap2/omap3/lowlevel_init.S +++
> b/arch/arm/mach-omap2/omap3/lowlevel_init.S @@ -45,7 +45,7 @@
> ENDPROC(do_omap3_emu_romcode_call) ENTRY(cpy_clk_code)
>  	/* Copy DPLL code into SRAM */
>  	adr	r0, go_to_speed		/* copy from start
> of go_to_speed... */
> -	adr	r2, lowlevel_init	/* ... up to start of
> low_level_init */
> +	adr	r2, go_to_speed_end	/* ... up to start of
> go_to_speed_end */ next2:
>  	ldmia	r0!, {r3 - r10}		/* copy from
> source address [r0] */ stmia	r1!, {r3 - r10}		/*
> copy to   target address [r1] */ @@ -167,8 +167,11 @@ pll_div_add5:
>  pll_div_val5:
>  	.word CLSEL1_EMU_VAL
>  
> +go_to_speed_end:
>  #endif
>  
> +#if !defined(CONFIG_SKIP_LOWLEVEL_INIT) && \
> +	!defined(CONFIG_SKIP_LOWLEVEL_INIT_ONLY)
>  ENTRY(lowlevel_init)
>  	ldr	sp, SRAM_STACK
>  	str	ip, [sp]	/* stash ip register */
> @@ -187,6 +190,7 @@ ENTRY(lowlevel_init)
>  	b	s_init
>  
>  ENDPROC(lowlevel_init)
> +#endif
>  
>  	/* the literal pools origin */
>  	.ltorg

Reviewed-by: Lukasz Majewski <lukma@denx.de>


Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210206/370935b0/attachment.sig>

^ permalink raw reply	[flat|nested] 69+ messages in thread

* [RESEND PATCH 13/16] arm: omap3: Compile s_init() function only when it is used
  2021-02-05 19:12 ` [RESEND PATCH 13/16] arm: omap3: Compile s_init() " Pali Rohár
@ 2021-02-06 15:21   ` Lukasz Majewski
  0 siblings, 0 replies; 69+ messages in thread
From: Lukasz Majewski @ 2021-02-06 15:21 UTC (permalink / raw)
  To: u-boot

On Fri,  5 Feb 2021 20:12:09 +0100
Pali Roh?r <pali@kernel.org> wrote:

> Function s_init() is called only from lowlevel_init(). So compile it
> only when function lowlevel_init() is compiled.
> 

Reviewed-by: Lukasz Majewski <lukma@denx.de>

> Signed-off-by: Pali Roh?r <pali@kernel.org>
> ---
>  arch/arm/mach-omap2/omap3/board.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/arch/arm/mach-omap2/omap3/board.c
> b/arch/arm/mach-omap2/omap3/board.c index 4da8df47cc..029bd54595
> 100644 --- a/arch/arm/mach-omap2/omap3/board.c
> +++ b/arch/arm/mach-omap2/omap3/board.c
> @@ -179,6 +179,8 @@ void early_system_init(void)
>  	hw_data_init();
>  }
>  
> +#if !defined(CONFIG_SKIP_LOWLEVEL_INIT) && \
> +	!defined(CONFIG_SKIP_LOWLEVEL_INIT_ONLY)
>  /******************************************************************************
>   * Routine: s_init
>   * Description: Does early system init of muxing and clocks.
> @@ -207,6 +209,7 @@ void s_init(void)
>  	ehci_clocks_enable();
>  #endif
>  }
> +#endif
>  
>  #ifdef CONFIG_SPL_BUILD
>  void board_init_f(ulong dummy)




Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210206/1fe6ab6b/attachment.sig>

^ permalink raw reply	[flat|nested] 69+ messages in thread

* [RESEND PATCH 14/16] Nokia RX-51: Remove function set_muxconf_regs()
  2021-02-05 19:12 ` [RESEND PATCH 14/16] Nokia RX-51: Remove function set_muxconf_regs() Pali Rohár
@ 2021-02-06 15:22   ` Lukasz Majewski
  0 siblings, 0 replies; 69+ messages in thread
From: Lukasz Majewski @ 2021-02-06 15:22 UTC (permalink / raw)
  To: u-boot

On Fri,  5 Feb 2021 20:12:10 +0100
Pali Roh?r <pali@kernel.org> wrote:

> This function is not used and was never called.
> 
> This board contains '#define CONFIG_SKIP_LOWLEVEL_INIT' because
> X-Loader set everything up, including MUX configuration.
> 
> Also this MUX configuration is incorrect and does not match hardware.
> 
> So remove this dead, unused and broken code.
> 
> This change will decrease size of U-Boot binary.
> 
> Signed-off-by: Pali Roh?r <pali@kernel.org>
> ---
>  board/nokia/rx51/rx51.c |  11 --
>  board/nokia/rx51/rx51.h | 346
> ---------------------------------------- 2 files changed, 357
> deletions(-)
> 
> diff --git a/board/nokia/rx51/rx51.c b/board/nokia/rx51/rx51.c
> index 84739ae129..cb72ffaaa9 100644
> --- a/board/nokia/rx51/rx51.c
> +++ b/board/nokia/rx51/rx51.c
> @@ -467,17 +467,6 @@ int misc_init_r(void)
>  	return 0;
>  }
>  
> -/*
> - * Routine: set_muxconf_regs
> - * Description: Setting up the configuration Mux registers specific
> to the
> - *		hardware. Many pins need to be moved from protect
> to primary
> - *		mode.
> - */
> -void set_muxconf_regs(void)
> -{
> -	MUX_RX51();
> -}
> -
>  static unsigned long int twl_wd_time; /* last time of watchdog reset
> */ static unsigned long int twl_i2c_lock;
>  
> diff --git a/board/nokia/rx51/rx51.h b/board/nokia/rx51/rx51.h
> index 4eff823a1b..0eddb06219 100644
> --- a/board/nokia/rx51/rx51.h
> +++ b/board/nokia/rx51/rx51.h
> @@ -21,352 +21,6 @@ struct emu_hal_params_rx51 {
>  	u32 param4;
>  };
>  
> -/*
> - * IEN  - Input Enable
> - * IDIS - Input Disable
> - * PTD  - Pull type Down
> - * PTU  - Pull type Up
> - * DIS  - Pull type selection is inactive
> - * EN   - Pull type selection is active
> - * M0   - Mode 0
> - * The commented string gives the final mux configuration for that
> pin
> - */
> -#define MUX_RX51() \
> -/* SDRC */\
> -	MUX_VAL(CP(SDRC_D0),		(IEN  | PTD | DIS | M0))
> /*SDRC_D0*/\
> -	MUX_VAL(CP(SDRC_D1),		(IEN  | PTD | DIS | M0))
> /*SDRC_D1*/\
> -	MUX_VAL(CP(SDRC_D2),		(IEN  | PTD | DIS | M0))
> /*SDRC_D2*/\
> -	MUX_VAL(CP(SDRC_D3),		(IEN  | PTD | DIS | M0))
> /*SDRC_D3*/\
> -	MUX_VAL(CP(SDRC_D4),		(IEN  | PTD | DIS | M0))
> /*SDRC_D4*/\
> -	MUX_VAL(CP(SDRC_D5),		(IEN  | PTD | DIS | M0))
> /*SDRC_D5*/\
> -	MUX_VAL(CP(SDRC_D6),		(IEN  | PTD | DIS | M0))
> /*SDRC_D6*/\
> -	MUX_VAL(CP(SDRC_D7),		(IEN  | PTD | DIS | M0))
> /*SDRC_D7*/\
> -	MUX_VAL(CP(SDRC_D8),		(IEN  | PTD | DIS | M0))
> /*SDRC_D8*/\
> -	MUX_VAL(CP(SDRC_D9),		(IEN  | PTD | DIS | M0))
> /*SDRC_D9*/\
> -	MUX_VAL(CP(SDRC_D10),		(IEN  | PTD | DIS |
> M0)) /*SDRC_D10*/\
> -	MUX_VAL(CP(SDRC_D11),		(IEN  | PTD | DIS |
> M0)) /*SDRC_D11*/\
> -	MUX_VAL(CP(SDRC_D12),		(IEN  | PTD | DIS |
> M0)) /*SDRC_D12*/\
> -	MUX_VAL(CP(SDRC_D13),		(IEN  | PTD | DIS |
> M0)) /*SDRC_D13*/\
> -	MUX_VAL(CP(SDRC_D14),		(IEN  | PTD | DIS |
> M0)) /*SDRC_D14*/\
> -	MUX_VAL(CP(SDRC_D15),		(IEN  | PTD | DIS |
> M0)) /*SDRC_D15*/\
> -	MUX_VAL(CP(SDRC_D16),		(IEN  | PTD | DIS |
> M0)) /*SDRC_D16*/\
> -	MUX_VAL(CP(SDRC_D17),		(IEN  | PTD | DIS |
> M0)) /*SDRC_D17*/\
> -	MUX_VAL(CP(SDRC_D18),		(IEN  | PTD | DIS |
> M0)) /*SDRC_D18*/\
> -	MUX_VAL(CP(SDRC_D19),		(IEN  | PTD | DIS |
> M0)) /*SDRC_D19*/\
> -	MUX_VAL(CP(SDRC_D20),		(IEN  | PTD | DIS |
> M0)) /*SDRC_D20*/\
> -	MUX_VAL(CP(SDRC_D21),		(IEN  | PTD | DIS |
> M0)) /*SDRC_D21*/\
> -	MUX_VAL(CP(SDRC_D22),		(IEN  | PTD | DIS |
> M0)) /*SDRC_D22*/\
> -	MUX_VAL(CP(SDRC_D23),		(IEN  | PTD | DIS |
> M0)) /*SDRC_D23*/\
> -	MUX_VAL(CP(SDRC_D24),		(IEN  | PTD | DIS |
> M0)) /*SDRC_D24*/\
> -	MUX_VAL(CP(SDRC_D25),		(IEN  | PTD | DIS |
> M0)) /*SDRC_D25*/\
> -	MUX_VAL(CP(SDRC_D26),		(IEN  | PTD | DIS |
> M0)) /*SDRC_D26*/\
> -	MUX_VAL(CP(SDRC_D27),		(IEN  | PTD | DIS |
> M0)) /*SDRC_D27*/\
> -	MUX_VAL(CP(SDRC_D28),		(IEN  | PTD | DIS |
> M0)) /*SDRC_D28*/\
> -	MUX_VAL(CP(SDRC_D29),		(IEN  | PTD | DIS |
> M0)) /*SDRC_D29*/\
> -	MUX_VAL(CP(SDRC_D30),		(IEN  | PTD | DIS |
> M0)) /*SDRC_D30*/\
> -	MUX_VAL(CP(SDRC_D31),		(IEN  | PTD | DIS |
> M0)) /*SDRC_D31*/\
> -	MUX_VAL(CP(SDRC_CLK),		(IEN  | PTD | DIS |
> M0)) /*SDRC_CLK*/\
> -	MUX_VAL(CP(SDRC_DQS0),		(IEN  | PTD | DIS |
> M0)) /*SDRC_DQS0*/\
> -	MUX_VAL(CP(SDRC_DQS1),		(IEN  | PTD | DIS |
> M0)) /*SDRC_DQS1*/\
> -	MUX_VAL(CP(SDRC_DQS2),		(IEN  | PTD | DIS |
> M0)) /*SDRC_DQS2*/\
> -	MUX_VAL(CP(SDRC_DQS3),		(IEN  | PTD | DIS |
> M0)) /*SDRC_DQS3*/\ -/* GPMC */\
> -	MUX_VAL(CP(GPMC_A1),		(IDIS | PTD | DIS | M0))
> /*GPMC_A1*/\
> -	MUX_VAL(CP(GPMC_A2),		(IDIS | PTD | DIS | M0))
> /*GPMC_A2*/\
> -	MUX_VAL(CP(GPMC_A3),		(IDIS | PTD | DIS | M0))
> /*GPMC_A3*/\
> -	MUX_VAL(CP(GPMC_A4),		(IDIS | PTD | DIS | M0))
> /*GPMC_A4*/\
> -	MUX_VAL(CP(GPMC_A5),		(IDIS | PTD | DIS | M0))
> /*GPMC_A5*/\
> -	MUX_VAL(CP(GPMC_A6),		(IDIS | PTD | DIS | M0))
> /*GPMC_A6*/\
> -	MUX_VAL(CP(GPMC_A7),		(IDIS | PTD | DIS | M0))
> /*GPMC_A7*/\
> -	MUX_VAL(CP(GPMC_A8),		(IDIS | PTD | DIS | M0))
> /*GPMC_A8*/\
> -	MUX_VAL(CP(GPMC_A9),		(IDIS | PTD | DIS | M0))
> /*GPMC_A9*/\
> -	MUX_VAL(CP(GPMC_A10),		(IDIS | PTD | DIS |
> M0)) /*GPMC_A10*/\
> -	MUX_VAL(CP(GPMC_D0),		(IEN  | PTD | DIS | M0))
> /*GPMC_D0*/\
> -	MUX_VAL(CP(GPMC_D1),		(IEN  | PTD | DIS | M0))
> /*GPMC_D1*/\
> -	MUX_VAL(CP(GPMC_D2),		(IEN  | PTD | DIS | M0))
> /*GPMC_D2*/\
> -	MUX_VAL(CP(GPMC_D3),		(IEN  | PTD | DIS | M0))
> /*GPMC_D3*/\
> -	MUX_VAL(CP(GPMC_D4),		(IEN  | PTD | DIS | M0))
> /*GPMC_D4*/\
> -	MUX_VAL(CP(GPMC_D5),		(IEN  | PTD | DIS | M0))
> /*GPMC_D5*/\
> -	MUX_VAL(CP(GPMC_D6),		(IEN  | PTD | DIS | M0))
> /*GPMC_D6*/\
> -	MUX_VAL(CP(GPMC_D7),		(IEN  | PTD | DIS | M0))
> /*GPMC_D7*/\
> -	MUX_VAL(CP(GPMC_D8),		(IEN  | PTD | DIS | M0))
> /*GPMC_D8*/\
> -	MUX_VAL(CP(GPMC_D9),		(IEN  | PTD | DIS | M0))
> /*GPMC_D9*/\
> -	MUX_VAL(CP(GPMC_D10),		(IEN  | PTD | DIS |
> M0)) /*GPMC_D10*/\
> -	MUX_VAL(CP(GPMC_D11),		(IEN  | PTD | DIS |
> M0)) /*GPMC_D11*/\
> -	MUX_VAL(CP(GPMC_D12),		(IEN  | PTD | DIS |
> M0)) /*GPMC_D12*/\
> -	MUX_VAL(CP(GPMC_D13),		(IEN  | PTD | DIS |
> M0)) /*GPMC_D13*/\
> -	MUX_VAL(CP(GPMC_D14),		(IEN  | PTD | DIS |
> M0)) /*GPMC_D14*/\
> -	MUX_VAL(CP(GPMC_D15),		(IEN  | PTD | DIS |
> M0)) /*GPMC_D15*/\
> -	MUX_VAL(CP(GPMC_NCS0),		(IDIS | PTU | EN  |
> M0)) /*GPMC_nCS0*/\
> -	MUX_VAL(CP(GPMC_NCS1),		(IDIS | PTU | EN  |
> M0)) /*GPMC_nCS1*/\
> -	MUX_VAL(CP(GPMC_NCS2),		(IDIS | PTU | EN  |
> M0)) /*GPMC_nCS2*/\
> -	MUX_VAL(CP(GPMC_NCS3),		(IDIS | PTU | EN  |
> M0)) /*GPMC_nCS3*/\
> -	MUX_VAL(CP(GPMC_NCS4),		(IDIS | PTU | EN  |
> M0)) /*GPMC_nCS4*/\
> -	MUX_VAL(CP(GPMC_NCS5),		(IDIS | PTD | DIS |
> M0)) /*GPMC_nCS5*/\
> -	MUX_VAL(CP(GPMC_NCS6),		(IEN  | PTD | DIS |
> M1)) /*nDMA_REQ2*/\
> -	MUX_VAL(CP(GPMC_NCS7),		(IEN  | PTU | EN  |
> M1)) /*nDMA_REQ3*/\
> -	MUX_VAL(CP(GPMC_NBE1),		(IEN  | PTD | DIS |
> M0)) /*GPMC_nBE1*/\
> -	MUX_VAL(CP(GPMC_WAIT2),		(IEN  | PTU | EN  |
> M0)) /*GPMC_WAIT2*/\
> -	MUX_VAL(CP(GPMC_WAIT3),		(IEN  | PTU | EN  |
> M0)) /*GPMC_WAIT3*/\
> -	MUX_VAL(CP(GPMC_CLK),		(IDIS | PTD | DIS |
> M0)) /*GPMC_CLK*/\
> -	MUX_VAL(CP(GPMC_NADV_ALE),	(IDIS | PTD | DIS | M0))
> /*GPMC_nADV*/\
> -	MUX_VAL(CP(GPMC_NOE),		(IDIS | PTD | DIS |
> M0)) /*GPMC_nOE*/\
> -	MUX_VAL(CP(GPMC_NWE),		(IDIS | PTD | DIS |
> M0)) /*GPMC_nWE*/\
> -	MUX_VAL(CP(GPMC_NBE0_CLE),	(IDIS | PTD | DIS | M0))
> /*GPMC_nBE0*/\
> -	MUX_VAL(CP(GPMC_NWP),		(IEN  | PTD | DIS |
> M0)) /*GPMC_nWP*/\
> -	MUX_VAL(CP(GPMC_WAIT0),		(IEN  | PTU | EN  |
> M0)) /*GPMC_WAIT0*/\
> -	MUX_VAL(CP(GPMC_WAIT1),		(IEN  | PTU | EN  |
> M0)) /*GPMC_WAIT1*/\ -/* DSS */\
> -	MUX_VAL(CP(DSS_PCLK),		(IDIS | PTD | DIS |
> M0)) /*DSS_PCLK*/\
> -	MUX_VAL(CP(DSS_HSYNC),		(IDIS | PTD | DIS |
> M0)) /*DSS_HSYNC*/\
> -	MUX_VAL(CP(DSS_VSYNC),		(IDIS | PTD | DIS |
> M0)) /*DSS_VSYNC*/\
> -	MUX_VAL(CP(DSS_ACBIAS),		(IDIS | PTD | DIS |
> M0)) /*DSS_ACBIAS*/\
> -	MUX_VAL(CP(DSS_DATA0),		(IDIS | PTD | DIS |
> M0)) /*DSS_DATA0*/\
> -	MUX_VAL(CP(DSS_DATA1),		(IDIS | PTD | DIS |
> M0)) /*DSS_DATA1*/\
> -	MUX_VAL(CP(DSS_DATA2),		(IDIS | PTD | DIS |
> M0)) /*DSS_DATA2*/\
> -	MUX_VAL(CP(DSS_DATA3),		(IDIS | PTD | DIS |
> M0)) /*DSS_DATA3*/\
> -	MUX_VAL(CP(DSS_DATA4),		(IDIS | PTD | DIS |
> M0)) /*DSS_DATA4*/\
> -	MUX_VAL(CP(DSS_DATA5),		(IDIS | PTD | DIS |
> M0)) /*DSS_DATA5*/\
> -	MUX_VAL(CP(DSS_DATA6),		(IDIS | PTD | DIS |
> M0)) /*DSS_DATA6*/\
> -	MUX_VAL(CP(DSS_DATA7),		(IDIS | PTD | DIS |
> M0)) /*DSS_DATA7*/\
> -	MUX_VAL(CP(DSS_DATA8),		(IDIS | PTD | DIS |
> M0)) /*DSS_DATA8*/\
> -	MUX_VAL(CP(DSS_DATA9),		(IDIS | PTD | DIS |
> M0)) /*DSS_DATA9*/\
> -	MUX_VAL(CP(DSS_DATA10),		(IDIS | PTD | DIS |
> M0)) /*DSS_DATA10*/\
> -	MUX_VAL(CP(DSS_DATA11),		(IDIS | PTD | DIS |
> M0)) /*DSS_DATA11*/\
> -	MUX_VAL(CP(DSS_DATA12),		(IDIS | PTD | DIS |
> M0)) /*DSS_DATA12*/\
> -	MUX_VAL(CP(DSS_DATA13),		(IDIS | PTD | DIS |
> M0)) /*DSS_DATA13*/\
> -	MUX_VAL(CP(DSS_DATA14),		(IDIS | PTD | DIS |
> M0)) /*DSS_DATA14*/\
> -	MUX_VAL(CP(DSS_DATA15),		(IDIS | PTD | DIS |
> M0)) /*DSS_DATA15*/\
> -	MUX_VAL(CP(DSS_DATA16),		(IDIS | PTD | DIS |
> M0)) /*DSS_DATA16*/\
> -	MUX_VAL(CP(DSS_DATA17),		(IDIS | PTD | DIS |
> M0)) /*DSS_DATA17*/\
> -	MUX_VAL(CP(DSS_DATA18),		(IDIS | PTD | DIS |
> M0)) /*DSS_DATA18*/\
> -	MUX_VAL(CP(DSS_DATA19),		(IDIS | PTD | DIS |
> M0)) /*DSS_DATA19*/\
> -	MUX_VAL(CP(DSS_DATA20),		(IDIS | PTD | DIS |
> M0)) /*DSS_DATA20*/\
> -	MUX_VAL(CP(DSS_DATA21),		(IDIS | PTD | DIS |
> M0)) /*DSS_DATA21*/\
> -	MUX_VAL(CP(DSS_DATA22),		(IDIS | PTD | DIS |
> M0)) /*DSS_DATA22*/\
> -	MUX_VAL(CP(DSS_DATA23),		(IDIS | PTD | DIS |
> M0)) /*DSS_DATA23*/\ -/* CAMERA */\
> -	MUX_VAL(CP(CAM_HS),		(IEN  | PTU | EN  | M0))
> /*CAM_HS*/\
> -	MUX_VAL(CP(CAM_VS),		(IEN  | PTU | EN  | M0))
> /*CAM_VS*/\
> -	MUX_VAL(CP(CAM_XCLKA),		(IDIS | PTD | DIS |
> M0)) /*CAM_XCLKA*/\
> -	MUX_VAL(CP(CAM_PCLK),		(IEN  | PTU | EN  |
> M0)) /*CAM_PCLK*/\
> -	MUX_VAL(CP(CAM_FLD),		(IDIS | PTD | DIS | M4))
> /*GPIO_98*/\
> -	MUX_VAL(CP(CAM_D0),		(IEN  | PTD | DIS | M0))
> /*CAM_D0*/\
> -	MUX_VAL(CP(CAM_D1),		(IEN  | PTD | DIS | M0))
> /*CAM_D1*/\
> -	MUX_VAL(CP(CAM_D2),		(IEN  | PTD | DIS | M0))
> /*CAM_D2*/\
> -	MUX_VAL(CP(CAM_D3),		(IEN  | PTD | DIS | M0))
> /*CAM_D3*/\
> -	MUX_VAL(CP(CAM_D4),		(IEN  | PTD | DIS | M0))
> /*CAM_D4*/\
> -	MUX_VAL(CP(CAM_D5),		(IEN  | PTD | DIS | M0))
> /*CAM_D5*/\
> -	MUX_VAL(CP(CAM_D6),		(IEN  | PTD | DIS | M0))
> /*CAM_D6*/\
> -	MUX_VAL(CP(CAM_D7),		(IEN  | PTD | DIS | M0))
> /*CAM_D7*/\
> -	MUX_VAL(CP(CAM_D8),		(IEN  | PTD | DIS | M0))
> /*CAM_D8*/\
> -	MUX_VAL(CP(CAM_D9),		(IEN  | PTD | DIS | M0))
> /*CAM_D9*/\
> -	MUX_VAL(CP(CAM_D10),		(IEN  | PTD | DIS | M0))
> /*CAM_D10*/\
> -	MUX_VAL(CP(CAM_D11),		(IEN  | PTD | DIS | M0))
> /*CAM_D11*/\
> -	MUX_VAL(CP(CAM_XCLKB),		(IDIS | PTD | DIS |
> M0)) /*CAM_XCLKB*/\
> -	MUX_VAL(CP(CAM_WEN),		(IEN  | PTD | DIS | M4))
> /*GPIO_167*/\
> -	MUX_VAL(CP(CAM_STROBE),		(IDIS | PTD | DIS |
> M0)) /*CAM_STROBE*/\
> -	MUX_VAL(CP(CSI2_DX0),		(IEN  | PTD | DIS |
> M0)) /*CSI2_DX0*/\
> -	MUX_VAL(CP(CSI2_DY0),		(IEN  | PTD | DIS |
> M0)) /*CSI2_DY0*/\
> -	MUX_VAL(CP(CSI2_DX1),		(IEN  | PTD | DIS |
> M0)) /*CSI2_DX1*/\
> -	MUX_VAL(CP(CSI2_DY1),		(IEN  | PTD | DIS |
> M0)) /*CSI2_DY1*/\ -/* Audio Interface */\
> -	MUX_VAL(CP(MCBSP2_FSX),		(IEN  | PTD | DIS |
> M0)) /*McBSP2_FSX*/\
> -	MUX_VAL(CP(MCBSP2_CLKX),	(IEN  | PTD | DIS | M0))
> /*McBSP2_CLK*/\
> -	MUX_VAL(CP(MCBSP2_DR),		(IEN  | PTD | DIS |
> M0)) /*McBSP2_DR*/\
> -	MUX_VAL(CP(MCBSP2_DX),		(IDIS | PTD | DIS |
> M0)) /*McBSP2_DX*/\ -/* Expansion card */\
> -	MUX_VAL(CP(MMC1_CLK),		(IDIS | PTU | EN  |
> M0)) /*MMC1_CLK*/\
> -	MUX_VAL(CP(MMC1_CMD),		(IEN  | PTU | EN  |
> M0)) /*MMC1_CMD*/\
> -	MUX_VAL(CP(MMC1_DAT0),		(IEN  | PTU | EN  |
> M0)) /*MMC1_DAT0*/\
> -	MUX_VAL(CP(MMC1_DAT1),		(IEN  | PTU | EN  |
> M0)) /*MMC1_DAT1*/\
> -	MUX_VAL(CP(MMC1_DAT2),		(IEN  | PTU | EN  |
> M0)) /*MMC1_DAT2*/\
> -	MUX_VAL(CP(MMC1_DAT3),		(IEN  | PTU | EN  |
> M0)) /*MMC1_DAT3*/\
> -	MUX_VAL(CP(MMC1_DAT4),		(IEN  | PTU | EN  |
> M0)) /*MMC1_DAT4*/\
> -	MUX_VAL(CP(MMC1_DAT5),		(IEN  | PTU | EN  |
> M0)) /*MMC1_DAT5*/\
> -	MUX_VAL(CP(MMC1_DAT6),		(IEN  | PTU | EN  |
> M0)) /*MMC1_DAT6*/\
> -	MUX_VAL(CP(MMC1_DAT7),		(IEN  | PTU | EN  |
> M0)) /*MMC1_DAT7*/\ -/* Wireless LAN */\
> -	MUX_VAL(CP(MMC2_CLK),		(IEN  | PTU | EN  |
> M4)) /*GPIO_130*/\
> -	MUX_VAL(CP(MMC2_CMD),		(IEN  | PTU | EN  |
> M4)) /*GPIO_131*/\
> -	MUX_VAL(CP(MMC2_DAT0),		(IEN  | PTU | EN  |
> M4)) /*GPIO_132*/\
> -	MUX_VAL(CP(MMC2_DAT1),		(IEN  | PTU | EN  |
> M4)) /*GPIO_133*/\
> -	MUX_VAL(CP(MMC2_DAT2),		(IEN  | PTU | EN  |
> M4)) /*GPIO_134*/\
> -	MUX_VAL(CP(MMC2_DAT3),		(IEN  | PTU | EN  |
> M4)) /*GPIO_135*/\
> -	MUX_VAL(CP(MMC2_DAT4),		(IEN  | PTU | EN  |
> M4)) /*GPIO_136*/\
> -	MUX_VAL(CP(MMC2_DAT5),		(IEN  | PTU | EN  |
> M4)) /*GPIO_137*/\
> -	MUX_VAL(CP(MMC2_DAT6),		(IEN  | PTU | EN  |
> M4)) /*GPIO_138*/\
> -	MUX_VAL(CP(MMC2_DAT7),		(IEN  | PTU | EN  |
> M4)) /*GPIO_139*/\ -/* Bluetooth */\
> -	MUX_VAL(CP(MCBSP3_DX),		(IEN  | PTD | DIS |
> M1)) /*UART2_CTS*/\
> -	MUX_VAL(CP(MCBSP3_DR),		(IDIS | PTD | DIS |
> M1)) /*UART2_RTS*/\
> -	MUX_VAL(CP(MCBSP3_CLKX),	(IDIS | PTD | DIS | M1))
> /*UART2_TX*/\
> -	MUX_VAL(CP(MCBSP3_FSX),		(IEN  | PTD | DIS |
> M1)) /*UART2_RX*/\
> -	MUX_VAL(CP(UART2_CTS),		(IEN  | PTD | DIS |
> M4)) /*GPIO_144*/\
> -	MUX_VAL(CP(UART2_RTS),		(IEN  | PTD | DIS |
> M4)) /*GPIO_145*/\
> -	MUX_VAL(CP(UART2_TX),		(IEN  | PTD | DIS |
> M4)) /*GPIO_146*/\
> -	MUX_VAL(CP(UART2_RX),		(IEN  | PTD | DIS |
> M4)) /*GPIO_147*/\ -/* Modem Interface */\
> -	MUX_VAL(CP(UART1_TX),		(IDIS | PTD | DIS |
> M0)) /*UART1_TX*/\
> -	MUX_VAL(CP(UART1_RTS),		(IDIS | PTD | DIS |
> M4)) /*GPIO_149*/\
> -	MUX_VAL(CP(UART1_CTS),		(IDIS | PTD | DIS |
> M4)) /*GPIO_150*/\
> -	MUX_VAL(CP(UART1_RX),		(IEN  | PTD | DIS |
> M0)) /*UART1_RX*/\
> -	MUX_VAL(CP(MCBSP4_CLKX),	(IEN  | PTD | DIS | M1))
> /*SSI1_DAT*/\
> -	MUX_VAL(CP(MCBSP4_DR),		(IEN  | PTD | DIS |
> M1)) /*SSI1_FLAG*/\
> -	MUX_VAL(CP(MCBSP4_DX),		(IEN  | PTD | DIS |
> M1)) /*SSI1_RDY*/\
> -	MUX_VAL(CP(MCBSP4_FSX),		(IEN  | PTD | DIS |
> M1)) /*SSI1_WAKE*/\
> -	MUX_VAL(CP(MCBSP1_CLKR),	(IDIS | PTD | DIS | M4))
> /*GPIO_156*/\
> -	MUX_VAL(CP(MCBSP1_FSR),		(IDIS | PTU | EN  |
> M4)) /*GPIO_157*/\
> -	MUX_VAL(CP(MCBSP1_DX),		(IDIS | PTD | DIS |
> M4)) /*GPIO_158*/\
> -	MUX_VAL(CP(MCBSP1_DR),		(IDIS | PTD | DIS |
> M4)) /*GPIO_159*/\
> -	MUX_VAL(CP(MCBSP_CLKS),		(IEN  | PTU | DIS |
> M0)) /*McBSP_CLKS*/\
> -	MUX_VAL(CP(MCBSP1_FSX),		(IDIS | PTD | DIS |
> M4)) /*GPIO_161*/\
> -	MUX_VAL(CP(MCBSP1_CLKX),	(IDIS | PTD | DIS | M4))
> /*GPIO_162*/\ -/* Serial Interface */\
> -	MUX_VAL(CP(UART3_CTS_RCTX),	(IEN  | PTD | EN  | M0))
> /*UART3_CTS*/\
> -	MUX_VAL(CP(UART3_RTS_SD),	(IDIS | PTD | DIS | M0))
> /*UART3_RTS*/\
> -	MUX_VAL(CP(UART3_RX_IRRX),	(IEN  | PTD | DIS | M0))
> /*UART3_RX*/\
> -	MUX_VAL(CP(UART3_TX_IRTX),	(IDIS | PTD | DIS | M0))
> /*UART3_TX*/\
> -	MUX_VAL(CP(HSUSB0_CLK),		(IEN  | PTD | DIS |
> M0)) /*HSUSB0_CLK*/\
> -	MUX_VAL(CP(HSUSB0_STP),		(IDIS | PTU | EN  |
> M0)) /*HSUSB0_STP*/\
> -	MUX_VAL(CP(HSUSB0_DIR),		(IEN  | PTD | DIS |
> M0)) /*HSUSB0_DIR*/\
> -	MUX_VAL(CP(HSUSB0_NXT),		(IEN  | PTD | DIS |
> M0)) /*HSUSB0_NXT*/\
> -	MUX_VAL(CP(HSUSB0_DATA0),	(IEN  | PTD | DIS | M0))
> /*HSUSB0_DA0*/\
> -	MUX_VAL(CP(HSUSB0_DATA1),	(IEN  | PTD | DIS | M0))
> /*HSUSB0_DA1*/\
> -	MUX_VAL(CP(HSUSB0_DATA2),	(IEN  | PTD | DIS | M0))
> /*HSUSB0_DA2*/\
> -	MUX_VAL(CP(HSUSB0_DATA3),	(IEN  | PTD | DIS | M0))
> /*HSUSB0_DA3*/\
> -	MUX_VAL(CP(HSUSB0_DATA4),	(IEN  | PTD | DIS | M0))
> /*HSUSB0_DA4*/\
> -	MUX_VAL(CP(HSUSB0_DATA5),	(IEN  | PTD | DIS | M0))
> /*HSUSB0_DA5*/\
> -	MUX_VAL(CP(HSUSB0_DATA6),	(IEN  | PTD | DIS | M0))
> /*HSUSB0_DA6*/\
> -	MUX_VAL(CP(HSUSB0_DATA7),	(IEN  | PTD | DIS | M0))
> /*HSUSB0_DA7*/\
> -	MUX_VAL(CP(I2C1_SCL),		(IEN  | PTU | EN  |
> M0)) /*I2C1_SCL*/\
> -	MUX_VAL(CP(I2C1_SDA),		(IEN  | PTU | EN  |
> M0)) /*I2C1_SDA*/\
> -	MUX_VAL(CP(I2C2_SCL),		(IEN  | PTU | EN  |
> M4)) /*GPIO_168*/\
> -	MUX_VAL(CP(I2C2_SDA),		(IEN  | PTU | EN  |
> M4)) /*GPIO_183*/\
> -	MUX_VAL(CP(I2C3_SCL),		(IEN  | PTU | EN  |
> M0)) /*I2C3_SCL*/\
> -	MUX_VAL(CP(I2C3_SDA),		(IEN  | PTU | EN  |
> M0)) /*I2C3_SDA*/\
> -	MUX_VAL(CP(I2C4_SCL),		(IEN  | PTU | EN  |
> M0)) /*I2C4_SCL*/\
> -	MUX_VAL(CP(I2C4_SDA),		(IEN  | PTU | EN  |
> M0)) /*I2C4_SDA*/\
> -	MUX_VAL(CP(HDQ_SIO),		(IDIS | PTU | EN  | M4))
> /*GPIO_170*/\
> -	MUX_VAL(CP(MCSPI1_CLK),		(IEN  | PTU | EN  |
> M4)) /*GPIO_171*/\
> -	MUX_VAL(CP(MCSPI1_SIMO),	(IEN  | PTU | EN  | M4))
> /*GPIO_172*/\
> -	MUX_VAL(CP(MCSPI1_SOMI),	(IEN  | PTD | DIS | M0))
> /*McSPI1_SOM*/\
> -	MUX_VAL(CP(MCSPI1_CS0),		(IEN  | PTD | EN  |
> M0)) /*McSPI1_CS0*/\
> -	MUX_VAL(CP(MCSPI1_CS1),		(IDIS | PTD | EN  |
> M0)) /*McSPI1_CS1*/\
> -	MUX_VAL(CP(MCSPI1_CS2),		(IDIS | PTD | DIS |
> M4)) /*GPIO_176*/\ -/* USB EHCI (port 2) */\
> -	MUX_VAL(CP(MCSPI1_CS3),		(IEN  | PTU | DIS |
> M3)) /*HSUSB2_DA2*/\
> -	MUX_VAL(CP(MCSPI2_CLK),		(IEN  | PTU | DIS |
> M3)) /*HSUSB2_DA7*/\
> -	MUX_VAL(CP(MCSPI2_SIMO),	(IEN  | PTU | DIS | M3))
> /*HSUSB2_DA4*/\
> -	MUX_VAL(CP(MCSPI2_SOMI),	(IEN  | PTU | DIS | M3))
> /*HSUSB2_DA5*/\
> -	MUX_VAL(CP(MCSPI2_CS0),		(IEN  | PTU | DIS |
> M3)) /*HSUSB2_DA6*/\
> -	MUX_VAL(CP(MCSPI2_CS1),		(IEN  | PTU | DIS |
> M3)) /*HSUSB2_DA3*/\
> -	MUX_VAL(CP(ETK_D10_ES2),	(IDIS | PTU | DIS | M3))
> /*HSUSB2_CLK*/\
> -	MUX_VAL(CP(ETK_D11_ES2),	(IDIS | PTU | DIS | M3))
> /*HSUSB2_STP*/\
> -	MUX_VAL(CP(ETK_D12_ES2),	(IEN  | PTU | DIS | M3))
> /*HSUSB2_DIR*/\
> -	MUX_VAL(CP(ETK_D13_ES2),	(IEN  | PTU | DIS | M3))
> /*HSUSB2_NXT*/\
> -	MUX_VAL(CP(ETK_D14_ES2),	(IEN  | PTU | DIS | M3))
> /*HSUSB2_DA0*/\
> -	MUX_VAL(CP(ETK_D15_ES2),	(IEN  | PTU | DIS | M3))
> /*HSUSB2_DA1*/\ -/* Control and debug */\
> -	MUX_VAL(CP(SYS_32K),		(IEN  | PTD | DIS | M0))
> /*SYS_32K*/\
> -	MUX_VAL(CP(SYS_CLKREQ),		(IEN  | PTD | DIS |
> M0)) /*SYS_CLKREQ*/\
> -	MUX_VAL(CP(SYS_NIRQ),		(IEN  | PTU | EN  |
> M0)) /*SYS_nIRQ*/\
> -	MUX_VAL(CP(SYS_BOOT0),		(IEN  | PTD | DIS |
> M4)) /*GPIO_2*/\
> -	MUX_VAL(CP(SYS_BOOT1),		(IEN  | PTD | DIS |
> M4)) /*GPIO_3*/\
> -	MUX_VAL(CP(SYS_BOOT2),		(IEN  | PTD | DIS |
> M4)) /*MMC1_WP*/\
> -	MUX_VAL(CP(SYS_BOOT3),		(IEN  | PTD | DIS |
> M4)) /*GPIO_5*/\
> -	MUX_VAL(CP(SYS_BOOT4),		(IEN  | PTD | DIS |
> M4)) /*GPIO_6*/\
> -	MUX_VAL(CP(SYS_BOOT5),		(IEN  | PTD | DIS |
> M4)) /*GPIO_7*/\
> -	MUX_VAL(CP(SYS_BOOT6),		(IDIS | PTD | DIS |
> M4)) /*GPIO_8*/\
> -	MUX_VAL(CP(SYS_OFF_MODE),	(IEN  | PTD | DIS | M0))
> /*SYS_OFF_MD*/\
> -	MUX_VAL(CP(SYS_CLKOUT1),	(IEN  | PTD | DIS | M0))
> /*SYS_CLKOUT*/\
> -	MUX_VAL(CP(SYS_CLKOUT2),	(IEN  | PTU | EN  | M4))
> /*GPIO_186*/\
> -	MUX_VAL(CP(ETK_CLK_ES2),	(IDIS | PTU | EN  | M3))
> /*HSUSB1_STP*/\
> -	MUX_VAL(CP(ETK_CTL_ES2),	(IDIS | PTU | DIS | M3))
> /*HSUSB1_CLK*/\
> -	MUX_VAL(CP(ETK_D0_ES2),		(IEN  | PTU | DIS |
> M3)) /*HSUSB1_DA0*/\
> -	MUX_VAL(CP(ETK_D1_ES2),		(IEN  | PTU | DIS |
> M3)) /*HSUSB1_DA1*/\
> -	MUX_VAL(CP(ETK_D2_ES2),		(IEN  | PTU | DIS |
> M3)) /*HSUSB1_DA2*/\
> -	MUX_VAL(CP(ETK_D3_ES2),		(IEN  | PTU | DIS |
> M3)) /*HSUSB1_DA7*/\
> -	MUX_VAL(CP(ETK_D4_ES2),		(IEN  | PTU | DIS |
> M3)) /*HSUSB1_DA4*/\
> -	MUX_VAL(CP(ETK_D5_ES2),		(IEN  | PTU | DIS |
> M3)) /*HSUSB1_DA5*/\
> -	MUX_VAL(CP(ETK_D6_ES2),		(IEN  | PTU | DIS |
> M3)) /*HSUSB1_DA6*/\
> -	MUX_VAL(CP(ETK_D7_ES2),		(IEN  | PTU | DIS |
> M3)) /*HSUSB1_DA3*/\
> -	MUX_VAL(CP(ETK_D8_ES2),		(IEN  | PTU | DIS |
> M3)) /*HSUSB1_DIR*/\
> -	MUX_VAL(CP(ETK_D9_ES2),		(IEN  | PTU | DIS |
> M3)) /*HSUSB1_NXT*/\
> -	MUX_VAL(CP(D2D_MCAD1),		(IEN  | PTD | EN  |
> M0)) /*d2d_mcad1*/\
> -	MUX_VAL(CP(D2D_MCAD2),		(IEN  | PTD | EN  |
> M0)) /*d2d_mcad2*/\
> -	MUX_VAL(CP(D2D_MCAD3),		(IEN  | PTD | EN  |
> M0)) /*d2d_mcad3*/\
> -	MUX_VAL(CP(D2D_MCAD4),		(IEN  | PTD | EN  |
> M0)) /*d2d_mcad4*/\
> -	MUX_VAL(CP(D2D_MCAD5),		(IEN  | PTD | EN  |
> M0)) /*d2d_mcad5*/\
> -	MUX_VAL(CP(D2D_MCAD6),		(IEN  | PTD | EN  |
> M0)) /*d2d_mcad6*/\
> -	MUX_VAL(CP(D2D_MCAD7),		(IEN  | PTD | EN  |
> M0)) /*d2d_mcad7*/\
> -	MUX_VAL(CP(D2D_MCAD8),		(IEN  | PTD | EN  |
> M0)) /*d2d_mcad8*/\
> -	MUX_VAL(CP(D2D_MCAD9),		(IEN  | PTD | EN  |
> M0)) /*d2d_mcad9*/\
> -	MUX_VAL(CP(D2D_MCAD10),		(IEN  | PTD | EN  |
> M0)) /*d2d_mcad10*/\
> -	MUX_VAL(CP(D2D_MCAD11),		(IEN  | PTD | EN  |
> M0)) /*d2d_mcad11*/\
> -	MUX_VAL(CP(D2D_MCAD12),		(IEN  | PTD | EN  |
> M0)) /*d2d_mcad12*/\
> -	MUX_VAL(CP(D2D_MCAD13),		(IEN  | PTD | EN  |
> M0)) /*d2d_mcad13*/\
> -	MUX_VAL(CP(D2D_MCAD14),		(IEN  | PTD | EN  |
> M0)) /*d2d_mcad14*/\
> -	MUX_VAL(CP(D2D_MCAD15),		(IEN  | PTD | EN  |
> M0)) /*d2d_mcad15*/\
> -	MUX_VAL(CP(D2D_MCAD16),		(IEN  | PTD | EN  |
> M0)) /*d2d_mcad16*/\
> -	MUX_VAL(CP(D2D_MCAD17),		(IEN  | PTD | EN  |
> M0)) /*d2d_mcad17*/\
> -	MUX_VAL(CP(D2D_MCAD18),		(IEN  | PTD | EN  |
> M0)) /*d2d_mcad18*/\
> -	MUX_VAL(CP(D2D_MCAD19),		(IEN  | PTD | EN  |
> M0)) /*d2d_mcad19*/\
> -	MUX_VAL(CP(D2D_MCAD20),		(IEN  | PTD | EN  |
> M0)) /*d2d_mcad20*/\
> -	MUX_VAL(CP(D2D_MCAD21),		(IEN  | PTD | EN  |
> M0)) /*d2d_mcad21*/\
> -	MUX_VAL(CP(D2D_MCAD22),		(IEN  | PTD | EN  |
> M0)) /*d2d_mcad22*/\
> -	MUX_VAL(CP(D2D_MCAD23),		(IEN  | PTD | EN  |
> M0)) /*d2d_mcad23*/\
> -	MUX_VAL(CP(D2D_MCAD24),		(IEN  | PTD | EN  |
> M0)) /*d2d_mcad24*/\
> -	MUX_VAL(CP(D2D_MCAD25),		(IEN  | PTD | EN  |
> M0)) /*d2d_mcad25*/\
> -	MUX_VAL(CP(D2D_MCAD26),		(IEN  | PTD | EN  |
> M0)) /*d2d_mcad26*/\
> -	MUX_VAL(CP(D2D_MCAD27),		(IEN  | PTD | EN  |
> M0)) /*d2d_mcad27*/\
> -	MUX_VAL(CP(D2D_MCAD28),		(IEN  | PTD | EN  |
> M0)) /*d2d_mcad28*/\
> -	MUX_VAL(CP(D2D_MCAD29),		(IEN  | PTD | EN  |
> M0)) /*d2d_mcad29*/\
> -	MUX_VAL(CP(D2D_MCAD30),		(IEN  | PTD | EN  |
> M0)) /*d2d_mcad30*/\
> -	MUX_VAL(CP(D2D_MCAD31),		(IEN  | PTD | EN  |
> M0)) /*d2d_mcad31*/\
> -	MUX_VAL(CP(D2D_MCAD32),		(IEN  | PTD | EN  |
> M0)) /*d2d_mcad32*/\
> -	MUX_VAL(CP(D2D_MCAD33),		(IEN  | PTD | EN  |
> M0)) /*d2d_mcad33*/\
> -	MUX_VAL(CP(D2D_MCAD34),		(IEN  | PTD | EN  |
> M0)) /*d2d_mcad34*/\
> -	MUX_VAL(CP(D2D_MCAD35),		(IEN  | PTD | EN  |
> M0)) /*d2d_mcad35*/\
> -	MUX_VAL(CP(D2D_MCAD36),		(IEN  | PTD | EN  |
> M0)) /*d2d_mcad36*/\
> -	MUX_VAL(CP(D2D_CLK26MI),	(IEN  | PTD | DIS | M0))
> /*d2d_clk26m*/\
> -	MUX_VAL(CP(D2D_NRESPWRON),	(IEN  | PTD | EN  | M0))
> /*d2d_nrespw*/\
> -	MUX_VAL(CP(D2D_NRESWARM),	(IEN  | PTU | EN  | M0))
> /*d2d_nreswa*/\
> -	MUX_VAL(CP(D2D_ARM9NIRQ),	(IEN  | PTD | DIS | M0))
> /*d2d_arm9ni*/\
> -	MUX_VAL(CP(D2D_UMA2P6FIQ),	(IEN  | PTD | DIS | M0))
> /*d2d_uma2p6*/\
> -	MUX_VAL(CP(D2D_SPINT),		(IEN  | PTD | EN  |
> M0)) /*d2d_spint*/\
> -	MUX_VAL(CP(D2D_FRINT),		(IEN  | PTD | EN  |
> M0)) /*d2d_frint*/\
> -	MUX_VAL(CP(D2D_DMAREQ0),	(IEN  | PTD | DIS | M0))
> /*d2d_dmare0*/\
> -	MUX_VAL(CP(D2D_DMAREQ1),	(IEN  | PTD | DIS | M0))
> /*d2d_dmare1*/\
> -	MUX_VAL(CP(D2D_DMAREQ2),	(IEN  | PTD | DIS | M0))
> /*d2d_dmare2*/\
> -	MUX_VAL(CP(D2D_DMAREQ3),	(IEN  | PTD | DIS | M0))
> /*d2d_dmare3*/\
> -	MUX_VAL(CP(D2D_N3GTRST),	(IEN  | PTD | DIS | M0))
> /*d2d_n3gtrs*/\
> -	MUX_VAL(CP(D2D_N3GTDI),		(IEN  | PTD | DIS |
> M0)) /*d2d_n3gtdi*/\
> -	MUX_VAL(CP(D2D_N3GTDO),		(IEN  | PTD | DIS |
> M0)) /*d2d_n3gtdo*/\
> -	MUX_VAL(CP(D2D_N3GTMS),		(IEN  | PTD | DIS |
> M0)) /*d2d_n3gtms*/\
> -	MUX_VAL(CP(D2D_N3GTCK),		(IEN  | PTD | DIS |
> M0)) /*d2d_n3gtck*/\
> -	MUX_VAL(CP(D2D_N3GRTCK),	(IEN  | PTD | DIS | M0))
> /*d2d_n3grtc*/\
> -	MUX_VAL(CP(D2D_MSTDBY),		(IEN  | PTU | EN  |
> M0)) /*d2d_mstdby*/\
> -	MUX_VAL(CP(D2D_SWAKEUP),	(IEN  | PTD | EN  | M0))
> /*d2d_swakeu*/\
> -	MUX_VAL(CP(D2D_IDLEREQ),	(IEN  | PTD | DIS | M0))
> /*d2d_idlere*/\
> -	MUX_VAL(CP(D2D_IDLEACK),	(IEN  | PTU | EN  | M0))
> /*d2d_idleac*/\
> -	MUX_VAL(CP(D2D_MWRITE),		(IEN  | PTD | DIS |
> M0)) /*d2d_mwrite*/\
> -	MUX_VAL(CP(D2D_SWRITE),		(IEN  | PTD | DIS |
> M0)) /*d2d_swrite*/\
> -	MUX_VAL(CP(D2D_MREAD),		(IEN  | PTD | DIS |
> M0)) /*d2d_mread*/\
> -	MUX_VAL(CP(D2D_SREAD),		(IEN  | PTD | DIS |
> M0)) /*d2d_sread*/\
> -	MUX_VAL(CP(D2D_MBUSFLAG),	(IEN  | PTD | DIS | M0))
> /*d2d_mbusfl*/\
> -	MUX_VAL(CP(D2D_SBUSFLAG),	(IEN  | PTD | DIS | M0))
> /*d2d_sbusfl*/\
> -	MUX_VAL(CP(SDRC_CKE0),		(IDIS | PTU | EN  |
> M0)) /*sdrc_cke0*/\
> -	MUX_VAL(CP(SDRC_CKE1),		(IDIS | PTU | EN  |
> M0)) /*sdrc_cke1*/ -
> -#define MUX_RX51_C() \
> -	MUX_VAL(CP(MCBSP3_DX),		(IEN | PTD | DIS |
> M4)) /*GPIO_140*/\
> -	MUX_VAL(CP(MCBSP3_DR),		(IEN | PTD | DIS |
> M4)) /*GPIO_142*/\
> -	MUX_VAL(CP(MCBSP3_CLKX),	(IEN | PTD | DIS | M4))
> /*GPIO_141*/\
> -	MUX_VAL(CP(UART2_CTS),		(IEN  | PTU | EN  |
> M0)) /*UART2_CTS*/\
> -	MUX_VAL(CP(UART2_RTS),		(IDIS | PTD | DIS |
> M0)) /*UART2_RTS*/\
> -	MUX_VAL(CP(UART2_TX),		(IDIS | PTD | DIS |
> M0)) /*UART2_TX*/ -
>  #define ONENAND_GPMC_CONFIG1_RX51	0xfb001202
>  #define ONENAND_GPMC_CONFIG2_RX51	0x00111100
>  #define ONENAND_GPMC_CONFIG3_RX51	0x00020200

Reviewed-by: Lukasz Majewski <lukma@denx.de>


Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210206/bb3c0731/attachment.sig>

^ permalink raw reply	[flat|nested] 69+ messages in thread

* [RESEND PATCH 15/16] Nokia RX-51: Move content of rx51.h to rx51.c
  2021-02-05 19:12 ` [RESEND PATCH 15/16] Nokia RX-51: Move content of rx51.h to rx51.c Pali Rohár
@ 2021-02-06 15:23   ` Lukasz Majewski
  0 siblings, 0 replies; 69+ messages in thread
From: Lukasz Majewski @ 2021-02-06 15:23 UTC (permalink / raw)
  To: u-boot

On Fri,  5 Feb 2021 20:12:11 +0100
Pali Roh?r <pali@kernel.org> wrote:

> After removal of MUX configuration there is no need to have extra
> rx51.h.
> 
> Signed-off-by: Pali Roh?r <pali@kernel.org>
> ---
>  board/nokia/rx51/rx51.c | 17 ++++++++++++++++-
>  board/nokia/rx51/rx51.h | 31 -------------------------------
>  2 files changed, 16 insertions(+), 32 deletions(-)
>  delete mode 100644 board/nokia/rx51/rx51.h
> 
> diff --git a/board/nokia/rx51/rx51.c b/board/nokia/rx51/rx51.c
> index cb72ffaaa9..0597a94faa 100644
> --- a/board/nokia/rx51/rx51.c
> +++ b/board/nokia/rx51/rx51.c
> @@ -39,9 +39,24 @@
>  #include <asm/arch/sys_proto.h>
>  #include <asm/arch/mmc_host_def.h>
>  
> -#include "rx51.h"
>  #include "tag_omap.h"
>  
> +/* Needed for ROM SMC call */
> +struct emu_hal_params_rx51 {
> +	u32 num_params;
> +	u32 param1;
> +	u32 param2;
> +	u32 param3;
> +	u32 param4;
> +};
> +
> +#define ONENAND_GPMC_CONFIG1_RX51	0xfb001202
> +#define ONENAND_GPMC_CONFIG2_RX51	0x00111100
> +#define ONENAND_GPMC_CONFIG3_RX51	0x00020200
> +#define ONENAND_GPMC_CONFIG4_RX51	0x11001102
> +#define ONENAND_GPMC_CONFIG5_RX51	0x03101616
> +#define ONENAND_GPMC_CONFIG6_RX51	0x90060000
> +
>  DECLARE_GLOBAL_DATA_PTR;
>  
>  GraphicDevice gdev;
> diff --git a/board/nokia/rx51/rx51.h b/board/nokia/rx51/rx51.h
> deleted file mode 100644
> index 0eddb06219..0000000000
> --- a/board/nokia/rx51/rx51.h
> +++ /dev/null
> @@ -1,31 +0,0 @@
> -/* SPDX-License-Identifier: GPL-2.0+ */
> -/*
> - * (C) Copyright 2012
> - * ?????? ???????? <freemangordon@abv.bg>
> - *
> - * (C) Copyright 2011-2012
> - * Pali Roh?r <pali@kernel.org>
> - *
> - * (C) Copyright 2008
> - * Dirk Behme <dirk.behme@gmail.com>
> - */
> -#ifndef _RX51_H_
> -#define _RX51_H_
> -
> -/* Needed for ROM SMC call */
> -struct emu_hal_params_rx51 {
> -	u32 num_params;
> -	u32 param1;
> -	u32 param2;
> -	u32 param3;
> -	u32 param4;
> -};
> -
> -#define ONENAND_GPMC_CONFIG1_RX51	0xfb001202
> -#define ONENAND_GPMC_CONFIG2_RX51	0x00111100
> -#define ONENAND_GPMC_CONFIG3_RX51	0x00020200
> -#define ONENAND_GPMC_CONFIG4_RX51	0x11001102
> -#define ONENAND_GPMC_CONFIG5_RX51	0x03101616
> -#define ONENAND_GPMC_CONFIG6_RX51	0x90060000
> -
> -#endif

Reviewed-by: Lukasz Majewski <lukma@denx.de>


Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210206/acbb3bd7/attachment.sig>

^ permalink raw reply	[flat|nested] 69+ messages in thread

* [RESEND PATCH 16/16] Nokia RX-51: Enable usbtty serial console by default
  2021-02-05 19:12 ` [RESEND PATCH 16/16] Nokia RX-51: Enable usbtty serial console by default Pali Rohár
  2021-02-06  9:10   ` Pavel Machek
@ 2021-02-06 15:24   ` Lukasz Majewski
  1 sibling, 0 replies; 69+ messages in thread
From: Lukasz Majewski @ 2021-02-06 15:24 UTC (permalink / raw)
  To: u-boot

On Fri,  5 Feb 2021 20:12:12 +0100
Pali Roh?r <pali@kernel.org> wrote:

> Now when usbtty serial console is fixed in U-Boot enable
> CONFIG_USB_TTY for Nokia RX-51 board by default.
> 
> Fix also USB product id as U-Boot ignores CONFIG_USBD_PRODUCTID macro
> and include U-Boot string into USB product name to indicate usage of
> U-Boot.
> 
> CONFIG_CONSOLE_MUX is already used and U-Boot console is available for
> all in/out devices. Therefore there is no need to have separate
> commands 'run sercon', 'run usbcon' and 'run vgacon', so remove them.
> 
> As space for U-Boot is limited to 256kB, disable some other unused
> options so CONFIG_USB_TTY can be enabled.
> 
> Nokia RX-51 does not have easily accessible UART serial console so
> the only option for easy debugging is to use device's keyboard+screen
> or this usbtty serial console over USB.
> 
> Signed-off-by: Pali Roh?r <pali@kernel.org>
> ---
>  configs/nokia_rx51_defconfig |  7 ++++---
>  doc/README.nokia_rx51        | 15 +--------------
>  include/configs/nokia_rx51.h | 21 +++++++--------------
>  3 files changed, 12 insertions(+), 31 deletions(-)
> 
> diff --git a/configs/nokia_rx51_defconfig
> b/configs/nokia_rx51_defconfig index 3b782715c7..bce55c4fe5 100644
> --- a/configs/nokia_rx51_defconfig
> +++ b/configs/nokia_rx51_defconfig
> @@ -13,6 +13,7 @@ CONFIG_AUTOBOOT_MENU_SHOW=y
>  CONFIG_USE_PREBOOT=y
>  CONFIG_PREBOOT="run preboot"
>  CONFIG_CONSOLE_MUX=y
> +# CONFIG_SYS_DEVICE_NULLDEV is not set
>  CONFIG_HUSH_PARSER=y
>  CONFIG_SYS_PROMPT="Nokia RX-51 # "
>  # CONFIG_CMD_BDI is not set
> @@ -47,9 +48,11 @@ CONFIG_ENV_OVERWRITE=y
>  CONFIG_SYS_RELOC_GD_ENV_ADDR=y
>  # CONFIG_NET is not set
>  CONFIG_DM=y
> +# CONFIG_DM_WARN is not set
>  # CONFIG_DM_DEVICE_REMOVE is not set
> +# CONFIG_DM_SEQ_ALIAS is not set
> +# CONFIG_BLOCK_CACHE is not set
>  CONFIG_DM_I2C=y
> -CONFIG_TWL4030_LED=y
>  CONFIG_DM_MMC=y
>  # CONFIG_MMC_HW_PARTITIONING is not set
>  # CONFIG_MMC_VERBOSE is not set
> @@ -59,10 +62,8 @@ CONFIG_CONS_INDEX=3
>  CONFIG_SYS_NS16550=y
>  CONFIG_SPI=y
>  CONFIG_USB=y
> -CONFIG_USB_MUSB_HCD=y
>  CONFIG_USB_MUSB_UDC=y
>  CONFIG_USB_OMAP3=y
> -CONFIG_TWL4030_USB=y
>  CONFIG_CFB_CONSOLE=y
>  CONFIG_CFB_CONSOLE_ANSI=y
>  # CONFIG_VGA_AS_SINGLE_DEVICE is not set
> diff --git a/doc/README.nokia_rx51 b/doc/README.nokia_rx51
> index 320b5efc7d..84d1912ddd 100644
> --- a/doc/README.nokia_rx51
> +++ b/doc/README.nokia_rx51
> @@ -24,8 +24,7 @@ called u-boot-gen-combined. It is available in
> following repository: There is support for hardware watchdog.
> Hardware watchdog is started by NOLO so u-boot must kick watchdog to
> prevent reboot device (but not very often, max every 2 seconds).
> There is also support for framebuffer display -output with ANSI
> escape codes and the N900 HW keyboard input. USB tty works -but is
> disabled because it prevents the current Maemo kernel from booting.
> +output with ANSI escape codes and the N900 HW keyboard input. 
>  When U-Boot is starting it enable IBE bit in Auxiliary Control
> Register, which is needed for Thumb-2 ISA support. It is workaround
> for errata 430973. @@ -49,10 +48,6 @@ Boot from SD or eMMC in this
> order: 
>  Available additional commands/variables:
>  
> - * run sercon - Use serial port for control
> - * run usbcon - Use usbtty for control
> - * run vgacon - Use framebuffer and HW keyboard for control (default)
> -
>   * run sdboot - Boot from external SD card (see boot order)
>   * run emmcboot - Boot from internal eMMC memory (see boot order)
>   * run attachboot - Boot attached kernel image (attached to U-Boot
> binary) @@ -87,14 +82,6 @@ Additional variables for booting kernel:
>   and u-boot standard output is set to serial then setup_console_atag
> is automatically set to 1. So output from Maemo kernel would go to
> serial port. 
> -USB TTY:
> -
> - Maemo kernel 2.6.28 will crash if u-boot enable usb tty. So USB TTY
> is disabled.
> - For enabling USB TTY just add this line to file
> include/configs/nokia_rx51.h -
> - #define CONFIG_USB_TTY
> -
> -
>  UBIFS support:
>  
>   UBIFS support is disabled, because U-Boot image is too big and
> cannot be diff --git a/include/configs/nokia_rx51.h
> b/include/configs/nokia_rx51.h index 3f2700d8e2..23368de624 100644
> --- a/include/configs/nokia_rx51.h
> +++ b/include/configs/nokia_rx51.h
> @@ -70,10 +70,12 @@
>  
>  /* USB device configuration */
>  #define CONFIG_USB_DEVICE
> +#define CONFIG_USB_TTY
>  #define CONFIG_USBD_VENDORID		0x0421
> -#define CONFIG_USBD_PRODUCTID		0x01c8
> +#define CONFIG_USBD_PRODUCTID_CDCACM	0x01c8
> +#define CONFIG_USBD_PRODUCTID_GSERIAL	0x01c8
>  #define CONFIG_USBD_MANUFACTURER	"Nokia"
> -#define CONFIG_USBD_PRODUCT_NAME	"N900"
> +#define CONFIG_USBD_PRODUCT_NAME	"N900 (U-Boot)"
>  
>  #define GPIO_SLIDE			71
>  
> @@ -108,15 +110,9 @@ int rx51_kp_getc(struct stdio_dev *sdev);
>  /* Environment information */
>  #define CONFIG_EXTRA_ENV_SETTINGS \
>  	"usbtty=cdc_acm\0" \
> -	"stdin=serial,vga\0" \
> -	"stdout=serial,vga\0" \
> -	"stderr=serial,vga\0" \
> -	"setcon=setenv stdin ${con};" \
> -		"setenv stdout ${con};" \
> -		"setenv stderr ${con}\0" \
> -	"sercon=setenv con serial; run setcon\0" \
> -	"usbcon=setenv con usbtty; run setcon\0" \
> -	"vgacon=setenv con vga; run setcon\0" \
> +	"stdin=usbtty,serial,vga\0" \
> +	"stdout=usbtty,serial,vga\0" \
> +	"stderr=usbtty,serial,vga\0" \
>  	"slide=gpio input " __stringify(GPIO_SLIDE) "\0" \
>  	"switchmmc=mmc dev ${mmcnum}\0" \
>  	"kernaddr=0x82008000\0" \
> @@ -198,9 +194,6 @@ int rx51_kp_getc(struct stdio_dev *sdev);
>  #define CONFIG_POSTBOOTMENU \
>  	"echo;" \
>  	"echo Extra commands:;" \
> -	"echo run sercon - Use serial port for control.;" \
> -	"echo run usbcon - Use usbtty for control.;" \
> -	"echo run vgacon - Use framebuffer/keyboard.;" \
>  	"echo run sdboot - Boot from SD card slot.;" \
>  	"echo run emmcboot - Boot internal eMMC memory.;" \
>  	"echo run attachboot - Boot attached kernel image.;" \


Reviewed-by: Lukasz Majewski <lukma@denx.de>

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210206/859d7c3f/attachment.sig>

^ permalink raw reply	[flat|nested] 69+ messages in thread

* [RESEND PATCH 12/16] arm: omap3: Compile lowlevel_init() function only when it is used
  2021-02-05 19:12 ` [RESEND PATCH 12/16] arm: omap3: Compile lowlevel_init() function only when it is used Pali Rohár
  2021-02-06 15:21   ` Lukasz Majewski
@ 2021-02-06 15:40   ` Marek Vasut
  2021-02-06 15:45     ` Pali Rohár
  1 sibling, 1 reply; 69+ messages in thread
From: Marek Vasut @ 2021-02-06 15:40 UTC (permalink / raw)
  To: u-boot

On 2/5/21 8:12 PM, Pali Roh?r wrote:
> Function lowlevel_init() is called only from cpu_init_crit() and this
> function is wrapped into #if .. #endif section. So compile also
> lowlevel_init() function under same #if condition.
> 
> Signed-off-by: Pali Roh?r <pali@kernel.org>
> ---
>   arch/arm/mach-omap2/omap3/lowlevel_init.S | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mach-omap2/omap3/lowlevel_init.S b/arch/arm/mach-omap2/omap3/lowlevel_init.S
> index 2a05b5e521..4fa89418a1 100644
> --- a/arch/arm/mach-omap2/omap3/lowlevel_init.S
> +++ b/arch/arm/mach-omap2/omap3/lowlevel_init.S
> @@ -45,7 +45,7 @@ ENDPROC(do_omap3_emu_romcode_call)
>   ENTRY(cpy_clk_code)
>   	/* Copy DPLL code into SRAM */
>   	adr	r0, go_to_speed		/* copy from start of go_to_speed... */
> -	adr	r2, lowlevel_init	/* ... up to start of low_level_init */
> +	adr	r2, go_to_speed_end	/* ... up to start of go_to_speed_end */
>   next2:
>   	ldmia	r0!, {r3 - r10}		/* copy from source address [r0] */
>   	stmia	r1!, {r3 - r10}		/* copy to   target address [r1] */
> @@ -167,8 +167,11 @@ pll_div_add5:
>   pll_div_val5:
>   	.word CLSEL1_EMU_VAL
>   
> +go_to_speed_end:
>   #endif

This hunk above seems like an unrelated change ^ ?

> +#if !defined(CONFIG_SKIP_LOWLEVEL_INIT) && \
> +	!defined(CONFIG_SKIP_LOWLEVEL_INIT_ONLY)
>   ENTRY(lowlevel_init)
>   	ldr	sp, SRAM_STACK
>   	str	ip, [sp]	/* stash ip register */
> @@ -187,6 +190,7 @@ ENTRY(lowlevel_init)
>   	b	s_init
>   
>   ENDPROC(lowlevel_init)
> +#endif
>   
>   	/* the literal pools origin */
>   	.ltorg
> 

[...]

^ permalink raw reply	[flat|nested] 69+ messages in thread

* [RESEND PATCH 12/16] arm: omap3: Compile lowlevel_init() function only when it is used
  2021-02-06 15:40   ` Marek Vasut
@ 2021-02-06 15:45     ` Pali Rohár
  2021-02-06 16:50       ` Marek Vasut
  0 siblings, 1 reply; 69+ messages in thread
From: Pali Rohár @ 2021-02-06 15:45 UTC (permalink / raw)
  To: u-boot

On Saturday 06 February 2021 16:40:18 Marek Vasut wrote:
> On 2/5/21 8:12 PM, Pali Roh?r wrote:
> > Function lowlevel_init() is called only from cpu_init_crit() and this
> > function is wrapped into #if .. #endif section. So compile also
> > lowlevel_init() function under same #if condition.
> > 
> > Signed-off-by: Pali Roh?r <pali@kernel.org>
> > ---
> >   arch/arm/mach-omap2/omap3/lowlevel_init.S | 6 +++++-
> >   1 file changed, 5 insertions(+), 1 deletion(-)
> > 
> > diff --git a/arch/arm/mach-omap2/omap3/lowlevel_init.S b/arch/arm/mach-omap2/omap3/lowlevel_init.S
> > index 2a05b5e521..4fa89418a1 100644
> > --- a/arch/arm/mach-omap2/omap3/lowlevel_init.S
> > +++ b/arch/arm/mach-omap2/omap3/lowlevel_init.S
> > @@ -45,7 +45,7 @@ ENDPROC(do_omap3_emu_romcode_call)
> >   ENTRY(cpy_clk_code)
> >   	/* Copy DPLL code into SRAM */
> >   	adr	r0, go_to_speed		/* copy from start of go_to_speed... */
> > -	adr	r2, lowlevel_init	/* ... up to start of low_level_init */
> > +	adr	r2, go_to_speed_end	/* ... up to start of go_to_speed_end */
> >   next2:
> >   	ldmia	r0!, {r3 - r10}		/* copy from source address [r0] */
> >   	stmia	r1!, {r3 - r10}		/* copy to   target address [r1] */
> > @@ -167,8 +167,11 @@ pll_div_add5:
> >   pll_div_val5:
> >   	.word CLSEL1_EMU_VAL
> > +go_to_speed_end:
> >   #endif
> 
> This hunk above seems like an unrelated change ^ ?

Entry 'lowlevel_init' is defined 3 lines below and is available only
when !CONFIG_SKIP_LOWLEVEL_INIT && !CONFIG_SKIP_LOWLEVEL_INIT_ONLY.

Few lines above is code which copies DPLL code into SRAM and this code
ends at address where 'lowlevel_init' entry starts.

Entry 'cpy_clk_code' is compiled also when CONFIG_SKIP_LOWLEVEL_INIT is
defined, therefore it is required to define label which is outside of
the #if code defined below and ends after the 'go_to_speed' code.

So I defined a new 'go_to_speed_end' label to allow compiling
'cpy_clk_code' entry when CONFIG_SKIP_LOWLEVEL_INIT is defined.

> > +#if !defined(CONFIG_SKIP_LOWLEVEL_INIT) && \
> > +	!defined(CONFIG_SKIP_LOWLEVEL_INIT_ONLY)
> >   ENTRY(lowlevel_init)
> >   	ldr	sp, SRAM_STACK
> >   	str	ip, [sp]	/* stash ip register */
> > @@ -187,6 +190,7 @@ ENTRY(lowlevel_init)
> >   	b	s_init
> >   ENDPROC(lowlevel_init)
> > +#endif
> >   	/* the literal pools origin */
> >   	.ltorg
> > 
> 
> [...]

^ permalink raw reply	[flat|nested] 69+ messages in thread

* [RESEND PATCH 12/16] arm: omap3: Compile lowlevel_init() function only when it is used
  2021-02-06 15:45     ` Pali Rohár
@ 2021-02-06 16:50       ` Marek Vasut
  2021-02-07 13:50         ` Pali Rohár
  0 siblings, 1 reply; 69+ messages in thread
From: Marek Vasut @ 2021-02-06 16:50 UTC (permalink / raw)
  To: u-boot

On 2/6/21 4:45 PM, Pali Roh?r wrote:
> On Saturday 06 February 2021 16:40:18 Marek Vasut wrote:
>> On 2/5/21 8:12 PM, Pali Roh?r wrote:
>>> Function lowlevel_init() is called only from cpu_init_crit() and this
>>> function is wrapped into #if .. #endif section. So compile also
>>> lowlevel_init() function under same #if condition.
>>>
>>> Signed-off-by: Pali Roh?r <pali@kernel.org>
>>> ---
>>>    arch/arm/mach-omap2/omap3/lowlevel_init.S | 6 +++++-
>>>    1 file changed, 5 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/arch/arm/mach-omap2/omap3/lowlevel_init.S b/arch/arm/mach-omap2/omap3/lowlevel_init.S
>>> index 2a05b5e521..4fa89418a1 100644
>>> --- a/arch/arm/mach-omap2/omap3/lowlevel_init.S
>>> +++ b/arch/arm/mach-omap2/omap3/lowlevel_init.S
>>> @@ -45,7 +45,7 @@ ENDPROC(do_omap3_emu_romcode_call)
>>>    ENTRY(cpy_clk_code)
>>>    	/* Copy DPLL code into SRAM */
>>>    	adr	r0, go_to_speed		/* copy from start of go_to_speed... */
>>> -	adr	r2, lowlevel_init	/* ... up to start of low_level_init */
>>> +	adr	r2, go_to_speed_end	/* ... up to start of go_to_speed_end */
>>>    next2:
>>>    	ldmia	r0!, {r3 - r10}		/* copy from source address [r0] */
>>>    	stmia	r1!, {r3 - r10}		/* copy to   target address [r1] */
>>> @@ -167,8 +167,11 @@ pll_div_add5:
>>>    pll_div_val5:
>>>    	.word CLSEL1_EMU_VAL
>>> +go_to_speed_end:
>>>    #endif
>>
>> This hunk above seems like an unrelated change ^ ?
> 
> Entry 'lowlevel_init' is defined 3 lines below and is available only
> when !CONFIG_SKIP_LOWLEVEL_INIT && !CONFIG_SKIP_LOWLEVEL_INIT_ONLY.
> 
> Few lines above is code which copies DPLL code into SRAM and this code
> ends at address where 'lowlevel_init' entry starts.
> 
> Entry 'cpy_clk_code' is compiled also when CONFIG_SKIP_LOWLEVEL_INIT is
> defined, therefore it is required to define label which is outside of
> the #if code defined below and ends after the 'go_to_speed' code.
> 
> So I defined a new 'go_to_speed_end' label to allow compiling
> 'cpy_clk_code' entry when CONFIG_SKIP_LOWLEVEL_INIT is defined.

Can you add exactly this description to the commit message -- the change 
isn't immediately obviously, collect the RBs and resend the patchset, so 
it can be picked ?

Thanks

^ permalink raw reply	[flat|nested] 69+ messages in thread

* [RESEND v2 PATCH 00/16] Nokia RX-51: Fix USB TTY console and enable it
  2021-02-05 19:11 [RESEND PATCH 00/16] Nokia RX-51: Fix USB TTY console and enable it Pali Rohár
                   ` (15 preceding siblings ...)
  2021-02-05 19:12 ` [RESEND PATCH 16/16] Nokia RX-51: Enable usbtty serial console by default Pali Rohár
@ 2021-02-07 13:50 ` Pali Rohár
  2021-02-07 13:50   ` [RESEND v2 PATCH 01/16] serial: usbtty: Fix puts function Pali Rohár
                     ` (16 more replies)
  16 siblings, 17 replies; 69+ messages in thread
From: Pali Rohár @ 2021-02-07 13:50 UTC (permalink / raw)
  To: u-boot

    Resended v2 patch series with fixed commit messages

This patch series fix usbtty code (serial console via USB peripheral
mode), fix underlying musb peripheral code, fix compilation of
CONFIG_USB_DEVICE (used by usbtty), remove unused Nokia RX-51 code to
decrease size of U-Boot binary and finally enable usbtty serial console
for Nokia RX-51.

With this patch series debugging of Nokia RX-51 can be done also via USB
serial console.

It fixes also stability of musb code and allows usage of file transfers
via Kermit protocol on Nokia RX-51. Kermit file transfer via U-Boot loadb
command is stable on Nokia N900 and gives about 52kB/s transfer rate.

On computer this serial console is accessible via /dev/ttyACM0 device.

Pali Roh?r (16):
  serial: usbtty: Fix puts function
  serial: usbtty: Send urb data in correct order
  usb: musb: Fix compilation of gadget code
  usb: musb: Always clear the data toggle bit when configuring ep
  usb: musb: Fix configuring FIFO for endpoints
  usb: musb: Read value of PERI_RXCSR to 16bit variable
  usb: musb: Fix transmission of bigger buffers
  usb: musb: Fix receiving of bigger buffers
  usb: musb: Fix handling interrupts for EP0 and SET ADDRESS commmand
  usb: musb: Ensure that we set musb dynamic FIFO buffer for every
    endpoint
  usb: gadget: Use dbg_ep0() macro instead of serial_printf()
  arm: omap3: Compile lowlevel_init() function only when it is used
  arm: omap3: Compile s_init() function only when it is used
  Nokia RX-51: Remove function set_muxconf_regs()
  Nokia RX-51: Move content of rx51.h to rx51.c
  Nokia RX-51: Enable usbtty serial console by default

 Makefile                                  |   1 +
 arch/arm/mach-omap2/omap3/board.c         |   3 +
 arch/arm/mach-omap2/omap3/lowlevel_init.S |   6 +-
 board/nokia/rx51/rx51.c                   |  28 +-
 board/nokia/rx51/rx51.h                   | 377 ----------------------
 configs/nokia_rx51_defconfig              |   7 +-
 doc/README.nokia_rx51                     |  15 +-
 drivers/serial/usbtty.c                   |  16 +-
 drivers/usb/gadget/ep0.c                  |  16 +-
 drivers/usb/musb/musb_core.c              |  12 +-
 drivers/usb/musb/musb_udc.c               |  61 ++--
 include/configs/nokia_rx51.h              |  21 +-
 12 files changed, 82 insertions(+), 481 deletions(-)
 delete mode 100644 board/nokia/rx51/rx51.h

-- 
2.20.1

^ permalink raw reply	[flat|nested] 69+ messages in thread

* [RESEND v2 PATCH 01/16] serial: usbtty: Fix puts function
  2021-02-07 13:50 ` [RESEND v2 PATCH 00/16] Nokia RX-51: Fix USB TTY console and enable it Pali Rohár
@ 2021-02-07 13:50   ` Pali Rohár
  2021-02-07 13:50   ` [RESEND v2 PATCH 02/16] serial: usbtty: Send urb data in correct order Pali Rohár
                     ` (15 subsequent siblings)
  16 siblings, 0 replies; 69+ messages in thread
From: Pali Rohár @ 2021-02-07 13:50 UTC (permalink / raw)
  To: u-boot

This function has incorrect implementation of prepending CR prior LF.
Without this patch it prepended CR prior whole string which is going to be
written and let LF without leading CR. Fix this issue by inserting CR at
correct place to make output on usbtty serial console more readable.

Signed-off-by: Pali Roh?r <pali@kernel.org>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Acked-by: Pavel Machek <pavel@ucw.cz>
---
 drivers/serial/usbtty.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/serial/usbtty.c b/drivers/serial/usbtty.c
index f1c1a260da..02f8edf200 100644
--- a/drivers/serial/usbtty.c
+++ b/drivers/serial/usbtty.c
@@ -500,8 +500,8 @@ void usbtty_puts(struct stdio_dev *dev, const char *str)
 		n = next_nl_pos (str);
 
 		if (str[n] == '\n') {
-			__usbtty_puts("\r", 1);
-			__usbtty_puts(str, n + 1);
+			__usbtty_puts(str, n);
+			__usbtty_puts("\r\n", 2);
 			str += (n + 1);
 			len -= (n + 1);
 		} else {
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 69+ messages in thread

* [RESEND v2 PATCH 02/16] serial: usbtty: Send urb data in correct order
  2021-02-07 13:50 ` [RESEND v2 PATCH 00/16] Nokia RX-51: Fix USB TTY console and enable it Pali Rohár
  2021-02-07 13:50   ` [RESEND v2 PATCH 01/16] serial: usbtty: Fix puts function Pali Rohár
@ 2021-02-07 13:50   ` Pali Rohár
  2021-02-07 13:50   ` [RESEND v2 PATCH 03/16] usb: musb: Fix compilation of gadget code Pali Rohár
                     ` (14 subsequent siblings)
  16 siblings, 0 replies; 69+ messages in thread
From: Pali Rohár @ 2021-02-07 13:50 UTC (permalink / raw)
  To: u-boot

Function next_urb() selects the last urb data buffer from linked list to
which next data from usbtty's puts function should be appended.

But to check if TX data still exists it is needed to look at the first urb
data buffer from linked list. So check for endpoint->tx_urb (first from the
linked list) instead of current_urb (the last from the linked list).

Successful call to udc_endpoint_write() may invalidate active urb and
allocate new urb in queue which invalidates pointer returned by next_urb()
function.

So call next_urb() prior putting data into urb buffer and call it every
time after using udc_endpoint_write() function to prevent sending data from
usbtty's puts function in incorrect order.

This patch fixes issue that usbtty code does not transmit data when they
are waiting in the tx queue.

Signed-off-by: Pali Roh?r <pali@kernel.org>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Acked-by: Pavel Machek <pavel@ucw.cz>
---
 drivers/serial/usbtty.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/serial/usbtty.c b/drivers/serial/usbtty.c
index 02f8edf200..4f4eb02de0 100644
--- a/drivers/serial/usbtty.c
+++ b/drivers/serial/usbtty.c
@@ -849,17 +849,9 @@ static int write_buffer (circbuf_t * buf)
 			&endpoint_instance[tx_endpoint];
 	struct urb *current_urb = NULL;
 
-	current_urb = next_urb (device_instance, endpoint);
-
-	if (!current_urb) {
-		TTYERR ("current_urb is NULL, buf->size %d\n",
-		buf->size);
-		return 0;
-	}
-
 	/* TX data still exists - send it now
 	 */
-	if(endpoint->sent < current_urb->actual_length){
+	if(endpoint->sent < endpoint->tx_urb->actual_length){
 		if(udc_endpoint_write (endpoint)){
 			/* Write pre-empted by RX */
 			return -1;
@@ -878,6 +870,8 @@ static int write_buffer (circbuf_t * buf)
 		 */
 		while (buf->size > 0) {
 
+			current_urb = next_urb (device_instance, endpoint);
+
 			dest = (char*)current_urb->buffer +
 				current_urb->actual_length;
 
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 69+ messages in thread

* [RESEND v2 PATCH 03/16] usb: musb: Fix compilation of gadget code
  2021-02-07 13:50 ` [RESEND v2 PATCH 00/16] Nokia RX-51: Fix USB TTY console and enable it Pali Rohár
  2021-02-07 13:50   ` [RESEND v2 PATCH 01/16] serial: usbtty: Fix puts function Pali Rohár
  2021-02-07 13:50   ` [RESEND v2 PATCH 02/16] serial: usbtty: Send urb data in correct order Pali Rohár
@ 2021-02-07 13:50   ` Pali Rohár
  2021-02-07 13:50   ` [RESEND v2 PATCH 04/16] usb: musb: Always clear the data toggle bit when configuring ep Pali Rohár
                     ` (13 subsequent siblings)
  16 siblings, 0 replies; 69+ messages in thread
From: Pali Rohár @ 2021-02-07 13:50 UTC (permalink / raw)
  To: u-boot

musb udc code depends on usb gadget code provided by CONFIG_USB_DEVICE as
defined in drivers/usb/gadget/Makefile. But this Makefile is not included
into U-Boot build when CONFIG_USB_GADGET is not set. As CONFIG_USB_DEVICE
cannot be enabled together with CONFIG_USB_GADGET it means that dependency
for musb udc code is not compiled during build. Fix it by including
drivers/usb/gadget dependency also when CONFIG_USB_DEVICE is set.

This patch fixes compile errors:

arm-linux-gnueabi-ld.bfd: drivers/usb/musb/built-in.o: in function `musb_peri_ep0_rx':
u-boot/drivers/usb/musb/musb_udc.c: undefined reference to `ep0_recv_setup'
arm-linux-gnueabi-ld.bfd: drivers/usb/musb/built-in.o: in function `musb_peri_ep0_idle':
u-boot/drivers/usb/musb/musb_udc.c: undefined reference to `ep0_recv_setup'
arm-linux-gnueabi-ld.bfd: drivers/usb/musb/built-in.o: in function `musb_peri_ep0_zero_data_request':
u-boot/drivers/usb/musb/musb_udc.c: undefined reference to `usbd_device_event_irq'
arm-linux-gnueabi-ld.bfd: drivers/usb/musb/built-in.o: in function `musb_peri_ep0_idle':
u-boot/drivers/usb/musb/musb_udc.c: undefined reference to `ep0_recv_setup'
arm-linux-gnueabi-ld.bfd: drivers/usb/musb/built-in.o: in function `musb_peri_ep0_rx':
u-boot/drivers/usb/musb/musb_udc.c: undefined reference to `usbd_rcv_complete'
arm-linux-gnueabi-ld.bfd: drivers/usb/musb/built-in.o: in function `musb_peri_rx_ep':
u-boot/drivers/usb/musb/musb_udc.c: undefined reference to `usbd_rcv_complete'
arm-linux-gnueabi-ld.bfd: drivers/usb/musb/built-in.o: in function `udc_endpoint_write':
u-boot/drivers/usb/musb/musb_udc.c: undefined reference to `usbd_tx_complete'
arm-linux-gnueabi-ld.bfd: drivers/usb/musb/built-in.o: in function `udc_irq':
u-boot/drivers/usb/musb/musb_udc.c: undefined reference to `usbd_device_event_irq'
arm-linux-gnueabi-ld.bfd: u-boot/drivers/usb/musb/musb_udc.c: undefined reference to `usbd_device_event_irq'
arm-linux-gnueabi-ld.bfd: u-boot/drivers/usb/musb/musb_udc.c: undefined reference to `usbd_device_event_irq'
arm-linux-gnueabi-ld.bfd: u-boot/drivers/usb/musb/musb_udc.c: undefined reference to `usbd_device_event_irq'
arm-linux-gnueabi-ld.bfd: u-boot/drivers/usb/musb/musb_udc.c: undefined reference to `usbd_device_event_irq'
arm-linux-gnueabi-ld.bfd: drivers/usb/musb/built-in.o:u-boot/drivers/usb/musb/musb_udc.c: more undefined references to `usbd_device_event_irq' follow
arm-linux-gnueabi-ld.bfd: drivers/usb/musb/built-in.o: in function `udc_setup_ep':
u-boot/drivers/usb/musb/musb_udc.c: undefined reference to `usbd_alloc_urb'
arm-linux-gnueabi-ld.bfd: drivers/usb/musb/built-in.o: in function `udc_startup_events':
u-boot/drivers/usb/musb/musb_udc.c: undefined reference to `usbd_device_event_irq'
arm-linux-gnueabi-ld.bfd: u-boot/drivers/usb/musb/musb_udc.c: undefined reference to `usbd_device_event_irq'
arm-linux-gnueabi-ld.bfd: u-boot/drivers/usb/musb/musb_udc.c: undefined reference to `usbd_device_event_irq'
make: *** [Makefile:1762: u-boot] Error 1

Signed-off-by: Pali Roh?r <pali@kernel.org>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Acked-by: Pavel Machek <pavel@ucw.cz>
---
 Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Makefile b/Makefile
index 23dd11f723..2173344497 100644
--- a/Makefile
+++ b/Makefile
@@ -792,6 +792,7 @@ libs-y += drivers/usb/dwc3/
 libs-y += drivers/usb/common/
 libs-y += drivers/usb/emul/
 libs-y += drivers/usb/eth/
+libs-$(CONFIG_USB_DEVICE) += drivers/usb/gadget/
 libs-$(CONFIG_USB_GADGET) += drivers/usb/gadget/
 libs-$(CONFIG_USB_GADGET) += drivers/usb/gadget/udc/
 libs-y += drivers/usb/host/
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 69+ messages in thread

* [RESEND v2 PATCH 04/16] usb: musb: Always clear the data toggle bit when configuring ep
  2021-02-07 13:50 ` [RESEND v2 PATCH 00/16] Nokia RX-51: Fix USB TTY console and enable it Pali Rohár
                     ` (2 preceding siblings ...)
  2021-02-07 13:50   ` [RESEND v2 PATCH 03/16] usb: musb: Fix compilation of gadget code Pali Rohár
@ 2021-02-07 13:50   ` Pali Rohár
  2021-02-07 13:50   ` [RESEND v2 PATCH 05/16] usb: musb: Fix configuring FIFO for endpoints Pali Rohár
                     ` (12 subsequent siblings)
  16 siblings, 0 replies; 69+ messages in thread
From: Pali Rohár @ 2021-02-07 13:50 UTC (permalink / raw)
  To: u-boot

Without this patch clearing was done only when U-Boot was compiled with
MUSB Host Controller. But clearing of data toggle bit is needed also for
MUSB Device Controller otherwise Device Controller does not work correctly.

Signed-off-by: Pali Roh?r <pali@kernel.org>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Acked-by: Pavel Machek <pavel@ucw.cz>
---
 drivers/usb/musb/musb_core.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 147b2eb929..cc6dc3839d 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -81,10 +81,8 @@ void musb_configure_ep(const struct musb_epinfo *epinfo, u8 cnt)
 			config_fifo(tx, idx, fifoaddr);
 
 			csr = readw(&musbr->txcsr);
-#if defined(CONFIG_USB_MUSB_HCD)
 			/* clear the data toggle bit */
 			writew(csr | MUSB_TXCSR_CLRDATATOG, &musbr->txcsr);
-#endif
 			/* Flush fifo if required */
 			if (csr & MUSB_TXCSR_TXPKTRDY)
 				writew(csr | MUSB_TXCSR_FLUSHFIFO,
@@ -94,10 +92,8 @@ void musb_configure_ep(const struct musb_epinfo *epinfo, u8 cnt)
 			config_fifo(rx, idx, fifoaddr);
 
 			csr = readw(&musbr->rxcsr);
-#if defined(CONFIG_USB_MUSB_HCD)
 			/* clear the data toggle bit */
 			writew(csr | MUSB_RXCSR_CLRDATATOG, &musbr->rxcsr);
-#endif
 			/* Flush fifo if required */
 			if (csr & MUSB_RXCSR_RXPKTRDY)
 				writew(csr | MUSB_RXCSR_FLUSHFIFO,
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 69+ messages in thread

* [RESEND v2 PATCH 05/16] usb: musb: Fix configuring FIFO for endpoints
  2021-02-07 13:50 ` [RESEND v2 PATCH 00/16] Nokia RX-51: Fix USB TTY console and enable it Pali Rohár
                     ` (3 preceding siblings ...)
  2021-02-07 13:50   ` [RESEND v2 PATCH 04/16] usb: musb: Always clear the data toggle bit when configuring ep Pali Rohár
@ 2021-02-07 13:50   ` Pali Rohár
  2021-02-07 13:50   ` [RESEND v2 PATCH 06/16] usb: musb: Read value of PERI_RXCSR to 16bit variable Pali Rohár
                     ` (11 subsequent siblings)
  16 siblings, 0 replies; 69+ messages in thread
From: Pali Rohár @ 2021-02-07 13:50 UTC (permalink / raw)
  To: u-boot

This patch fixes configuring FIFOs for one-directional endpoints which have
only one queue (either RX or TX, but noth both).

Size of FIFO buffer is 2^(idx+3) bytes and starting address is 2^(addr+3).
Moreover first 64 bytes are reserved for EP0.

Without this patch if FIFO size specified by caller was zero then idx was
incorrectly calculated (expr. ffs(0)-1) and size overflowed in fifosz
register. This register uses has only 4 bits for FIFO size. Moreover
specifying zero buffer size is not possible (with idx=0 is minimal buffer
size 8 bytes).

So even for one-directional endpoints we need to correctly specify both
(RX and TX) FIFO buffer sizes and its addresses.

This patch is fixing calculation of start address and buffer size to
minimal value and ensures that it would not overlap with buffer reserved
for EP0.

This issue caused loose of packets on USB bus in both directions and
basically usbtty was unusable.

Signed-off-by: Pali Roh?r <pali@kernel.org>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Acked-by: Pavel Machek <pavel@ucw.cz>
---
 drivers/usb/musb/musb_core.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index cc6dc3839d..9651f074a4 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -50,7 +50,7 @@ void musb_start(void)
 # define config_fifo(dir, idx, addr) \
 	do { \
 		writeb(idx, &musbr->dir##fifosz); \
-		writew(fifoaddr >> 3, &musbr->dir##fifoadd); \
+		writew(addr, &musbr->dir##fifoadd); \
 	} while (0)
 #endif
 
@@ -66,14 +66,14 @@ void musb_start(void)
 void musb_configure_ep(const struct musb_epinfo *epinfo, u8 cnt)
 {
 	u16 csr;
-	u16 fifoaddr = 64; /* First 64 bytes of FIFO reserved for EP0 */
+	u16 fifoaddr = 64 >> 3; /* First 64 bytes of FIFO reserved for EP0 */
 	u32 fifosize;
 	u8  idx;
 
 	while (cnt--) {
 		/* prepare fifosize to write to register */
 		fifosize = epinfo->epsize >> 3;
-		idx = ffs(fifosize) - 1;
+		idx = fifosize ? ((ffs(fifosize) - 1) & 0xF) : 0;
 
 		writeb(epinfo->epnum, &musbr->index);
 		if (epinfo->epdir) {
@@ -99,7 +99,7 @@ void musb_configure_ep(const struct musb_epinfo *epinfo, u8 cnt)
 				writew(csr | MUSB_RXCSR_FLUSHFIFO,
 					&musbr->rxcsr);
 		}
-		fifoaddr += epinfo->epsize;
+		fifoaddr += 1 << idx;
 		epinfo++;
 	}
 }
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 69+ messages in thread

* [RESEND v2 PATCH 06/16] usb: musb: Read value of PERI_RXCSR to 16bit variable
  2021-02-07 13:50 ` [RESEND v2 PATCH 00/16] Nokia RX-51: Fix USB TTY console and enable it Pali Rohár
                     ` (4 preceding siblings ...)
  2021-02-07 13:50   ` [RESEND v2 PATCH 05/16] usb: musb: Fix configuring FIFO for endpoints Pali Rohár
@ 2021-02-07 13:50   ` Pali Rohár
  2021-02-07 13:50   ` [RESEND v2 PATCH 07/16] usb: musb: Fix transmission of bigger buffers Pali Rohár
                     ` (10 subsequent siblings)
  16 siblings, 0 replies; 69+ messages in thread
From: Pali Rohár @ 2021-02-07 13:50 UTC (permalink / raw)
  To: u-boot

PERI_RXCSR is 16bit register so store its value into 16bit local variable.

Signed-off-by: Pali Roh?r <pali@kernel.org>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Acked-by: Pavel Machek <pavel@ucw.cz>
---
 drivers/usb/musb/musb_udc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/musb/musb_udc.c b/drivers/usb/musb/musb_udc.c
index d901f8777c..67d1c56f9a 100644
--- a/drivers/usb/musb/musb_udc.c
+++ b/drivers/usb/musb/musb_udc.c
@@ -629,7 +629,7 @@ static void musb_peri_ep0(void)
 static void musb_peri_rx_ep(unsigned int ep)
 {
 	u16 peri_rxcount;
-	u8 peri_rxcsr = readw(&musbr->ep[ep].epN.rxcsr);
+	u16 peri_rxcsr = readw(&musbr->ep[ep].epN.rxcsr);
 
 	if (!(peri_rxcsr & MUSB_RXCSR_RXPKTRDY)) {
 		if (debug_level > 0)
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 69+ messages in thread

* [RESEND v2 PATCH 07/16] usb: musb: Fix transmission of bigger buffers
  2021-02-07 13:50 ` [RESEND v2 PATCH 00/16] Nokia RX-51: Fix USB TTY console and enable it Pali Rohár
                     ` (5 preceding siblings ...)
  2021-02-07 13:50   ` [RESEND v2 PATCH 06/16] usb: musb: Read value of PERI_RXCSR to 16bit variable Pali Rohár
@ 2021-02-07 13:50   ` Pali Rohár
  2021-02-07 13:50   ` [RESEND v2 PATCH 08/16] usb: musb: Fix receiving " Pali Rohár
                     ` (9 subsequent siblings)
  16 siblings, 0 replies; 69+ messages in thread
From: Pali Rohár @ 2021-02-07 13:50 UTC (permalink / raw)
  To: u-boot

If udc_endpoint_write() was called with bigger payload which does not fit
into one USB packet it is needed to transmit payload in more USB packets.
First packet is transmitted by udc_endpoint_write() call itself and other
packets are put into waiting queue.

Implement function musb_peri_tx() which checks if endpoints are ready for
transmit and continue transmission of waiting queue.

This patch fixes sending big output from printenv command over usbtty
serial console.

Signed-off-by: Pali Roh?r <pali@kernel.org>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Acked-by: Pavel Machek <pavel@ucw.cz>>
---
 drivers/usb/musb/musb_udc.c | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)

diff --git a/drivers/usb/musb/musb_udc.c b/drivers/usb/musb/musb_udc.c
index 67d1c56f9a..28719cc3f6 100644
--- a/drivers/usb/musb/musb_udc.c
+++ b/drivers/usb/musb/musb_udc.c
@@ -708,21 +708,16 @@ static void musb_peri_rx(u16 intr)
 
 static void musb_peri_tx(u16 intr)
 {
+	unsigned int ep;
+
 	/* Check for EP0 */
 	if (0x01 & intr)
 		musb_peri_ep0_tx();
 
-	/*
-	 * Use this in the future when handling epN tx
-	 *
-	 * u8 ep;
-	 *
-	 * for (ep = 1; ep < 16; ep++) {
-	 *	if ((1 << ep) & intr) {
-	 *		/ * handle tx for this endpoint * /
-	 *	}
-	 * }
-	 */
+	for (ep = 1; ep < 16; ep++) {
+		if ((1 << ep) & intr)
+			udc_endpoint_write(GET_ENDPOINT(udc_device, ep));
+	}
 }
 
 void udc_irq(void)
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 69+ messages in thread

* [RESEND v2 PATCH 08/16] usb: musb: Fix receiving of bigger buffers
  2021-02-07 13:50 ` [RESEND v2 PATCH 00/16] Nokia RX-51: Fix USB TTY console and enable it Pali Rohár
                     ` (6 preceding siblings ...)
  2021-02-07 13:50   ` [RESEND v2 PATCH 07/16] usb: musb: Fix transmission of bigger buffers Pali Rohár
@ 2021-02-07 13:50   ` Pali Rohár
  2021-02-07 13:50   ` [RESEND v2 PATCH 09/16] usb: musb: Fix handling interrupts for EP0 and SET ADDRESS commmand Pali Rohár
                     ` (8 subsequent siblings)
  16 siblings, 0 replies; 69+ messages in thread
From: Pali Rohár @ 2021-02-07 13:50 UTC (permalink / raw)
  To: u-boot

If musb_peri_rx_ep() was called to process received HW buffer but U-Boot
cannot read it yet (e.g. because U-Boot SW buffer is full) then interrupt
was marked as processed also when HW buffer stayed unprocessed.

U-Boot tried to process this buffer again when it received interrupt again,
but it can receive it only when sender (host) sends a new data. As sender
(host) is not going to send a new data until U-Boot process current data
this issue caused a deadlock in case sender (host) is emitting data faster
than U-Boot can process it.

Reading musb intrrx register automatically clears this register and marks
interrupt as processed. So to prevent marking interrupt in U-Boot as
processed, adds a new variable pending_intrrx which would contain
unprocessed bits of intrrx register.

For a second step, every time when musb_peri_rx_ep() is called and there
are waiting data to be processed (signaled by MUSB_RXCSR_RXPKTRDY) either
acknowledge sender (via musb_peri_rx_ack()) that whole HW buffer was
processed or set corresponding bit in pending_intrrx that HW buffer was not
fully processed yet and next iteration is required after U-Boot allocates
space for reading HW buffer.

This patch fixes receiving large usb buffers, e.g. file transfer via Kermit
protocol implemented by 'loadb' U-Boot command over usbtty serial console.

Signed-off-by: Pali Roh?r <pali@kernel.org>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Acked-by: Pavel Machek <pavel@ucw.cz>
---
 drivers/usb/musb/musb_udc.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/musb/musb_udc.c b/drivers/usb/musb/musb_udc.c
index 28719cc3f6..41fff94df4 100644
--- a/drivers/usb/musb/musb_udc.c
+++ b/drivers/usb/musb/musb_udc.c
@@ -104,6 +104,8 @@ struct usb_endpoint_instance *ep0_endpoint;
 static struct usb_device_instance *udc_device;
 static int enabled;
 
+static u16 pending_intrrx;
+
 #ifdef MUSB_DEBUG
 static void musb_db_regs(void)
 {
@@ -664,7 +666,10 @@ static void musb_peri_rx_ep(unsigned int ep)
 				/* The common musb fifo reader */
 				read_fifo(ep, length, data);
 
-				musb_peri_rx_ack(ep);
+				if (length == peri_rxcount)
+					musb_peri_rx_ack(ep);
+				else
+					pending_intrrx |= (1 << ep);
 
 				/*
 				 * urb's actual_length is updated in
@@ -677,18 +682,24 @@ static void musb_peri_rx_ep(unsigned int ep)
 					serial_printf("ERROR : %s %d no space "
 						      "in rcv buffer\n",
 						      __PRETTY_FUNCTION__, ep);
+
+				pending_intrrx |= (1 << ep);
 			}
 		} else {
 			if (debug_level > 0)
 				serial_printf("ERROR : %s %d problem with "
 					      "endpoint\n",
 					      __PRETTY_FUNCTION__, ep);
+
+			pending_intrrx |= (1 << ep);
 		}
 
 	} else {
 		if (debug_level > 0)
 			serial_printf("ERROR : %s %d with nothing to do\n",
 				      __PRETTY_FUNCTION__, ep);
+
+		musb_peri_rx_ack(ep);
 	}
 }
 
@@ -770,6 +781,9 @@ void udc_irq(void)
 			intrrx = readw(&musbr->intrrx);
 			intrtx = readw(&musbr->intrtx);
 
+			intrrx |= pending_intrrx;
+			pending_intrrx = 0;
+
 			if (intrrx)
 				musb_peri_rx(intrrx);
 
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 69+ messages in thread

* [RESEND v2 PATCH 09/16] usb: musb: Fix handling interrupts for EP0 and SET ADDRESS commmand
  2021-02-07 13:50 ` [RESEND v2 PATCH 00/16] Nokia RX-51: Fix USB TTY console and enable it Pali Rohár
                     ` (7 preceding siblings ...)
  2021-02-07 13:50   ` [RESEND v2 PATCH 08/16] usb: musb: Fix receiving " Pali Rohár
@ 2021-02-07 13:50   ` Pali Rohár
  2021-02-07 13:50   ` [RESEND v2 PATCH 10/16] usb: musb: Ensure that we set musb dynamic FIFO buffer for every endpoint Pali Rohár
                     ` (7 subsequent siblings)
  16 siblings, 0 replies; 69+ messages in thread
From: Pali Rohár @ 2021-02-07 13:50 UTC (permalink / raw)
  To: u-boot

Interrupt for EP0 is indicated in intrtx register via first bit. This bit
is set for both RX and TX despite register has only TX in its name. First
bit in intrrx register is reserved, not used and never set.

So remove calling musb_peri_ep0() function at every iteration of udc_irq()
and musb_peri_rx() and call it only from musb_peri_tx() when correct
interrupt bit in initrtx it set.

Address from SET ADDRESS command must be set to faddr register only after
acknowledging SERV_RXPKTRDY followed by received EP0 interrupt. So prior
calling musb_peri_ep0_set_address() check for EP0 interrupt instead of
(incorrect) MUSB_INTR_SOF interrupt.

This patch fixes issue that host (computer) cannot register U-Boot USB
device and is failing with errors:

    usb 1-1: new full-speed USB device number 86 using xhci_hcd
    usb 1-1: Device not responding to setup address.
    usb 1-1: Device not responding to setup address.
    usb 1-1: device not accepting address 86, error -71

U-Boot was writing address to faddr register too early and did not wait for
correct interrupt after which should update address.

Signed-off-by: Pali Roh?r <pali@kernel.org>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Acked-by: Pavel Machek <pavel@ucw.cz>
---
 drivers/usb/musb/musb_udc.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/usb/musb/musb_udc.c b/drivers/usb/musb/musb_udc.c
index 41fff94df4..8d48056f08 100644
--- a/drivers/usb/musb/musb_udc.c
+++ b/drivers/usb/musb/musb_udc.c
@@ -707,9 +707,7 @@ static void musb_peri_rx(u16 intr)
 {
 	unsigned int ep;
 
-	/* Check for EP0 */
-	if (0x01 & intr)
-		musb_peri_ep0();
+	/* First bit is reserved and does not indicate interrupt for EP0 */
 
 	for (ep = 1; ep < 16; ep++) {
 		if ((1 << ep) & intr)
@@ -721,9 +719,9 @@ static void musb_peri_tx(u16 intr)
 {
 	unsigned int ep;
 
-	/* Check for EP0 */
+	/* Check for EP0: first bit indicates interrupt for both RX and TX */
 	if (0x01 & intr)
-		musb_peri_ep0_tx();
+		musb_peri_ep0();
 
 	for (ep = 1; ep < 16; ep++) {
 		if ((1 << ep) & intr)
@@ -750,8 +748,6 @@ void udc_irq(void)
 			musb_peri_resume();
 		}
 
-		musb_peri_ep0();
-
 		if (MUSB_INTR_RESET & intrusb) {
 			usbd_device_event_irq(udc_device, DEVICE_RESET, 0);
 			musb_peri_reset();
@@ -790,7 +786,7 @@ void udc_irq(void)
 			if (intrtx)
 				musb_peri_tx(intrtx);
 		} else {
-			if (MUSB_INTR_SOF & intrusb) {
+			if (readw(&musbr->intrtx) & 0x1) {
 				u8 faddr;
 				faddr = readb(&musbr->faddr);
 				/*
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 69+ messages in thread

* [RESEND v2 PATCH 10/16] usb: musb: Ensure that we set musb dynamic FIFO buffer for every endpoint
  2021-02-07 13:50 ` [RESEND v2 PATCH 00/16] Nokia RX-51: Fix USB TTY console and enable it Pali Rohár
                     ` (8 preceding siblings ...)
  2021-02-07 13:50   ` [RESEND v2 PATCH 09/16] usb: musb: Fix handling interrupts for EP0 and SET ADDRESS commmand Pali Rohár
@ 2021-02-07 13:50   ` Pali Rohár
  2021-02-07 13:50   ` [RESEND v2 PATCH 11/16] usb: gadget: Use dbg_ep0() macro instead of serial_printf() Pali Rohár
                     ` (6 subsequent siblings)
  16 siblings, 0 replies; 69+ messages in thread
From: Pali Rohár @ 2021-02-07 13:50 UTC (permalink / raw)
  To: u-boot

If we do not set FIFO buffer address and size for some endpoint which is in
use then default programmed address 0x0 would be used which is in conflict
with address of FIFO buffer for endpoint 0. Moreover address of FIFO buffer
for endpoint 0 cannot be programmed, it is fixed to 0x0. Sharing address
space between more endpoints cause data loss and unexpected errors.

This patch is fixing transmission of characters over usbtty serial console
and allows using of usbtty for debugging purposes on Nokia N900.

Signed-off-by: Pali Roh?r <pali@kernel.org>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Acked-by: Pavel Machek <pavel@ucw.cz>
---
 drivers/usb/musb/musb_udc.c | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/drivers/usb/musb/musb_udc.c b/drivers/usb/musb/musb_udc.c
index 8d48056f08..b9510e3045 100644
--- a/drivers/usb/musb/musb_udc.c
+++ b/drivers/usb/musb/musb_udc.c
@@ -875,18 +875,8 @@ void udc_setup_ep(struct usb_device_instance *device, unsigned int id,
 		ep0_endpoint->endpoint_address = 0xff;
 		ep0_urb = usbd_alloc_urb(device, endpoint);
 	} else if (MAX_ENDPOINT >= id) {
-		int ep_addr;
-
-		/* Check the direction */
-		ep_addr = endpoint->endpoint_address;
-		if (USB_DIR_IN == (ep_addr & USB_ENDPOINT_DIR_MASK)) {
-			/* IN */
-			epinfo[(id * 2) + 1].epsize = endpoint->tx_packetSize;
-		} else {
-			/* OUT */
-			epinfo[id * 2].epsize = endpoint->rcv_packetSize;
-		}
-
+		epinfo[(id * 2) + 0].epsize = endpoint->rcv_packetSize;
+		epinfo[(id * 2) + 1].epsize = endpoint->tx_packetSize;
 		musb_configure_ep(&epinfo[0], ARRAY_SIZE(epinfo));
 	} else {
 		if (debug_level > 0)
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 69+ messages in thread

* [RESEND v2 PATCH 11/16] usb: gadget: Use dbg_ep0() macro instead of serial_printf()
  2021-02-07 13:50 ` [RESEND v2 PATCH 00/16] Nokia RX-51: Fix USB TTY console and enable it Pali Rohár
                     ` (9 preceding siblings ...)
  2021-02-07 13:50   ` [RESEND v2 PATCH 10/16] usb: musb: Ensure that we set musb dynamic FIFO buffer for every endpoint Pali Rohár
@ 2021-02-07 13:50   ` Pali Rohár
  2021-02-07 13:50   ` [RESEND v2 PATCH 12/16] arm: omap3: Compile lowlevel_init() function only when it is used Pali Rohár
                     ` (5 subsequent siblings)
  16 siblings, 0 replies; 69+ messages in thread
From: Pali Rohár @ 2021-02-07 13:50 UTC (permalink / raw)
  To: u-boot

All debug messages from ep0.c except a few are printed by dbg_ep0() macro.
So for remaining few exceptions use also dbg_ep0() instead of serial_printf().

Signed-off-by: Pali Roh?r <pali@kernel.org>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Acked-by: Pavel Machek <pavel@ucw.cz>
---
 drivers/usb/gadget/ep0.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/usb/gadget/ep0.c b/drivers/usb/gadget/ep0.c
index 457679f0a4..6624f61b76 100644
--- a/drivers/usb/gadget/ep0.c
+++ b/drivers/usb/gadget/ep0.c
@@ -294,7 +294,7 @@ static int ep0_get_descriptor (struct usb_device_instance *device,
 		{
 			struct usb_string_descriptor *string_descriptor;
 			if (!(string_descriptor = usbd_get_string (index))) {
-				serial_printf("Invalid string index %d\n", index);
+				dbg_ep0(0, "Invalid string index %d\n", index);
 				return -1;
 			}
 			dbg_ep0(3, "string_descriptor: %p length %d", string_descriptor, string_descriptor->bLength);
@@ -302,14 +302,14 @@ static int ep0_get_descriptor (struct usb_device_instance *device,
 		}
 		break;
 	case USB_DESCRIPTOR_TYPE_INTERFACE:
-	serial_printf("USB_DESCRIPTOR_TYPE_INTERFACE - error not implemented\n");
+		dbg_ep0(2, "USB_DESCRIPTOR_TYPE_INTERFACE - error not implemented\n");
 		return -1;
 	case USB_DESCRIPTOR_TYPE_ENDPOINT:
-		serial_printf("USB_DESCRIPTOR_TYPE_ENDPOINT - error not implemented\n");
+		dbg_ep0(2, "USB_DESCRIPTOR_TYPE_ENDPOINT - error not implemented\n");
 		return -1;
 	case USB_DESCRIPTOR_TYPE_HID:
 		{
-			serial_printf("USB_DESCRIPTOR_TYPE_HID - error not implemented\n");
+			dbg_ep0(2, "USB_DESCRIPTOR_TYPE_HID - error not implemented\n");
 			return -1;	/* unsupported at this time */
 #if 0
 			int bNumInterface =
@@ -338,7 +338,7 @@ static int ep0_get_descriptor (struct usb_device_instance *device,
 		break;
 	case USB_DESCRIPTOR_TYPE_REPORT:
 		{
-			serial_printf("USB_DESCRIPTOR_TYPE_REPORT - error not implemented\n");
+			dbg_ep0(2, "USB_DESCRIPTOR_TYPE_REPORT - error not implemented\n");
 			return -1;	/* unsupported at this time */
 #if 0
 			int bNumInterface =
@@ -531,7 +531,7 @@ int ep0_recv_setup (struct urb *urb)
 						   le16_to_cpu (request->wValue) & 0xff);
 
 		case USB_REQ_GET_CONFIGURATION:
-			serial_printf("get config %d\n", device->configuration);
+			dbg_ep0(2, "get config %d\n", device->configuration);
 			return ep0_get_one (device, urb,
 					    device->configuration);
 
@@ -621,14 +621,14 @@ int ep0_recv_setup (struct urb *urb)
 			device->interface = device->alternate = 0;
 
 			/*dbg_ep0(2, "set configuration: %d", device->configuration); */
-			/*serial_printf("DEVICE_CONFIGURED.. event?\n"); */
+			/*dbg_ep0(2, "DEVICE_CONFIGURED.. event?\n"); */
 			return 0;
 
 		case USB_REQ_SET_INTERFACE:
 			device->interface = le16_to_cpu (request->wIndex);
 			device->alternate = le16_to_cpu (request->wValue);
 			/*dbg_ep0(2, "set interface: %d alternate: %d", device->interface, device->alternate); */
-			serial_printf("DEVICE_SET_INTERFACE.. event?\n");
+			dbg_ep0(2, "DEVICE_SET_INTERFACE.. event?\n");
 			return 0;
 
 		case USB_REQ_GET_STATUS:
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 69+ messages in thread

* [RESEND v2 PATCH 12/16] arm: omap3: Compile lowlevel_init() function only when it is used
  2021-02-07 13:50 ` [RESEND v2 PATCH 00/16] Nokia RX-51: Fix USB TTY console and enable it Pali Rohár
                     ` (10 preceding siblings ...)
  2021-02-07 13:50   ` [RESEND v2 PATCH 11/16] usb: gadget: Use dbg_ep0() macro instead of serial_printf() Pali Rohár
@ 2021-02-07 13:50   ` Pali Rohár
  2021-02-07 13:50   ` [RESEND v2 PATCH 13/16] arm: omap3: Compile s_init() " Pali Rohár
                     ` (4 subsequent siblings)
  16 siblings, 0 replies; 69+ messages in thread
From: Pali Rohár @ 2021-02-07 13:50 UTC (permalink / raw)
  To: u-boot

Function lowlevel_init() is called only from cpu_init_crit() and this
function is wrapped into #if .. #endif section. So compile also
lowlevel_init() function under same #if condition.

Function cpy_clk_code() uses lowlevel_init symbol to get address where
go_to_speed code ends. As this symbol is not available anymore when
compiling with CONFIG_SKIP_LOWLEVEL_INIT, defines a new label
go_to_speed_end at the place where go_to_speed code ends.

Signed-off-by: Pali Roh?r <pali@kernel.org>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Acked-by: Pavel Machek <pavel@ucw.cz>
---
 arch/arm/mach-omap2/omap3/lowlevel_init.S | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-omap2/omap3/lowlevel_init.S b/arch/arm/mach-omap2/omap3/lowlevel_init.S
index 2a05b5e521..4fa89418a1 100644
--- a/arch/arm/mach-omap2/omap3/lowlevel_init.S
+++ b/arch/arm/mach-omap2/omap3/lowlevel_init.S
@@ -45,7 +45,7 @@ ENDPROC(do_omap3_emu_romcode_call)
 ENTRY(cpy_clk_code)
 	/* Copy DPLL code into SRAM */
 	adr	r0, go_to_speed		/* copy from start of go_to_speed... */
-	adr	r2, lowlevel_init	/* ... up to start of low_level_init */
+	adr	r2, go_to_speed_end	/* ... up to start of go_to_speed_end */
 next2:
 	ldmia	r0!, {r3 - r10}		/* copy from source address [r0] */
 	stmia	r1!, {r3 - r10}		/* copy to   target address [r1] */
@@ -167,8 +167,11 @@ pll_div_add5:
 pll_div_val5:
 	.word CLSEL1_EMU_VAL
 
+go_to_speed_end:
 #endif
 
+#if !defined(CONFIG_SKIP_LOWLEVEL_INIT) && \
+	!defined(CONFIG_SKIP_LOWLEVEL_INIT_ONLY)
 ENTRY(lowlevel_init)
 	ldr	sp, SRAM_STACK
 	str	ip, [sp]	/* stash ip register */
@@ -187,6 +190,7 @@ ENTRY(lowlevel_init)
 	b	s_init
 
 ENDPROC(lowlevel_init)
+#endif
 
 	/* the literal pools origin */
 	.ltorg
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 69+ messages in thread

* [RESEND v2 PATCH 13/16] arm: omap3: Compile s_init() function only when it is used
  2021-02-07 13:50 ` [RESEND v2 PATCH 00/16] Nokia RX-51: Fix USB TTY console and enable it Pali Rohár
                     ` (11 preceding siblings ...)
  2021-02-07 13:50   ` [RESEND v2 PATCH 12/16] arm: omap3: Compile lowlevel_init() function only when it is used Pali Rohár
@ 2021-02-07 13:50   ` Pali Rohár
  2021-02-07 13:50   ` [RESEND v2 PATCH 14/16] Nokia RX-51: Remove function set_muxconf_regs() Pali Rohár
                     ` (3 subsequent siblings)
  16 siblings, 0 replies; 69+ messages in thread
From: Pali Rohár @ 2021-02-07 13:50 UTC (permalink / raw)
  To: u-boot

Function s_init() is called only from lowlevel_init(). So compile it only
when function lowlevel_init() is compiled.

Signed-off-by: Pali Roh?r <pali@kernel.org>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Acked-by: Pavel Machek <pavel@ucw.cz>
---
 arch/arm/mach-omap2/omap3/board.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/mach-omap2/omap3/board.c b/arch/arm/mach-omap2/omap3/board.c
index 4da8df47cc..029bd54595 100644
--- a/arch/arm/mach-omap2/omap3/board.c
+++ b/arch/arm/mach-omap2/omap3/board.c
@@ -179,6 +179,8 @@ void early_system_init(void)
 	hw_data_init();
 }
 
+#if !defined(CONFIG_SKIP_LOWLEVEL_INIT) && \
+	!defined(CONFIG_SKIP_LOWLEVEL_INIT_ONLY)
 /******************************************************************************
  * Routine: s_init
  * Description: Does early system init of muxing and clocks.
@@ -207,6 +209,7 @@ void s_init(void)
 	ehci_clocks_enable();
 #endif
 }
+#endif
 
 #ifdef CONFIG_SPL_BUILD
 void board_init_f(ulong dummy)
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 69+ messages in thread

* [RESEND v2 PATCH 14/16] Nokia RX-51: Remove function set_muxconf_regs()
  2021-02-07 13:50 ` [RESEND v2 PATCH 00/16] Nokia RX-51: Fix USB TTY console and enable it Pali Rohár
                     ` (12 preceding siblings ...)
  2021-02-07 13:50   ` [RESEND v2 PATCH 13/16] arm: omap3: Compile s_init() " Pali Rohár
@ 2021-02-07 13:50   ` Pali Rohár
  2021-02-07 13:50   ` [RESEND v2 PATCH 15/16] Nokia RX-51: Move content of rx51.h to rx51.c Pali Rohár
                     ` (2 subsequent siblings)
  16 siblings, 0 replies; 69+ messages in thread
From: Pali Rohár @ 2021-02-07 13:50 UTC (permalink / raw)
  To: u-boot

This function is not used and was never called.

This board contains '#define CONFIG_SKIP_LOWLEVEL_INIT' because X-Loader
set everything up, including MUX configuration.

Also this MUX configuration is incorrect and does not match hardware.

So remove this dead, unused and broken code.

This change will decrease size of U-Boot binary.

Signed-off-by: Pali Roh?r <pali@kernel.org>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Acked-by: Pavel Machek <pavel@ucw.cz>
---
 board/nokia/rx51/rx51.c |  11 --
 board/nokia/rx51/rx51.h | 346 ----------------------------------------
 2 files changed, 357 deletions(-)

diff --git a/board/nokia/rx51/rx51.c b/board/nokia/rx51/rx51.c
index 84739ae129..cb72ffaaa9 100644
--- a/board/nokia/rx51/rx51.c
+++ b/board/nokia/rx51/rx51.c
@@ -467,17 +467,6 @@ int misc_init_r(void)
 	return 0;
 }
 
-/*
- * Routine: set_muxconf_regs
- * Description: Setting up the configuration Mux registers specific to the
- *		hardware. Many pins need to be moved from protect to primary
- *		mode.
- */
-void set_muxconf_regs(void)
-{
-	MUX_RX51();
-}
-
 static unsigned long int twl_wd_time; /* last time of watchdog reset */
 static unsigned long int twl_i2c_lock;
 
diff --git a/board/nokia/rx51/rx51.h b/board/nokia/rx51/rx51.h
index 4eff823a1b..0eddb06219 100644
--- a/board/nokia/rx51/rx51.h
+++ b/board/nokia/rx51/rx51.h
@@ -21,352 +21,6 @@ struct emu_hal_params_rx51 {
 	u32 param4;
 };
 
-/*
- * IEN  - Input Enable
- * IDIS - Input Disable
- * PTD  - Pull type Down
- * PTU  - Pull type Up
- * DIS  - Pull type selection is inactive
- * EN   - Pull type selection is active
- * M0   - Mode 0
- * The commented string gives the final mux configuration for that pin
- */
-#define MUX_RX51() \
-/* SDRC */\
-	MUX_VAL(CP(SDRC_D0),		(IEN  | PTD | DIS | M0)) /*SDRC_D0*/\
-	MUX_VAL(CP(SDRC_D1),		(IEN  | PTD | DIS | M0)) /*SDRC_D1*/\
-	MUX_VAL(CP(SDRC_D2),		(IEN  | PTD | DIS | M0)) /*SDRC_D2*/\
-	MUX_VAL(CP(SDRC_D3),		(IEN  | PTD | DIS | M0)) /*SDRC_D3*/\
-	MUX_VAL(CP(SDRC_D4),		(IEN  | PTD | DIS | M0)) /*SDRC_D4*/\
-	MUX_VAL(CP(SDRC_D5),		(IEN  | PTD | DIS | M0)) /*SDRC_D5*/\
-	MUX_VAL(CP(SDRC_D6),		(IEN  | PTD | DIS | M0)) /*SDRC_D6*/\
-	MUX_VAL(CP(SDRC_D7),		(IEN  | PTD | DIS | M0)) /*SDRC_D7*/\
-	MUX_VAL(CP(SDRC_D8),		(IEN  | PTD | DIS | M0)) /*SDRC_D8*/\
-	MUX_VAL(CP(SDRC_D9),		(IEN  | PTD | DIS | M0)) /*SDRC_D9*/\
-	MUX_VAL(CP(SDRC_D10),		(IEN  | PTD | DIS | M0)) /*SDRC_D10*/\
-	MUX_VAL(CP(SDRC_D11),		(IEN  | PTD | DIS | M0)) /*SDRC_D11*/\
-	MUX_VAL(CP(SDRC_D12),		(IEN  | PTD | DIS | M0)) /*SDRC_D12*/\
-	MUX_VAL(CP(SDRC_D13),		(IEN  | PTD | DIS | M0)) /*SDRC_D13*/\
-	MUX_VAL(CP(SDRC_D14),		(IEN  | PTD | DIS | M0)) /*SDRC_D14*/\
-	MUX_VAL(CP(SDRC_D15),		(IEN  | PTD | DIS | M0)) /*SDRC_D15*/\
-	MUX_VAL(CP(SDRC_D16),		(IEN  | PTD | DIS | M0)) /*SDRC_D16*/\
-	MUX_VAL(CP(SDRC_D17),		(IEN  | PTD | DIS | M0)) /*SDRC_D17*/\
-	MUX_VAL(CP(SDRC_D18),		(IEN  | PTD | DIS | M0)) /*SDRC_D18*/\
-	MUX_VAL(CP(SDRC_D19),		(IEN  | PTD | DIS | M0)) /*SDRC_D19*/\
-	MUX_VAL(CP(SDRC_D20),		(IEN  | PTD | DIS | M0)) /*SDRC_D20*/\
-	MUX_VAL(CP(SDRC_D21),		(IEN  | PTD | DIS | M0)) /*SDRC_D21*/\
-	MUX_VAL(CP(SDRC_D22),		(IEN  | PTD | DIS | M0)) /*SDRC_D22*/\
-	MUX_VAL(CP(SDRC_D23),		(IEN  | PTD | DIS | M0)) /*SDRC_D23*/\
-	MUX_VAL(CP(SDRC_D24),		(IEN  | PTD | DIS | M0)) /*SDRC_D24*/\
-	MUX_VAL(CP(SDRC_D25),		(IEN  | PTD | DIS | M0)) /*SDRC_D25*/\
-	MUX_VAL(CP(SDRC_D26),		(IEN  | PTD | DIS | M0)) /*SDRC_D26*/\
-	MUX_VAL(CP(SDRC_D27),		(IEN  | PTD | DIS | M0)) /*SDRC_D27*/\
-	MUX_VAL(CP(SDRC_D28),		(IEN  | PTD | DIS | M0)) /*SDRC_D28*/\
-	MUX_VAL(CP(SDRC_D29),		(IEN  | PTD | DIS | M0)) /*SDRC_D29*/\
-	MUX_VAL(CP(SDRC_D30),		(IEN  | PTD | DIS | M0)) /*SDRC_D30*/\
-	MUX_VAL(CP(SDRC_D31),		(IEN  | PTD | DIS | M0)) /*SDRC_D31*/\
-	MUX_VAL(CP(SDRC_CLK),		(IEN  | PTD | DIS | M0)) /*SDRC_CLK*/\
-	MUX_VAL(CP(SDRC_DQS0),		(IEN  | PTD | DIS | M0)) /*SDRC_DQS0*/\
-	MUX_VAL(CP(SDRC_DQS1),		(IEN  | PTD | DIS | M0)) /*SDRC_DQS1*/\
-	MUX_VAL(CP(SDRC_DQS2),		(IEN  | PTD | DIS | M0)) /*SDRC_DQS2*/\
-	MUX_VAL(CP(SDRC_DQS3),		(IEN  | PTD | DIS | M0)) /*SDRC_DQS3*/\
-/* GPMC */\
-	MUX_VAL(CP(GPMC_A1),		(IDIS | PTD | DIS | M0)) /*GPMC_A1*/\
-	MUX_VAL(CP(GPMC_A2),		(IDIS | PTD | DIS | M0)) /*GPMC_A2*/\
-	MUX_VAL(CP(GPMC_A3),		(IDIS | PTD | DIS | M0)) /*GPMC_A3*/\
-	MUX_VAL(CP(GPMC_A4),		(IDIS | PTD | DIS | M0)) /*GPMC_A4*/\
-	MUX_VAL(CP(GPMC_A5),		(IDIS | PTD | DIS | M0)) /*GPMC_A5*/\
-	MUX_VAL(CP(GPMC_A6),		(IDIS | PTD | DIS | M0)) /*GPMC_A6*/\
-	MUX_VAL(CP(GPMC_A7),		(IDIS | PTD | DIS | M0)) /*GPMC_A7*/\
-	MUX_VAL(CP(GPMC_A8),		(IDIS | PTD | DIS | M0)) /*GPMC_A8*/\
-	MUX_VAL(CP(GPMC_A9),		(IDIS | PTD | DIS | M0)) /*GPMC_A9*/\
-	MUX_VAL(CP(GPMC_A10),		(IDIS | PTD | DIS | M0)) /*GPMC_A10*/\
-	MUX_VAL(CP(GPMC_D0),		(IEN  | PTD | DIS | M0)) /*GPMC_D0*/\
-	MUX_VAL(CP(GPMC_D1),		(IEN  | PTD | DIS | M0)) /*GPMC_D1*/\
-	MUX_VAL(CP(GPMC_D2),		(IEN  | PTD | DIS | M0)) /*GPMC_D2*/\
-	MUX_VAL(CP(GPMC_D3),		(IEN  | PTD | DIS | M0)) /*GPMC_D3*/\
-	MUX_VAL(CP(GPMC_D4),		(IEN  | PTD | DIS | M0)) /*GPMC_D4*/\
-	MUX_VAL(CP(GPMC_D5),		(IEN  | PTD | DIS | M0)) /*GPMC_D5*/\
-	MUX_VAL(CP(GPMC_D6),		(IEN  | PTD | DIS | M0)) /*GPMC_D6*/\
-	MUX_VAL(CP(GPMC_D7),		(IEN  | PTD | DIS | M0)) /*GPMC_D7*/\
-	MUX_VAL(CP(GPMC_D8),		(IEN  | PTD | DIS | M0)) /*GPMC_D8*/\
-	MUX_VAL(CP(GPMC_D9),		(IEN  | PTD | DIS | M0)) /*GPMC_D9*/\
-	MUX_VAL(CP(GPMC_D10),		(IEN  | PTD | DIS | M0)) /*GPMC_D10*/\
-	MUX_VAL(CP(GPMC_D11),		(IEN  | PTD | DIS | M0)) /*GPMC_D11*/\
-	MUX_VAL(CP(GPMC_D12),		(IEN  | PTD | DIS | M0)) /*GPMC_D12*/\
-	MUX_VAL(CP(GPMC_D13),		(IEN  | PTD | DIS | M0)) /*GPMC_D13*/\
-	MUX_VAL(CP(GPMC_D14),		(IEN  | PTD | DIS | M0)) /*GPMC_D14*/\
-	MUX_VAL(CP(GPMC_D15),		(IEN  | PTD | DIS | M0)) /*GPMC_D15*/\
-	MUX_VAL(CP(GPMC_NCS0),		(IDIS | PTU | EN  | M0)) /*GPMC_nCS0*/\
-	MUX_VAL(CP(GPMC_NCS1),		(IDIS | PTU | EN  | M0)) /*GPMC_nCS1*/\
-	MUX_VAL(CP(GPMC_NCS2),		(IDIS | PTU | EN  | M0)) /*GPMC_nCS2*/\
-	MUX_VAL(CP(GPMC_NCS3),		(IDIS | PTU | EN  | M0)) /*GPMC_nCS3*/\
-	MUX_VAL(CP(GPMC_NCS4),		(IDIS | PTU | EN  | M0)) /*GPMC_nCS4*/\
-	MUX_VAL(CP(GPMC_NCS5),		(IDIS | PTD | DIS | M0)) /*GPMC_nCS5*/\
-	MUX_VAL(CP(GPMC_NCS6),		(IEN  | PTD | DIS | M1)) /*nDMA_REQ2*/\
-	MUX_VAL(CP(GPMC_NCS7),		(IEN  | PTU | EN  | M1)) /*nDMA_REQ3*/\
-	MUX_VAL(CP(GPMC_NBE1),		(IEN  | PTD | DIS | M0)) /*GPMC_nBE1*/\
-	MUX_VAL(CP(GPMC_WAIT2),		(IEN  | PTU | EN  | M0)) /*GPMC_WAIT2*/\
-	MUX_VAL(CP(GPMC_WAIT3),		(IEN  | PTU | EN  | M0)) /*GPMC_WAIT3*/\
-	MUX_VAL(CP(GPMC_CLK),		(IDIS | PTD | DIS | M0)) /*GPMC_CLK*/\
-	MUX_VAL(CP(GPMC_NADV_ALE),	(IDIS | PTD | DIS | M0)) /*GPMC_nADV*/\
-	MUX_VAL(CP(GPMC_NOE),		(IDIS | PTD | DIS | M0)) /*GPMC_nOE*/\
-	MUX_VAL(CP(GPMC_NWE),		(IDIS | PTD | DIS | M0)) /*GPMC_nWE*/\
-	MUX_VAL(CP(GPMC_NBE0_CLE),	(IDIS | PTD | DIS | M0)) /*GPMC_nBE0*/\
-	MUX_VAL(CP(GPMC_NWP),		(IEN  | PTD | DIS | M0)) /*GPMC_nWP*/\
-	MUX_VAL(CP(GPMC_WAIT0),		(IEN  | PTU | EN  | M0)) /*GPMC_WAIT0*/\
-	MUX_VAL(CP(GPMC_WAIT1),		(IEN  | PTU | EN  | M0)) /*GPMC_WAIT1*/\
-/* DSS */\
-	MUX_VAL(CP(DSS_PCLK),		(IDIS | PTD | DIS | M0)) /*DSS_PCLK*/\
-	MUX_VAL(CP(DSS_HSYNC),		(IDIS | PTD | DIS | M0)) /*DSS_HSYNC*/\
-	MUX_VAL(CP(DSS_VSYNC),		(IDIS | PTD | DIS | M0)) /*DSS_VSYNC*/\
-	MUX_VAL(CP(DSS_ACBIAS),		(IDIS | PTD | DIS | M0)) /*DSS_ACBIAS*/\
-	MUX_VAL(CP(DSS_DATA0),		(IDIS | PTD | DIS | M0)) /*DSS_DATA0*/\
-	MUX_VAL(CP(DSS_DATA1),		(IDIS | PTD | DIS | M0)) /*DSS_DATA1*/\
-	MUX_VAL(CP(DSS_DATA2),		(IDIS | PTD | DIS | M0)) /*DSS_DATA2*/\
-	MUX_VAL(CP(DSS_DATA3),		(IDIS | PTD | DIS | M0)) /*DSS_DATA3*/\
-	MUX_VAL(CP(DSS_DATA4),		(IDIS | PTD | DIS | M0)) /*DSS_DATA4*/\
-	MUX_VAL(CP(DSS_DATA5),		(IDIS | PTD | DIS | M0)) /*DSS_DATA5*/\
-	MUX_VAL(CP(DSS_DATA6),		(IDIS | PTD | DIS | M0)) /*DSS_DATA6*/\
-	MUX_VAL(CP(DSS_DATA7),		(IDIS | PTD | DIS | M0)) /*DSS_DATA7*/\
-	MUX_VAL(CP(DSS_DATA8),		(IDIS | PTD | DIS | M0)) /*DSS_DATA8*/\
-	MUX_VAL(CP(DSS_DATA9),		(IDIS | PTD | DIS | M0)) /*DSS_DATA9*/\
-	MUX_VAL(CP(DSS_DATA10),		(IDIS | PTD | DIS | M0)) /*DSS_DATA10*/\
-	MUX_VAL(CP(DSS_DATA11),		(IDIS | PTD | DIS | M0)) /*DSS_DATA11*/\
-	MUX_VAL(CP(DSS_DATA12),		(IDIS | PTD | DIS | M0)) /*DSS_DATA12*/\
-	MUX_VAL(CP(DSS_DATA13),		(IDIS | PTD | DIS | M0)) /*DSS_DATA13*/\
-	MUX_VAL(CP(DSS_DATA14),		(IDIS | PTD | DIS | M0)) /*DSS_DATA14*/\
-	MUX_VAL(CP(DSS_DATA15),		(IDIS | PTD | DIS | M0)) /*DSS_DATA15*/\
-	MUX_VAL(CP(DSS_DATA16),		(IDIS | PTD | DIS | M0)) /*DSS_DATA16*/\
-	MUX_VAL(CP(DSS_DATA17),		(IDIS | PTD | DIS | M0)) /*DSS_DATA17*/\
-	MUX_VAL(CP(DSS_DATA18),		(IDIS | PTD | DIS | M0)) /*DSS_DATA18*/\
-	MUX_VAL(CP(DSS_DATA19),		(IDIS | PTD | DIS | M0)) /*DSS_DATA19*/\
-	MUX_VAL(CP(DSS_DATA20),		(IDIS | PTD | DIS | M0)) /*DSS_DATA20*/\
-	MUX_VAL(CP(DSS_DATA21),		(IDIS | PTD | DIS | M0)) /*DSS_DATA21*/\
-	MUX_VAL(CP(DSS_DATA22),		(IDIS | PTD | DIS | M0)) /*DSS_DATA22*/\
-	MUX_VAL(CP(DSS_DATA23),		(IDIS | PTD | DIS | M0)) /*DSS_DATA23*/\
-/* CAMERA */\
-	MUX_VAL(CP(CAM_HS),		(IEN  | PTU | EN  | M0)) /*CAM_HS*/\
-	MUX_VAL(CP(CAM_VS),		(IEN  | PTU | EN  | M0)) /*CAM_VS*/\
-	MUX_VAL(CP(CAM_XCLKA),		(IDIS | PTD | DIS | M0)) /*CAM_XCLKA*/\
-	MUX_VAL(CP(CAM_PCLK),		(IEN  | PTU | EN  | M0)) /*CAM_PCLK*/\
-	MUX_VAL(CP(CAM_FLD),		(IDIS | PTD | DIS | M4)) /*GPIO_98*/\
-	MUX_VAL(CP(CAM_D0),		(IEN  | PTD | DIS | M0)) /*CAM_D0*/\
-	MUX_VAL(CP(CAM_D1),		(IEN  | PTD | DIS | M0)) /*CAM_D1*/\
-	MUX_VAL(CP(CAM_D2),		(IEN  | PTD | DIS | M0)) /*CAM_D2*/\
-	MUX_VAL(CP(CAM_D3),		(IEN  | PTD | DIS | M0)) /*CAM_D3*/\
-	MUX_VAL(CP(CAM_D4),		(IEN  | PTD | DIS | M0)) /*CAM_D4*/\
-	MUX_VAL(CP(CAM_D5),		(IEN  | PTD | DIS | M0)) /*CAM_D5*/\
-	MUX_VAL(CP(CAM_D6),		(IEN  | PTD | DIS | M0)) /*CAM_D6*/\
-	MUX_VAL(CP(CAM_D7),		(IEN  | PTD | DIS | M0)) /*CAM_D7*/\
-	MUX_VAL(CP(CAM_D8),		(IEN  | PTD | DIS | M0)) /*CAM_D8*/\
-	MUX_VAL(CP(CAM_D9),		(IEN  | PTD | DIS | M0)) /*CAM_D9*/\
-	MUX_VAL(CP(CAM_D10),		(IEN  | PTD | DIS | M0)) /*CAM_D10*/\
-	MUX_VAL(CP(CAM_D11),		(IEN  | PTD | DIS | M0)) /*CAM_D11*/\
-	MUX_VAL(CP(CAM_XCLKB),		(IDIS | PTD | DIS | M0)) /*CAM_XCLKB*/\
-	MUX_VAL(CP(CAM_WEN),		(IEN  | PTD | DIS | M4)) /*GPIO_167*/\
-	MUX_VAL(CP(CAM_STROBE),		(IDIS | PTD | DIS | M0)) /*CAM_STROBE*/\
-	MUX_VAL(CP(CSI2_DX0),		(IEN  | PTD | DIS | M0)) /*CSI2_DX0*/\
-	MUX_VAL(CP(CSI2_DY0),		(IEN  | PTD | DIS | M0)) /*CSI2_DY0*/\
-	MUX_VAL(CP(CSI2_DX1),		(IEN  | PTD | DIS | M0)) /*CSI2_DX1*/\
-	MUX_VAL(CP(CSI2_DY1),		(IEN  | PTD | DIS | M0)) /*CSI2_DY1*/\
-/* Audio Interface */\
-	MUX_VAL(CP(MCBSP2_FSX),		(IEN  | PTD | DIS | M0)) /*McBSP2_FSX*/\
-	MUX_VAL(CP(MCBSP2_CLKX),	(IEN  | PTD | DIS | M0)) /*McBSP2_CLK*/\
-	MUX_VAL(CP(MCBSP2_DR),		(IEN  | PTD | DIS | M0)) /*McBSP2_DR*/\
-	MUX_VAL(CP(MCBSP2_DX),		(IDIS | PTD | DIS | M0)) /*McBSP2_DX*/\
-/* Expansion card */\
-	MUX_VAL(CP(MMC1_CLK),		(IDIS | PTU | EN  | M0)) /*MMC1_CLK*/\
-	MUX_VAL(CP(MMC1_CMD),		(IEN  | PTU | EN  | M0)) /*MMC1_CMD*/\
-	MUX_VAL(CP(MMC1_DAT0),		(IEN  | PTU | EN  | M0)) /*MMC1_DAT0*/\
-	MUX_VAL(CP(MMC1_DAT1),		(IEN  | PTU | EN  | M0)) /*MMC1_DAT1*/\
-	MUX_VAL(CP(MMC1_DAT2),		(IEN  | PTU | EN  | M0)) /*MMC1_DAT2*/\
-	MUX_VAL(CP(MMC1_DAT3),		(IEN  | PTU | EN  | M0)) /*MMC1_DAT3*/\
-	MUX_VAL(CP(MMC1_DAT4),		(IEN  | PTU | EN  | M0)) /*MMC1_DAT4*/\
-	MUX_VAL(CP(MMC1_DAT5),		(IEN  | PTU | EN  | M0)) /*MMC1_DAT5*/\
-	MUX_VAL(CP(MMC1_DAT6),		(IEN  | PTU | EN  | M0)) /*MMC1_DAT6*/\
-	MUX_VAL(CP(MMC1_DAT7),		(IEN  | PTU | EN  | M0)) /*MMC1_DAT7*/\
-/* Wireless LAN */\
-	MUX_VAL(CP(MMC2_CLK),		(IEN  | PTU | EN  | M4)) /*GPIO_130*/\
-	MUX_VAL(CP(MMC2_CMD),		(IEN  | PTU | EN  | M4)) /*GPIO_131*/\
-	MUX_VAL(CP(MMC2_DAT0),		(IEN  | PTU | EN  | M4)) /*GPIO_132*/\
-	MUX_VAL(CP(MMC2_DAT1),		(IEN  | PTU | EN  | M4)) /*GPIO_133*/\
-	MUX_VAL(CP(MMC2_DAT2),		(IEN  | PTU | EN  | M4)) /*GPIO_134*/\
-	MUX_VAL(CP(MMC2_DAT3),		(IEN  | PTU | EN  | M4)) /*GPIO_135*/\
-	MUX_VAL(CP(MMC2_DAT4),		(IEN  | PTU | EN  | M4)) /*GPIO_136*/\
-	MUX_VAL(CP(MMC2_DAT5),		(IEN  | PTU | EN  | M4)) /*GPIO_137*/\
-	MUX_VAL(CP(MMC2_DAT6),		(IEN  | PTU | EN  | M4)) /*GPIO_138*/\
-	MUX_VAL(CP(MMC2_DAT7),		(IEN  | PTU | EN  | M4)) /*GPIO_139*/\
-/* Bluetooth */\
-	MUX_VAL(CP(MCBSP3_DX),		(IEN  | PTD | DIS | M1)) /*UART2_CTS*/\
-	MUX_VAL(CP(MCBSP3_DR),		(IDIS | PTD | DIS | M1)) /*UART2_RTS*/\
-	MUX_VAL(CP(MCBSP3_CLKX),	(IDIS | PTD | DIS | M1)) /*UART2_TX*/\
-	MUX_VAL(CP(MCBSP3_FSX),		(IEN  | PTD | DIS | M1)) /*UART2_RX*/\
-	MUX_VAL(CP(UART2_CTS),		(IEN  | PTD | DIS | M4)) /*GPIO_144*/\
-	MUX_VAL(CP(UART2_RTS),		(IEN  | PTD | DIS | M4)) /*GPIO_145*/\
-	MUX_VAL(CP(UART2_TX),		(IEN  | PTD | DIS | M4)) /*GPIO_146*/\
-	MUX_VAL(CP(UART2_RX),		(IEN  | PTD | DIS | M4)) /*GPIO_147*/\
-/* Modem Interface */\
-	MUX_VAL(CP(UART1_TX),		(IDIS | PTD | DIS | M0)) /*UART1_TX*/\
-	MUX_VAL(CP(UART1_RTS),		(IDIS | PTD | DIS | M4)) /*GPIO_149*/\
-	MUX_VAL(CP(UART1_CTS),		(IDIS | PTD | DIS | M4)) /*GPIO_150*/\
-	MUX_VAL(CP(UART1_RX),		(IEN  | PTD | DIS | M0)) /*UART1_RX*/\
-	MUX_VAL(CP(MCBSP4_CLKX),	(IEN  | PTD | DIS | M1)) /*SSI1_DAT*/\
-	MUX_VAL(CP(MCBSP4_DR),		(IEN  | PTD | DIS | M1)) /*SSI1_FLAG*/\
-	MUX_VAL(CP(MCBSP4_DX),		(IEN  | PTD | DIS | M1)) /*SSI1_RDY*/\
-	MUX_VAL(CP(MCBSP4_FSX),		(IEN  | PTD | DIS | M1)) /*SSI1_WAKE*/\
-	MUX_VAL(CP(MCBSP1_CLKR),	(IDIS | PTD | DIS | M4)) /*GPIO_156*/\
-	MUX_VAL(CP(MCBSP1_FSR),		(IDIS | PTU | EN  | M4)) /*GPIO_157*/\
-	MUX_VAL(CP(MCBSP1_DX),		(IDIS | PTD | DIS | M4)) /*GPIO_158*/\
-	MUX_VAL(CP(MCBSP1_DR),		(IDIS | PTD | DIS | M4)) /*GPIO_159*/\
-	MUX_VAL(CP(MCBSP_CLKS),		(IEN  | PTU | DIS | M0)) /*McBSP_CLKS*/\
-	MUX_VAL(CP(MCBSP1_FSX),		(IDIS | PTD | DIS | M4)) /*GPIO_161*/\
-	MUX_VAL(CP(MCBSP1_CLKX),	(IDIS | PTD | DIS | M4)) /*GPIO_162*/\
-/* Serial Interface */\
-	MUX_VAL(CP(UART3_CTS_RCTX),	(IEN  | PTD | EN  | M0)) /*UART3_CTS*/\
-	MUX_VAL(CP(UART3_RTS_SD),	(IDIS | PTD | DIS | M0)) /*UART3_RTS*/\
-	MUX_VAL(CP(UART3_RX_IRRX),	(IEN  | PTD | DIS | M0)) /*UART3_RX*/\
-	MUX_VAL(CP(UART3_TX_IRTX),	(IDIS | PTD | DIS | M0)) /*UART3_TX*/\
-	MUX_VAL(CP(HSUSB0_CLK),		(IEN  | PTD | DIS | M0)) /*HSUSB0_CLK*/\
-	MUX_VAL(CP(HSUSB0_STP),		(IDIS | PTU | EN  | M0)) /*HSUSB0_STP*/\
-	MUX_VAL(CP(HSUSB0_DIR),		(IEN  | PTD | DIS | M0)) /*HSUSB0_DIR*/\
-	MUX_VAL(CP(HSUSB0_NXT),		(IEN  | PTD | DIS | M0)) /*HSUSB0_NXT*/\
-	MUX_VAL(CP(HSUSB0_DATA0),	(IEN  | PTD | DIS | M0)) /*HSUSB0_DA0*/\
-	MUX_VAL(CP(HSUSB0_DATA1),	(IEN  | PTD | DIS | M0)) /*HSUSB0_DA1*/\
-	MUX_VAL(CP(HSUSB0_DATA2),	(IEN  | PTD | DIS | M0)) /*HSUSB0_DA2*/\
-	MUX_VAL(CP(HSUSB0_DATA3),	(IEN  | PTD | DIS | M0)) /*HSUSB0_DA3*/\
-	MUX_VAL(CP(HSUSB0_DATA4),	(IEN  | PTD | DIS | M0)) /*HSUSB0_DA4*/\
-	MUX_VAL(CP(HSUSB0_DATA5),	(IEN  | PTD | DIS | M0)) /*HSUSB0_DA5*/\
-	MUX_VAL(CP(HSUSB0_DATA6),	(IEN  | PTD | DIS | M0)) /*HSUSB0_DA6*/\
-	MUX_VAL(CP(HSUSB0_DATA7),	(IEN  | PTD | DIS | M0)) /*HSUSB0_DA7*/\
-	MUX_VAL(CP(I2C1_SCL),		(IEN  | PTU | EN  | M0)) /*I2C1_SCL*/\
-	MUX_VAL(CP(I2C1_SDA),		(IEN  | PTU | EN  | M0)) /*I2C1_SDA*/\
-	MUX_VAL(CP(I2C2_SCL),		(IEN  | PTU | EN  | M4)) /*GPIO_168*/\
-	MUX_VAL(CP(I2C2_SDA),		(IEN  | PTU | EN  | M4)) /*GPIO_183*/\
-	MUX_VAL(CP(I2C3_SCL),		(IEN  | PTU | EN  | M0)) /*I2C3_SCL*/\
-	MUX_VAL(CP(I2C3_SDA),		(IEN  | PTU | EN  | M0)) /*I2C3_SDA*/\
-	MUX_VAL(CP(I2C4_SCL),		(IEN  | PTU | EN  | M0)) /*I2C4_SCL*/\
-	MUX_VAL(CP(I2C4_SDA),		(IEN  | PTU | EN  | M0)) /*I2C4_SDA*/\
-	MUX_VAL(CP(HDQ_SIO),		(IDIS | PTU | EN  | M4)) /*GPIO_170*/\
-	MUX_VAL(CP(MCSPI1_CLK),		(IEN  | PTU | EN  | M4)) /*GPIO_171*/\
-	MUX_VAL(CP(MCSPI1_SIMO),	(IEN  | PTU | EN  | M4)) /*GPIO_172*/\
-	MUX_VAL(CP(MCSPI1_SOMI),	(IEN  | PTD | DIS | M0)) /*McSPI1_SOM*/\
-	MUX_VAL(CP(MCSPI1_CS0),		(IEN  | PTD | EN  | M0)) /*McSPI1_CS0*/\
-	MUX_VAL(CP(MCSPI1_CS1),		(IDIS | PTD | EN  | M0)) /*McSPI1_CS1*/\
-	MUX_VAL(CP(MCSPI1_CS2),		(IDIS | PTD | DIS | M4)) /*GPIO_176*/\
-/* USB EHCI (port 2) */\
-	MUX_VAL(CP(MCSPI1_CS3),		(IEN  | PTU | DIS | M3)) /*HSUSB2_DA2*/\
-	MUX_VAL(CP(MCSPI2_CLK),		(IEN  | PTU | DIS | M3)) /*HSUSB2_DA7*/\
-	MUX_VAL(CP(MCSPI2_SIMO),	(IEN  | PTU | DIS | M3)) /*HSUSB2_DA4*/\
-	MUX_VAL(CP(MCSPI2_SOMI),	(IEN  | PTU | DIS | M3)) /*HSUSB2_DA5*/\
-	MUX_VAL(CP(MCSPI2_CS0),		(IEN  | PTU | DIS | M3)) /*HSUSB2_DA6*/\
-	MUX_VAL(CP(MCSPI2_CS1),		(IEN  | PTU | DIS | M3)) /*HSUSB2_DA3*/\
-	MUX_VAL(CP(ETK_D10_ES2),	(IDIS | PTU | DIS | M3)) /*HSUSB2_CLK*/\
-	MUX_VAL(CP(ETK_D11_ES2),	(IDIS | PTU | DIS | M3)) /*HSUSB2_STP*/\
-	MUX_VAL(CP(ETK_D12_ES2),	(IEN  | PTU | DIS | M3)) /*HSUSB2_DIR*/\
-	MUX_VAL(CP(ETK_D13_ES2),	(IEN  | PTU | DIS | M3)) /*HSUSB2_NXT*/\
-	MUX_VAL(CP(ETK_D14_ES2),	(IEN  | PTU | DIS | M3)) /*HSUSB2_DA0*/\
-	MUX_VAL(CP(ETK_D15_ES2),	(IEN  | PTU | DIS | M3)) /*HSUSB2_DA1*/\
-/* Control and debug */\
-	MUX_VAL(CP(SYS_32K),		(IEN  | PTD | DIS | M0)) /*SYS_32K*/\
-	MUX_VAL(CP(SYS_CLKREQ),		(IEN  | PTD | DIS | M0)) /*SYS_CLKREQ*/\
-	MUX_VAL(CP(SYS_NIRQ),		(IEN  | PTU | EN  | M0)) /*SYS_nIRQ*/\
-	MUX_VAL(CP(SYS_BOOT0),		(IEN  | PTD | DIS | M4)) /*GPIO_2*/\
-	MUX_VAL(CP(SYS_BOOT1),		(IEN  | PTD | DIS | M4)) /*GPIO_3*/\
-	MUX_VAL(CP(SYS_BOOT2),		(IEN  | PTD | DIS | M4)) /*MMC1_WP*/\
-	MUX_VAL(CP(SYS_BOOT3),		(IEN  | PTD | DIS | M4)) /*GPIO_5*/\
-	MUX_VAL(CP(SYS_BOOT4),		(IEN  | PTD | DIS | M4)) /*GPIO_6*/\
-	MUX_VAL(CP(SYS_BOOT5),		(IEN  | PTD | DIS | M4)) /*GPIO_7*/\
-	MUX_VAL(CP(SYS_BOOT6),		(IDIS | PTD | DIS | M4)) /*GPIO_8*/\
-	MUX_VAL(CP(SYS_OFF_MODE),	(IEN  | PTD | DIS | M0)) /*SYS_OFF_MD*/\
-	MUX_VAL(CP(SYS_CLKOUT1),	(IEN  | PTD | DIS | M0)) /*SYS_CLKOUT*/\
-	MUX_VAL(CP(SYS_CLKOUT2),	(IEN  | PTU | EN  | M4)) /*GPIO_186*/\
-	MUX_VAL(CP(ETK_CLK_ES2),	(IDIS | PTU | EN  | M3)) /*HSUSB1_STP*/\
-	MUX_VAL(CP(ETK_CTL_ES2),	(IDIS | PTU | DIS | M3)) /*HSUSB1_CLK*/\
-	MUX_VAL(CP(ETK_D0_ES2),		(IEN  | PTU | DIS | M3)) /*HSUSB1_DA0*/\
-	MUX_VAL(CP(ETK_D1_ES2),		(IEN  | PTU | DIS | M3)) /*HSUSB1_DA1*/\
-	MUX_VAL(CP(ETK_D2_ES2),		(IEN  | PTU | DIS | M3)) /*HSUSB1_DA2*/\
-	MUX_VAL(CP(ETK_D3_ES2),		(IEN  | PTU | DIS | M3)) /*HSUSB1_DA7*/\
-	MUX_VAL(CP(ETK_D4_ES2),		(IEN  | PTU | DIS | M3)) /*HSUSB1_DA4*/\
-	MUX_VAL(CP(ETK_D5_ES2),		(IEN  | PTU | DIS | M3)) /*HSUSB1_DA5*/\
-	MUX_VAL(CP(ETK_D6_ES2),		(IEN  | PTU | DIS | M3)) /*HSUSB1_DA6*/\
-	MUX_VAL(CP(ETK_D7_ES2),		(IEN  | PTU | DIS | M3)) /*HSUSB1_DA3*/\
-	MUX_VAL(CP(ETK_D8_ES2),		(IEN  | PTU | DIS | M3)) /*HSUSB1_DIR*/\
-	MUX_VAL(CP(ETK_D9_ES2),		(IEN  | PTU | DIS | M3)) /*HSUSB1_NXT*/\
-	MUX_VAL(CP(D2D_MCAD1),		(IEN  | PTD | EN  | M0)) /*d2d_mcad1*/\
-	MUX_VAL(CP(D2D_MCAD2),		(IEN  | PTD | EN  | M0)) /*d2d_mcad2*/\
-	MUX_VAL(CP(D2D_MCAD3),		(IEN  | PTD | EN  | M0)) /*d2d_mcad3*/\
-	MUX_VAL(CP(D2D_MCAD4),		(IEN  | PTD | EN  | M0)) /*d2d_mcad4*/\
-	MUX_VAL(CP(D2D_MCAD5),		(IEN  | PTD | EN  | M0)) /*d2d_mcad5*/\
-	MUX_VAL(CP(D2D_MCAD6),		(IEN  | PTD | EN  | M0)) /*d2d_mcad6*/\
-	MUX_VAL(CP(D2D_MCAD7),		(IEN  | PTD | EN  | M0)) /*d2d_mcad7*/\
-	MUX_VAL(CP(D2D_MCAD8),		(IEN  | PTD | EN  | M0)) /*d2d_mcad8*/\
-	MUX_VAL(CP(D2D_MCAD9),		(IEN  | PTD | EN  | M0)) /*d2d_mcad9*/\
-	MUX_VAL(CP(D2D_MCAD10),		(IEN  | PTD | EN  | M0)) /*d2d_mcad10*/\
-	MUX_VAL(CP(D2D_MCAD11),		(IEN  | PTD | EN  | M0)) /*d2d_mcad11*/\
-	MUX_VAL(CP(D2D_MCAD12),		(IEN  | PTD | EN  | M0)) /*d2d_mcad12*/\
-	MUX_VAL(CP(D2D_MCAD13),		(IEN  | PTD | EN  | M0)) /*d2d_mcad13*/\
-	MUX_VAL(CP(D2D_MCAD14),		(IEN  | PTD | EN  | M0)) /*d2d_mcad14*/\
-	MUX_VAL(CP(D2D_MCAD15),		(IEN  | PTD | EN  | M0)) /*d2d_mcad15*/\
-	MUX_VAL(CP(D2D_MCAD16),		(IEN  | PTD | EN  | M0)) /*d2d_mcad16*/\
-	MUX_VAL(CP(D2D_MCAD17),		(IEN  | PTD | EN  | M0)) /*d2d_mcad17*/\
-	MUX_VAL(CP(D2D_MCAD18),		(IEN  | PTD | EN  | M0)) /*d2d_mcad18*/\
-	MUX_VAL(CP(D2D_MCAD19),		(IEN  | PTD | EN  | M0)) /*d2d_mcad19*/\
-	MUX_VAL(CP(D2D_MCAD20),		(IEN  | PTD | EN  | M0)) /*d2d_mcad20*/\
-	MUX_VAL(CP(D2D_MCAD21),		(IEN  | PTD | EN  | M0)) /*d2d_mcad21*/\
-	MUX_VAL(CP(D2D_MCAD22),		(IEN  | PTD | EN  | M0)) /*d2d_mcad22*/\
-	MUX_VAL(CP(D2D_MCAD23),		(IEN  | PTD | EN  | M0)) /*d2d_mcad23*/\
-	MUX_VAL(CP(D2D_MCAD24),		(IEN  | PTD | EN  | M0)) /*d2d_mcad24*/\
-	MUX_VAL(CP(D2D_MCAD25),		(IEN  | PTD | EN  | M0)) /*d2d_mcad25*/\
-	MUX_VAL(CP(D2D_MCAD26),		(IEN  | PTD | EN  | M0)) /*d2d_mcad26*/\
-	MUX_VAL(CP(D2D_MCAD27),		(IEN  | PTD | EN  | M0)) /*d2d_mcad27*/\
-	MUX_VAL(CP(D2D_MCAD28),		(IEN  | PTD | EN  | M0)) /*d2d_mcad28*/\
-	MUX_VAL(CP(D2D_MCAD29),		(IEN  | PTD | EN  | M0)) /*d2d_mcad29*/\
-	MUX_VAL(CP(D2D_MCAD30),		(IEN  | PTD | EN  | M0)) /*d2d_mcad30*/\
-	MUX_VAL(CP(D2D_MCAD31),		(IEN  | PTD | EN  | M0)) /*d2d_mcad31*/\
-	MUX_VAL(CP(D2D_MCAD32),		(IEN  | PTD | EN  | M0)) /*d2d_mcad32*/\
-	MUX_VAL(CP(D2D_MCAD33),		(IEN  | PTD | EN  | M0)) /*d2d_mcad33*/\
-	MUX_VAL(CP(D2D_MCAD34),		(IEN  | PTD | EN  | M0)) /*d2d_mcad34*/\
-	MUX_VAL(CP(D2D_MCAD35),		(IEN  | PTD | EN  | M0)) /*d2d_mcad35*/\
-	MUX_VAL(CP(D2D_MCAD36),		(IEN  | PTD | EN  | M0)) /*d2d_mcad36*/\
-	MUX_VAL(CP(D2D_CLK26MI),	(IEN  | PTD | DIS | M0)) /*d2d_clk26m*/\
-	MUX_VAL(CP(D2D_NRESPWRON),	(IEN  | PTD | EN  | M0)) /*d2d_nrespw*/\
-	MUX_VAL(CP(D2D_NRESWARM),	(IEN  | PTU | EN  | M0)) /*d2d_nreswa*/\
-	MUX_VAL(CP(D2D_ARM9NIRQ),	(IEN  | PTD | DIS | M0)) /*d2d_arm9ni*/\
-	MUX_VAL(CP(D2D_UMA2P6FIQ),	(IEN  | PTD | DIS | M0)) /*d2d_uma2p6*/\
-	MUX_VAL(CP(D2D_SPINT),		(IEN  | PTD | EN  | M0)) /*d2d_spint*/\
-	MUX_VAL(CP(D2D_FRINT),		(IEN  | PTD | EN  | M0)) /*d2d_frint*/\
-	MUX_VAL(CP(D2D_DMAREQ0),	(IEN  | PTD | DIS | M0)) /*d2d_dmare0*/\
-	MUX_VAL(CP(D2D_DMAREQ1),	(IEN  | PTD | DIS | M0)) /*d2d_dmare1*/\
-	MUX_VAL(CP(D2D_DMAREQ2),	(IEN  | PTD | DIS | M0)) /*d2d_dmare2*/\
-	MUX_VAL(CP(D2D_DMAREQ3),	(IEN  | PTD | DIS | M0)) /*d2d_dmare3*/\
-	MUX_VAL(CP(D2D_N3GTRST),	(IEN  | PTD | DIS | M0)) /*d2d_n3gtrs*/\
-	MUX_VAL(CP(D2D_N3GTDI),		(IEN  | PTD | DIS | M0)) /*d2d_n3gtdi*/\
-	MUX_VAL(CP(D2D_N3GTDO),		(IEN  | PTD | DIS | M0)) /*d2d_n3gtdo*/\
-	MUX_VAL(CP(D2D_N3GTMS),		(IEN  | PTD | DIS | M0)) /*d2d_n3gtms*/\
-	MUX_VAL(CP(D2D_N3GTCK),		(IEN  | PTD | DIS | M0)) /*d2d_n3gtck*/\
-	MUX_VAL(CP(D2D_N3GRTCK),	(IEN  | PTD | DIS | M0)) /*d2d_n3grtc*/\
-	MUX_VAL(CP(D2D_MSTDBY),		(IEN  | PTU | EN  | M0)) /*d2d_mstdby*/\
-	MUX_VAL(CP(D2D_SWAKEUP),	(IEN  | PTD | EN  | M0)) /*d2d_swakeu*/\
-	MUX_VAL(CP(D2D_IDLEREQ),	(IEN  | PTD | DIS | M0)) /*d2d_idlere*/\
-	MUX_VAL(CP(D2D_IDLEACK),	(IEN  | PTU | EN  | M0)) /*d2d_idleac*/\
-	MUX_VAL(CP(D2D_MWRITE),		(IEN  | PTD | DIS | M0)) /*d2d_mwrite*/\
-	MUX_VAL(CP(D2D_SWRITE),		(IEN  | PTD | DIS | M0)) /*d2d_swrite*/\
-	MUX_VAL(CP(D2D_MREAD),		(IEN  | PTD | DIS | M0)) /*d2d_mread*/\
-	MUX_VAL(CP(D2D_SREAD),		(IEN  | PTD | DIS | M0)) /*d2d_sread*/\
-	MUX_VAL(CP(D2D_MBUSFLAG),	(IEN  | PTD | DIS | M0)) /*d2d_mbusfl*/\
-	MUX_VAL(CP(D2D_SBUSFLAG),	(IEN  | PTD | DIS | M0)) /*d2d_sbusfl*/\
-	MUX_VAL(CP(SDRC_CKE0),		(IDIS | PTU | EN  | M0)) /*sdrc_cke0*/\
-	MUX_VAL(CP(SDRC_CKE1),		(IDIS | PTU | EN  | M0)) /*sdrc_cke1*/
-
-#define MUX_RX51_C() \
-	MUX_VAL(CP(MCBSP3_DX),		(IEN | PTD | DIS | M4)) /*GPIO_140*/\
-	MUX_VAL(CP(MCBSP3_DR),		(IEN | PTD | DIS | M4)) /*GPIO_142*/\
-	MUX_VAL(CP(MCBSP3_CLKX),	(IEN | PTD | DIS | M4)) /*GPIO_141*/\
-	MUX_VAL(CP(UART2_CTS),		(IEN  | PTU | EN  | M0)) /*UART2_CTS*/\
-	MUX_VAL(CP(UART2_RTS),		(IDIS | PTD | DIS | M0)) /*UART2_RTS*/\
-	MUX_VAL(CP(UART2_TX),		(IDIS | PTD | DIS | M0)) /*UART2_TX*/
-
 #define ONENAND_GPMC_CONFIG1_RX51	0xfb001202
 #define ONENAND_GPMC_CONFIG2_RX51	0x00111100
 #define ONENAND_GPMC_CONFIG3_RX51	0x00020200
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 69+ messages in thread

* [RESEND v2 PATCH 15/16] Nokia RX-51: Move content of rx51.h to rx51.c
  2021-02-07 13:50 ` [RESEND v2 PATCH 00/16] Nokia RX-51: Fix USB TTY console and enable it Pali Rohár
                     ` (13 preceding siblings ...)
  2021-02-07 13:50   ` [RESEND v2 PATCH 14/16] Nokia RX-51: Remove function set_muxconf_regs() Pali Rohár
@ 2021-02-07 13:50   ` Pali Rohár
  2021-02-07 13:50   ` [RESEND v2 PATCH 16/16] Nokia RX-51: Enable usbtty serial console by default Pali Rohár
  2021-02-08 22:15   ` [RESEND v2 PATCH 00/16] Nokia RX-51: Fix USB TTY console and enable it Lukasz Majewski
  16 siblings, 0 replies; 69+ messages in thread
From: Pali Rohár @ 2021-02-07 13:50 UTC (permalink / raw)
  To: u-boot

After removal of MUX configuration there is no need to have extra rx51.h.

Signed-off-by: Pali Roh?r <pali@kernel.org>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Acked-by: Pavel Machek <pavel@ucw.cz>
---
 board/nokia/rx51/rx51.c | 17 ++++++++++++++++-
 board/nokia/rx51/rx51.h | 31 -------------------------------
 2 files changed, 16 insertions(+), 32 deletions(-)
 delete mode 100644 board/nokia/rx51/rx51.h

diff --git a/board/nokia/rx51/rx51.c b/board/nokia/rx51/rx51.c
index cb72ffaaa9..0597a94faa 100644
--- a/board/nokia/rx51/rx51.c
+++ b/board/nokia/rx51/rx51.c
@@ -39,9 +39,24 @@
 #include <asm/arch/sys_proto.h>
 #include <asm/arch/mmc_host_def.h>
 
-#include "rx51.h"
 #include "tag_omap.h"
 
+/* Needed for ROM SMC call */
+struct emu_hal_params_rx51 {
+	u32 num_params;
+	u32 param1;
+	u32 param2;
+	u32 param3;
+	u32 param4;
+};
+
+#define ONENAND_GPMC_CONFIG1_RX51	0xfb001202
+#define ONENAND_GPMC_CONFIG2_RX51	0x00111100
+#define ONENAND_GPMC_CONFIG3_RX51	0x00020200
+#define ONENAND_GPMC_CONFIG4_RX51	0x11001102
+#define ONENAND_GPMC_CONFIG5_RX51	0x03101616
+#define ONENAND_GPMC_CONFIG6_RX51	0x90060000
+
 DECLARE_GLOBAL_DATA_PTR;
 
 GraphicDevice gdev;
diff --git a/board/nokia/rx51/rx51.h b/board/nokia/rx51/rx51.h
deleted file mode 100644
index 0eddb06219..0000000000
--- a/board/nokia/rx51/rx51.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * (C) Copyright 2012
- * ?????? ???????? <freemangordon@abv.bg>
- *
- * (C) Copyright 2011-2012
- * Pali Roh?r <pali@kernel.org>
- *
- * (C) Copyright 2008
- * Dirk Behme <dirk.behme@gmail.com>
- */
-#ifndef _RX51_H_
-#define _RX51_H_
-
-/* Needed for ROM SMC call */
-struct emu_hal_params_rx51 {
-	u32 num_params;
-	u32 param1;
-	u32 param2;
-	u32 param3;
-	u32 param4;
-};
-
-#define ONENAND_GPMC_CONFIG1_RX51	0xfb001202
-#define ONENAND_GPMC_CONFIG2_RX51	0x00111100
-#define ONENAND_GPMC_CONFIG3_RX51	0x00020200
-#define ONENAND_GPMC_CONFIG4_RX51	0x11001102
-#define ONENAND_GPMC_CONFIG5_RX51	0x03101616
-#define ONENAND_GPMC_CONFIG6_RX51	0x90060000
-
-#endif
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 69+ messages in thread

* [RESEND v2 PATCH 16/16] Nokia RX-51: Enable usbtty serial console by default
  2021-02-07 13:50 ` [RESEND v2 PATCH 00/16] Nokia RX-51: Fix USB TTY console and enable it Pali Rohár
                     ` (14 preceding siblings ...)
  2021-02-07 13:50   ` [RESEND v2 PATCH 15/16] Nokia RX-51: Move content of rx51.h to rx51.c Pali Rohár
@ 2021-02-07 13:50   ` Pali Rohár
  2021-02-20 10:50     ` [AZURE FIX RESEND " Pali Rohár
  2021-02-08 22:15   ` [RESEND v2 PATCH 00/16] Nokia RX-51: Fix USB TTY console and enable it Lukasz Majewski
  16 siblings, 1 reply; 69+ messages in thread
From: Pali Rohár @ 2021-02-07 13:50 UTC (permalink / raw)
  To: u-boot

Now when usbtty serial console is fixed in U-Boot enable CONFIG_USB_TTY for
Nokia RX-51 board by default.

Fix also USB product id as U-Boot ignores CONFIG_USBD_PRODUCTID macro and
include U-Boot string into USB product name to indicate usage of U-Boot.

CONFIG_CONSOLE_MUX is already used and U-Boot console is available for
all in/out devices. Therefore there is no need to have separate commands
'run sercon', 'run usbcon' and 'run vgacon', so remove them.

As space for U-Boot is limited to 256kB, disable some other unused options
so CONFIG_USB_TTY can be enabled.

Nokia RX-51 does not have easily accessible UART serial console so the only
option for easy debugging is to use device's keyboard+screen or this usbtty
serial console over USB.

Signed-off-by: Pali Roh?r <pali@kernel.org>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Acked-by: Pavel Machek <pavel@ucw.cz>
---
 configs/nokia_rx51_defconfig |  7 ++++---
 doc/README.nokia_rx51        | 15 +--------------
 include/configs/nokia_rx51.h | 21 +++++++--------------
 3 files changed, 12 insertions(+), 31 deletions(-)

diff --git a/configs/nokia_rx51_defconfig b/configs/nokia_rx51_defconfig
index 3b782715c7..bce55c4fe5 100644
--- a/configs/nokia_rx51_defconfig
+++ b/configs/nokia_rx51_defconfig
@@ -13,6 +13,7 @@ CONFIG_AUTOBOOT_MENU_SHOW=y
 CONFIG_USE_PREBOOT=y
 CONFIG_PREBOOT="run preboot"
 CONFIG_CONSOLE_MUX=y
+# CONFIG_SYS_DEVICE_NULLDEV is not set
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="Nokia RX-51 # "
 # CONFIG_CMD_BDI is not set
@@ -47,9 +48,11 @@ CONFIG_ENV_OVERWRITE=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 # CONFIG_NET is not set
 CONFIG_DM=y
+# CONFIG_DM_WARN is not set
 # CONFIG_DM_DEVICE_REMOVE is not set
+# CONFIG_DM_SEQ_ALIAS is not set
+# CONFIG_BLOCK_CACHE is not set
 CONFIG_DM_I2C=y
-CONFIG_TWL4030_LED=y
 CONFIG_DM_MMC=y
 # CONFIG_MMC_HW_PARTITIONING is not set
 # CONFIG_MMC_VERBOSE is not set
@@ -59,10 +62,8 @@ CONFIG_CONS_INDEX=3
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_USB=y
-CONFIG_USB_MUSB_HCD=y
 CONFIG_USB_MUSB_UDC=y
 CONFIG_USB_OMAP3=y
-CONFIG_TWL4030_USB=y
 CONFIG_CFB_CONSOLE=y
 CONFIG_CFB_CONSOLE_ANSI=y
 # CONFIG_VGA_AS_SINGLE_DEVICE is not set
diff --git a/doc/README.nokia_rx51 b/doc/README.nokia_rx51
index 320b5efc7d..84d1912ddd 100644
--- a/doc/README.nokia_rx51
+++ b/doc/README.nokia_rx51
@@ -24,8 +24,7 @@ called u-boot-gen-combined. It is available in following repository:
 There is support for hardware watchdog. Hardware watchdog is started by
 NOLO so u-boot must kick watchdog to prevent reboot device (but not very
 often, max every 2 seconds). There is also support for framebuffer display
-output with ANSI escape codes and the N900 HW keyboard input. USB tty works
-but is disabled because it prevents the current Maemo kernel from booting.
+output with ANSI escape codes and the N900 HW keyboard input.
 
 When U-Boot is starting it enable IBE bit in Auxiliary Control Register,
 which is needed for Thumb-2 ISA support. It is workaround for errata 430973.
@@ -49,10 +48,6 @@ Boot from SD or eMMC in this order:
 
 Available additional commands/variables:
 
- * run sercon - Use serial port for control
- * run usbcon - Use usbtty for control
- * run vgacon - Use framebuffer and HW keyboard for control (default)
-
  * run sdboot - Boot from external SD card (see boot order)
  * run emmcboot - Boot from internal eMMC memory (see boot order)
  * run attachboot - Boot attached kernel image (attached to U-Boot binary)
@@ -87,14 +82,6 @@ Additional variables for booting kernel:
  and u-boot standard output is set to serial then setup_console_atag is
  automatically set to 1. So output from Maemo kernel would go to serial port.
 
-USB TTY:
-
- Maemo kernel 2.6.28 will crash if u-boot enable usb tty. So USB TTY is disabled.
- For enabling USB TTY just add this line to file include/configs/nokia_rx51.h
-
- #define CONFIG_USB_TTY
-
-
 UBIFS support:
 
  UBIFS support is disabled, because U-Boot image is too big and cannot be
diff --git a/include/configs/nokia_rx51.h b/include/configs/nokia_rx51.h
index 3f2700d8e2..23368de624 100644
--- a/include/configs/nokia_rx51.h
+++ b/include/configs/nokia_rx51.h
@@ -70,10 +70,12 @@
 
 /* USB device configuration */
 #define CONFIG_USB_DEVICE
+#define CONFIG_USB_TTY
 #define CONFIG_USBD_VENDORID		0x0421
-#define CONFIG_USBD_PRODUCTID		0x01c8
+#define CONFIG_USBD_PRODUCTID_CDCACM	0x01c8
+#define CONFIG_USBD_PRODUCTID_GSERIAL	0x01c8
 #define CONFIG_USBD_MANUFACTURER	"Nokia"
-#define CONFIG_USBD_PRODUCT_NAME	"N900"
+#define CONFIG_USBD_PRODUCT_NAME	"N900 (U-Boot)"
 
 #define GPIO_SLIDE			71
 
@@ -108,15 +110,9 @@ int rx51_kp_getc(struct stdio_dev *sdev);
 /* Environment information */
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	"usbtty=cdc_acm\0" \
-	"stdin=serial,vga\0" \
-	"stdout=serial,vga\0" \
-	"stderr=serial,vga\0" \
-	"setcon=setenv stdin ${con};" \
-		"setenv stdout ${con};" \
-		"setenv stderr ${con}\0" \
-	"sercon=setenv con serial; run setcon\0" \
-	"usbcon=setenv con usbtty; run setcon\0" \
-	"vgacon=setenv con vga; run setcon\0" \
+	"stdin=usbtty,serial,vga\0" \
+	"stdout=usbtty,serial,vga\0" \
+	"stderr=usbtty,serial,vga\0" \
 	"slide=gpio input " __stringify(GPIO_SLIDE) "\0" \
 	"switchmmc=mmc dev ${mmcnum}\0" \
 	"kernaddr=0x82008000\0" \
@@ -198,9 +194,6 @@ int rx51_kp_getc(struct stdio_dev *sdev);
 #define CONFIG_POSTBOOTMENU \
 	"echo;" \
 	"echo Extra commands:;" \
-	"echo run sercon - Use serial port for control.;" \
-	"echo run usbcon - Use usbtty for control.;" \
-	"echo run vgacon - Use framebuffer/keyboard.;" \
 	"echo run sdboot - Boot from SD card slot.;" \
 	"echo run emmcboot - Boot internal eMMC memory.;" \
 	"echo run attachboot - Boot attached kernel image.;" \
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 69+ messages in thread

* [RESEND PATCH 12/16] arm: omap3: Compile lowlevel_init() function only when it is used
  2021-02-06 16:50       ` Marek Vasut
@ 2021-02-07 13:50         ` Pali Rohár
  2021-02-07 14:33           ` Marek Vasut
  0 siblings, 1 reply; 69+ messages in thread
From: Pali Rohár @ 2021-02-07 13:50 UTC (permalink / raw)
  To: u-boot

On Saturday 06 February 2021 17:50:54 Marek Vasut wrote:
> On 2/6/21 4:45 PM, Pali Roh?r wrote:
> > On Saturday 06 February 2021 16:40:18 Marek Vasut wrote:
> > > On 2/5/21 8:12 PM, Pali Roh?r wrote:
> > > > Function lowlevel_init() is called only from cpu_init_crit() and this
> > > > function is wrapped into #if .. #endif section. So compile also
> > > > lowlevel_init() function under same #if condition.
> > > > 
> > > > Signed-off-by: Pali Roh?r <pali@kernel.org>
> > > > ---
> > > >    arch/arm/mach-omap2/omap3/lowlevel_init.S | 6 +++++-
> > > >    1 file changed, 5 insertions(+), 1 deletion(-)
> > > > 
> > > > diff --git a/arch/arm/mach-omap2/omap3/lowlevel_init.S b/arch/arm/mach-omap2/omap3/lowlevel_init.S
> > > > index 2a05b5e521..4fa89418a1 100644
> > > > --- a/arch/arm/mach-omap2/omap3/lowlevel_init.S
> > > > +++ b/arch/arm/mach-omap2/omap3/lowlevel_init.S
> > > > @@ -45,7 +45,7 @@ ENDPROC(do_omap3_emu_romcode_call)
> > > >    ENTRY(cpy_clk_code)
> > > >    	/* Copy DPLL code into SRAM */
> > > >    	adr	r0, go_to_speed		/* copy from start of go_to_speed... */
> > > > -	adr	r2, lowlevel_init	/* ... up to start of low_level_init */
> > > > +	adr	r2, go_to_speed_end	/* ... up to start of go_to_speed_end */
> > > >    next2:
> > > >    	ldmia	r0!, {r3 - r10}		/* copy from source address [r0] */
> > > >    	stmia	r1!, {r3 - r10}		/* copy to   target address [r1] */
> > > > @@ -167,8 +167,11 @@ pll_div_add5:
> > > >    pll_div_val5:
> > > >    	.word CLSEL1_EMU_VAL
> > > > +go_to_speed_end:
> > > >    #endif
> > > 
> > > This hunk above seems like an unrelated change ^ ?
> > 
> > Entry 'lowlevel_init' is defined 3 lines below and is available only
> > when !CONFIG_SKIP_LOWLEVEL_INIT && !CONFIG_SKIP_LOWLEVEL_INIT_ONLY.
> > 
> > Few lines above is code which copies DPLL code into SRAM and this code
> > ends at address where 'lowlevel_init' entry starts.
> > 
> > Entry 'cpy_clk_code' is compiled also when CONFIG_SKIP_LOWLEVEL_INIT is
> > defined, therefore it is required to define label which is outside of
> > the #if code defined below and ends after the 'go_to_speed' code.
> > 
> > So I defined a new 'go_to_speed_end' label to allow compiling
> > 'cpy_clk_code' entry when CONFIG_SKIP_LOWLEVEL_INIT is defined.
> 
> Can you add exactly this description to the commit message -- the change
> isn't immediately obviously, collect the RBs and resend the patchset, so it
> can be picked ?

Done! I fixed commit messages and sent all patches again.

^ permalink raw reply	[flat|nested] 69+ messages in thread

* [RESEND PATCH 12/16] arm: omap3: Compile lowlevel_init() function only when it is used
  2021-02-07 13:50         ` Pali Rohár
@ 2021-02-07 14:33           ` Marek Vasut
  0 siblings, 0 replies; 69+ messages in thread
From: Marek Vasut @ 2021-02-07 14:33 UTC (permalink / raw)
  To: u-boot

On 2/7/21 2:50 PM, Pali Roh?r wrote:
> On Saturday 06 February 2021 17:50:54 Marek Vasut wrote:
>> On 2/6/21 4:45 PM, Pali Roh?r wrote:
>>> On Saturday 06 February 2021 16:40:18 Marek Vasut wrote:
>>>> On 2/5/21 8:12 PM, Pali Roh?r wrote:
>>>>> Function lowlevel_init() is called only from cpu_init_crit() and this
>>>>> function is wrapped into #if .. #endif section. So compile also
>>>>> lowlevel_init() function under same #if condition.
>>>>>
>>>>> Signed-off-by: Pali Roh?r <pali@kernel.org>
>>>>> ---
>>>>>     arch/arm/mach-omap2/omap3/lowlevel_init.S | 6 +++++-
>>>>>     1 file changed, 5 insertions(+), 1 deletion(-)
>>>>>
>>>>> diff --git a/arch/arm/mach-omap2/omap3/lowlevel_init.S b/arch/arm/mach-omap2/omap3/lowlevel_init.S
>>>>> index 2a05b5e521..4fa89418a1 100644
>>>>> --- a/arch/arm/mach-omap2/omap3/lowlevel_init.S
>>>>> +++ b/arch/arm/mach-omap2/omap3/lowlevel_init.S
>>>>> @@ -45,7 +45,7 @@ ENDPROC(do_omap3_emu_romcode_call)
>>>>>     ENTRY(cpy_clk_code)
>>>>>     	/* Copy DPLL code into SRAM */
>>>>>     	adr	r0, go_to_speed		/* copy from start of go_to_speed... */
>>>>> -	adr	r2, lowlevel_init	/* ... up to start of low_level_init */
>>>>> +	adr	r2, go_to_speed_end	/* ... up to start of go_to_speed_end */
>>>>>     next2:
>>>>>     	ldmia	r0!, {r3 - r10}		/* copy from source address [r0] */
>>>>>     	stmia	r1!, {r3 - r10}		/* copy to   target address [r1] */
>>>>> @@ -167,8 +167,11 @@ pll_div_add5:
>>>>>     pll_div_val5:
>>>>>     	.word CLSEL1_EMU_VAL
>>>>> +go_to_speed_end:
>>>>>     #endif
>>>>
>>>> This hunk above seems like an unrelated change ^ ?
>>>
>>> Entry 'lowlevel_init' is defined 3 lines below and is available only
>>> when !CONFIG_SKIP_LOWLEVEL_INIT && !CONFIG_SKIP_LOWLEVEL_INIT_ONLY.
>>>
>>> Few lines above is code which copies DPLL code into SRAM and this code
>>> ends at address where 'lowlevel_init' entry starts.
>>>
>>> Entry 'cpy_clk_code' is compiled also when CONFIG_SKIP_LOWLEVEL_INIT is
>>> defined, therefore it is required to define label which is outside of
>>> the #if code defined below and ends after the 'go_to_speed' code.
>>>
>>> So I defined a new 'go_to_speed_end' label to allow compiling
>>> 'cpy_clk_code' entry when CONFIG_SKIP_LOWLEVEL_INIT is defined.
>>
>> Can you add exactly this description to the commit message -- the change
>> isn't immediately obviously, collect the RBs and resend the patchset, so it
>> can be picked ?
> 
> Done! I fixed commit messages and sent all patches again.

Thanks

^ permalink raw reply	[flat|nested] 69+ messages in thread

* [RESEND v2 PATCH 00/16] Nokia RX-51: Fix USB TTY console and enable it
  2021-02-07 13:50 ` [RESEND v2 PATCH 00/16] Nokia RX-51: Fix USB TTY console and enable it Pali Rohár
                     ` (15 preceding siblings ...)
  2021-02-07 13:50   ` [RESEND v2 PATCH 16/16] Nokia RX-51: Enable usbtty serial console by default Pali Rohár
@ 2021-02-08 22:15   ` Lukasz Majewski
  2021-02-08 22:21     ` Pali Rohár
  16 siblings, 1 reply; 69+ messages in thread
From: Lukasz Majewski @ 2021-02-08 22:15 UTC (permalink / raw)
  To: u-boot

Hi Pali,

>     Resended v2 patch series with fixed commit messages
> 
> This patch series fix usbtty code (serial console via USB peripheral
> mode), fix underlying musb peripheral code, fix compilation of
> CONFIG_USB_DEVICE (used by usbtty), remove unused Nokia RX-51 code to
> decrease size of U-Boot binary and finally enable usbtty serial
> console for Nokia RX-51.
> 
> With this patch series debugging of Nokia RX-51 can be done also via
> USB serial console.
> 
> It fixes also stability of musb code and allows usage of file
> transfers via Kermit protocol on Nokia RX-51. Kermit file transfer
> via U-Boot loadb command is stable on Nokia N900 and gives about
> 52kB/s transfer rate.
> 
> On computer this serial console is accessible via /dev/ttyACM0 device.
> 

I've integrated your patchset and now it turns out that the u-boot size
is too big:
https://dev.azure.com/lukma633/U-Boot/_build/results?buildId=24&view=results
https://dev.azure.com/lukma633/U-Boot/_build/results?buildId=24&view=logs&j=9a06d2a9-1498-5de0-2a01-be581d48ba67&t=f9a6b761-daa3-500f-4840-65a939c5040d

The branch is https://github.com/lmajewski/u-boot-dfu/tree/testing

Have you experienced similar issues?

> Pali Roh?r (16):
>   serial: usbtty: Fix puts function
>   serial: usbtty: Send urb data in correct order
>   usb: musb: Fix compilation of gadget code
>   usb: musb: Always clear the data toggle bit when configuring ep
>   usb: musb: Fix configuring FIFO for endpoints
>   usb: musb: Read value of PERI_RXCSR to 16bit variable
>   usb: musb: Fix transmission of bigger buffers
>   usb: musb: Fix receiving of bigger buffers
>   usb: musb: Fix handling interrupts for EP0 and SET ADDRESS commmand
>   usb: musb: Ensure that we set musb dynamic FIFO buffer for every
>     endpoint
>   usb: gadget: Use dbg_ep0() macro instead of serial_printf()
>   arm: omap3: Compile lowlevel_init() function only when it is used
>   arm: omap3: Compile s_init() function only when it is used
>   Nokia RX-51: Remove function set_muxconf_regs()
>   Nokia RX-51: Move content of rx51.h to rx51.c
>   Nokia RX-51: Enable usbtty serial console by default
> 
>  Makefile                                  |   1 +
>  arch/arm/mach-omap2/omap3/board.c         |   3 +
>  arch/arm/mach-omap2/omap3/lowlevel_init.S |   6 +-
>  board/nokia/rx51/rx51.c                   |  28 +-
>  board/nokia/rx51/rx51.h                   | 377
> ---------------------- configs/nokia_rx51_defconfig              |
> 7 +- doc/README.nokia_rx51                     |  15 +-
>  drivers/serial/usbtty.c                   |  16 +-
>  drivers/usb/gadget/ep0.c                  |  16 +-
>  drivers/usb/musb/musb_core.c              |  12 +-
>  drivers/usb/musb/musb_udc.c               |  61 ++--
>  include/configs/nokia_rx51.h              |  21 +-
>  12 files changed, 82 insertions(+), 481 deletions(-)
>  delete mode 100644 board/nokia/rx51/rx51.h
> 




Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210208/77437d79/attachment.sig>

^ permalink raw reply	[flat|nested] 69+ messages in thread

* [RESEND v2 PATCH 00/16] Nokia RX-51: Fix USB TTY console and enable it
  2021-02-08 22:15   ` [RESEND v2 PATCH 00/16] Nokia RX-51: Fix USB TTY console and enable it Lukasz Majewski
@ 2021-02-08 22:21     ` Pali Rohár
  2021-02-08 22:34       ` Pali Rohár
  0 siblings, 1 reply; 69+ messages in thread
From: Pali Rohár @ 2021-02-08 22:21 UTC (permalink / raw)
  To: u-boot

On Monday 08 February 2021 23:15:33 Lukasz Majewski wrote:
> Hi Pali,
> 
> >     Resended v2 patch series with fixed commit messages
> > 
> > This patch series fix usbtty code (serial console via USB peripheral
> > mode), fix underlying musb peripheral code, fix compilation of
> > CONFIG_USB_DEVICE (used by usbtty), remove unused Nokia RX-51 code to
> > decrease size of U-Boot binary and finally enable usbtty serial
> > console for Nokia RX-51.
> > 
> > With this patch series debugging of Nokia RX-51 can be done also via
> > USB serial console.
> > 
> > It fixes also stability of musb code and allows usage of file
> > transfers via Kermit protocol on Nokia RX-51. Kermit file transfer
> > via U-Boot loadb command is stable on Nokia N900 and gives about
> > 52kB/s transfer rate.
> > 
> > On computer this serial console is accessible via /dev/ttyACM0 device.
> > 
> 
> I've integrated your patchset and now it turns out that the u-boot size
> is too big:
> https://dev.azure.com/lukma633/U-Boot/_build/results?buildId=24&view=results
> https://dev.azure.com/lukma633/U-Boot/_build/results?buildId=24&view=logs&j=9a06d2a9-1498-5de0-2a01-be581d48ba67&t=f9a6b761-daa3-500f-4840-65a939c5040d

Ah :-(
In November when I sent these patches, U-Boot binary was smaller.

> The branch is https://github.com/lmajewski/u-boot-dfu/tree/testing
> 
> Have you experienced similar issues?

Yes, memory for U-Boot is limited. It is needed to decrease size of
U-Boot binary and then it will work.

I will try to look at it later and find some dead code which can be
commented or removed to decrease binary size...

If you have an idea what increased U-Boot side it could help.

> > Pali Roh?r (16):
> >   serial: usbtty: Fix puts function
> >   serial: usbtty: Send urb data in correct order
> >   usb: musb: Fix compilation of gadget code
> >   usb: musb: Always clear the data toggle bit when configuring ep
> >   usb: musb: Fix configuring FIFO for endpoints
> >   usb: musb: Read value of PERI_RXCSR to 16bit variable
> >   usb: musb: Fix transmission of bigger buffers
> >   usb: musb: Fix receiving of bigger buffers
> >   usb: musb: Fix handling interrupts for EP0 and SET ADDRESS commmand
> >   usb: musb: Ensure that we set musb dynamic FIFO buffer for every
> >     endpoint
> >   usb: gadget: Use dbg_ep0() macro instead of serial_printf()
> >   arm: omap3: Compile lowlevel_init() function only when it is used
> >   arm: omap3: Compile s_init() function only when it is used
> >   Nokia RX-51: Remove function set_muxconf_regs()
> >   Nokia RX-51: Move content of rx51.h to rx51.c
> >   Nokia RX-51: Enable usbtty serial console by default
> > 
> >  Makefile                                  |   1 +
> >  arch/arm/mach-omap2/omap3/board.c         |   3 +
> >  arch/arm/mach-omap2/omap3/lowlevel_init.S |   6 +-
> >  board/nokia/rx51/rx51.c                   |  28 +-
> >  board/nokia/rx51/rx51.h                   | 377
> > ---------------------- configs/nokia_rx51_defconfig              |
> > 7 +- doc/README.nokia_rx51                     |  15 +-
> >  drivers/serial/usbtty.c                   |  16 +-
> >  drivers/usb/gadget/ep0.c                  |  16 +-
> >  drivers/usb/musb/musb_core.c              |  12 +-
> >  drivers/usb/musb/musb_udc.c               |  61 ++--
> >  include/configs/nokia_rx51.h              |  21 +-
> >  12 files changed, 82 insertions(+), 481 deletions(-)
> >  delete mode 100644 board/nokia/rx51/rx51.h
> > 
> 
> 
> 
> 
> Best regards,
> 
> Lukasz Majewski
> 
> --
> 
> DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de

^ permalink raw reply	[flat|nested] 69+ messages in thread

* [RESEND v2 PATCH 00/16] Nokia RX-51: Fix USB TTY console and enable it
  2021-02-08 22:21     ` Pali Rohár
@ 2021-02-08 22:34       ` Pali Rohár
  2021-02-08 22:45         ` Marek Vasut
  2021-02-13 10:20         ` Pali Rohár
  0 siblings, 2 replies; 69+ messages in thread
From: Pali Rohár @ 2021-02-08 22:34 UTC (permalink / raw)
  To: u-boot

On Monday 08 February 2021 23:21:38 Pali Roh?r wrote:
> On Monday 08 February 2021 23:15:33 Lukasz Majewski wrote:
> > Hi Pali,
> > 
> > >     Resended v2 patch series with fixed commit messages
> > > 
> > > This patch series fix usbtty code (serial console via USB peripheral
> > > mode), fix underlying musb peripheral code, fix compilation of
> > > CONFIG_USB_DEVICE (used by usbtty), remove unused Nokia RX-51 code to
> > > decrease size of U-Boot binary and finally enable usbtty serial
> > > console for Nokia RX-51.
> > > 
> > > With this patch series debugging of Nokia RX-51 can be done also via
> > > USB serial console.
> > > 
> > > It fixes also stability of musb code and allows usage of file
> > > transfers via Kermit protocol on Nokia RX-51. Kermit file transfer
> > > via U-Boot loadb command is stable on Nokia N900 and gives about
> > > 52kB/s transfer rate.
> > > 
> > > On computer this serial console is accessible via /dev/ttyACM0 device.
> > > 
> > 
> > I've integrated your patchset and now it turns out that the u-boot size
> > is too big:
> > https://dev.azure.com/lukma633/U-Boot/_build/results?buildId=24&view=results
> > https://dev.azure.com/lukma633/U-Boot/_build/results?buildId=24&view=logs&j=9a06d2a9-1498-5de0-2a01-be581d48ba67&t=f9a6b761-daa3-500f-4840-65a939c5040d
> 
> Ah :-(
> In November when I sent these patches, U-Boot binary was smaller.
> 
> > The branch is https://github.com/lmajewski/u-boot-dfu/tree/testing
> > 
> > Have you experienced similar issues?
> 
> Yes, memory for U-Boot is limited. It is needed to decrease size of
> U-Boot binary and then it will work.
> 
> I will try to look at it later and find some dead code which can be
> commented or removed to decrease binary size...

Just a quick test, could you try to add

CONFIG_OPTIMIZE_INLINING=y

into configs/nokia_rx51_defconfig file, if it helps?

> If you have an idea what increased U-Boot side it could help.
> 
> > > Pali Roh?r (16):
> > >   serial: usbtty: Fix puts function
> > >   serial: usbtty: Send urb data in correct order
> > >   usb: musb: Fix compilation of gadget code
> > >   usb: musb: Always clear the data toggle bit when configuring ep
> > >   usb: musb: Fix configuring FIFO for endpoints
> > >   usb: musb: Read value of PERI_RXCSR to 16bit variable
> > >   usb: musb: Fix transmission of bigger buffers
> > >   usb: musb: Fix receiving of bigger buffers
> > >   usb: musb: Fix handling interrupts for EP0 and SET ADDRESS commmand
> > >   usb: musb: Ensure that we set musb dynamic FIFO buffer for every
> > >     endpoint
> > >   usb: gadget: Use dbg_ep0() macro instead of serial_printf()
> > >   arm: omap3: Compile lowlevel_init() function only when it is used
> > >   arm: omap3: Compile s_init() function only when it is used
> > >   Nokia RX-51: Remove function set_muxconf_regs()
> > >   Nokia RX-51: Move content of rx51.h to rx51.c
> > >   Nokia RX-51: Enable usbtty serial console by default
> > > 
> > >  Makefile                                  |   1 +
> > >  arch/arm/mach-omap2/omap3/board.c         |   3 +
> > >  arch/arm/mach-omap2/omap3/lowlevel_init.S |   6 +-
> > >  board/nokia/rx51/rx51.c                   |  28 +-
> > >  board/nokia/rx51/rx51.h                   | 377
> > > ---------------------- configs/nokia_rx51_defconfig              |
> > > 7 +- doc/README.nokia_rx51                     |  15 +-
> > >  drivers/serial/usbtty.c                   |  16 +-
> > >  drivers/usb/gadget/ep0.c                  |  16 +-
> > >  drivers/usb/musb/musb_core.c              |  12 +-
> > >  drivers/usb/musb/musb_udc.c               |  61 ++--
> > >  include/configs/nokia_rx51.h              |  21 +-
> > >  12 files changed, 82 insertions(+), 481 deletions(-)
> > >  delete mode 100644 board/nokia/rx51/rx51.h
> > > 
> > 
> > 
> > 
> > 
> > Best regards,
> > 
> > Lukasz Majewski
> > 
> > --
> > 
> > DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
> > HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> > Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de
> 
> 

^ permalink raw reply	[flat|nested] 69+ messages in thread

* [RESEND v2 PATCH 00/16] Nokia RX-51: Fix USB TTY console and enable it
  2021-02-08 22:34       ` Pali Rohár
@ 2021-02-08 22:45         ` Marek Vasut
  2021-02-08 22:54           ` Pali Rohár
  2021-02-13 10:20         ` Pali Rohár
  1 sibling, 1 reply; 69+ messages in thread
From: Marek Vasut @ 2021-02-08 22:45 UTC (permalink / raw)
  To: u-boot

On 2/8/21 11:34 PM, Pali Roh?r wrote:
> On Monday 08 February 2021 23:21:38 Pali Roh?r wrote:
>> On Monday 08 February 2021 23:15:33 Lukasz Majewski wrote:
>>> Hi Pali,
>>>
>>>>      Resended v2 patch series with fixed commit messages
>>>>
>>>> This patch series fix usbtty code (serial console via USB peripheral
>>>> mode), fix underlying musb peripheral code, fix compilation of
>>>> CONFIG_USB_DEVICE (used by usbtty), remove unused Nokia RX-51 code to
>>>> decrease size of U-Boot binary and finally enable usbtty serial
>>>> console for Nokia RX-51.
>>>>
>>>> With this patch series debugging of Nokia RX-51 can be done also via
>>>> USB serial console.
>>>>
>>>> It fixes also stability of musb code and allows usage of file
>>>> transfers via Kermit protocol on Nokia RX-51. Kermit file transfer
>>>> via U-Boot loadb command is stable on Nokia N900 and gives about
>>>> 52kB/s transfer rate.
>>>>
>>>> On computer this serial console is accessible via /dev/ttyACM0 device.
>>>>
>>>
>>> I've integrated your patchset and now it turns out that the u-boot size
>>> is too big:
>>> https://dev.azure.com/lukma633/U-Boot/_build/results?buildId=24&view=results
>>> https://dev.azure.com/lukma633/U-Boot/_build/results?buildId=24&view=logs&j=9a06d2a9-1498-5de0-2a01-be581d48ba67&t=f9a6b761-daa3-500f-4840-65a939c5040d
>>
>> Ah :-(
>> In November when I sent these patches, U-Boot binary was smaller.
>>
>>> The branch is https://github.com/lmajewski/u-boot-dfu/tree/testing
>>>
>>> Have you experienced similar issues?
>>
>> Yes, memory for U-Boot is limited. It is needed to decrease size of
>> U-Boot binary and then it will work.
>>
>> I will try to look at it later and find some dead code which can be
>> commented or removed to decrease binary size...
> 
> Just a quick test, could you try to add
> 
> CONFIG_OPTIMIZE_INLINING=y
> 
> into configs/nokia_rx51_defconfig file, if it helps?

Surely you can try build-testing the patches yourself ? :-)

^ permalink raw reply	[flat|nested] 69+ messages in thread

* [RESEND v2 PATCH 00/16] Nokia RX-51: Fix USB TTY console and enable it
  2021-02-08 22:45         ` Marek Vasut
@ 2021-02-08 22:54           ` Pali Rohár
  0 siblings, 0 replies; 69+ messages in thread
From: Pali Rohár @ 2021-02-08 22:54 UTC (permalink / raw)
  To: u-boot

On Monday 08 February 2021 23:45:37 Marek Vasut wrote:
> On 2/8/21 11:34 PM, Pali Roh?r wrote:
> > On Monday 08 February 2021 23:21:38 Pali Roh?r wrote:
> > > On Monday 08 February 2021 23:15:33 Lukasz Majewski wrote:
> > > > Hi Pali,
> > > > 
> > > > >      Resended v2 patch series with fixed commit messages
> > > > > 
> > > > > This patch series fix usbtty code (serial console via USB peripheral
> > > > > mode), fix underlying musb peripheral code, fix compilation of
> > > > > CONFIG_USB_DEVICE (used by usbtty), remove unused Nokia RX-51 code to
> > > > > decrease size of U-Boot binary and finally enable usbtty serial
> > > > > console for Nokia RX-51.
> > > > > 
> > > > > With this patch series debugging of Nokia RX-51 can be done also via
> > > > > USB serial console.
> > > > > 
> > > > > It fixes also stability of musb code and allows usage of file
> > > > > transfers via Kermit protocol on Nokia RX-51. Kermit file transfer
> > > > > via U-Boot loadb command is stable on Nokia N900 and gives about
> > > > > 52kB/s transfer rate.
> > > > > 
> > > > > On computer this serial console is accessible via /dev/ttyACM0 device.
> > > > > 
> > > > 
> > > > I've integrated your patchset and now it turns out that the u-boot size
> > > > is too big:
> > > > https://dev.azure.com/lukma633/U-Boot/_build/results?buildId=24&view=results
> > > > https://dev.azure.com/lukma633/U-Boot/_build/results?buildId=24&view=logs&j=9a06d2a9-1498-5de0-2a01-be581d48ba67&t=f9a6b761-daa3-500f-4840-65a939c5040d
> > > 
> > > Ah :-(
> > > In November when I sent these patches, U-Boot binary was smaller.
> > > 
> > > > The branch is https://github.com/lmajewski/u-boot-dfu/tree/testing
> > > > 
> > > > Have you experienced similar issues?
> > > 
> > > Yes, memory for U-Boot is limited. It is needed to decrease size of
> > > U-Boot binary and then it will work.
> > > 
> > > I will try to look at it later and find some dead code which can be
> > > commented or removed to decrease binary size...
> > 
> > Just a quick test, could you try to add
> > 
> > CONFIG_OPTIMIZE_INLINING=y
> > 
> > into configs/nokia_rx51_defconfig file, if it helps?
> 
> Surely you can try build-testing the patches yourself ? :-)

They are working fine on my two testes machines. I do not have this
problem which Lukasz described. Otherwise I would not send patches to
mailing list for upstream. Also I have tested CONFIG_OPTIMIZE_INLINING
and it decreased size of u-boot binary on my machine.

But I already figured out that "working on my machine" does not mean
that it would also on other machines... In past I hit compiler bugs
which caused that on my machine gcc compiled code correctly but on other
machine with older (buggy) gcc code was compiled incorrectly and result
of computation was incorrect.

That is why I'm asking if people who triggered mentioned issue can check
if proposed fix helps.

Btw, if I understood correctly without CONFIG_OPTIMIZE_INLINING U-Boot
redefine "inline" to "always inline". And with CONFIG_OPTIMIZE_INLINING
"inline" is "inline". From past I know that gcc is very smart and can
decide that it is better to ignore inlining some functions for -Os size
optimizations.

^ permalink raw reply	[flat|nested] 69+ messages in thread

* [RESEND v2 PATCH 00/16] Nokia RX-51: Fix USB TTY console and enable it
  2021-02-08 22:34       ` Pali Rohár
  2021-02-08 22:45         ` Marek Vasut
@ 2021-02-13 10:20         ` Pali Rohár
  2021-02-16  8:28           ` Lukasz Majewski
  1 sibling, 1 reply; 69+ messages in thread
From: Pali Rohár @ 2021-02-13 10:20 UTC (permalink / raw)
  To: u-boot

On Monday 08 February 2021 23:34:06 Pali Roh?r wrote:
> On Monday 08 February 2021 23:21:38 Pali Roh?r wrote:
> > On Monday 08 February 2021 23:15:33 Lukasz Majewski wrote:
> > > Hi Pali,
> > > 
> > > >     Resended v2 patch series with fixed commit messages
> > > > 
> > > > This patch series fix usbtty code (serial console via USB peripheral
> > > > mode), fix underlying musb peripheral code, fix compilation of
> > > > CONFIG_USB_DEVICE (used by usbtty), remove unused Nokia RX-51 code to
> > > > decrease size of U-Boot binary and finally enable usbtty serial
> > > > console for Nokia RX-51.
> > > > 
> > > > With this patch series debugging of Nokia RX-51 can be done also via
> > > > USB serial console.
> > > > 
> > > > It fixes also stability of musb code and allows usage of file
> > > > transfers via Kermit protocol on Nokia RX-51. Kermit file transfer
> > > > via U-Boot loadb command is stable on Nokia N900 and gives about
> > > > 52kB/s transfer rate.
> > > > 
> > > > On computer this serial console is accessible via /dev/ttyACM0 device.
> > > > 
> > > 
> > > I've integrated your patchset and now it turns out that the u-boot size
> > > is too big:
> > > https://dev.azure.com/lukma633/U-Boot/_build/results?buildId=24&view=results
> > > https://dev.azure.com/lukma633/U-Boot/_build/results?buildId=24&view=logs&j=9a06d2a9-1498-5de0-2a01-be581d48ba67&t=f9a6b761-daa3-500f-4840-65a939c5040d
> > 
> > Ah :-(
> > In November when I sent these patches, U-Boot binary was smaller.
> > 
> > > The branch is https://github.com/lmajewski/u-boot-dfu/tree/testing
> > > 
> > > Have you experienced similar issues?
> > 
> > Yes, memory for U-Boot is limited. It is needed to decrease size of
> > U-Boot binary and then it will work.
> > 
> > I will try to look at it later and find some dead code which can be
> > commented or removed to decrease binary size...
> 
> Just a quick test, could you try to add
> 
> CONFIG_OPTIMIZE_INLINING=y
> 
> into configs/nokia_rx51_defconfig file, if it helps?

Lukasz, is CONFIG_OPTIMIZE_INLINING=y option fixing build for you?

> > If you have an idea what increased U-Boot side it could help.
> > 
> > > > Pali Roh?r (16):
> > > >   serial: usbtty: Fix puts function
> > > >   serial: usbtty: Send urb data in correct order
> > > >   usb: musb: Fix compilation of gadget code
> > > >   usb: musb: Always clear the data toggle bit when configuring ep
> > > >   usb: musb: Fix configuring FIFO for endpoints
> > > >   usb: musb: Read value of PERI_RXCSR to 16bit variable
> > > >   usb: musb: Fix transmission of bigger buffers
> > > >   usb: musb: Fix receiving of bigger buffers
> > > >   usb: musb: Fix handling interrupts for EP0 and SET ADDRESS commmand
> > > >   usb: musb: Ensure that we set musb dynamic FIFO buffer for every
> > > >     endpoint
> > > >   usb: gadget: Use dbg_ep0() macro instead of serial_printf()
> > > >   arm: omap3: Compile lowlevel_init() function only when it is used
> > > >   arm: omap3: Compile s_init() function only when it is used
> > > >   Nokia RX-51: Remove function set_muxconf_regs()
> > > >   Nokia RX-51: Move content of rx51.h to rx51.c
> > > >   Nokia RX-51: Enable usbtty serial console by default
> > > > 
> > > >  Makefile                                  |   1 +
> > > >  arch/arm/mach-omap2/omap3/board.c         |   3 +
> > > >  arch/arm/mach-omap2/omap3/lowlevel_init.S |   6 +-
> > > >  board/nokia/rx51/rx51.c                   |  28 +-
> > > >  board/nokia/rx51/rx51.h                   | 377
> > > > ---------------------- configs/nokia_rx51_defconfig              |
> > > > 7 +- doc/README.nokia_rx51                     |  15 +-
> > > >  drivers/serial/usbtty.c                   |  16 +-
> > > >  drivers/usb/gadget/ep0.c                  |  16 +-
> > > >  drivers/usb/musb/musb_core.c              |  12 +-
> > > >  drivers/usb/musb/musb_udc.c               |  61 ++--
> > > >  include/configs/nokia_rx51.h              |  21 +-
> > > >  12 files changed, 82 insertions(+), 481 deletions(-)
> > > >  delete mode 100644 board/nokia/rx51/rx51.h
> > > > 
> > > 
> > > 
> > > 
> > > 
> > > Best regards,
> > > 
> > > Lukasz Majewski
> > > 
> > > --
> > > 
> > > DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
> > > HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> > > Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de
> > 
> > 

^ permalink raw reply	[flat|nested] 69+ messages in thread

* [RESEND v2 PATCH 00/16] Nokia RX-51: Fix USB TTY console and enable it
  2021-02-13 10:20         ` Pali Rohár
@ 2021-02-16  8:28           ` Lukasz Majewski
  2021-02-19  0:38             ` Pali Rohár
  0 siblings, 1 reply; 69+ messages in thread
From: Lukasz Majewski @ 2021-02-16  8:28 UTC (permalink / raw)
  To: u-boot

Hi Pali,

> On Monday 08 February 2021 23:34:06 Pali Roh?r wrote:
> > On Monday 08 February 2021 23:21:38 Pali Roh?r wrote:  
> > > On Monday 08 February 2021 23:15:33 Lukasz Majewski wrote:  
> > > > Hi Pali,
> > > >   
> > > > >     Resended v2 patch series with fixed commit messages
> > > > > 
> > > > > This patch series fix usbtty code (serial console via USB
> > > > > peripheral mode), fix underlying musb peripheral code, fix
> > > > > compilation of CONFIG_USB_DEVICE (used by usbtty), remove
> > > > > unused Nokia RX-51 code to decrease size of U-Boot binary and
> > > > > finally enable usbtty serial console for Nokia RX-51.
> > > > > 
> > > > > With this patch series debugging of Nokia RX-51 can be done
> > > > > also via USB serial console.
> > > > > 
> > > > > It fixes also stability of musb code and allows usage of file
> > > > > transfers via Kermit protocol on Nokia RX-51. Kermit file
> > > > > transfer via U-Boot loadb command is stable on Nokia N900 and
> > > > > gives about 52kB/s transfer rate.
> > > > > 
> > > > > On computer this serial console is accessible via
> > > > > /dev/ttyACM0 device. 
> > > > 
> > > > I've integrated your patchset and now it turns out that the
> > > > u-boot size is too big:
> > > > https://dev.azure.com/lukma633/U-Boot/_build/results?buildId=24&view=results
> > > > https://dev.azure.com/lukma633/U-Boot/_build/results?buildId=24&view=logs&j=9a06d2a9-1498-5de0-2a01-be581d48ba67&t=f9a6b761-daa3-500f-4840-65a939c5040d
> > > >  
> > > 
> > > Ah :-(
> > > In November when I sent these patches, U-Boot binary was smaller.
> > >   
> > > > The branch is
> > > > https://github.com/lmajewski/u-boot-dfu/tree/testing
> > > > 
> > > > Have you experienced similar issues?  
> > > 
> > > Yes, memory for U-Boot is limited. It is needed to decrease size
> > > of U-Boot binary and then it will work.
> > > 
> > > I will try to look at it later and find some dead code which can
> > > be commented or removed to decrease binary size...  
> > 
> > Just a quick test, could you try to add
> > 
> > CONFIG_OPTIMIZE_INLINING=y
> > 
> > into configs/nokia_rx51_defconfig file, if it helps?  
> 
> Lukasz, is CONFIG_OPTIMIZE_INLINING=y option fixing build for you?

Could you setup the CI environment and test your patchset with it?

It is documented in .azure-pipelines.yml.

Azure build takes not more than 3h for the whole test setup.

> 
> > > If you have an idea what increased U-Boot side it could help.
> > >   
> > > > > Pali Roh?r (16):
> > > > >   serial: usbtty: Fix puts function
> > > > >   serial: usbtty: Send urb data in correct order
> > > > >   usb: musb: Fix compilation of gadget code
> > > > >   usb: musb: Always clear the data toggle bit when
> > > > > configuring ep usb: musb: Fix configuring FIFO for endpoints
> > > > >   usb: musb: Read value of PERI_RXCSR to 16bit variable
> > > > >   usb: musb: Fix transmission of bigger buffers
> > > > >   usb: musb: Fix receiving of bigger buffers
> > > > >   usb: musb: Fix handling interrupts for EP0 and SET ADDRESS
> > > > > commmand usb: musb: Ensure that we set musb dynamic FIFO
> > > > > buffer for every endpoint
> > > > >   usb: gadget: Use dbg_ep0() macro instead of serial_printf()
> > > > >   arm: omap3: Compile lowlevel_init() function only when it
> > > > > is used arm: omap3: Compile s_init() function only when it is
> > > > > used Nokia RX-51: Remove function set_muxconf_regs()
> > > > >   Nokia RX-51: Move content of rx51.h to rx51.c
> > > > >   Nokia RX-51: Enable usbtty serial console by default
> > > > > 
> > > > >  Makefile                                  |   1 +
> > > > >  arch/arm/mach-omap2/omap3/board.c         |   3 +
> > > > >  arch/arm/mach-omap2/omap3/lowlevel_init.S |   6 +-
> > > > >  board/nokia/rx51/rx51.c                   |  28 +-
> > > > >  board/nokia/rx51/rx51.h                   | 377
> > > > > ---------------------- configs/nokia_rx51_defconfig
> > > > >    | 7 +- doc/README.nokia_rx51                     |  15 +-
> > > > >  drivers/serial/usbtty.c                   |  16 +-
> > > > >  drivers/usb/gadget/ep0.c                  |  16 +-
> > > > >  drivers/usb/musb/musb_core.c              |  12 +-
> > > > >  drivers/usb/musb/musb_udc.c               |  61 ++--
> > > > >  include/configs/nokia_rx51.h              |  21 +-
> > > > >  12 files changed, 82 insertions(+), 481 deletions(-)
> > > > >  delete mode 100644 board/nokia/rx51/rx51.h
> > > > >   
> > > > 
> > > > 
> > > > 
> > > > 
> > > > Best regards,
> > > > 
> > > > Lukasz Majewski
> > > > 
> > > > --
> > > > 
> > > > DENX Software Engineering GmbH,      Managing Director:
> > > > Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194
> > > > Groebenzell, Germany Phone: (+49)-8142-66989-59 Fax:
> > > > (+49)-8142-66989-80 Email: lukma at denx.de  
> > > 
> > >   




Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210216/02f26b45/attachment.sig>

^ permalink raw reply	[flat|nested] 69+ messages in thread

* [RESEND v2 PATCH 00/16] Nokia RX-51: Fix USB TTY console and enable it
  2021-02-16  8:28           ` Lukasz Majewski
@ 2021-02-19  0:38             ` Pali Rohár
  2021-02-20  8:20               ` Lukasz Majewski
  0 siblings, 1 reply; 69+ messages in thread
From: Pali Rohár @ 2021-02-19  0:38 UTC (permalink / raw)
  To: u-boot

On Tuesday 16 February 2021 09:28:06 Lukasz Majewski wrote:
> Hi Pali,
> 
> > On Monday 08 February 2021 23:34:06 Pali Roh?r wrote:
> > > On Monday 08 February 2021 23:21:38 Pali Roh?r wrote:  
> > > > On Monday 08 February 2021 23:15:33 Lukasz Majewski wrote:  
> > > > > Hi Pali,
> > > > >   
> > > > > >     Resended v2 patch series with fixed commit messages
> > > > > > 
> > > > > > This patch series fix usbtty code (serial console via USB
> > > > > > peripheral mode), fix underlying musb peripheral code, fix
> > > > > > compilation of CONFIG_USB_DEVICE (used by usbtty), remove
> > > > > > unused Nokia RX-51 code to decrease size of U-Boot binary and
> > > > > > finally enable usbtty serial console for Nokia RX-51.
> > > > > > 
> > > > > > With this patch series debugging of Nokia RX-51 can be done
> > > > > > also via USB serial console.
> > > > > > 
> > > > > > It fixes also stability of musb code and allows usage of file
> > > > > > transfers via Kermit protocol on Nokia RX-51. Kermit file
> > > > > > transfer via U-Boot loadb command is stable on Nokia N900 and
> > > > > > gives about 52kB/s transfer rate.
> > > > > > 
> > > > > > On computer this serial console is accessible via
> > > > > > /dev/ttyACM0 device. 
> > > > > 
> > > > > I've integrated your patchset and now it turns out that the
> > > > > u-boot size is too big:
> > > > > https://dev.azure.com/lukma633/U-Boot/_build/results?buildId=24&view=results
> > > > > https://dev.azure.com/lukma633/U-Boot/_build/results?buildId=24&view=logs&j=9a06d2a9-1498-5de0-2a01-be581d48ba67&t=f9a6b761-daa3-500f-4840-65a939c5040d
> > > > >  
> > > > 
> > > > Ah :-(
> > > > In November when I sent these patches, U-Boot binary was smaller.
> > > >   
> > > > > The branch is
> > > > > https://github.com/lmajewski/u-boot-dfu/tree/testing
> > > > > 
> > > > > Have you experienced similar issues?  
> > > > 
> > > > Yes, memory for U-Boot is limited. It is needed to decrease size
> > > > of U-Boot binary and then it will work.
> > > > 
> > > > I will try to look at it later and find some dead code which can
> > > > be commented or removed to decrease binary size...  
> > > 
> > > Just a quick test, could you try to add
> > > 
> > > CONFIG_OPTIMIZE_INLINING=y
> > > 
> > > into configs/nokia_rx51_defconfig file, if it helps?  
> > 
> > Lukasz, is CONFIG_OPTIMIZE_INLINING=y option fixing build for you?
> 
> Could you setup the CI environment and test your patchset with it?
> 
> It is documented in .azure-pipelines.yml.
> 
> Azure build takes not more than 3h for the whole test setup.

It helped!

https://dev.azure.com/u-boot/u-boot/_build/results?buildId=1816&view=logs&j=9a06d2a9-1498-5de0-2a01-be581d48ba67&t=f9a6b761-daa3-500f-4840-65a939c5040d&l=8777

> > 
> > > > If you have an idea what increased U-Boot side it could help.
> > > >   
> > > > > > Pali Roh?r (16):
> > > > > >   serial: usbtty: Fix puts function
> > > > > >   serial: usbtty: Send urb data in correct order
> > > > > >   usb: musb: Fix compilation of gadget code
> > > > > >   usb: musb: Always clear the data toggle bit when
> > > > > > configuring ep usb: musb: Fix configuring FIFO for endpoints
> > > > > >   usb: musb: Read value of PERI_RXCSR to 16bit variable
> > > > > >   usb: musb: Fix transmission of bigger buffers
> > > > > >   usb: musb: Fix receiving of bigger buffers
> > > > > >   usb: musb: Fix handling interrupts for EP0 and SET ADDRESS
> > > > > > commmand usb: musb: Ensure that we set musb dynamic FIFO
> > > > > > buffer for every endpoint
> > > > > >   usb: gadget: Use dbg_ep0() macro instead of serial_printf()
> > > > > >   arm: omap3: Compile lowlevel_init() function only when it
> > > > > > is used arm: omap3: Compile s_init() function only when it is
> > > > > > used Nokia RX-51: Remove function set_muxconf_regs()
> > > > > >   Nokia RX-51: Move content of rx51.h to rx51.c
> > > > > >   Nokia RX-51: Enable usbtty serial console by default
> > > > > > 
> > > > > >  Makefile                                  |   1 +
> > > > > >  arch/arm/mach-omap2/omap3/board.c         |   3 +
> > > > > >  arch/arm/mach-omap2/omap3/lowlevel_init.S |   6 +-
> > > > > >  board/nokia/rx51/rx51.c                   |  28 +-
> > > > > >  board/nokia/rx51/rx51.h                   | 377
> > > > > > ---------------------- configs/nokia_rx51_defconfig
> > > > > >    | 7 +- doc/README.nokia_rx51                     |  15 +-
> > > > > >  drivers/serial/usbtty.c                   |  16 +-
> > > > > >  drivers/usb/gadget/ep0.c                  |  16 +-
> > > > > >  drivers/usb/musb/musb_core.c              |  12 +-
> > > > > >  drivers/usb/musb/musb_udc.c               |  61 ++--
> > > > > >  include/configs/nokia_rx51.h              |  21 +-
> > > > > >  12 files changed, 82 insertions(+), 481 deletions(-)
> > > > > >  delete mode 100644 board/nokia/rx51/rx51.h
> > > > > >   
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > Best regards,
> > > > > 
> > > > > Lukasz Majewski
> > > > > 
> > > > > --
> > > > > 
> > > > > DENX Software Engineering GmbH,      Managing Director:
> > > > > Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194
> > > > > Groebenzell, Germany Phone: (+49)-8142-66989-59 Fax:
> > > > > (+49)-8142-66989-80 Email: lukma at denx.de  
> > > > 
> > > >   
> 
> 
> 
> 
> Best regards,
> 
> Lukasz Majewski
> 
> --
> 
> DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de

^ permalink raw reply	[flat|nested] 69+ messages in thread

* [RESEND v2 PATCH 00/16] Nokia RX-51: Fix USB TTY console and enable it
  2021-02-19  0:38             ` Pali Rohár
@ 2021-02-20  8:20               ` Lukasz Majewski
  2021-02-20 10:54                 ` Pali Rohár
  0 siblings, 1 reply; 69+ messages in thread
From: Lukasz Majewski @ 2021-02-20  8:20 UTC (permalink / raw)
  To: u-boot

On Fri, 19 Feb 2021 01:38:14 +0100
Pali Roh?r <pali@kernel.org> wrote:

> On Tuesday 16 February 2021 09:28:06 Lukasz Majewski wrote:
> > Hi Pali,
> >   
> > > On Monday 08 February 2021 23:34:06 Pali Roh?r wrote:  
> > > > On Monday 08 February 2021 23:21:38 Pali Roh?r wrote:    
> > > > > On Monday 08 February 2021 23:15:33 Lukasz Majewski wrote:    
> > > > > > Hi Pali,
> > > > > >     
> > > > > > >     Resended v2 patch series with fixed commit messages
> > > > > > > 
> > > > > > > This patch series fix usbtty code (serial console via USB
> > > > > > > peripheral mode), fix underlying musb peripheral code, fix
> > > > > > > compilation of CONFIG_USB_DEVICE (used by usbtty), remove
> > > > > > > unused Nokia RX-51 code to decrease size of U-Boot binary
> > > > > > > and finally enable usbtty serial console for Nokia RX-51.
> > > > > > > 
> > > > > > > With this patch series debugging of Nokia RX-51 can be
> > > > > > > done also via USB serial console.
> > > > > > > 
> > > > > > > It fixes also stability of musb code and allows usage of
> > > > > > > file transfers via Kermit protocol on Nokia RX-51. Kermit
> > > > > > > file transfer via U-Boot loadb command is stable on Nokia
> > > > > > > N900 and gives about 52kB/s transfer rate.
> > > > > > > 
> > > > > > > On computer this serial console is accessible via
> > > > > > > /dev/ttyACM0 device.   
> > > > > > 
> > > > > > I've integrated your patchset and now it turns out that the
> > > > > > u-boot size is too big:
> > > > > > https://dev.azure.com/lukma633/U-Boot/_build/results?buildId=24&view=results
> > > > > > https://dev.azure.com/lukma633/U-Boot/_build/results?buildId=24&view=logs&j=9a06d2a9-1498-5de0-2a01-be581d48ba67&t=f9a6b761-daa3-500f-4840-65a939c5040d
> > > > > >    
> > > > > 
> > > > > Ah :-(
> > > > > In November when I sent these patches, U-Boot binary was
> > > > > smaller. 
> > > > > > The branch is
> > > > > > https://github.com/lmajewski/u-boot-dfu/tree/testing
> > > > > > 
> > > > > > Have you experienced similar issues?    
> > > > > 
> > > > > Yes, memory for U-Boot is limited. It is needed to decrease
> > > > > size of U-Boot binary and then it will work.
> > > > > 
> > > > > I will try to look at it later and find some dead code which
> > > > > can be commented or removed to decrease binary size...    
> > > > 
> > > > Just a quick test, could you try to add
> > > > 
> > > > CONFIG_OPTIMIZE_INLINING=y
> > > > 
> > > > into configs/nokia_rx51_defconfig file, if it helps?    
> > > 
> > > Lukasz, is CONFIG_OPTIMIZE_INLINING=y option fixing build for
> > > you?  
> > 
> > Could you setup the CI environment and test your patchset with it?
> > 
> > It is documented in .azure-pipelines.yml.
> > 
> > Azure build takes not more than 3h for the whole test setup.  
> 
> It helped!
> 
> https://dev.azure.com/u-boot/u-boot/_build/results?buildId=1816&view=logs&j=9a06d2a9-1498-5de0-2a01-be581d48ba67&t=f9a6b761-daa3-500f-4840-65a939c5040d&l=8777

Great. Please resend the eligible patch (with adding this variable).
And I will prepare PR ASAP.

> 
> > >   
> > > > > If you have an idea what increased U-Boot side it could help.
> > > > >     
> > > > > > > Pali Roh?r (16):
> > > > > > >   serial: usbtty: Fix puts function
> > > > > > >   serial: usbtty: Send urb data in correct order
> > > > > > >   usb: musb: Fix compilation of gadget code
> > > > > > >   usb: musb: Always clear the data toggle bit when
> > > > > > > configuring ep usb: musb: Fix configuring FIFO for
> > > > > > > endpoints usb: musb: Read value of PERI_RXCSR to 16bit
> > > > > > > variable usb: musb: Fix transmission of bigger buffers
> > > > > > >   usb: musb: Fix receiving of bigger buffers
> > > > > > >   usb: musb: Fix handling interrupts for EP0 and SET
> > > > > > > ADDRESS commmand usb: musb: Ensure that we set musb
> > > > > > > dynamic FIFO buffer for every endpoint
> > > > > > >   usb: gadget: Use dbg_ep0() macro instead of
> > > > > > > serial_printf() arm: omap3: Compile lowlevel_init()
> > > > > > > function only when it is used arm: omap3: Compile
> > > > > > > s_init() function only when it is used Nokia RX-51:
> > > > > > > Remove function set_muxconf_regs() Nokia RX-51: Move
> > > > > > > content of rx51.h to rx51.c Nokia RX-51: Enable usbtty
> > > > > > > serial console by default
> > > > > > > 
> > > > > > >  Makefile                                  |   1 +
> > > > > > >  arch/arm/mach-omap2/omap3/board.c         |   3 +
> > > > > > >  arch/arm/mach-omap2/omap3/lowlevel_init.S |   6 +-
> > > > > > >  board/nokia/rx51/rx51.c                   |  28 +-
> > > > > > >  board/nokia/rx51/rx51.h                   | 377
> > > > > > > ---------------------- configs/nokia_rx51_defconfig
> > > > > > >    | 7 +- doc/README.nokia_rx51                     |  15
> > > > > > > +- drivers/serial/usbtty.c                   |  16 +-
> > > > > > >  drivers/usb/gadget/ep0.c                  |  16 +-
> > > > > > >  drivers/usb/musb/musb_core.c              |  12 +-
> > > > > > >  drivers/usb/musb/musb_udc.c               |  61 ++--
> > > > > > >  include/configs/nokia_rx51.h              |  21 +-
> > > > > > >  12 files changed, 82 insertions(+), 481 deletions(-)
> > > > > > >  delete mode 100644 board/nokia/rx51/rx51.h
> > > > > > >     
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > Best regards,
> > > > > > 
> > > > > > Lukasz Majewski
> > > > > > 
> > > > > > --
> > > > > > 
> > > > > > DENX Software Engineering GmbH,      Managing Director:
> > > > > > Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5,
> > > > > > D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-59 Fax:
> > > > > > (+49)-8142-66989-80 Email: lukma at denx.de    
> > > > > 
> > > > >     
> > 
> > 
> > 
> > 
> > Best regards,
> > 
> > Lukasz Majewski
> > 
> > --
> > 
> > DENX Software Engineering GmbH,      Managing Director: Wolfgang
> > Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell,
> > Germany Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email:
> > lukma at denx.de  
> 
> 




Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210220/4d9f5277/attachment.sig>

^ permalink raw reply	[flat|nested] 69+ messages in thread

* [AZURE FIX RESEND v2 PATCH 16/16] Nokia RX-51: Enable usbtty serial console by default
  2021-02-07 13:50   ` [RESEND v2 PATCH 16/16] Nokia RX-51: Enable usbtty serial console by default Pali Rohár
@ 2021-02-20 10:50     ` Pali Rohár
  0 siblings, 0 replies; 69+ messages in thread
From: Pali Rohár @ 2021-02-20 10:50 UTC (permalink / raw)
  To: u-boot

Now when usbtty serial console is fixed in U-Boot enable CONFIG_USB_TTY for
Nokia RX-51 board by default.

Fix also USB product id as U-Boot ignores CONFIG_USBD_PRODUCTID macro and
include U-Boot string into USB product name to indicate usage of U-Boot.

CONFIG_CONSOLE_MUX is already used and U-Boot console is available for
all in/out devices. Therefore there is no need to have separate commands
'run sercon', 'run usbcon' and 'run vgacon', so remove them.

As space for U-Boot is limited to 256kB, enable CONFIG_OPTIMIZE_INLINING
and disable some other unused options so CONFIG_USB_TTY can be enabled.

Nokia RX-51 does not have easily accessible UART serial console so the only
option for easy debugging is to use device's keyboard+screen or this usbtty
serial console over USB.

Signed-off-by: Pali Roh?r <pali@kernel.org>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Acked-by: Pavel Machek <pavel@ucw.cz>
---
 configs/nokia_rx51_defconfig |  8 +++++---
 doc/README.nokia_rx51        | 15 +--------------
 include/configs/nokia_rx51.h | 21 +++++++--------------
 3 files changed, 13 insertions(+), 31 deletions(-)

diff --git a/configs/nokia_rx51_defconfig b/configs/nokia_rx51_defconfig
index 9744d1c322..0df11b9858 100644
--- a/configs/nokia_rx51_defconfig
+++ b/configs/nokia_rx51_defconfig
@@ -4,6 +4,7 @@ CONFIG_ARCH_OMAP2PLUS=y
 CONFIG_SYS_TEXT_BASE=0x80008000
 CONFIG_NR_DRAM_BANKS=2
 CONFIG_TARGET_NOKIA_RX51=y
+CONFIG_OPTIMIZE_INLINING=y
 # CONFIG_SYS_MALLOC_F is not set
 # CONFIG_FIT is not set
 CONFIG_BOOTDELAY=30
@@ -12,6 +13,7 @@ CONFIG_AUTOBOOT_MENU_SHOW=y
 CONFIG_USE_PREBOOT=y
 CONFIG_PREBOOT="run preboot"
 CONFIG_CONSOLE_MUX=y
+# CONFIG_SYS_DEVICE_NULLDEV is not set
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="Nokia RX-51 # "
 # CONFIG_CMD_BDI is not set
@@ -46,9 +48,11 @@ CONFIG_ENV_OVERWRITE=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 # CONFIG_NET is not set
 CONFIG_DM=y
+# CONFIG_DM_WARN is not set
 # CONFIG_DM_DEVICE_REMOVE is not set
+# CONFIG_DM_SEQ_ALIAS is not set
+# CONFIG_BLOCK_CACHE is not set
 CONFIG_DM_I2C=y
-CONFIG_TWL4030_LED=y
 CONFIG_DM_MMC=y
 # CONFIG_MMC_HW_PARTITIONING is not set
 # CONFIG_MMC_VERBOSE is not set
@@ -58,10 +62,8 @@ CONFIG_CONS_INDEX=3
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_USB=y
-CONFIG_USB_MUSB_HCD=y
 CONFIG_USB_MUSB_UDC=y
 CONFIG_USB_OMAP3=y
-CONFIG_TWL4030_USB=y
 CONFIG_CFB_CONSOLE=y
 CONFIG_CFB_CONSOLE_ANSI=y
 # CONFIG_VGA_AS_SINGLE_DEVICE is not set
diff --git a/doc/README.nokia_rx51 b/doc/README.nokia_rx51
index 320b5efc7d..84d1912ddd 100644
--- a/doc/README.nokia_rx51
+++ b/doc/README.nokia_rx51
@@ -24,8 +24,7 @@ called u-boot-gen-combined. It is available in following repository:
 There is support for hardware watchdog. Hardware watchdog is started by
 NOLO so u-boot must kick watchdog to prevent reboot device (but not very
 often, max every 2 seconds). There is also support for framebuffer display
-output with ANSI escape codes and the N900 HW keyboard input. USB tty works
-but is disabled because it prevents the current Maemo kernel from booting.
+output with ANSI escape codes and the N900 HW keyboard input.
 
 When U-Boot is starting it enable IBE bit in Auxiliary Control Register,
 which is needed for Thumb-2 ISA support. It is workaround for errata 430973.
@@ -49,10 +48,6 @@ Boot from SD or eMMC in this order:
 
 Available additional commands/variables:
 
- * run sercon - Use serial port for control
- * run usbcon - Use usbtty for control
- * run vgacon - Use framebuffer and HW keyboard for control (default)
-
  * run sdboot - Boot from external SD card (see boot order)
  * run emmcboot - Boot from internal eMMC memory (see boot order)
  * run attachboot - Boot attached kernel image (attached to U-Boot binary)
@@ -87,14 +82,6 @@ Additional variables for booting kernel:
  and u-boot standard output is set to serial then setup_console_atag is
  automatically set to 1. So output from Maemo kernel would go to serial port.
 
-USB TTY:
-
- Maemo kernel 2.6.28 will crash if u-boot enable usb tty. So USB TTY is disabled.
- For enabling USB TTY just add this line to file include/configs/nokia_rx51.h
-
- #define CONFIG_USB_TTY
-
-
 UBIFS support:
 
  UBIFS support is disabled, because U-Boot image is too big and cannot be
diff --git a/include/configs/nokia_rx51.h b/include/configs/nokia_rx51.h
index 3f2700d8e2..23368de624 100644
--- a/include/configs/nokia_rx51.h
+++ b/include/configs/nokia_rx51.h
@@ -70,10 +70,12 @@
 
 /* USB device configuration */
 #define CONFIG_USB_DEVICE
+#define CONFIG_USB_TTY
 #define CONFIG_USBD_VENDORID		0x0421
-#define CONFIG_USBD_PRODUCTID		0x01c8
+#define CONFIG_USBD_PRODUCTID_CDCACM	0x01c8
+#define CONFIG_USBD_PRODUCTID_GSERIAL	0x01c8
 #define CONFIG_USBD_MANUFACTURER	"Nokia"
-#define CONFIG_USBD_PRODUCT_NAME	"N900"
+#define CONFIG_USBD_PRODUCT_NAME	"N900 (U-Boot)"
 
 #define GPIO_SLIDE			71
 
@@ -108,15 +110,9 @@ int rx51_kp_getc(struct stdio_dev *sdev);
 /* Environment information */
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	"usbtty=cdc_acm\0" \
-	"stdin=serial,vga\0" \
-	"stdout=serial,vga\0" \
-	"stderr=serial,vga\0" \
-	"setcon=setenv stdin ${con};" \
-		"setenv stdout ${con};" \
-		"setenv stderr ${con}\0" \
-	"sercon=setenv con serial; run setcon\0" \
-	"usbcon=setenv con usbtty; run setcon\0" \
-	"vgacon=setenv con vga; run setcon\0" \
+	"stdin=usbtty,serial,vga\0" \
+	"stdout=usbtty,serial,vga\0" \
+	"stderr=usbtty,serial,vga\0" \
 	"slide=gpio input " __stringify(GPIO_SLIDE) "\0" \
 	"switchmmc=mmc dev ${mmcnum}\0" \
 	"kernaddr=0x82008000\0" \
@@ -198,9 +194,6 @@ int rx51_kp_getc(struct stdio_dev *sdev);
 #define CONFIG_POSTBOOTMENU \
 	"echo;" \
 	"echo Extra commands:;" \
-	"echo run sercon - Use serial port for control.;" \
-	"echo run usbcon - Use usbtty for control.;" \
-	"echo run vgacon - Use framebuffer/keyboard.;" \
 	"echo run sdboot - Boot from SD card slot.;" \
 	"echo run emmcboot - Boot internal eMMC memory.;" \
 	"echo run attachboot - Boot attached kernel image.;" \
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 69+ messages in thread

* [RESEND v2 PATCH 00/16] Nokia RX-51: Fix USB TTY console and enable it
  2021-02-20  8:20               ` Lukasz Majewski
@ 2021-02-20 10:54                 ` Pali Rohár
  0 siblings, 0 replies; 69+ messages in thread
From: Pali Rohár @ 2021-02-20 10:54 UTC (permalink / raw)
  To: u-boot

On Saturday 20 February 2021 09:20:05 Lukasz Majewski wrote:
> Great. Please resend the eligible patch (with adding this variable).
> And I will prepare PR ASAP.

Done!

http://patchwork.ozlabs.org/project/uboot/patch/20210220105015.26210-1-pali at kernel.org/

^ permalink raw reply	[flat|nested] 69+ messages in thread

end of thread, other threads:[~2021-02-20 10:54 UTC | newest]

Thread overview: 69+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-05 19:11 [RESEND PATCH 00/16] Nokia RX-51: Fix USB TTY console and enable it Pali Rohár
2021-02-05 19:11 ` [RESEND PATCH 01/16] serial: usbtty: Fix puts function Pali Rohár
2021-02-06 13:49   ` Lukasz Majewski
2021-02-05 19:11 ` [RESEND PATCH 02/16] serial: usbtty: Send urb data in correct order Pali Rohár
2021-02-06 13:56   ` Lukasz Majewski
2021-02-05 19:11 ` [RESEND PATCH 03/16] usb: musb: Fix compilation of gadget code Pali Rohár
2021-02-06 13:57   ` Lukasz Majewski
2021-02-05 19:12 ` [RESEND PATCH 04/16] usb: musb: Always clear the data toggle bit when configuring ep Pali Rohár
2021-02-06 13:58   ` Lukasz Majewski
2021-02-05 19:12 ` [RESEND PATCH 05/16] usb: musb: Fix configuring FIFO for endpoints Pali Rohár
2021-02-06  8:58   ` Pavel Machek
2021-02-06 14:01   ` Lukasz Majewski
2021-02-05 19:12 ` [RESEND PATCH 06/16] usb: musb: Read value of PERI_RXCSR to 16bit variable Pali Rohár
2021-02-06 14:01   ` Lukasz Majewski
2021-02-05 19:12 ` [RESEND PATCH 07/16] usb: musb: Fix transmission of bigger buffers Pali Rohár
2021-02-06 14:07   ` Lukasz Majewski
2021-02-05 19:12 ` [RESEND PATCH 08/16] usb: musb: Fix receiving " Pali Rohár
2021-02-06 14:15   ` Lukasz Majewski
2021-02-05 19:12 ` [RESEND PATCH 09/16] usb: musb: Fix handling interrupts for EP0 and SET ADDRESS commmand Pali Rohár
2021-02-06 14:17   ` Lukasz Majewski
2021-02-05 19:12 ` [RESEND PATCH 10/16] usb: musb: Ensure that we set musb dynamic FIFO buffer for every endpoint Pali Rohár
2021-02-06  9:04   ` Pavel Machek
2021-02-06 15:18   ` Lukasz Majewski
2021-02-05 19:12 ` [RESEND PATCH 11/16] usb: gadget: Use dbg_ep0() macro instead of serial_printf() Pali Rohár
2021-02-06 15:19   ` Lukasz Majewski
2021-02-05 19:12 ` [RESEND PATCH 12/16] arm: omap3: Compile lowlevel_init() function only when it is used Pali Rohár
2021-02-06 15:21   ` Lukasz Majewski
2021-02-06 15:40   ` Marek Vasut
2021-02-06 15:45     ` Pali Rohár
2021-02-06 16:50       ` Marek Vasut
2021-02-07 13:50         ` Pali Rohár
2021-02-07 14:33           ` Marek Vasut
2021-02-05 19:12 ` [RESEND PATCH 13/16] arm: omap3: Compile s_init() " Pali Rohár
2021-02-06 15:21   ` Lukasz Majewski
2021-02-05 19:12 ` [RESEND PATCH 14/16] Nokia RX-51: Remove function set_muxconf_regs() Pali Rohár
2021-02-06 15:22   ` Lukasz Majewski
2021-02-05 19:12 ` [RESEND PATCH 15/16] Nokia RX-51: Move content of rx51.h to rx51.c Pali Rohár
2021-02-06 15:23   ` Lukasz Majewski
2021-02-05 19:12 ` [RESEND PATCH 16/16] Nokia RX-51: Enable usbtty serial console by default Pali Rohár
2021-02-06  9:10   ` Pavel Machek
2021-02-06 15:24   ` Lukasz Majewski
2021-02-07 13:50 ` [RESEND v2 PATCH 00/16] Nokia RX-51: Fix USB TTY console and enable it Pali Rohár
2021-02-07 13:50   ` [RESEND v2 PATCH 01/16] serial: usbtty: Fix puts function Pali Rohár
2021-02-07 13:50   ` [RESEND v2 PATCH 02/16] serial: usbtty: Send urb data in correct order Pali Rohár
2021-02-07 13:50   ` [RESEND v2 PATCH 03/16] usb: musb: Fix compilation of gadget code Pali Rohár
2021-02-07 13:50   ` [RESEND v2 PATCH 04/16] usb: musb: Always clear the data toggle bit when configuring ep Pali Rohár
2021-02-07 13:50   ` [RESEND v2 PATCH 05/16] usb: musb: Fix configuring FIFO for endpoints Pali Rohár
2021-02-07 13:50   ` [RESEND v2 PATCH 06/16] usb: musb: Read value of PERI_RXCSR to 16bit variable Pali Rohár
2021-02-07 13:50   ` [RESEND v2 PATCH 07/16] usb: musb: Fix transmission of bigger buffers Pali Rohár
2021-02-07 13:50   ` [RESEND v2 PATCH 08/16] usb: musb: Fix receiving " Pali Rohár
2021-02-07 13:50   ` [RESEND v2 PATCH 09/16] usb: musb: Fix handling interrupts for EP0 and SET ADDRESS commmand Pali Rohár
2021-02-07 13:50   ` [RESEND v2 PATCH 10/16] usb: musb: Ensure that we set musb dynamic FIFO buffer for every endpoint Pali Rohár
2021-02-07 13:50   ` [RESEND v2 PATCH 11/16] usb: gadget: Use dbg_ep0() macro instead of serial_printf() Pali Rohár
2021-02-07 13:50   ` [RESEND v2 PATCH 12/16] arm: omap3: Compile lowlevel_init() function only when it is used Pali Rohár
2021-02-07 13:50   ` [RESEND v2 PATCH 13/16] arm: omap3: Compile s_init() " Pali Rohár
2021-02-07 13:50   ` [RESEND v2 PATCH 14/16] Nokia RX-51: Remove function set_muxconf_regs() Pali Rohár
2021-02-07 13:50   ` [RESEND v2 PATCH 15/16] Nokia RX-51: Move content of rx51.h to rx51.c Pali Rohár
2021-02-07 13:50   ` [RESEND v2 PATCH 16/16] Nokia RX-51: Enable usbtty serial console by default Pali Rohár
2021-02-20 10:50     ` [AZURE FIX RESEND " Pali Rohár
2021-02-08 22:15   ` [RESEND v2 PATCH 00/16] Nokia RX-51: Fix USB TTY console and enable it Lukasz Majewski
2021-02-08 22:21     ` Pali Rohár
2021-02-08 22:34       ` Pali Rohár
2021-02-08 22:45         ` Marek Vasut
2021-02-08 22:54           ` Pali Rohár
2021-02-13 10:20         ` Pali Rohár
2021-02-16  8:28           ` Lukasz Majewski
2021-02-19  0:38             ` Pali Rohár
2021-02-20  8:20               ` Lukasz Majewski
2021-02-20 10:54                 ` Pali Rohár

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.