Skip to contentSkip to conversation

PXA: Cleanup serial_pxa

PATCH New Marek Vasut 2 participants 9 messages Aug 28, 2011

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/5 PXA: Cleanup serial_pxa

* Cleanup register definitions by introducing new regs-uart.h, compliant with rest of U-Boot.
* Remove old register definitions from pxa-regs.h
* Convert serial_pxa to new regs-uart.h
* Cleanup serial_pxa

---
 arch/arm/include/asm/arch-pxa/pxa-regs.h  |  111 -------
 arch/arm/include/asm/arch-pxa/regs-uart.h |  109 +++++++
 drivers/serial/serial_pxa.c               |  464 ++++++++++++-----------------
 3 files changed, 297 insertions(+), 387 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-pxa/regs-uart.h

V2: Add missing regs-uart.h

arch/arm/include/asm/arch-pxa/pxa-regs.h +0 -111
index 109fdc0..52c79a9 100644
@@ -315,117 +315,6 @@ typedef void		(*ExcpHndlr) (void) ;
 
 /******************************************************************************/
 /*
- * UARTs
- */
-/* Full Function UART (FFUART) */
-#define FFUART		FFRBR
-#define FFRBR		0x40100000  /* Receive Buffer Register (read only) */
-#define FFTHR		0x40100000  /* Transmit Holding Register (write only) */
-#define FFIER		0x40100004  /* Interrupt Enable Register (read/write) */
-#define FFIIR		0x40100008  /* Interrupt ID Register (read only) */
-#define FFFCR		0x40100008  /* FIFO Control Register (write only) */
-#define FFLCR		0x4010000C  /* Line Control Register (read/write) */
-#define FFMCR		0x40100010  /* Modem Control Register (read/write) */
-#define FFLSR		0x40100014  /* Line Status Register (read only) */
-#define FFMSR		0x40100018  /* Modem Status Register (read only) */
-#define FFSPR		0x4010001C  /* Scratch Pad Register (read/write) */
-#define FFISR		0x40100020  /* Infrared Selection Register (read/write) */
-#define FFDLL		0x40100000  /* Divisor Latch Low Register (DLAB = 1) (read/write) */
-#define FFDLH		0x40100004  /* Divisor Latch High Register (DLAB = 1) (read/write) */
-
-/* Bluetooth UART (BTUART) */
-#define BTUART		BTRBR
-#define BTRBR		0x40200000  /* Receive Buffer Register (read only) */
-#define BTTHR		0x40200000  /* Transmit Holding Register (write only) */
-#define BTIER		0x40200004  /* Interrupt Enable Register (read/write) */
-#define BTIIR		0x40200008  /* Interrupt ID Register (read only) */
-#define BTFCR		0x40200008  /* FIFO Control Register (write only) */
-#define BTLCR		0x4020000C  /* Line Control Register (read/write) */
-#define BTMCR		0x40200010  /* Modem Control Register (read/write) */
-#define BTLSR		0x40200014  /* Line Status Register (read only) */
-#define BTMSR		0x40200018  /* Modem Status Register (read only) */
-#define BTSPR		0x4020001C  /* Scratch Pad Register (read/write) */
-#define BTISR		0x40200020  /* Infrared Selection Register (read/write) */
-#define BTDLL		0x40200000  /* Divisor Latch Low Register (DLAB = 1) (read/write) */
-#define BTDLH		0x40200004  /* Divisor Latch High Register (DLAB = 1) (read/write) */
-
-/* Standard UART (STUART) */
-#define STUART		STRBR
-#define STRBR		0x40700000  /* Receive Buffer Register (read only) */
-#define STTHR		0x40700000  /* Transmit Holding Register (write only) */
-#define STIER		0x40700004  /* Interrupt Enable Register (read/write) */
-#define STIIR		0x40700008  /* Interrupt ID Register (read only) */
-#define STFCR		0x40700008  /* FIFO Control Register (write only) */
-#define STLCR		0x4070000C  /* Line Control Register (read/write) */
-#define STMCR		0x40700010  /* Modem Control Register (read/write) */
-#define STLSR		0x40700014  /* Line Status Register (read only) */
-#define STMSR		0x40700018  /* Reserved */
-#define STSPR		0x4070001C  /* Scratch Pad Register (read/write) */
-#define STISR		0x40700020  /* Infrared Selection Register (read/write) */
-#define STDLL		0x40700000  /* Divisor Latch Low Register (DLAB = 1) (read/write) */
-#define STDLH		0x40700004  /* Divisor Latch High Register (DLAB = 1) (read/write) */
-
-#define IER_DMAE	(1 << 7)	/* DMA Requests Enable */
-#define IER_UUE		(1 << 6)	/* UART Unit Enable */
-#define IER_NRZE	(1 << 5)	/* NRZ coding Enable */
-#define IER_RTIOE	(1 << 4)	/* Receiver Time Out Interrupt Enable */
-#define IER_MIE		(1 << 3)	/* Modem Interrupt Enable */
-#define IER_RLSE	(1 << 2)	/* Receiver Line Status Interrupt Enable */
-#define IER_TIE		(1 << 1)	/* Transmit Data request Interrupt Enable */
-#define IER_RAVIE	(1 << 0)	/* Receiver Data Available Interrupt Enable */
-
-#define IIR_FIFOES1	(1 << 7)	/* FIFO Mode Enable Status */
-#define IIR_FIFOES0	(1 << 6)	/* FIFO Mode Enable Status */
-#define IIR_TOD		(1 << 3)	/* Time Out Detected */
-#define IIR_IID2	(1 << 2)	/* Interrupt Source Encoded */
-#define IIR_IID1	(1 << 1)	/* Interrupt Source Encoded */
-#define IIR_IP		(1 << 0)	/* Interrupt Pending (active low) */
-
-#define FCR_ITL2	(1 << 7)	/* Interrupt Trigger Level */
-#define FCR_ITL1	(1 << 6)	/* Interrupt Trigger Level */
-#define FCR_RESETTF	(1 << 2)	/* Reset Transmitter FIFO */
-#define FCR_RESETRF	(1 << 1)	/* Reset Receiver FIFO */
-#define FCR_TRFIFOE	(1 << 0)	/* Transmit and Receive FIFO Enable */
-#define FCR_ITL_1	(0)
-#define FCR_ITL_8	(FCR_ITL1)
-#define FCR_ITL_16	(FCR_ITL2)
-#define FCR_ITL_32	(FCR_ITL2|FCR_ITL1)
-
-#define LCR_DLAB	(1 << 7)	/* Divisor Latch Access Bit */
-#define LCR_SB		(1 << 6)	/* Set Break */
-#define LCR_STKYP	(1 << 5)	/* Sticky Parity */
-#define LCR_EPS		(1 << 4)	/* Even Parity Select */
-#define LCR_PEN		(1 << 3)	/* Parity Enable */
-#define LCR_STB		(1 << 2)	/* Stop Bit */
-#define LCR_WLS1	(1 << 1)	/* Word Length Select */
-#define LCR_WLS0	(1 << 0)	/* Word Length Select */
-
-#define LSR_FIFOE	(1 << 7)	/* FIFO Error Status */
-#define LSR_TEMT	(1 << 6)	/* Transmitter Empty */
-#define LSR_TDRQ	(1 << 5)	/* Transmit Data Request */
-#define LSR_BI		(1 << 4)	/* Break Interrupt */
-#define LSR_FE		(1 << 3)	/* Framing Error */
-#define LSR_PE		(1 << 2)	/* Parity Error */
-#define LSR_OE		(1 << 1)	/* Overrun Error */
-#define LSR_DR		(1 << 0)	/* Data Ready */
-
-#define MCR_LOOP	(1 << 4)	/* */
-#define MCR_OUT2	(1 << 3)	/* force MSR_DCD in loopback mode */
-#define MCR_OUT1	(1 << 2)	/* force MSR_RI in loopback mode */
-#define MCR_RTS		(1 << 1)	/* Request to Send */
-#define MCR_DTR		(1 << 0)	/* Data Terminal Ready */
-
-#define MSR_DCD		(1 << 7)	/* Data Carrier Detect */
-#define MSR_RI		(1 << 6)	/* Ring Indicator */
-#define MSR_DSR		(1 << 5)	/* Data Set Ready */
-#define MSR_CTS		(1 << 4)	/* Clear To Send */
-#define MSR_DDCD	(1 << 3)	/* Delta Data Carrier Detect */
-#define MSR_TERI	(1 << 2)	/* Trailing Edge Ring Indicator */
-#define MSR_DDSR	(1 << 1)	/* Delta Data Set Ready */
-#define MSR_DCTS	(1 << 0)	/* Delta Clear To Send */
-
-/******************************************************************************/
-/*
  * IrSR (Infrared Selection Register)
  */
 #define IrSR_OFFSET 0x20
arch/arm/include/asm/arch-pxa/regs-uart.h new file +109 -0

109 lines not on this page · raw message

drivers/serial/serial_pxa.c +188 -276

544 lines not on this page · raw message

Signature · 1 line
1.7.5.4
#1 lore raw

PATCH 2/5 PXA: Add MMC driver using the generic MMC framework

---
 arch/arm/include/asm/arch-pxa/regs-mmc.h |  155 +++++++++++
 drivers/mmc/Makefile                     |    1 +
 drivers/mmc/pxa_mmc_gen.c                |  442 ++++++++++++++++++++++++++++++
 3 files changed, 598 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-pxa/regs-mmc.h
 create mode 100644 drivers/mmc/pxa_mmc_gen.c
arch/arm/include/asm/arch-pxa/regs-mmc.h new file +155 -0
new file mode 100644
index 0000000..fd1eb1e
@@ -0,0 +1,155 @@
+/*
+ * Copyright (C) 2011 Marek Vasut <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef	__REGS_MMC_H__
+#define	__REGS_MMC_H__
+
+#define	MMC0_BASE	0x41100000
+#define	MMC1_BASE	0x42000000
+
+int pxa_mmc_register(int card_index);
+
+struct pxa_mmc_regs {
+	uint32_t	strpcl;
+	uint32_t	stat;
+	uint32_t	clkrt;
+	uint32_t	spi;
+	uint32_t	cmdat;
+	uint32_t	resto;
+	uint32_t	rdto;
+	uint32_t	blklen;
+	uint32_t	nob;
+	uint32_t	prtbuf;
+	uint32_t	i_mask;
+	uint32_t	i_reg;
+	uint32_t	cmd;
+	uint32_t	argh;
+	uint32_t	argl;
+	uint32_t	res;
+	uint32_t	rxfifo;
+	uint32_t	txfifo;
+};
+
+/* MMC_STRPCL */
+#define	MMC_STRPCL_STOP_CLK		(1 << 0)
+#define	MMC_STRPCL_START_CLK		(1 << 1)
+
+/* MMC_STAT */
+#define	MMC_STAT_END_CMD_RES		(1 << 13)
+#define	MMC_STAT_PRG_DONE		(1 << 12)
+#define	MMC_STAT_DATA_TRAN_DONE		(1 << 11)
+#define	MMC_STAT_CLK_EN			(1 << 8)
+#define	MMC_STAT_RECV_FIFO_FULL		(1 << 7)
+#define	MMC_STAT_XMIT_FIFO_EMPTY	(1 << 6)
+#define	MMC_STAT_RES_CRC_ERROR		(1 << 5)
+#define	MMC_STAT_SPI_READ_ERROR_TOKEN   (1 << 4)
+#define	MMC_STAT_CRC_READ_ERROR		(1 << 3)
+#define	MMC_STAT_CRC_WRITE_ERROR	(1 << 2)
+#define	MMC_STAT_TIME_OUT_RESPONSE	(1 << 1)
+#define	MMC_STAT_READ_TIME_OUT		(1 << 0)
+
+/* MMC_CLKRT */
+#define	MMC_CLKRT_20MHZ			0
+#define	MMC_CLKRT_10MHZ			1
+#define	MMC_CLKRT_5MHZ			2
+#define	MMC_CLKRT_2_5MHZ		3
+#define	MMC_CLKRT_1_25MHZ		4
+#define	MMC_CLKRT_0_625MHZ		5
+#define	MMC_CLKRT_0_3125MHZ		6
+
+/* MMC_SPI */
+#define	MMC_SPI_EN			(1 << 0)
+#define	MMC_SPI_CS_EN			(1 << 2)
+#define	MMC_SPI_CS_ADDRESS		(1 << 3)
+#define	MMC_SPI_CRC_ON			(1 << 1)
+
+/* MMC_CMDAT */
+#define	MMC_CMDAT_SD_4DAT		(1 << 8)
+#define	MMC_CMDAT_MMC_DMA_EN		(1 << 7)
+#define	MMC_CMDAT_INIT			(1 << 6)
+#define	MMC_CMDAT_BUSY			(1 << 5)
+#define	MMC_CMDAT_BCR			(MMC_CMDAT_BUSY | MMC_CMDAT_INIT)
+#define	MMC_CMDAT_STREAM		(1 << 4)
+#define	MMC_CMDAT_WRITE			(1 << 3)
+#define	MMC_CMDAT_DATA_EN		(1 << 2)
+#define	MMC_CMDAT_R0			0
+#define	MMC_CMDAT_R1			1
+#define	MMC_CMDAT_R2			2
+#define	MMC_CMDAT_R3			3
+
+/* MMC_RESTO */
+#define	MMC_RES_TO_MAX_MASK		0x7f
+
+/* MMC_RDTO */
+#define	MMC_READ_TO_MAX_MASK		0xffff
+
+/* MMC_BLKLEN */
+#define	MMC_BLK_LEN_MAX_MASK		0x3ff
+
+/* MMC_PRTBUF */
+#define	MMC_PRTBUF_BUF_PART_FULL	(1 << 0)
+
+/* MMC_I_MASK */
+#define	MMC_I_MASK_TXFIFO_WR_REQ	(1 << 6)
+#define	MMC_I_MASK_RXFIFO_RD_REQ	(1 << 5)
+#define	MMC_I_MASK_CLK_IS_OFF		(1 << 4)
+#define	MMC_I_MASK_STOP_CMD		(1 << 3)
+#define	MMC_I_MASK_END_CMD_RES		(1 << 2)
+#define	MMC_I_MASK_PRG_DONE		(1 << 1)
+#define	MMC_I_MASK_DATA_TRAN_DONE       (1 << 0)
+#define	MMC_I_MASK_ALL			0x7f
+
+
+/* MMC_I_REG */
+#define	MMC_I_REG_TXFIFO_WR_REQ		(1 << 6)
+#define	MMC_I_REG_RXFIFO_RD_REQ		(1 << 5)
+#define	MMC_I_REG_CLK_IS_OFF		(1 << 4)
+#define	MMC_I_REG_STOP_CMD		(1 << 3)
+#define	MMC_I_REG_END_CMD_RES		(1 << 2)
+#define	MMC_I_REG_PRG_DONE		(1 << 1)
+#define	MMC_I_REG_DATA_TRAN_DONE	(1 << 0)
+
+/* MMC_CMD */
+#define	MMC_CMD_INDEX_MAX		0x6f
+#define	CMD(x)  (x)
+
+#define	MMC_R1_IDLE_STATE		0x01
+#define	MMC_R1_ERASE_STATE		0x02
+#define	MMC_R1_ILLEGAL_CMD		0x04
+#define	MMC_R1_COM_CRC_ERR		0x08
+#define	MMC_R1_ERASE_SEQ_ERR		0x01
+#define	MMC_R1_ADDR_ERR			0x02
+#define	MMC_R1_PARAM_ERR		0x04
+
+#define	MMC_R1B_WP_ERASE_SKIP		0x0002
+#define	MMC_R1B_ERR			0x0004
+#define	MMC_R1B_CC_ERR			0x0008
+#define	MMC_R1B_CARD_ECC_ERR		0x0010
+#define	MMC_R1B_WP_VIOLATION		0x0020
+#define	MMC_R1B_ERASE_PARAM		0x0040
+#define	MMC_R1B_OOR			0x0080
+#define	MMC_R1B_IDLE_STATE		0x0100
+#define	MMC_R1B_ERASE_RESET		0x0200
+#define	MMC_R1B_ILLEGAL_CMD		0x0400
+#define	MMC_R1B_COM_CRC_ERR		0x0800
+#define	MMC_R1B_ERASE_SEQ_ERR		0x1000
+#define	MMC_R1B_ADDR_ERR		0x2000
+#define	MMC_R1B_PARAM_ERR		0x4000
+
+#endif	/* __REGS_MMC_H__ */
drivers/mmc/Makefile +1 -0
index 3968c14..59bda49 100644
@@ -38,6 +38,7 @@ COBJS-$(CONFIG_MXC_MMC) += mxcmmc.o
 COBJS-$(CONFIG_OMAP3_MMC) += omap3_mmc.o
 COBJS-$(CONFIG_OMAP_HSMMC) += omap_hsmmc.o
 COBJS-$(CONFIG_PXA_MMC) += pxa_mmc.o
+COBJS-$(CONFIG_PXA_MMC_GENERIC) += pxa_mmc_gen.o
 COBJS-$(CONFIG_S5P_MMC) += s5p_mmc.o
 COBJS-$(CONFIG_SDHCI) += sdhci.o
 COBJS-$(CONFIG_SH_MMCIF) += sh_mmcif.o
drivers/mmc/pxa_mmc_gen.c new file +442 -0

442 lines not on this page · raw message

Signature · 1 line
1.7.5.4
#2 lore raw

PATCH 3/5 PXA: vpac270: Enable the new generic MMC driver

In reply to Marek Vasut
---
 board/vpac270/vpac270.c   |    8 ++++++++
 include/configs/vpac270.h |    3 ++-
 2 files changed, 10 insertions(+), 1 deletions(-)
board/vpac270/vpac270.c +8 -0
index 43bbdff..d3f03c0 100644
@@ -21,6 +21,7 @@
 
 #include <common.h>
 #include <asm/arch/hardware.h>
+#include <asm/arch/regs-mmc.h>
 #include <netdev.h>
 #include <serial.h>
 #include <asm/io.h>
@@ -72,6 +73,13 @@ void dram_init_banksize(void)
 #endif
 }
 
+#ifdef	CONFIG_CMD_MMC
+int board_mmc_init(bd_t *bis)
+{
+	pxa_mmc_register(0);
+}
+#endif
+
 #ifdef	CONFIG_CMD_USB
 int usb_board_init(void)
 {
include/configs/vpac270.h +2 -1
index ea77971..9c3980d 100644
@@ -108,7 +108,8 @@
  */
 #ifdef	CONFIG_CMD_MMC
 #define	CONFIG_MMC
-#define	CONFIG_PXA_MMC
+#define	CONFIG_GENERIC_MMC
+#define	CONFIG_PXA_MMC_GENERIC
 #define	CONFIG_SYS_MMC_BASE		0xF0000000
 #define	CONFIG_CMD_FAT
 #define	CONFIG_CMD_EXT2
Signature · 1 line
1.7.5.4
#3 lore raw

PATCH RESEND 4/5 USB: Fix complaints about strict aliasing in OHCI-HCD

In reply to Marek Vasut
---
 drivers/usb/host/ohci-hcd.c |   69 +++++++++++++++++++++++-------------------
 1 files changed, 38 insertions(+), 31 deletions(-)
drivers/usb/host/ohci-hcd.c +38 -31
index bc8bb20..653f97d 100644
@@ -1263,12 +1263,19 @@ static int ohci_submit_rh_msg(struct usb_device *dev, unsigned long pipe,
 	int len = 0;
 	int stat = 0;
 	__u32 datab[4];
-	__u8 *data_buf = (__u8 *)datab;
+	union {
+		void *ptr;
+		__u8 *u8;
+		__u16 *u16;
+		__u32 *u32;
+	} databuf;
 	__u16 bmRType_bReq;
 	__u16 wValue;
 	__u16 wIndex;
 	__u16 wLength;
 
+	databuf.u32 = (__u32 *)datab;
+
 #ifdef DEBUG
 pkt_print(NULL, dev, pipe, buffer, transfer_len,
 	  cmd, "SUB(rh)", usb_pipein(pipe));
@@ -1298,20 +1305,20 @@ pkt_print(NULL, dev, pipe, buffer, transfer_len,
 	*/
 
 	case RH_GET_STATUS:
-		*(__u16 *) data_buf = cpu_to_le16(1);
+		databuf.u16[0] = cpu_to_le16(1);
 		OK(2);
 	case RH_GET_STATUS | RH_INTERFACE:
-		*(__u16 *) data_buf = cpu_to_le16(0);
+		databuf.u16[0] = cpu_to_le16(0);
 		OK(2);
 	case RH_GET_STATUS | RH_ENDPOINT:
-		*(__u16 *) data_buf = cpu_to_le16(0);
+		databuf.u16[0] = cpu_to_le16(0);
 		OK(2);
 	case RH_GET_STATUS | RH_CLASS:
-		*(__u32 *) data_buf = cpu_to_le32(
+		databuf.u32[0] = cpu_to_le32(
 				RD_RH_STAT & ~(RH_HS_CRWE | RH_HS_DRWE));
 		OK(4);
 	case RH_GET_STATUS | RH_OTHER | RH_CLASS:
-		*(__u32 *) data_buf = cpu_to_le32(RD_RH_PORTSTAT);
+		databuf.u32[0] = cpu_to_le32(RD_RH_PORTSTAT);
 		OK(4);
 
 	case RH_CLEAR_FEATURE | RH_ENDPOINT:
@@ -1375,14 +1382,14 @@ pkt_print(NULL, dev, pipe, buffer, transfer_len,
 					min_t(unsigned int,
 					sizeof(root_hub_dev_des),
 					wLength));
-			data_buf = root_hub_dev_des; OK(len);
+			databuf.ptr = root_hub_dev_des; OK(len);
 		case (0x02): /* configuration descriptor */
 			len = min_t(unsigned int,
 					leni,
 					min_t(unsigned int,
 					sizeof(root_hub_config_des),
 					wLength));
-			data_buf = root_hub_config_des; OK(len);
+			databuf.ptr = root_hub_config_des; OK(len);
 		case (0x03): /* string descriptors */
 			if (wValue == 0x0300) {
 				len = min_t(unsigned int,
@@ -1390,7 +1397,7 @@ pkt_print(NULL, dev, pipe, buffer, transfer_len,
 						min_t(unsigned int,
 						sizeof(root_hub_str_index0),
 						wLength));
-				data_buf = root_hub_str_index0;
+				databuf.ptr = root_hub_str_index0;
 				OK(len);
 			}
 			if (wValue == 0x0301) {
@@ -1399,7 +1406,7 @@ pkt_print(NULL, dev, pipe, buffer, transfer_len,
 						min_t(unsigned int,
 						sizeof(root_hub_str_index1),
 						wLength));
-				data_buf = root_hub_str_index1;
+				databuf.ptr = root_hub_str_index1;
 				OK(len);
 		}
 		default:
@@ -1411,39 +1418,39 @@ pkt_print(NULL, dev, pipe, buffer, transfer_len,
 	{
 		__u32 temp = roothub_a(&gohci);
 
-		data_buf [0] = 9;		/* min length; */
-		data_buf [1] = 0x29;
-		data_buf [2] = temp & RH_A_NDP;
+		databuf.u8[0] = 9;		/* min length; */
+		databuf.u8[1] = 0x29;
+		databuf.u8[2] = temp & RH_A_NDP;
 #ifdef CONFIG_AT91C_PQFP_UHPBUG
-		data_buf [2] = (data_buf [2] == 2) ? 1:0;
+		databuf.u8[2] = (databuf.u8[2] == 2) ? 1:0;
 #endif
-		data_buf [3] = 0;
+		databuf.u8[3] = 0;
 		if (temp & RH_A_PSM)	/* per-port power switching? */
-			data_buf [3] |= 0x1;
+			databuf.u8[3] |= 0x1;
 		if (temp & RH_A_NOCP)	/* no overcurrent reporting? */
-			data_buf [3] |= 0x10;
+			databuf.u8[3] |= 0x10;
 		else if (temp & RH_A_OCPM)/* per-port overcurrent reporting? */
-			data_buf [3] |= 0x8;
+			databuf.u8[3] |= 0x8;
 
-		/* corresponds to data_buf[4-7] */
-		datab [1] = 0;
-		data_buf [5] = (temp & RH_A_POTPGT) >> 24;
+		/* corresponds to databuf.u8[4-7] */
+		databuf.u8[1] = 0;
+		databuf.u8[5] = (temp & RH_A_POTPGT) >> 24;
 		temp = roothub_b(&gohci);
-		data_buf [7] = temp & RH_B_DR;
-		if (data_buf [2] < 7) {
-			data_buf [8] = 0xff;
+		databuf.u8[7] = temp & RH_B_DR;
+		if (databuf.u8[2] < 7) {
+			databuf.u8[8] = 0xff;
 		} else {
-			data_buf [0] += 2;
-			data_buf [8] = (temp & RH_B_DR) >> 8;
-			data_buf [10] = data_buf [9] = 0xff;
+			databuf.u8[0] += 2;
+			databuf.u8[8] = (temp & RH_B_DR) >> 8;
+			databuf.u8[10] = databuf.u8[9] = 0xff;
 		}
 
 		len = min_t(unsigned int, leni,
-			    min_t(unsigned int, data_buf [0], wLength));
+			    min_t(unsigned int, databuf.u8[0], wLength));
 		OK(len);
 	}
 
-	case RH_GET_CONFIGURATION:	*(__u8 *) data_buf = 0x01; OK(1);
+	case RH_GET_CONFIGURATION:	databuf.u8[0] = 0x01; OK(1);
 
 	case RH_SET_CONFIGURATION:	WR_RH_STAT(0x10000); OK(0);
 
@@ -1459,8 +1466,8 @@ pkt_print(NULL, dev, pipe, buffer, transfer_len,
 #endif
 
 	len = min_t(int, len, leni);
-	if (data != data_buf)
-	    memcpy(data, data_buf, len);
+	if (data != databuf.ptr)
+	    memcpy(data, databuf.ptr, len);
 	dev->act_len = len;
 	dev->status = stat;
 
Signature · 1 line
1.7.5.4
#4 lore raw

PATCH RESEND 5/5 IDE: Fix complaints about strict aliasing in cmd_ide.c

In reply to Marek Vasut
---
 common/cmd_ide.c |   51 +++++++++++++++++++++++++--------------------------
 1 files changed, 25 insertions(+), 26 deletions(-)
common/cmd_ide.c +25 -26
index 2e8c6e0..da5189c 100644
@@ -985,9 +985,8 @@ input_data(int dev, ulong *sect_buf, int words)
  */
 static void ide_ident (block_dev_desc_t *dev_desc)
 {
-	ulong iobuf[ATA_SECTORWORDS];
 	unsigned char c;
-	hd_driveid_t *iop = (hd_driveid_t *)iobuf;
+	hd_driveid_t iop;
 
 #ifdef CONFIG_ATAPI
 	int retries = 0;
@@ -1073,11 +1072,11 @@ static void ide_ident (block_dev_desc_t *dev_desc)
 		return;
 #endif
 
-	input_swap_data (device, iobuf, ATA_SECTORWORDS);
+	input_swap_data (device, (ulong *)&iop, ATA_SECTORWORDS);
 
-	ident_cpy ((unsigned char*)dev_desc->revision, iop->fw_rev, sizeof(dev_desc->revision));
-	ident_cpy ((unsigned char*)dev_desc->vendor, iop->model, sizeof(dev_desc->vendor));
-	ident_cpy ((unsigned char*)dev_desc->product, iop->serial_no, sizeof(dev_desc->product));
+	ident_cpy ((unsigned char*)dev_desc->revision, iop.fw_rev, sizeof(dev_desc->revision));
+	ident_cpy ((unsigned char*)dev_desc->vendor, iop.model, sizeof(dev_desc->vendor));
+	ident_cpy ((unsigned char*)dev_desc->product, iop.serial_no, sizeof(dev_desc->product));
 #ifdef __LITTLE_ENDIAN
 	/*
 	 * firmware revision, model, and serial number have Big Endian Byte
@@ -1092,14 +1091,14 @@ static void ide_ident (block_dev_desc_t *dev_desc)
 	strswab (dev_desc->product);
 #endif /* __LITTLE_ENDIAN */
 
-	if ((iop->config & 0x0080)==0x0080)
+	if ((iop.config & 0x0080) == 0x0080)
 		dev_desc->removable = 1;
 	else
 		dev_desc->removable = 0;
 
 #ifdef CONFIG_TUNE_PIO
 	/* Mode 0 - 2 only, are directly determined by word 51. */
-	pio_mode = iop->tPIO;
+	pio_mode = iop.tPIO;
 	if (pio_mode > 2) {
 		printf("WARNING: Invalid PIO (word 51 = %d).\n", pio_mode);
 		pio_mode = 0; /* Force it to dead slow, and hope for the best... */
@@ -1109,18 +1108,18 @@ static void ide_ident (block_dev_desc_t *dev_desc)
 	 * shall set bit 1 of word 53 to one and support the fields contained
 	 * in words 64 through 70.
 	 */
-	if (iop->field_valid & 0x02) {
+	if (iop.field_valid & 0x02) {
 		/* Mode 3 and above are possible.  Check in order from slow
 		 * to fast, so we wind up with the highest mode allowed.
 		 */
-		if (iop->eide_pio_modes & 0x01)
+		if (iop.eide_pio_modes & 0x01)
 			pio_mode = 3;
-		if (iop->eide_pio_modes & 0x02)
+		if (iop.eide_pio_modes & 0x02)
 			pio_mode = 4;
-		if (ata_id_is_cfa((u16 *)iop)) {
-			if ((iop->cf_advanced_caps & 0x07) == 0x01)
+		if (ata_id_is_cfa((u16 *)&iop)) {
+			if ((iop.cf_advanced_caps & 0x07) == 0x01)
 				pio_mode = 5;
-			if ((iop->cf_advanced_caps & 0x07) == 0x02)
+			if ((iop.cf_advanced_caps & 0x07) == 0x02)
 				pio_mode = 6;
 		}
 	}
@@ -1133,19 +1132,19 @@ static void ide_ident (block_dev_desc_t *dev_desc)
 	/*
 	 * Drive PIO mode autoselection
 	 */
-	mode = iop->tPIO;
+	mode = iop.tPIO;
 
 	printf ("tPIO = 0x%02x = %d\n",mode, mode);
 	if (mode > 2) {		/* 2 is maximum allowed tPIO value */
 		mode = 2;
 		debug ("Override tPIO -> 2\n");
 	}
-	if (iop->field_valid & 2) {	/* drive implements ATA2? */
+	if (iop.field_valid & 2) {	/* drive implements ATA2? */
 		debug ("Drive implements ATA2\n");
-		if (iop->capability & 8) {	/* drive supports use_iordy? */
-			cycle_time = iop->eide_pio_iordy;
+		if (iop.capability & 8) {	/* drive supports use_iordy? */
+			cycle_time = iop.eide_pio_iordy;
 		} else {
-			cycle_time = iop->eide_pio;
+			cycle_time = iop.eide_pio;
 		}
 		debug ("cycle time = %d\n", cycle_time);
 		mode = 4;
@@ -1166,7 +1165,7 @@ static void ide_ident (block_dev_desc_t *dev_desc)
 
 #ifdef __BIG_ENDIAN
 	/* swap shorts */
-	dev_desc->lba = (iop->lba_capacity << 16) | (iop->lba_capacity >> 16);
+	dev_desc->lba = (iop.lba_capacity << 16) | (iop.lba_capacity >> 16);
 #else	/* ! __BIG_ENDIAN */
 	/*
 	 * do not swap shorts on little endian
@@ -1174,16 +1173,16 @@ static void ide_ident (block_dev_desc_t *dev_desc)
 	 * See CF+ and CompactFlash Specification Revision 2.0:
 	 * 6.2.1.6: Identfy Drive, Table 39, Word Address 57-58 for details.
 	 */
-	dev_desc->lba = iop->lba_capacity;
+	dev_desc->lba = iop.lba_capacity;
 #endif	/* __BIG_ENDIAN */
 
 #ifdef CONFIG_LBA48
-	if (iop->command_set_2 & 0x0400) { /* LBA 48 support */
+	if (iop.command_set_2 & 0x0400) { /* LBA 48 support */
 		dev_desc->lba48 = 1;
-		dev_desc->lba = (unsigned long long)iop->lba48_capacity[0] |
-						  ((unsigned long long)iop->lba48_capacity[1] << 16) |
-						  ((unsigned long long)iop->lba48_capacity[2] << 32) |
-						  ((unsigned long long)iop->lba48_capacity[3] << 48);
+		dev_desc->lba = (unsigned long long)iop.lba48_capacity[0] |
+						  ((unsigned long long)iop.lba48_capacity[1] << 16) |
+						  ((unsigned long long)iop.lba48_capacity[2] << 32) |
+						  ((unsigned long long)iop.lba48_capacity[3] << 48);
 	} else {
 		dev_desc->lba48 = 0;
 	}
Signature · 1 line
1.7.5.4
#5 lore raw

PATCH v2 1/5 PXA: Cleanup serial_pxa

In reply to Marek Vasut

Dear Marek Vasut,

Quoted 7 lines · In message <[email protected]> you wrote:

* Cleanup register definitions by introducing new regs-uart.h, compliant with rest of U-Boot.
* Remove old register definitions from pxa-regs.h
* Convert serial_pxa to new regs-uart.h
* Cleanup serial_pxa

Quoted 8 lines
---
 arch/arm/include/asm/arch-pxa/pxa-regs.h  |  111 -------
 arch/arm/include/asm/arch-pxa/regs-uart.h |  109 +++++++
 drivers/serial/serial_pxa.c               |  464 ++++++++++++-----------------
 3 files changed, 297 insertions(+), 387 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-pxa/regs-uart.h

V2: Add missing regs-uart.h

Your patch stacks are a mess. It's impossible for mne to tell what you actually intend.

So we have now tow series:

1: [PATCH 1/6] PXA: Fix Lubbock, remove redundant parenthesis 1: [PATCH 2/6] PXA: Fix CSB226, fix monitor length
1: [PATCH 3/6] USB: Fix complaints about strict aliasing in OHCI-HCD 1: [PATCH 4/6] IDE: Fix complaints about strict aliasing in cmd_ide.c 1: [PATCH 5/6] PXA: Cleanup serial_pxa
1: [PATCH 6/6] PXA: vpac270: Remove re-defined CONFIG_SYS_TEXT_BASE

2: [PATCH 1/5 V2] PXA: Cleanup serial_pxa
2: [PATCH 3/5] PXA: vpac270: Enable the new generic MMC driver 2: [PATCH 2/5] PXA: Add MMC driver using the generic MMC framework 2: [PATCH 4/5 RESEND] USB: Fix complaints about strict aliasing in OHCI-HCD 2: [PATCH 5/5 RESEND] IDE: Fix complaints about strict aliasing in cmd_id

It appears as if "2: [PATCH 1/5 V2]" might be a replacement for "1:
[PATCH 5/6]" - but then, it does not contain any of the required
In-reply-to: and/or References: headers.

It appears as if "2: [PATCH 4/5 RESEND]" and "2: [PATCH 5/5 RESEND]" might be (unchanged ???) Repostings of ""1: [PATCH 3/6]" resp. "1:
[PATCH 4/6]" - but then, why do you repost these at all? You are not supposed to resubmit patches without changes.

Also, it does not appears as if the whole 2nd series was a replacement / update for the first, as there are no equivalents for "1: [PATCH 1/6]" or "1: [PATCH 2/6]'.

All in all, this is a terrible mess, and in violation of patch submission rules.

Please consider both patch series NAKed.

Fix your code and clean up as needed, then repost but please with proper version information, proper change logs, and proper mail threading.

Thanks.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Have you lived in this village all your life?"        "No, not yet."
#6 lore raw

PATCH v2 1/5 PXA: Cleanup serial_pxa

Quoted 2 lines · Wolfgang Denk

Dear Marek Vasut,

[...]

Quoted 4 lines
Quoted 1 line

V2: Add missing regs-uart.h

Your patch stacks are a mess. It's impossible for mne to tell what you actually intend.

Yes, it didn't work out a bit here. I tried to split the stuff so Albert can pick up what's for him and then the rest for review.

[...]

Quoted 5 lines

All in all, this is a terrible mess, and in violation of patch submission rules.

Please consider both patch series NAKed.

Can you just review this series and scrap the other one please?

Thanks

Cheers

Quoted 6 lines

Thanks.

Best regards,

Wolfgang Denk

#7 lore raw

PATCH v2 1/5 PXA: Cleanup serial_pxa

Dear Marek Vasut,

Quoted 8 lines · In message <[email protected]> you wrote:
Quoted 6 lines

All in all, this is a terrible mess, and in violation of patch submission rules.

Please consider both patch series NAKed.

Can you just review this series and scrap the other one please?

"This" being the second (5 parts), and "the other" being the first (6 parts)?

That means we also ignore your pull request, which refers to the first series?

I revommend you restart from a clean state. Split off independent patches that are not actually forming a series, and then send a new pull rq.

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Alliance: In international politics, the union  of  two  thieves  who
have  their hands so deeply inserted in each other's pocket that they
cannot separately plunder a third.                   - Ambrose Bierce
#8 lore raw

PATCH v2 1/5 PXA: Cleanup serial_pxa

Quoted 6 lines · Wolfgang Denk

Dear Marek Vasut,

Quoted 3 lines · In message <[email protected]> you wrote:
Quoted 3 lines

All in all, this is a terrible mess, and in violation of patch submission rules.

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Please consider both patch series NAKed.

Can you just review this series and scrap the other one please?

"This" being the second (5 parts), and "the other" being the first (6 parts)?

Yes

Quoted 3 lines

That means we also ignore your pull request, which refers to the first series?

No, the pull request _IS_FINE_. I picked the patches that are good for Albert to pick (fixes). These would be good to have in 2011.09.

Then I submitted again the rest of the patches I have in stack ... 5 part series. I just want review on these, I don't intend to have them in 2011.09.

The 6 part series is wrong and should be scrapped.

Quoted 4 lines

I revommend you restart from a clean state. Split off independent patches that are not actually forming a series, and then send a new pull rq.

The pull request is fine, so it's no use to resend it again. It can be pulled.

I'll resend the patches in a smaller chunks.

Cheers

Quoted 4 lines

Best regards,

Wolfgang Denk