Skip to contentSkip to conversation

qong: support for Dave/DENX QongEVB-LITE

PATCH Superseded Ilya Yanok 3 participants 7 messages Feb 5, 2009

Subsystems (3)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
author
#1 lore raw

PATCH v2 1/3 mx31: add GPIO registers definitions

Added definitions for i.MX31 processor GPIO registers.

---
 include/asm-arm/arch-mx31/mx31-regs.h |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
include/asm-arm/arch-mx31/mx31-regs.h +10 -0
index e736052..3cdaa02 100644
@@ -87,6 +87,16 @@
 #define WDOG_BASE		0x53FDC000
 
 /*
+ * GPIO
+ */
+#define GPIO1_BASE	0x53FCC000
+#define GPIO2_BASE	0x53FD0000
+#define GPIO3_BASE	0x53FA4000
+#define GPIO_DR		0x00000000	/* data register */
+#define GPIO_GDIR	0x00000004	/* direction register */
+#define GPIO_PSR	0x00000008	/* pad status register */
+
+/*
  * Signal Multiplexing (IOMUX)
  */
 
Signature · 1 line
1.6.0.6
author
#2 lore raw

PATCH v2 2/3 dnet: driver for Dave DNET ethernet controller

In reply to Ilya Yanok

Driver for Dave DNET ethernet controller (used on Dave/DENX QongEVB-LITE board).

---
 drivers/net/Makefile |    2 +
 drivers/net/dnet.c   |  394 ++++++++++++++++++++++++++++++++++++++++++++++++++
 drivers/net/dnet.h   |  166 +++++++++++++++++++++
 include/netdev.h     |    1 +
 4 files changed, 563 insertions(+), 0 deletions(-)
 create mode 100644 drivers/net/dnet.c
 create mode 100644 drivers/net/dnet.h
drivers/net/Makefile +2 -0
index 128dc11..10e3c6d 100644
@@ -33,6 +33,7 @@ COBJS-$(CONFIG_BFIN_MAC) += bfin_mac.o
 COBJS-$(CONFIG_DRIVER_CS8900) += cs8900.o
 COBJS-$(CONFIG_TULIP) += dc2114x.o
 COBJS-$(CONFIG_DRIVER_DM9000) += dm9000x.o
+COBJS-$(CONFIG_DNET) += dnet.o
 COBJS-$(CONFIG_E1000) += e1000.o
 COBJS-$(CONFIG_EEPRO100) += eepro100.o
 COBJS-$(CONFIG_ENC28J60) += enc28j60.o
@@ -69,6 +70,7 @@ COBJS-$(CONFIG_ULI526X) += uli526x.o
 COBJS-$(CONFIG_VSC7385_ENET) += vsc7385.o
 COBJS-$(CONFIG_XILINX_EMAC) += xilinx_emac.o
 COBJS-$(CONFIG_XILINX_EMACLITE) += xilinx_emaclite.o
+COBJS-$(CONFIG_SH_ETHER) += sh_eth.o
 
 COBJS	:= $(COBJS-y)
 SRCS	:= $(COBJS:.o=.c)
drivers/net/dnet.c new file +394 -0

394 lines not on this page · raw message

drivers/net/dnet.h new file +166 -0

166 lines not on this page · raw message

include/netdev.h +1 -0
index ce1ecbd..5c568f3 100644
@@ -44,6 +44,7 @@ int cpu_eth_init(bd_t *bis);
 int au1x00_enet_initialize(bd_t*);
 int bfin_EMAC_initialize(bd_t *bis);
 int dc21x4x_initialize(bd_t *bis);
+int dnet_eth_initialize(int id, void *regs, unsigned int phy_addr);
 int e1000_initialize(bd_t *bis);
 int eepro100_initialize(bd_t *bis);
 int eth_3com_initialize (bd_t * bis);
Signature · 1 line
1.6.0.6
#3 lore raw

PATCH v2 2/3 dnet: driver for Dave DNET ethernet controller

Quoted 4 lines · Ilya Yanok

Driver for Dave DNET ethernet controller (used on Dave/DENX QongEVB-LITE board).

please have Ben ack

Quoted 38 lines
---
 drivers/net/Makefile |    2 +
 drivers/net/dnet.c   |  394 ++++++++++++++++++++++++++++++++++++++++++++++++++
 drivers/net/dnet.h   |  166 +++++++++++++++++++++
 include/netdev.h     |    1 +
 4 files changed, 563 insertions(+), 0 deletions(-)
 create mode 100644 drivers/net/dnet.c
 create mode 100644 drivers/net/dnet.h
drivers/net/Makefile +2 -0
index 128dc11..10e3c6d 100644
@@ -33,6 +33,7 @@ COBJS-$(CONFIG_BFIN_MAC) += bfin_mac.o
 COBJS-$(CONFIG_DRIVER_CS8900) += cs8900.o
 COBJS-$(CONFIG_TULIP) += dc2114x.o
 COBJS-$(CONFIG_DRIVER_DM9000) += dm9000x.o
+COBJS-$(CONFIG_DNET) += dnet.o
 COBJS-$(CONFIG_E1000) += e1000.o
 COBJS-$(CONFIG_EEPRO100) += eepro100.o
 COBJS-$(CONFIG_ENC28J60) += enc28j60.o
@@ -69,6 +70,7 @@ COBJS-$(CONFIG_ULI526X) += uli526x.o
 COBJS-$(CONFIG_VSC7385_ENET) += vsc7385.o
 COBJS-$(CONFIG_XILINX_EMAC) += xilinx_emac.o
 COBJS-$(CONFIG_XILINX_EMACLITE) += xilinx_emaclite.o
+COBJS-$(CONFIG_SH_ETHER) += sh_eth.o
 
 COBJS	:= $(COBJS-y)
 SRCS	:= $(COBJS:.o=.c)
drivers/net/dnet.c new file +3 -0
new file mode 100644
index 0000000..e7cd716
@@ -0,0 +1,394 @@
+/*
+ * Dave Ethernet Controller driver
+ *

drivers/net/dnet.c line 13

Quoted 10 lines
drivers/net/dnet.c new file +10 -0
+ * Copyright (C) 2008 Dave S.r.l. <www.dave.eu>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <common.h>
+
+#define CFG_DNET_AUTONEG_TIMEOUT	5000000

pelase use CONFIG_ and maybe move it in a header

Quoted 49 lines
drivers/net/dnet.c new file +48 -0
+
+#include <net.h>
+#include <malloc.h>
+#include <linux/mii.h>
+
+#include <miiphy.h>
+#include <asm/io.h>
+
+#include "dnet.h"
+
+struct dnet_device {
+	struct dnet_registers	*regs;
+	const struct device	*dev;
+	struct eth_device	netdev;
+	unsigned short		phy_addr;
+};
+
+++ b/drivers/net/dnet.h
@@ -0,0 +1,166 @@
+/*
+ * Dave Ethernet Controller driver
+ *
+ * Copyright (C) 2008 Dave S.r.l. <www.dave.eu>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef __DRIVERS_DNET_H__
+#define __DRIVERS_DNET_H__
+
+#define DRIVERNAME "dnet"
+
+struct dnet_registers {
+	/* ALL DNET FIFO REGISTERS */
+	u32 RX_LEN_FIFO;
+	u32 RX_DATA_FIFO;
+	u32 TX_LEN_FIFO;
+	u32 TX_DATA_FIFO;
+	u32 pad1[0x3c];
+	/* ALL DNET CONTROL/STATUS REGISTERS */
+	u32 VERCAPS;
+	u32 INTR_SRC;
+	u32 INTR_ENB;
+	u32 RX_STATUS;
+	u32 TX_STATUS;
+	u32 RX_FRAMES_CNT;
+	u32 TX_FRAMES_CNT;

drivers/net/dnet.c line 40

Quoted 10 lines
drivers/net/dnet.c new file +10 -0
+	u32 RX_FIFO_TH;
+	u32 TX_FIFO_TH;
+	u32 SYS_CTL;
+	u32 PAUSE_TMR;
+	u32 RX_FIFO_WCNT;
+	u32 TX_FIFO_WCNT;
+	u32 pad2[0x33];
+	/* ALL DNET MAC REGISTERS */
+	u32 MACREG_DATA;	/* Mac-Reg Data */
+	u32 MACREG_ADDR;	/* Mac-Reg Addr  */
					       ^^

whitespace please fix

drivers/net/dnet.c line 42

Quoted 2 lines
drivers/net/dnet.c new file +2 -0
+	u32 pad3[0x3e];
+	/* ALL DNET RX STATISTICS COUNTERS  */
					   ^^

whitespace please fix

Quoted 20 lines
drivers/net/dnet.c new file +20 -0
+	u32 RX_PKT_IGNR_CNT;
+	u32 RX_LEN_CHK_ERR_CNT;
+	u32 RX_LNG_FRM_CNT;
+	u32 RX_SHRT_FRM_CNT;
+	u32 RX_IPG_VIOL_CNT;
+	u32 RX_CRC_ERR_CNT;
+	u32 RX_OK_PKT_CNT;
+	u32 RX_CTL_FRM_CNT;
+	u32 RX_PAUSE_FRM_CNT;
+	u32 RX_MULTICAST_CNT;
+	u32 RX_BROADCAST_CNT;
+	u32 RX_VLAN_TAG_CNT;
+	u32 RX_PRE_SHRINK_CNT;
+	u32 RX_DRIB_NIB_CNT;
+	u32 RX_UNSUP_OPCD_CNT;
+	u32 RX_BYTE_CNT;
+	u32 pad4[0x30];
+	/* DNET TX STATISTICS COUNTERS */
+	u32 TX_UNICAST_CNT;
+	u32 TX_PAUSE_FRM_CNT;

drivers/net/dnet.c line 72

Quoted 10 lines
drivers/net/dnet.c new file +10 -0
+	u32 TX_MULTICAST_CNT;
+	u32 TX_BRDCAST_CNT;
+	u32 TX_VLAN_TAG_CNT;
+	u32 TX_BAD_FCS_CNT;
+	u32 TX_JUMBO_CNT;
+	u32 TX_BYTE_CNT;
+} __attribute__((packed));
+
+/* SOME INTERNAL MAC-CORE REGISTER */
+#define DNET_INTERNAL_MODE_REG            	0x0
				 ^^^^^^^^^^^^

whitespace please fix

drivers/net/dnet.c line 73

Quoted 1 line
drivers/net/dnet.c new file +1 -0
+#define DNET_INTERNAL_RXTX_CONTROL_REG    	0x2
					 ^^^^

whitespace please fix

drivers/net/dnet.c line 74

Quoted 1 line
drivers/net/dnet.c new file +1 -0
+#define DNET_INTERNAL_MAX_PKT_SIZE_REG    	0x4
					 ^^^^

whitespace please fix

drivers/net/dnet.c line 75

Quoted 1 line
drivers/net/dnet.c new file +1 -0
+#define DNET_INTERNAL_IGP_REG             	0x8
				^^^^^^^^^^^^^

whitespace please fix

drivers/net/dnet.c line 76

Quoted 1 line
drivers/net/dnet.c new file +1 -0
+#define DNET_INTERNAL_MAC_ADDR_0_REG      	0xa
				       ^^^^^^

whitespace please fix

drivers/net/dnet.c line 77

Quoted 1 line
drivers/net/dnet.c new file +1 -0
+#define DNET_INTERNAL_MAC_ADDR_1_REG      	0xc
				       ^^^^^^

whitespace please fix

drivers/net/dnet.c line 78

Quoted 1 line
drivers/net/dnet.c new file +1 -0
+#define DNET_INTERNAL_MAC_ADDR_2_REG      	0xe
				       ^^^^^^

whitespace please fix

drivers/net/dnet.c line 90

Quoted 12 lines
drivers/net/dnet.c new file +12 -0
+#define DNET_INTERNAL_TX_RX_STS_REG		0x12
+#define DNET_INTERNAL_GMII_MNG_CTL_REG		0x14
+#define DNET_INTERNAL_GMII_MNG_DAT_REG		0x16
+
+#define DNET_INTERNAL_GMII_MNG_CMD_FIN		(1 << 14)
+
+#define DNET_INTERNAL_WRITE			(1 << 31)
+
+/* MAC-CORE REGISTER FIELDS */
+
+/* MAC-CORE MODE REGISTER FIELDS */
+#define DNET_INTERNAL_MODE_GBITEN 			(1 << 0)
				    ^

whitespace please fix

drivers/net/dnet.c line 91

Quoted 1 line
drivers/net/dnet.c new file +1 -0
+#define DNET_INTERNAL_MODE_FCEN 			(1 << 1)
				  ^

whitespace please fix

drivers/net/dnet.c line 92

Quoted 1 line
drivers/net/dnet.c new file +1 -0
+#define DNET_INTERNAL_MODE_RXEN 			(1 << 2)
				  ^

whitespace please fix

drivers/net/dnet.c line 93

Quoted 1 line
drivers/net/dnet.c new file +1 -0
+#define DNET_INTERNAL_MODE_TXEN 			(1 << 3)
				  ^

whitespace please fix

drivers/net/dnet.c line 96

Quoted 3 lines
drivers/net/dnet.c new file +3 -0
+
+/* MAC-CORE RXTX CONTROL REGISTER FIELDS */
+#define DNET_INTERNAL_RXTX_CONTROL_RXSHORTFRAME 	(1 << 8)
						  ^

whitespace please fix

drivers/net/dnet.c line 97

Quoted 1 line
drivers/net/dnet.c new file +1 -0
+#define DNET_INTERNAL_RXTX_CONTROL_RXBROADCAST	 	(1 << 7)
							^

whitespace please fix

drivers/net/dnet.c line 98

Quoted 1 line
drivers/net/dnet.c new file +1 -0
+#define DNET_INTERNAL_RXTX_CONTROL_RXMULTICAST	 	(1 << 4)
							^

whitespace please fix

drivers/net/dnet.c line 99

Quoted 1 line
drivers/net/dnet.c new file +1 -0
+#define DNET_INTERNAL_RXTX_CONTROL_RXPAUSE	 	(1 << 3)
						^

whitespace please fix

drivers/net/dnet.c line 100

Quoted 1 line
drivers/net/dnet.c new file +1 -0
+#define DNET_INTERNAL_RXTX_CONTROL_DISTXFCS	 	(1 << 2)
						^

whitespace please fix

drivers/net/dnet.c line 101

Quoted 1 line
drivers/net/dnet.c new file +1 -0
+#define DNET_INTERNAL_RXTX_CONTROL_DISCFXFCS 		(1 << 1)
					       ^

whitespace please fix

drivers/net/dnet.c line 102

Quoted 1 line
drivers/net/dnet.c new file +1 -0
+#define DNET_INTERNAL_RXTX_CONTROL_ENPROMISC	 	(1 << 0)
						^

whitespace please fix

drivers/net/dnet.c line 103

Quoted 1 line
drivers/net/dnet.c new file +1 -0
+#define DNET_INTERNAL_RXTX_CONTROL_DROPCONTROL	 	(1 << 6)
							^

whitespace please fix

drivers/net/dnet.c line 104

Quoted 1 line
drivers/net/dnet.c new file +1 -0
+#define DNET_INTERNAL_RXTX_CONTROL_ENABLEHALFDUP 	(1 << 5)
						   ^

whitespace please fix

drivers/net/dnet.c line 117

Quoted 13 lines
drivers/net/dnet.c new file +13 -0
+
+/* SYSTEM CONTROL REGISTER FIELDS */
+#define DNET_SYS_CTL_IGNORENEXTPKT			(1 << 0)
+#define DNET_SYS_CTL_SENDPAUSE				(1 << 2)
+#define DNET_SYS_CTL_RXFIFOFLUSH			(1 << 3)
+#define DNET_SYS_CTL_TXFIFOFLUSH			(1 << 4)
+
+/*
+ * Capabilities. Used by the driver to know the capabilities that
+ * the ethernet controller inside the FPGA have.
+ */
+
+#define DNET_HAS_MDIO 		(1 << 0)
			^

whitespace please fix

drivers/net/dnet.c line 118

Quoted 1 line
drivers/net/dnet.c new file +1 -0
+#define DNET_HAS_IRQ 		(1 << 1)
		       ^

whitespace please fix

drivers/net/dnet.c line 119

Quoted 1 line
drivers/net/dnet.c new file +1 -0
+#define DNET_HAS_GIGABIT 	(1 << 2)
			   ^

whitespace please fix

drivers/net/dnet.c line 120

Quoted 1 line
drivers/net/dnet.c new file +1 -0
+#define DNET_HAS_DMA 		(1 << 3)
		       ^

whitespace please fix

drivers/net/dnet.c line 133

Quoted 13 lines
drivers/net/dnet.c new file +13 -0
+
+#define DNET_HAS_MII		(1 << 4) /* or GMII */
+#define DNET_HAS_RMII		(1 << 5) /* or RGMII */
+
+#define DNET_CAPS_MASK		0xFFFF
+
+#define DNET_FIFO_SIZE		2048 /* 2K x 32 bit */
+#define DNET_FIFO_TX_DATA_AF_TH	(DNET_FIFO_SIZE - 384) /* 384 = 1536 / 4 */
+#define DNET_FIFO_TX_DATA_AE_TH	(384)
+
+#define DNET_FIFO_RX_CMD_AF_TH	(1 << 16) /* just one frame inside the FIFO */
+
+#endif

Best Regards,
J.

author
#4 lore raw

PATCH v2 3/3 qong: support for Dave/DENX QongEVB-LITE board

In reply to Ilya Yanok

This patch adds support for Dave/DENX QongEVB-LITE i.MX31-based board.

---
 Makefile                            |    4 +
 board/davedenx/qong/Makefile        |   53 +++++++++
 board/davedenx/qong/config.mk       |    1 +
 board/davedenx/qong/lowlevel_init.S |  172 ++++++++++++++++++++++++++++
 board/davedenx/qong/qong.c          |  167 +++++++++++++++++++++++++++
 board/davedenx/qong/qong_fpga.h     |   41 +++++++
 board/davedenx/qong/u-boot.lds      |   58 ++++++++++
 include/configs/qong.h              |  215 +++++++++++++++++++++++++++++++++++
 8 files changed, 711 insertions(+), 0 deletions(-)
 create mode 100644 board/davedenx/qong/Makefile
 create mode 100644 board/davedenx/qong/config.mk
 create mode 100644 board/davedenx/qong/lowlevel_init.S
 create mode 100644 board/davedenx/qong/qong.c
 create mode 100644 board/davedenx/qong/qong_fpga.h
 create mode 100644 board/davedenx/qong/u-boot.lds
 create mode 100644 include/configs/qong.h
Makefile +4 -0
index 787c5f2..7508e1d 100644
@@ -3034,6 +3034,10 @@ mx31ads_config		: unconfig
 omap2420h4_config	: unconfig
 	@$(MKCONFIG) $(@:_config=) arm arm1136 omap2420h4 NULL omap24xx
 
+qong_config		: unconfig
+	@$(MKCONFIG) $(@:_config=) arm arm1136 qong davedenx mx31
+
+
 #########################################################################
 ## ARM1176 Systems
 #########################################################################
board/davedenx/qong/Makefile new file +53 -0

53 lines not on this page · raw message

board/davedenx/qong/config.mk new file +1 -0
new file mode 100644
index 0000000..d8d0a57
@@ -0,0 +1 @@
+TEXT_BASE = 0x8ff00000
board/davedenx/qong/lowlevel_init.S new file +172 -0

172 lines not on this page · raw message

board/davedenx/qong/qong.c new file +167 -0

167 lines not on this page · raw message

board/davedenx/qong/qong_fpga.h new file +41 -0

41 lines not on this page · raw message

board/davedenx/qong/u-boot.lds new file +58 -0

58 lines not on this page · raw message

include/configs/qong.h new file +215 -0

215 lines not on this page · raw message

Signature · 1 line
1.6.0.6
#5 lore raw

PATCH v2 3/3 qong: support for Dave/DENX QongEVB-LITE board

Quoted 4 lines · Ilya Yanok

This patch adds support for Dave/DENX QongEVB-LITE i.MX31-based board.

---

MAITAINER and MAKEALL?

Quoted 62 lines
 Makefile                            |    4 +
 board/davedenx/qong/Makefile        |   53 +++++++++
 board/davedenx/qong/config.mk       |    1 +
 board/davedenx/qong/lowlevel_init.S |  172 ++++++++++++++++++++++++++++
 board/davedenx/qong/qong.c          |  167 +++++++++++++++++++++++++++
 board/davedenx/qong/qong_fpga.h     |   41 +++++++
 board/davedenx/qong/u-boot.lds      |   58 ++++++++++
 include/configs/qong.h              |  215 +++++++++++++++++++++++++++++++++++
 8 files changed, 711 insertions(+), 0 deletions(-)
 create mode 100644 board/davedenx/qong/Makefile
 create mode 100644 board/davedenx/qong/config.mk
 create mode 100644 board/davedenx/qong/lowlevel_init.S
 create mode 100644 board/davedenx/qong/qong.c
 create mode 100644 board/davedenx/qong/qong_fpga.h
 create mode 100644 board/davedenx/qong/u-boot.lds
 create mode 100644 include/configs/qong.h
Makefile +4 -0
index 787c5f2..7508e1d 100644
@@ -3034,6 +3034,10 @@ mx31ads_config		: unconfig
 omap2420h4_config	: unconfig
 	@$(MKCONFIG) $(@:_config=) arm arm1136 omap2420h4 NULL omap24xx
 
+qong_config		: unconfig
+	@$(MKCONFIG) $(@:_config=) arm arm1136 qong davedenx mx31
+
+
 #########################################################################
 ## ARM1176 Systems
 #########################################################################

new file mode 100644
index 0000000..ae653ab

board/davedenx/qong/lowlevel_init.S new file +25 -0
@@ -0,0 +1,172 @@
+/*
+ * Copyright (C) 2009, Emcraft Systems, Ilya Yanok <[email protected]>
+ *
+ * Based on board/freescale/mx31ads/lowlevel_init.S
+ * by Guennadi Liakhovetski.
+ *
+ * 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
+ */
+
+#include <asm/arch/mx31-regs.h>
+
+.macro REG reg, val

board/davedenx/qong/lowlevel_init.S line 35

Quoted 10 lines
board/davedenx/qong/lowlevel_init.S new file +10 -0
+	ldr r2, =\reg
+	ldr r3, =\val
+	str r3, [r2]
+.endm
+
+.macro REG8 reg, val
+	ldr r2, =\reg
+	ldr r3, =\val
+	strb r3, [r2]
+.endm

we have these macro in a lots of place maybe we can create a common hearder as we do for SH?

Quoted 8 lines
board/davedenx/qong/lowlevel_init.S new file +8 -0
+
+.macro DELAY loops
+	ldr r2, =\loops
+1:
+	subs	r2, r2, #1
+	nop
+	bcs 1b
+.endm

board/davedenx/qong/lowlevel_init.S line 53

Quoted 10 lines
board/davedenx/qong/lowlevel_init.S new file +10 -0
+
+/* RedBoot: To support 133MHz DDR */
+.macro  init_drive_strength
+	/*
+	 * Disable maximum drive strength SDRAM/DDR lines by clearing DSE1 bits
+	 * in SW_PAD_CTL registers
+	 */
+
+	/* SDCLK */
+	ldr r1, =0x43FAC200

hardcoded value?

Quoted 24 lines
board/davedenx/qong/lowlevel_init.S new file +24 -0
+	ldr r0, [r1, #0x6C]
+	bic r0, r0, #(1 << 12)
+	str r0, [r1, #0x6C]
+
+	/* CAS */
+	ldr r0, [r1, #0x70]
+	bic r0, r0, #(1 << 22)
+	str r0, [r1, #0x70]
+
+	/* RAS */
+	ldr r0, [r1, #0x74]
+	bic r0, r0, #(1 << 2)
+	str r0, [r1, #0x74]
+
+	/* CS2 (CSD0) */
+	ldr r0, [r1, #0x7C]
+	bic r0, r0, #(1 << 22)
+	str r0, [r1, #0x7C]
+
+	/* DQM3 */
+	ldr r0, [r1, #0x84]
+	bic r0, r0, #(1 << 22)
+	str r0, [r1, #0x84]
+

board/davedenx/qong/lowlevel_init.S line 135

Quoted 10 lines
board/davedenx/qong/lowlevel_init.S new file +10 -0
+	/* DQM2, DQM1, DQM0, SD31-SD0, A25-A0, MA10 (0x288..0x2DC) */
+	ldr r2, =22	/* (0x2E0 - 0x288) / 4 = 22 */
+	str	r1, [r0, #0x1c]
+
+	/* Default: 1, 4, 12, 1 */
+	REG	CCM_SPCTL, PLL_PD(1) | PLL_MFD(4) | PLL_MFI(12) | PLL_MFN(1)
+
+	/* B8xxxxxx - NAND, 8xxxxxxx - CSD0 RAM */
+	REG	0xB8001010, 0x00000004
+	REG	0xB8001004, ((3<<21) | /* tXP */	\

please add space before and after '<<'

board/davedenx/qong/lowlevel_init.S line 144

Quoted 9 lines
board/davedenx/qong/lowlevel_init.S new file +9 -0
+			     (0<<20) | /* tWTR */	\
+			     (2<<18) | /* tRP */	\
+			     (1<<16) | /* tMRD */	\
+			     (0<<15) | /* tWR */	\
+			     (5<<12) | /* tRAS */	\
+			     (1<<10) | /* tRRD */	\
+			     (3<<8)  | /* tCAS */	\
+			     (2<<4)  | /* tRCD */	\
+			     (7<<0)    /* tRC */ )

+

Quoted 12 lines
board/davedenx/qong/lowlevel_init.S new file +12 -0
+#ifdef CONFIG_QONG_FPGA
+	/* CS1: FPGA/Network Controller/GPIO */
+	/* 16-bit, no DTACK */
+	__REG(CSCR_U(1)) = 0x00000A01;
+	__REG(CSCR_L(1)) = 0x20040501;
+	__REG(CSCR_A(1)) = 0x04020C00;
+
+	/* setup pins for FPGA */
+	mx31_gpio_mux(IOMUX_MODE(0x76, MUX_CTL_GPIO));
+	mx31_gpio_mux(IOMUX_MODE(0x7e, MUX_CTL_GPIO));
+	mx31_gpio_mux(IOMUX_MODE(0x91, MUX_CTL_OUT_FUNC | MUX_CTL_IN_GPIO));
+	mx31_gpio_mux(IOMUX_MODE(0x92, MUX_CTL_GPIO));

board/davedenx/qong/lowlevel_init.S line 118

Quoted 10 lines
board/davedenx/qong/lowlevel_init.S new file +10 -0
+	mx31_gpio_mux(IOMUX_MODE(0x93, MUX_CTL_GPIO));
+#endif
+
+	/* setup pins for UART1 */
+	mx31_gpio_mux(MUX_RXD1__UART1_RXD_MUX);
+	mx31_gpio_mux(MUX_TXD1__UART1_TXD_MUX);
+	mx31_gpio_mux(MUX_RTS1__UART1_RTS_B);
+	mx31_gpio_mux(MUX_CTS1__UART1_CTS_B);
+
+	gd->bd->bi_arch_number = 1524;		/* board id for linux */

please use macro

Quoted 30 lines
board/davedenx/qong/lowlevel_init.S new file +30 -0
+	gd->bd->bi_boot_params = (0x80000100);	/* adress of boot parameters */
+
+	return 0;
+}
+
+int checkboard (void)
+{
+	printf("Board: DAVE/DENX QongEVB-LITE\n");
+	return 0;
+}
+
+int misc_init_r (void)
+{
+#ifdef CONFIG_QONG_FPGA
+	u32 tmp;
+
+	/* FPGA reset */
+	/* rstn = 0 */
+	tmp = __REG(GPIO2_BASE + GPIO_DR);
+	tmp &= (~(1 << QONG_FPGA_RST_PIN));
+	__REG(GPIO2_BASE + GPIO_DR) = tmp;
+	/* set the GPIO as output */
+	tmp = __REG(GPIO2_BASE + GPIO_GDIR);
+	tmp |= (1 << QONG_FPGA_RST_PIN);
+	__REG(GPIO2_BASE + GPIO_GDIR) = tmp;
+	/* wait */
+	udelay(30);
+	/* rstn = 1 */
+	tmp = __REG(GPIO2_BASE + GPIO_DR);
+	tmp |= (1 << QONG_FPGA_RST_PIN);

board/davedenx/qong/lowlevel_init.S line 158

Quoted 10 lines
board/davedenx/qong/lowlevel_init.S new file +10 -0
+	__REG(GPIO2_BASE + GPIO_DR) = tmp;
+	/* set interrupt pin as input */
+	__REG(GPIO2_BASE + GPIO_GDIR) = tmp | (1 << QONG_FPGA_IRQ_PIN);
+	/* wait while the FPGA starts */
+	udelay(300);
+
+	tmp = *(volatile u32*)QONG_FPGA_CTRL_VERSION;
+	printf("FPGA:  ");
+	printf("version register = %u.%u.%u\n",
+		(tmp & 0xF000)>>12, (tmp & 0x0F00) >> 8, tmp & 0x00FF);

please add a space before and after '>>'

Quoted 8 lines
board/davedenx/qong/lowlevel_init.S new file +8 -0
+#endif
+
+	return 0;
+}
+
+int board_eth_init(bd_t *bis)
+{
+#if defined(CONFIG_QONG_FPGA) && defined(CONFIG_DNET)

board/davedenx/qong/lowlevel_init.S

Quoted 10 lines
board/davedenx/qong/lowlevel_init.S new file +10 -0
+	return dnet_eth_initialize(0, (void *)CONFIG_DNET_BASE, -1);
+#else
+	return 0;
+#endif
+}
+
+#define	CONFIG_ENV_IS_IN_FLASH	1
+#define CONFIG_ENV_SECT_SIZE	0x20000
+#define CONFIG_ENV_SIZE		CONFIG_ENV_SECT_SIZE
+#define CONFIG_ENV_ADDR		(CONFIG_SYS_FLASH_BASE+(0x40000))

please add space before and after '+'

board/davedenx/qong/lowlevel_init.S

Quoted 5 lines
board/davedenx/qong/lowlevel_init.S new file +5 -0
+
+/* Address and size of Redundant Environment Sector	*/
+#define CONFIG_ENV_OFFSET_REDUND	(CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)
+#define CONFIG_ENV_SIZE_REDUND	CONFIG_ENV_SIZE
+

Best Regards,
J.

#6 lore raw

PATCH v2 3/3 qong: support for Dave/DENX QongEVB-LITE board

In reply to Ilya Yanok

Dear Ilya,

Quoted 1 line · In message <[email protected]> you wrote:

This patch adds support for Dave/DENX QongEVB-LITE i.MX31-based board.

...

Quoted 3 lines
include/configs/qong.h new file +0 -0
new file mode 100644
index 0000000..e7ce8ee

...

Quoted 1 line

+#define CONFIG_ENV_ADDR (CONFIG_SYS_FLASH_BASE+(0x40000))

s/(0x40000)/0x40000/ please.

Thanks.

Best regards,

Wolfgang Denk

Signature · 5 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
A weak mind is like a microscope, which magnifies trifling things,
but cannot receive great ones.      -- Philip Earl of Chesterfield