Skip to contentSkip to conversation

iPAQ h2200 support

PATCH Superseded Łukasz Dałek 4 participants 39 messages Sep 19, 2012 – Sep 22, 2012 2 messages not in the archive

Subsystems (2)

v1 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

cover iPAQ h2200 support

This is set of patches adding support for iPAQ h2200 device

Ad. [PATCH 1/6] h2200: Add support for iPAQ h2200 I've added device id to the mach-types.h file. But I'm pretty sure this is the bad way. The id I took from
http://www.arm.linux.org.uk/developer/machines/list.php?id=341

Device's 1st stage bootloader requires from 2nd stage loader specific header which I've defined in file h2200-header.S. For now it is build to h2200-header.bin which has to be concatenated with u-boot.bin (cat h2200-header.bin u-boot.bin > u-boot.rdy). I don't know how I can do this another way.

One more, can I add to device folder program which generates packed binary with header which device's rescue bootloader can flash into memory?

Ad. [PATCH 3/6] pxa: Add some stuff to examine cpu model and rev This patch shuld be already in pxa tree but it's not. Maybe I overlooked or sth. If so I'm sorry for sending it again.

?ukasz Da?ek (6):
h2200: Add support for iPAQ h2200
pxa25x: Add USB Ethernet driver
pxa: Add some stuff to examine cpu model and rev
usbether: Fixed bug when using with PXA25X chips
usbether: Define CONFIG_USB_ETH_{CDC,SUBSET}
usbether: Removed DEV_CONFIG_{CDC,SUBSET}

 arch/arm/cpu/pxa/cpuinfo.c          |   11 +-
 arch/arm/include/asm/arch-pxa/pxa.h |   13 +
 arch/arm/include/asm/mach-types.h   |    1 +
 board/h2200/Makefile                |   51 +
 board/h2200/h2200-header.S          |   27 +
 board/h2200/h2200.c                 |  197 ++++
 board/h2200/h2200.h                 |   28 +
 boards.cfg                          |    2 +
 drivers/usb/gadget/Makefile         |    1 +
 drivers/usb/gadget/ether.c          |   69 +-
 drivers/usb/gadget/pxa25x_udc.c     | 2059 +++++++++++++++++++++++++++++++++++
 drivers/usb/gadget/pxa25x_udc.h     |  162 +++
 include/configs/h2200.h             |  168 +++
 13 files changed, 2757 insertions(+), 32 deletions(-)
 create mode 100644 board/h2200/Makefile
 create mode 100644 board/h2200/h2200-header.S
 create mode 100644 board/h2200/h2200.c
 create mode 100644 board/h2200/h2200.h
 create mode 100644 drivers/usb/gadget/pxa25x_udc.c
 create mode 100644 drivers/usb/gadget/pxa25x_udc.h
 create mode 100644 include/configs/h2200.h
Signature · 1 line
1.7.8.6
#1 lore raw

PATCH 1/6 h2200: Add support for iPAQ h2200

---
 arch/arm/include/asm/mach-types.h |    1 +
 board/h2200/Makefile              |   51 ++++++++++
 board/h2200/h2200-header.S        |   27 +++++
 board/h2200/h2200.c               |  197 +++++++++++++++++++++++++++++++++++++
 board/h2200/h2200.h               |   28 +++++
 boards.cfg                        |    2 +
 include/configs/h2200.h           |  168 +++++++++++++++++++++++++++++++
 7 files changed, 474 insertions(+), 0 deletions(-)
 create mode 100644 board/h2200/Makefile
 create mode 100644 board/h2200/h2200-header.S
 create mode 100644 board/h2200/h2200.c
 create mode 100644 board/h2200/h2200.h
 create mode 100644 include/configs/h2200.h
arch/arm/include/asm/mach-types.h +1 -0
index 2d5c3bc..b03f385 100644
@@ -74,6 +74,7 @@ extern unsigned int __machine_arch_type;
 #define MACH_TYPE_IXDP2801             300
 #define MACH_TYPE_IQ31244              327
 #define MACH_TYPE_BAST                 331
+#define MACH_TYPE_H2200                341
 #define MACH_TYPE_H1940                347
 #define MACH_TYPE_ENP2611              356
 #define MACH_TYPE_S3C2440              362
board/h2200/Makefile new file +51 -0

51 lines not on this page · raw message

board/h2200/h2200-header.S new file +27 -0
new file mode 100644
index 0000000..146795f
@@ -0,0 +1,27 @@
+/*
+ * iPAQ h2200 header
+ *
+ * Copyright (C) 2012 ?ukasz Da?ek <[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
+ */
+
+	.word 0xea0003fe /* b 0x1000 */
+
+	.org 0x40
+	.ascii "ECEC"
+
+	.org 0x1000 - 1
+	.byte 0x0
board/h2200/h2200.c new file +197 -0

197 lines not on this page · raw message

board/h2200/h2200.h new file +28 -0
new file mode 100644
index 0000000..4392d6f
@@ -0,0 +1,28 @@
+/*
+ * iPAQ h2200 board configuration
+ *
+ * Copyright (C) 2012 ?ukasz Da?ek <[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 __IPAQ_H2200_H
+#define __IPAQ_H2200_H
+
+#if defined(CONFIG_H2200_USBETH)
+extern void udc_disconnect(void);
+#endif
+
+#endif /* __IPAQ_H2200_H */
boards.cfg +2 -0
index 72e7803..e40cc41 100644
@@ -283,6 +283,8 @@ dvlhost                      arm         ixp
 pdnb3                        arm         ixp         pdnb3               prodrive
 scpu                         arm         ixp         pdnb3               prodrive       -           pdnb3:SCPU
 balloon3                     arm         pxa
+h2200                        arm         pxa
+h2200_usbeth                 arm         pxa         h2200               -              -           h2200:H2200_USBETH
 lubbock                      arm         pxa
 palmld                       arm         pxa
 palmtc                       arm         pxa
include/configs/h2200.h new file +168 -0

168 lines not on this page · raw message

Signature · 1 line
1.7.8.6
#2 lore raw

PATCH 1/6 h2200: Add support for iPAQ h2200

Dear ?ukasz Da?ek,

[ Joe, see the bottom of my babble here ]

Quoted 22 lines
---
 arch/arm/include/asm/mach-types.h |    1 +
 board/h2200/Makefile              |   51 ++++++++++
 board/h2200/h2200-header.S        |   27 +++++
 board/h2200/h2200.c               |  197
+++++++++++++++++++++++++++++++++++++ board/h2200/h2200.h               | 
 28 +++++
 boards.cfg                        |    2 +
 include/configs/h2200.h           |  168 +++++++++++++++++++++++++++++++
 7 files changed, 474 insertions(+), 0 deletions(-)
 create mode 100644 board/h2200/Makefile
 create mode 100644 board/h2200/h2200-header.S
 create mode 100644 board/h2200/h2200.c
 create mode 100644 board/h2200/h2200.h
 create mode 100644 include/configs/h2200.h
(quoted diff) +0 -0

b/arch/arm/include/asm/mach-types.h index 2d5c3bc..b03f385 100644

arch/arm/include/asm/mach-types.h extern unsigned int __machine_arch_type; · line 80

Quoted 7 lines
arch/arm/include/asm/mach-types.h +1 -0
@@ -74,6 +74,7 @@ extern unsigned int __machine_arch_type;
 #define MACH_TYPE_IXDP2801             300
 #define MACH_TYPE_IQ31244              327
 #define MACH_TYPE_BAST                 331
+#define MACH_TYPE_H2200                341
 #define MACH_TYPE_H1940                347
 #define MACH_TYPE_ENP2611              356
 #define MACH_TYPE_S3C2440              362

How come it's not in the mach-types already? Was it removed? If so, define CONFIG_MACH_TYPE in your h2200.h (see m28evk.h for example)

board/h2200/Makefile line 4

Quoted 10 lines
board/h2200/Makefile new file +4 -0
new file mode 100644
index 0000000..39da114
@@ -0,0 +1,51 @@
+#
+# h2200 Support
+#
+# Copyright (C) 2012 ?ukasz Da?ek <[email protected]>

Can we cut the crappy unicode and stick to ascii?
[...]

board/h2200/Makefile line 7

Quoted 3 lines
board/h2200/Makefile new file +3 -0
+
+	.org 0x40
+	.ascii "ECEC"

ECEC ... looks familiar, what is it though? WinCE bootloader signature ?

Quoted 39 lines
board/h2200/Makefile new file +2 -0
+	.org 0x1000 - 1
+	.byte 0x0
board/h2200/h2200.c new file +18 -0
new file mode 100644
index 0000000..d31c67f
@@ -0,0 +1,197 @@
+/*
+ * iPAQ h2200 board configuration
+ *
+ * Copyright (C) 2012 ?ukasz Da?ek <[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 + */

board/h2200/h2200.c new file +12 -0
+
+#include <common.h>
+#include <asm/arch/pxa.h>
+#include <asm/arch/pxa-regs.h>
+#include <asm/io.h>
+#include "h2200.h"
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#ifdef CONFIG_H2200_USBETH
+int board_eth_init(bd_t *bis)
+{

board/h2200/h2200.c line 41

Quoted 10 lines
board/h2200/h2200.c new file +10 -0
+	usb_eth_initialize(bis);
+	return 0;
+}
+#endif
+
+int board_early_init_f(void)
+{
+	/* Enable serial */
+	setbits_le32(GPDR0, 1 << 24);
+	writel(1 << 24, GPSR0);

Shitty ... doesn't the board do GPIO setup in arch/arm/cpu/pxa/pxa2xx.c already?

GPIOlib driver would come handy (see drivers/gpio/)

board/h2200/h2200.c line 56

Quoted 13 lines
board/h2200/h2200.c new file +13 -0
+	/* Enable serial transreceiver */
+	setbits_le32(GPDR2, 1 << 16);
+	writel(1 << 16, GPSR2);
+
+	return 0;
+}
+
+int board_init(void)
+{
+	/* We have RAM, disable cache */
+	dcache_disable();
+	icache_disable();
+	/* arch number of Lubbock-Board */

Lubbock, yea ...

board/h2200/h2200.c line 64

Quoted 8 lines
board/h2200/h2200.c new file +8 -0
+	gd->bd->bi_arch_number = MACH_TYPE_H2200;
+
+	/* adress of boot parameters */
+	gd->bd->bi_boot_params = 0xa0000100;
+
+#if defined(CONFIG_H2200_USBETH)
+	udc_disconnect();
+	mdelay(500);

Comment won't hurt here

board/h2200/h2200.c

Quoted 11 lines
board/h2200/h2200.c new file +11 -0
+#endif
+
+	return 0;
+}
+
+/*
+ * iPAQ h2200 has two stage bootloader.
+ * We only replace 2nd stage, so u-boot needs to be
+ * adpopted to the way how 1st stage bootloader works.
+ * Firstly, code needs to have first 4 bytes equal to
+ * 0xea0003fe (arm instruction b 0x1000)

GCC/GAS won't generate it so you use .word ?

board/h2200/h2200.c

Quoted 8 lines

and at the offset
+ * 0x40 ascii characters 'ECEC', secondly 1st stage
+ * loads code from flash into SDRAM at address 0xa0040000
+ * so all instructions which reinitializes memory
+ * controller have to be disabled.
+ */

board/h2200/h2200.c new file +2 -0
+
+static inline void writelrb(uint32_t val, uint32_t addr)

Replace this with clrsetbits_le32()

board/h2200/h2200.c line 90

Quoted 8 lines
board/h2200/h2200.c new file +8 -0
+{
+	writel(val, addr);
+	asm volatile("" : : : "memory");
+	readl(addr);
+	asm volatile("" : : : "memory");
+}
+
+static void h2200_pxa2xx_dram_init(void)

Why do you duplicate it ?!

[...]

board/h2200/h2200.c line 196

Quoted 13 lines
board/h2200/h2200.c new file +13 -0
+}
+
+int dram_init(void)
+{
+	h2200_pxa2xx_dram_init();
+	gd->ram_size = PHYS_SDRAM_1_SIZE;
+	return 0;
+}
+
+void dram_init_banksize(void)
+{
+	gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
+	gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;

Isn't there weak alias for this function in arch/arm/lib/board.c that does exactly this?

[...]

include/configs/h2200.h

Quoted 6 lines
include/configs/h2200.h new file +0 -0
new file mode 100644
index 0000000..fb4ec05
@@ -0,0 +1,168 @@

Missing license header.

Quoted 34 lines
include/configs/h2200.h new file +34 -0
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+#define CONFIG_CPU_PXA25X		1
+#define CONFIG_BOARD_H2200		1
+
+#define CONFIG_SYS_NO_FLASH		1
+
+#define CONFIG_SYS_HZ			1000
+
+#define CONFIG_NR_DRAM_BANKS		1
+#define PHYS_SDRAM_1			0xa0000000 /* SDRAM Bank #1 */
+#define PHYS_SDRAM_1_SIZE		0x04000000 /* 64 MB */
+
+#define CONFIG_SYS_DRAM_BASE		PHYS_SDRAM_1
+#define CONFIG_SYS_DRAM_SIZE		PHYS_SDRAM_1_SIZE
+
+#define CONFIG_SYS_SDRAM_BASE		PHYS_SDRAM_1
+#define CONFIG_SYS_INIT_SP_ADDR		0xfffff800
+
+#define CONFIG_ENV_SIZE			0x00040000
+#define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + 128*1024)
+
+#define CONFIG_ENV_IS_NOWHERE		1
+#define CONFIG_SYS_MAXARGS		16
+#define CONFIG_SYS_LOAD_ADDR		0xa3000000 /* default load address */
+
+/*
+ * iPAQ 1st stage bootloader loads 2nd stage bootloader
+ * at address 0xa0040000 but bootloader requires header
+ * which is 0x1000 long.
+ *
+ * --- Header begin ---
+ *	.word 0xea0003fe ; b 0x1000

include/configs/h2200.h line 44

Quoted 10 lines
include/configs/h2200.h new file +10 -0
+ *
+ *	.org 0x40
+ *	.ascii "ECEC"
+ *
+ *	.org 0x1000
+ * --- Header end ---
+ */
+
+#define CONFIG_SYS_TEXT_BASE		0xa0041000
+#define CONFIG_BOARD_EARLY_INIT_F	1

Just define it, not set to 1
[...]

include/configs/h2200.h line 108

Quoted 2 lines
include/configs/h2200.h new file +2 -0
+#define CONFIG_BAUDRATE			115200
+#define CONFIG_SYS_BAUDRATE_TABLE	{ 115200 }

115200 only?

Quoted 42 lines
include/configs/h2200.h new file +42 -0
+/*
+ * USB device configuration
+ */
+
+#define CONFIG_SYS_CONSOLE_IS_IN_ENV	1
+#define CONFIG_USB_DEV_PULLUP_GPIO	33
+/* USB VBUS GPIO 3 */
+
+#define CONFIG_CMD_LOADB		1
+#define CONFIG_CMD_IMPORTENV		1
+#define CONFIG_CMD_SOURCE		1
+#define CONFIG_CMD_RUN			1
+#define CONFIG_CMD_IMI			1
+
+/* Monitor Command Prompt */
+#define CONFIG_SYS_PROMPT		"> "
+
+/* Console I/O Buffer Size */
+#define CONFIG_SYS_CBSIZE		256
+
+/* Print Buffer Size */
+#define CONFIG_SYS_PBSIZE		(CONFIG_SYS_CBSIZE + \
+					sizeof(CONFIG_SYS_PROMPT) + 16)
+
+#define CONFIG_BOOTARGS "root=/dev/ram0 ro console=ttyS0,115200n8"
+
+#ifdef CONFIG_H2200_USBETH
+# define CONFIG_USB_ETH_SUBSET		1
+# define CONFIG_SYS_HUSH_PARSER		1
+# define CONFIG_SYS_PROMPT_HUSH_PS2	"$ "
+
+# define CONFIG_CMD_NET			1
+# define CONFIG_CMD_PING		1
+
+# define CONFIG_BOOTDELAY		2
+
+# define CONFIG_BOOTCOMMAND		\
+	"setenv downloaded 0 ; while test $downloaded -eq 0 ; do " \
+	"if bootp ; then setenv downloaded 1 ; fi ; done ; " \
+	"source :script ; " \
+	"bootm ; "
+

include/configs/h2200.h line 161

Quoted 10 lines
include/configs/h2200.h new file +10 -0
+# define CONFIG_USB_GADGET_PXA2XX	1
+
+# define CONFIG_FIT			1
+# define CONFIG_SETUP_MEMORY_TAGS	1
+# define CONFIG_CMDLINE_TAG		1
+# define CONFIG_INITRD_TAG		1
+
+# define CONFIG_USB_ETHER		1
+# define CONFIG_USBNET_DEV_ADDR		"de:ad:be:ef:00:01"
+# define CONFIG_USBNET_HOST_ADDR	"de:ad:be:ef:00:02"

Definitelly not, any mac address setting should not be present, Joe ?

Quoted 7 lines
include/configs/h2200.h new file +7 -0
+# define CONFIG_EXTRA_ENV_SETTINGS \
+	"stdin=serial\0" \
+	"stdout=serial\0" \
+	"stderr=serial\0"
+#endif
+
+#endif /* __CONFIG_H */

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw

PATCH 1/6 h2200: Add support for iPAQ h2200

Dear ?ukasz Da?ek,

Quoted 23 lines · Marek Vasut
Quoted 5 lines

board/h2200/h2200-header.S line 24

Quoted 3 lines
board/h2200/h2200-header.S new file +3 -0
+
+	.org 0x40
+	.ascii "ECEC"

ECEC ... looks familiar, what is it though? WinCE bootloader signature ?

Yes.

Quoted 5 lines
Quoted 5 lines
board/h2200/h2200.c new file +5 -0
+#endif
+
+	return 0;
+}
+
Quoted 8 lines
Quoted 6 lines

+/*
+ * iPAQ h2200 has two stage bootloader.
+ * We only replace 2nd stage, so u-boot needs to be
+ * adpopted to the way how 1st stage bootloader works.
+ * Firstly, code needs to have first 4 bytes equal to
+ * 0xea0003fe (arm instruction b 0x1000)

GCC/GAS won't generate it so you use .word ?

Quoted 1 line

No. GCC generates sth else than 0xea0003fe.

Try b 0x9098 ... is that it ?

Please keep CC

Best regards,
Marek Vasut

#5 lore raw

PATCH 1/6 h2200: Add support for iPAQ h2200

Quoted 12 lines · Marek Vasut
Quoted 12 lines
Quoted 12 lines

board/h2200/h2200.c

Quoted 11 lines
board/h2200/h2200.c new file +11 -0
+#endif
+
+	return 0;
+}
+
+/*
+ * iPAQ h2200 has two stage bootloader.
+ * We only replace 2nd stage, so u-boot needs to be
+ * adpopted to the way how 1st stage bootloader works.
+ * Firstly, code needs to have first 4 bytes equal to
+ * 0xea0003fe (arm instruction b 0x1000)

GCC/GAS won't generate it so you use .word ?

Quoted 2 lines
Quoted 1 line

No. GCC generates sth else than 0xea0003fe.

Try b 0x9098 ... is that it ?

Yes, GCC/GAS generate 0xeafffffe (b 0x9098).

Can you tell me why? Can I left .word?

?ukasz Da?ek

#6 lore raw

PATCH 1/6 h2200: Add support for iPAQ h2200

Dear ?ukasz Da?ek,

Quoted 15 lines · Marek Vasut
Quoted 14 lines
Quoted 14 lines
Quoted 13 lines

board/h2200/h2200.c

Quoted 11 lines
board/h2200/h2200.c new file +11 -0
+#endif
+
+	return 0;
+}
+
+/*
+ * iPAQ h2200 has two stage bootloader.
+ * We only replace 2nd stage, so u-boot needs to be
+ * adpopted to the way how 1st stage bootloader works.
+ * Firstly, code needs to have first 4 bytes equal to
+ * 0xea0003fe (arm instruction b 0x1000)

GCC/GAS won't generate it so you use .word ?

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

No. GCC generates sth else than 0xea0003fe.

Try b 0x9098 ... is that it ?

Yes, GCC/GAS generate 0xeafffffe (b 0x9098).

Can you tell me why? Can I left .word?

Why is the jump offset 0x9098 ?

Quoted 1 line

?ukasz Da?ek

Best regards,
Marek Vasut

#7 lore raw

PATCH 1/6 h2200: Add support for iPAQ h2200

Quoted 5 lines · Marek Vasut

Yes, GCC/GAS generate 0xeafffffe (b 0x9098).

Can you tell me why? Can I left .word?
Why is the jump offset 0x9098 ?

I figured out that 0xeafffffe is a loop (b -4) but I don't know why toolchain generate b -4 instead of b 0x1000 and I don't know how to fix it (without .word).

?ukasz Da?ek

#8 lore raw

PATCH 1/6 h2200: Add support for iPAQ h2200

Dear ?ukasz Da?ek,

Quoted 7 lines · Marek Vasut
Quoted 4 lines

Yes, GCC/GAS generate 0xeafffffe (b 0x9098).

Can you tell me why? Can I left .word?
Why is the jump offset 0x9098 ?

I figured out that 0xeafffffe is a loop (b -4)

ldr pc, pc, #-4

Quoted 3 lines

but I don't know
why toolchain generate b -4 instead of b 0x1000 and I don't know how to fix it (without .word).

I don't follow, sorry. How did you even get to 0xeafffffe ?

Quoted 1 line

?ukasz Da?ek

Best regards,
Marek Vasut

#9 lore raw

PATCH 1/6 h2200: Add support for iPAQ h2200

Quoted 7 lines · Marek Vasut

Dear ?ukasz Da?ek,

Quoted 5 lines · Marek Vasut
Quoted 4 lines

Yes, GCC/GAS generate 0xeafffffe (b 0x9098).

Can you tell me why? Can I left .word?
Why is the jump offset 0x9098 ?

Quoted 8 lines
Quoted 1 line

I figured out that 0xeafffffe is a loop (b -4)

ldr pc, pc, #-4

Quoted 3 lines

but I don't know
why toolchain generate b -4 instead of b 0x1000 and I don't know how to fix it (without .word).

I don't follow, sorry. How did you even get to 0xeafffffe ?

My point is that GCC/GAS generate 0xeafffffe instead of 0xea0003fe when I use 'b 0x1000'. That's why I use directive .word 0xea0003fe instead of asm instruction 'b 0x1000'. But I don't know that: Can I leave that .word directive or I can not.

Another question: I asked in cover letter question about tools. Can I add them in h2200 directory or should I put them somwhere else?

?ukasz Da?ek

#10 lore raw

PATCH 1/6 h2200: Add support for iPAQ h2200

Dear ?ukasz Da?ek,

Quoted 13 lines · Marek Vasut
Quoted 12 lines

Dear ?ukasz Da?ek,

Quoted 7 lines · Marek Vasut
Quoted 4 lines

Yes, GCC/GAS generate 0xeafffffe (b 0x9098).

Can you tell me why? Can I left .word?
Why is the jump offset 0x9098 ?

I figured out that 0xeafffffe is a loop (b -4)

ldr pc, pc, #-4

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

but I don't know
why toolchain generate b -4 instead of b 0x1000 and I don't know how to fix it (without .word).

I don't follow, sorry. How did you even get to 0xeafffffe ?

My point is that GCC/GAS generate 0xeafffffe instead of 0xea0003fe when I use 'b 0x1000'.

How did you get to 0x1000 ?

Quoted 1 line

That's why I use directive .word 0xea0003fe

Check some arm instruction quick ref for what 0xea0003fe really is and if it really is necessary or anything else work just fine as well.

Quoted 6 lines

instead of
asm instruction 'b 0x1000'. But I don't know that: Can I leave that .word directive or I can not.

Another question: I asked in cover letter question about tools. Can I add them in h2200 directory or should I put them somwhere else?

I didn't receive the cover letter.

Quoted 1 line

?ukasz Da?ek

Best regards,
Marek Vasut

#11 lore raw

PATCH 1/6 h2200: Add support for iPAQ h2200

Quoted 3 lines · Marek Vasut
Quoted 1 line

That's why I use directive .word 0xea0003fe

Check some arm instruction quick ref for what 0xea0003fe really is and if it really is necessary or anything else work just fine as well.

0xea0003fe is a branch instruction. 0x3fe is an offset (0x3fe << 2 + 8 = 0x1000)
And I will left it. Bootloader checks for 4 bytes which have to be equal 0xfe, 0x03, 0x00, 0xea and for 4 bytes@the offset 0x40 which have to be equal E, C, E, C

Quoted 7 lines
Quoted 6 lines

instead of
asm instruction 'b 0x1000'. But I don't know that: Can I leave that .word directive or I can not.

Another question: I asked in cover letter question about tools. Can I add them in h2200 directory or should I put them somwhere else?

I didn't receive the cover letter.

Weird, I sent it with patches. With your address in CC field. Btw. Did you got all 6 patches?

?ukasz Da?ek

#12 lore raw

PATCH 1/6 h2200: Add support for iPAQ h2200

Dear ?ukasz Da?ek,

Quoted 11 lines · Marek Vasut
Quoted 4 lines
Quoted 1 line

That's why I use directive .word 0xea0003fe

Check some arm instruction quick ref for what 0xea0003fe really is and if it really is necessary or anything else work just fine as well.

0xea0003fe is a branch instruction. 0x3fe is an offset (0x3fe << 2 + 8 = 0x1000)
And I will left it. Bootloader checks for 4 bytes which have to be equal 0xfe, 0x03, 0x00, 0xea and for 4 bytes at the offset 0x40 which have to be equal E, C, E, C

It checks the branch instruction? What a piece of crap ... can't you replace it as well?

Quoted 11 lines
Quoted 8 lines
Quoted 6 lines

instead of
asm instruction 'b 0x1000'. But I don't know that: Can I leave that .word directive or I can not.

Another question: I asked in cover letter question about tools. Can I add them in h2200 directory or should I put them somwhere else?

I didn't receive the cover letter.

Weird, I sent it with patches. With your address in CC field. Btw. Did you got all 6 patches?

Yes

Next time add

Cc <>

to the cover letter too.

Quoted 1 line

?ukasz Da?ek

Best regards,
Marek Vasut

#13 lore raw

PATCH 1/6 h2200: Add support for iPAQ h2200

Quoted 6 lines · Marek Vasut

Dear ?ukasz Da?ek,

Quoted 4 lines · Marek Vasut
Quoted 3 lines
Quoted 1 line

That's why I use directive .word 0xea0003fe

Check some arm instruction quick ref for what 0xea0003fe really is and if it really is necessary or anything else work just fine as well.

Quoted 7 lines
Quoted 5 lines

0xea0003fe is a branch instruction. 0x3fe is an offset (0x3fe<< 2 + 8 = 0x1000)
And I will left it. Bootloader checks for 4 bytes which have to be equal 0xfe, 0x03, 0x00, 0xea and for 4 bytes at the offset 0x40 which have to be equal E, C, E, C

It checks the branch instruction? What a piece of crap ... can't you replace it as well?

I can't. I would have to prepare sth like x-loader used in ti omap processors.
And I want to add driver for sdcard and flash and keyboard and lcd would be nice... So I will left it as it is for now.

?ukasz Da?ek

#14 lore raw

PATCH 1/6 h2200: Add support for iPAQ h2200

Dear ?ukasz Da?ek,

Quoted 15 lines · Marek Vasut
Quoted 14 lines

Dear ?ukasz Da?ek,

Quoted 11 lines · Marek Vasut
Quoted 4 lines
Quoted 1 line

That's why I use directive .word 0xea0003fe

Check some arm instruction quick ref for what 0xea0003fe really is and if it really is necessary or anything else work just fine as well.

0xea0003fe is a branch instruction. 0x3fe is an offset (0x3fe<< 2 + 8 = 0x1000)
And I will left it. Bootloader checks for 4 bytes which have to be equal 0xfe, 0x03, 0x00, 0xea and for 4 bytes at the offset 0x40 which have to be equal E, C, E, C

Quoted 5 lines
Quoted 2 lines

It checks the branch instruction? What a piece of crap ... can't you replace it as well?

I can't. I would have to prepare sth like x-loader used in ti omap processors.

What? Why?

Quoted 2 lines

And I want to add driver for sdcard and flash and keyboard and lcd would be nice... So I will left it as it is for now.

these drivers are already in uboot

Quoted 1 line

?ukasz Da?ek

Best regards,
Marek Vasut

#15 lore raw

PATCH 1/6 h2200: Add support for iPAQ h2200

Quoted 14 lines · Marek Vasut

Dear ?ukasz Da?ek,

Quoted 12 lines · Marek Vasut
Quoted 11 lines

Dear ?ukasz Da?ek,

Quoted 9 lines · Marek Vasut
Quoted 3 lines
Quoted 1 line

That's why I use directive .word 0xea0003fe

Check some arm instruction quick ref for what 0xea0003fe really is and if it really is necessary or anything else work just fine as well.

0xea0003fe is a branch instruction. 0x3fe is an offset (0x3fe<< 2 + 8 =
0x1000)
And I will left it. Bootloader checks for 4 bytes which have to be equal 0xfe, 0x03, 0x00, 0xea and for 4 bytes at the offset 0x40 which have to be equal E, C, E, C

Quoted 5 lines
Quoted 4 lines
Quoted 2 lines

It checks the branch instruction? What a piece of crap ... can't you replace it as well?

I can't. I would have to prepare sth like x-loader used in ti omap processors.

What? Why?

h2200 uses companion chip from Samsung. When device is powered on chip loads 16kb of flash into internal SRAM and PXA executes it. That program is 1st stage bootloader.
But u-boot for my device has ~180kb. So it's to big for SRAM.

Quoted 3 lines
Quoted 2 lines

And I want to add driver for sdcard and flash and keyboard and lcd would be nice... So I will left it as it is for now.

these drivers are already in uboot

I haven't seen any MediaQ 1178 drivers (LCD).
Also SD card and FLASH controllers are embedded in companion chip. Chip is based on S3C440 (or 410?) processor but needs some tweaks and tests.

?ukasz Da?ek

#16 lore raw

PATCH 1/6 h2200: Add support for iPAQ h2200

Dear ?ukasz Da?ek,

Quoted 22 lines · Marek Vasut
Quoted 21 lines

Dear ?ukasz Da?ek,

Quoted 19 lines · Marek Vasut
Quoted 17 lines

Dear ?ukasz Da?ek,

Quoted 7 lines · Marek Vasut
Quoted 5 lines
Quoted 1 line

That's why I use directive .word 0xea0003fe

Check some arm instruction quick ref for what 0xea0003fe really is and if it really is necessary or anything else work just fine as well.

Quoted 5 lines

0xea0003fe is a branch instruction. 0x3fe is an offset (0x3fe<< 2 +
8 = 0x1000)
And I will left it. Bootloader checks for 4 bytes which have to be equal 0xfe, 0x03, 0x00, 0xea and for 4 bytes at the offset 0x40 which have to be equal E, C, E, C

It checks the branch instruction? What a piece of crap ... can't you replace it as well?

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

I can't. I would have to prepare sth like x-loader used in ti omap processors.

What? Why?

h2200 uses companion chip from Samsung.

OneNAND ?

Quoted 3 lines

When device is powered on
chip loads 16kb of flash into internal SRAM and PXA executes it. That program is 1st stage bootloader.

Check OneNAND SPL

Quoted 8 lines

But u-boot for my device has ~180kb. So it's to big for SRAM.

Quoted 4 lines
Quoted 2 lines

And I want to add driver for sdcard and flash and keyboard and lcd would be nice... So I will left it as it is for now.

these drivers are already in uboot

I haven't seen any MediaQ 1178 drivers (LCD).

oh it has separate LCD or it uses PXA LCDIF ?

Quoted 1 line

Also SD card and FLASH controllers are embedded in companion chip.

ASIC3 ?

Quoted 2 lines

Chip is based on S3C440 (or 410?) processor but needs some tweaks and tests.

Uhhh ?

Quoted 1 line

?ukasz Da?ek

Best regards,
Marek Vasut

#17 lore raw

PATCH 1/6 h2200: Add support for iPAQ h2200

Quoted 7 lines · Marek Vasut

h2200 uses companion chip from Samsung.
OneNAND ?

Quoted 3 lines

When device is powered on
chip loads 16kb of flash into internal SRAM and PXA executes it. That program is 1st stage bootloader.

Check OneNAND SPL

I'm not sure I didn't checked yet.

Quoted 7 lines
Quoted 6 lines

But u-boot for my device has ~180kb. So it's to big for SRAM.

Quoted 3 lines
Quoted 2 lines

And I want to add driver for sdcard and flash and keyboard and lcd would be nice... So I will left it as it is for now.

these drivers are already in uboot

I haven't seen any MediaQ 1178 drivers (LCD).

oh it has separate LCD or it uses PXA LCDIF ?

MQ1178 is a separate SoC.

Quoted 2 lines
Quoted 1 line

Also SD card and FLASH controllers are embedded in companion chip.

ASIC3 ?

Hamcop

Quoted 3 lines
Quoted 2 lines

Chip is based on S3C440 (or 410?) processor but needs some tweaks and tests.

Uhhh ?

Hamcop chip looks like s3c2440 processor without ARM core and with internal data busses limited to 16bytes. Really weird and buggy thing.

?ukasz Da?ek

#18 lore raw

PATCH 1/6 h2200: Add support for iPAQ h2200

Dear ?ukasz Da?ek,

Quoted 31 lines · Marek Vasut
Quoted 8 lines

h2200 uses companion chip from Samsung.
OneNAND ?

Quoted 3 lines

When device is powered on
chip loads 16kb of flash into internal SRAM and PXA executes it. That program is 1st stage bootloader.

Check OneNAND SPL

I'm not sure I didn't checked yet.

Quoted 10 lines
Quoted 8 lines

But u-boot for my device has ~180kb. So it's to big for SRAM.

Quoted 4 lines
Quoted 2 lines

And I want to add driver for sdcard and flash and keyboard and lcd would be nice... So I will left it as it is for now.

these drivers are already in uboot

I haven't seen any MediaQ 1178 drivers (LCD).

oh it has separate LCD or it uses PXA LCDIF ?

MQ1178 is a separate SoC.

Quoted 3 lines
Quoted 1 line

Also SD card and FLASH controllers are embedded in companion chip.

ASIC3 ?

Hamcop

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

Chip is based on S3C440 (or 410?) processor but needs some tweaks and tests.

Uhhh ?

Hamcop chip looks like s3c2440 processor without ARM core and with internal data busses limited to 16bytes. Really weird and buggy thing.

:-(

Quoted 1 line

?ukasz Da?ek

Best regards,
Marek Vasut

#19 lore raw

PATCH 1/6 h2200: Add support for iPAQ h2200

In reply to Marek Vasut

Hi Marek,

Quoted 10 lines · Marek Vasut

Dear ?ukasz Da?ek,

[ Joe, see the bottom of my babble here ]

include/configs/h2200.h line 161

Quoted 4 lines
include/configs/h2200.h new file +4 -0
+
+# define CONFIG_USB_ETHER            1
+# define CONFIG_USBNET_DEV_ADDR              "de:ad:be:ef:00:01"
+# define CONFIG_USBNET_HOST_ADDR     "de:ad:be:ef:00:02"

Definitelly not, any mac address setting should not be present, Joe ?

I certainly agree, in most cases. However, a USB Ethernet device is unique in that it is known to be 1 of only 2 devices on the network. Therefore conflicts are unlikely. The only source of conflicts is if there are more than one of these devices plugged into the same host, and even then I'm not sure that it's a problem, since the routing will have to choose an interface first anyway.

-Joe

#20 lore raw

PATCH 1/6 h2200: Add support for iPAQ h2200

Dear Joe Hershberger,

Quoted 14 lines

Hi Marek,

Quoted 10 lines · Marek Vasut

Dear ?ukasz Da?ek,

[ Joe, see the bottom of my babble here ]

include/configs/h2200.h line 161

Quoted 4 lines
include/configs/h2200.h new file +4 -0
+
+# define CONFIG_USB_ETHER            1
+# define CONFIG_USBNET_DEV_ADDR              "de:ad:be:ef:00:01"
+# define CONFIG_USBNET_HOST_ADDR     "de:ad:be:ef:00:02"

Definitelly not, any mac address setting should not be present, Joe ?

Quoted 6 lines

I certainly agree, in most cases. However, a USB Ethernet device is unique in that it is known to be 1 of only 2 devices on the network. Therefore conflicts are unlikely. The only source of conflicts is if there are more than one of these devices plugged into the same host, and even then I'm not sure that it's a problem, since the routing will have to choose an interface first anyway.

Oh wait, this is the CDC ethernet mac ... oh man. But we certainly should interoduce some configs for this.

Quoted 1 line

-Joe

Best regards,
Marek Vasut

#21 lore raw

PATCH 1/6 h2200: Add support for iPAQ h2200

In reply to Marek Vasut
Quoted 9 lines · Marek Vasut

Review

Quoted 8 lines

and at the offset
+ * 0x40 ascii characters 'ECEC', secondly 1st stage
+ * loads code from flash into SDRAM at address 0xa0040000
+ * so all instructions which reinitializes memory
+ * controller have to be disabled.
+ */

(quoted diff) +2 -0
+
+static inline void writelrb(uint32_t val, uint32_t addr)

Replace this with clrsetbits_le32()

I've copied writelrb and pxa2xx_dram_init from pxa2xx.c
and I think there is a reason why it's done that way and not by clrsetbits_le32. But if you insist I can replace all calls to writelrb by clrsetbits.

Quoted 11 lines

board/h2200/h2200.c line 90

Quoted 8 lines
board/h2200/h2200.c new file +8 -0
+{
+	writel(val, addr);
+	asm volatile("" : : : "memory");
+	readl(addr);
+	asm volatile("" : : : "memory");
+}
+
+static void h2200_pxa2xx_dram_init(void)

Why do you duplicate it ?!

[...]

Because code in pxa2xx.c disable and then re-enable memory. And u-boot is executed from memory (1st stage bootloder copied it there).

Quoted 5 lines
include/configs/h2200.h new file +4 -0
+
+# define CONFIG_USB_ETHER		1
+# define CONFIG_USBNET_DEV_ADDR		"de:ad:be:ef:00:01"
+# define CONFIG_USBNET_HOST_ADDR	"de:ad:be:ef:00:02"

Definitelly not, any mac address setting should not be present, Joe ?

So tell me how should I specify mac addresses? By EXTRA_ENV_SETTINGS?

?ukasz Da?ek

#22 lore raw

PATCH 1/6 h2200: Add support for iPAQ h2200

Dear ?ukasz Da?ek,

Quoted 12 lines · Marek Vasut
Quoted 10 lines

Review

Quoted 8 lines

and at the offset
+ * 0x40 ascii characters 'ECEC', secondly 1st stage
+ * loads code from flash into SDRAM at address 0xa0040000
+ * so all instructions which reinitializes memory
+ * controller have to be disabled.
+ */

(quoted diff) +2 -0
+
+static inline void writelrb(uint32_t val, uint32_t addr)

Replace this with clrsetbits_le32()

Quoted 4 lines

I've copied writelrb and pxa2xx_dram_init from pxa2xx.c
and I think there is a reason why it's done that way and not by clrsetbits_le32. But if you insist I can replace all calls to writelrb by clrsetbits.

And can you elaborate on the reason please?

(hint: clrsetbits() wasn't there by the time)

Quoted 11 lines
Quoted 11 lines

board/h2200/h2200.c line 90

Quoted 8 lines
board/h2200/h2200.c new file +8 -0
+{
+	writel(val, addr);
+	asm volatile("" : : : "memory");
+	readl(addr);
+	asm volatile("" : : : "memory");
+}
+
+static void h2200_pxa2xx_dram_init(void)

Why do you duplicate it ?!

Quoted 5 lines
Quoted 1 line

[...]

Because code in pxa2xx.c disable and then re-enable memory. And u-boot is executed from memory (1st stage bootloder copied it there).

So don't reinit the memory at all, just skip this whole part.

Quoted 7 lines
Quoted 5 lines
include/configs/h2200.h new file +4 -0
+
+# define CONFIG_USB_ETHER		1
+# define CONFIG_USBNET_DEV_ADDR		"de:ad:be:ef:00:01"
+# define CONFIG_USBNET_HOST_ADDR	"de:ad:be:ef:00:02"

Definitelly not, any mac address setting should not be present, Joe ?

So tell me how should I specify mac addresses? By EXTRA_ENV_SETTINGS?

Joe explained it, your adapter doesn't carry it's own mac?

Quoted 1 line

?ukasz Da?ek

Best regards,
Marek Vasut

#23 lore raw

PATCH 1/6 h2200: Add support for iPAQ h2200

Quoted 12 lines · Marek Vasut

Dear ?ukasz Da?ek,

Quoted 10 lines · Marek Vasut
Quoted 9 lines

Review

Quoted 8 lines

and at the offset
+ * 0x40 ascii characters 'ECEC', secondly 1st stage
+ * loads code from flash into SDRAM at address 0xa0040000
+ * so all instructions which reinitializes memory
+ * controller have to be disabled.
+ */

(quoted diff) +2 -0
+
+static inline void writelrb(uint32_t val, uint32_t addr)

Replace this with clrsetbits_le32()

Quoted 7 lines
Quoted 4 lines

I've copied writelrb and pxa2xx_dram_init from pxa2xx.c
and I think there is a reason why it's done that way and not by clrsetbits_le32. But if you insist I can replace all calls to writelrb by clrsetbits.

And can you elaborate on the reason please?

(hint: clrsetbits() wasn't there by the time)

I don't know what was the reason. I didn't change becuse I didn't want to break it.

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines

board/h2200/h2200.c line 90

Quoted 8 lines
board/h2200/h2200.c new file +8 -0
+{
+	writel(val, addr);
+	asm volatile("" : : : "memory");
+	readl(addr);
+	asm volatile("" : : : "memory");
+}
+
+static void h2200_pxa2xx_dram_init(void)

Why do you duplicate it ?!

Quoted 5 lines
Quoted 4 lines
Quoted 1 line

[...]

Because code in pxa2xx.c disable and then re-enable memory. And u-boot is executed from memory (1st stage bootloder copied it there).

So don't reinit the memory at all, just skip this whole part.

1st stage loader doesn't init everything (for example MSC).

Quoted 7 lines
Quoted 6 lines
Quoted 5 lines
include/configs/h2200.h new file +4 -0
+
+# define CONFIG_USB_ETHER		1
+# define CONFIG_USBNET_DEV_ADDR		"de:ad:be:ef:00:01"
+# define CONFIG_USBNET_HOST_ADDR	"de:ad:be:ef:00:02"

Definitelly not, any mac address setting should not be present, Joe ?

So tell me how should I specify mac addresses? By EXTRA_ENV_SETTINGS?

Joe explained it, your adapter doesn't carry it's own mac?

No.

?ukasz Da?ek

#24 lore raw

PATCH 1/6 h2200: Add support for iPAQ h2200

Dear ?ukasz Da?ek,

Quoted 20 lines · Marek Vasut
Quoted 19 lines

Dear ?ukasz Da?ek,

Quoted 16 lines · Marek Vasut
Quoted 10 lines

Review

Quoted 8 lines

and at the offset
+ * 0x40 ascii characters 'ECEC', secondly 1st stage
+ * loads code from flash into SDRAM at address 0xa0040000
+ * so all instructions which reinitializes memory
+ * controller have to be disabled.
+ */

(quoted diff) +2 -0
+
+static inline void writelrb(uint32_t val, uint32_t addr)

Replace this with clrsetbits_le32()

I've copied writelrb and pxa2xx_dram_init from pxa2xx.c
and I think there is a reason why it's done that way and not by clrsetbits_le32. But if you insist I can replace all calls to writelrb by clrsetbits.

Quoted 6 lines
Quoted 3 lines

And can you elaborate on the reason please?

(hint: clrsetbits() wasn't there by the time)

I don't know what was the reason. I didn't change becuse I didn't want to break it.

If you have time, replace it with clrsetbits() please ... in the original file.

Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 12 lines

board/h2200/h2200.c line 90

Quoted 8 lines
board/h2200/h2200.c new file +8 -0
+{
+	writel(val, addr);
+	asm volatile("" : : : "memory");
+	readl(addr);
+	asm volatile("" : : : "memory");
+}
+
+static void h2200_pxa2xx_dram_init(void)

Why do you duplicate it ?!

[...]

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

Because code in pxa2xx.c disable and then re-enable memory. And u-boot is executed from memory (1st stage bootloder copied it there).

So don't reinit the memory at all, just skip this whole part.

1st stage loader doesn't init everything (for example MSC).

So I checked ... every board calls the dram init on it's own in dram_init() ... so just don't do that.

Quoted 11 lines
Quoted 9 lines
Quoted 7 lines
Quoted 5 lines
include/configs/h2200.h new file +4 -0
+
+# define CONFIG_USB_ETHER		1
+# define CONFIG_USBNET_DEV_ADDR		"de:ad:be:ef:00:01"
+# define CONFIG_USBNET_HOST_ADDR	"de:ad:be:ef:00:02"

Definitelly not, any mac address setting should not be present, Joe ?

So tell me how should I specify mac addresses? By EXTRA_ENV_SETTINGS?

Joe explained it, your adapter doesn't carry it's own mac?

No.

Then leave it in ?

Quoted 1 line

?ukasz Da?ek

Best regards,
Marek Vasut

#25 lore raw

PATCH 1/6 h2200: Add support for iPAQ h2200

Quoted 19 lines · Marek Vasut

Dear ?ukasz Da?ek,

Quoted 17 lines · Marek Vasut
Quoted 16 lines

Dear ?ukasz Da?ek,

Quoted 14 lines · Marek Vasut
Quoted 9 lines

Review

Quoted 8 lines

and at the offset
+ * 0x40 ascii characters 'ECEC', secondly 1st stage
+ * loads code from flash into SDRAM at address 0xa0040000
+ * so all instructions which reinitializes memory
+ * controller have to be disabled.
+ */

(quoted diff) +2 -0
+
+static inline void writelrb(uint32_t val, uint32_t addr)

Replace this with clrsetbits_le32()

I've copied writelrb and pxa2xx_dram_init from pxa2xx.c
and I think there is a reason why it's done that way and not by clrsetbits_le32. But if you insist I can replace all calls to writelrb by clrsetbits.

Quoted 6 lines
Quoted 5 lines
Quoted 3 lines

And can you elaborate on the reason please?

(hint: clrsetbits() wasn't there by the time)

I don't know what was the reason. I didn't change becuse I didn't want to break it.

If you have time, replace it with clrsetbits() please ... in the original file.

In arch/arm/cpu/pxa/pxa2xx.c?

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines

board/h2200/h2200.c line 90

Quoted 8 lines
board/h2200/h2200.c new file +8 -0
+{
+	writel(val, addr);
+	asm volatile("" : : : "memory");
+	readl(addr);
+	asm volatile("" : : : "memory");
+}
+
+static void h2200_pxa2xx_dram_init(void)

Why do you duplicate it ?!

Quoted 8 lines
Quoted 6 lines
Quoted 5 lines
Quoted 4 lines
Quoted 1 line

[...]

Because code in pxa2xx.c disable and then re-enable memory. And u-boot is executed from memory (1st stage bootloder copied it there).

So don't reinit the memory at all, just skip this whole part.

1st stage loader doesn't init everything (for example MSC).

So I checked ... every board calls the dram init on it's own in dram_init() ... so just don't do that.

Do what? Don't call modified pxa2xx_dram_init?

Quoted 10 lines
Quoted 9 lines
Quoted 8 lines
Quoted 7 lines
Quoted 6 lines
include/configs/h2200.h new file +4 -0
+
+# define CONFIG_USB_ETHER		1
+# define CONFIG_USBNET_DEV_ADDR		"de:ad:be:ef:00:01"
+# define CONFIG_USBNET_HOST_ADDR	"de:ad:be:ef:00:02"

Definitelly not, any mac address setting should not be present, Joe ?

So tell me how should I specify mac addresses? By EXTRA_ENV_SETTINGS?

Joe explained it, your adapter doesn't carry it's own mac?

No.

Then leave it in ?

leave CONFIG_USBNET_DEV_ADDR...?

?ukasz Da?ek

#26 lore raw

PATCH 1/6 h2200: Add support for iPAQ h2200

Dear ?ukasz Da?ek,

Quoted 27 lines · Marek Vasut
Quoted 26 lines

Dear ?ukasz Da?ek,

Quoted 24 lines · Marek Vasut
Quoted 22 lines

Dear ?ukasz Da?ek,

Quoted 12 lines · Marek Vasut
Quoted 10 lines

Review

Quoted 8 lines

and at the offset
+ * 0x40 ascii characters 'ECEC', secondly 1st stage
+ * loads code from flash into SDRAM at address 0xa0040000
+ * so all instructions which reinitializes memory
+ * controller have to be disabled.
+ */

(quoted diff) +2 -0
+
+static inline void writelrb(uint32_t val, uint32_t addr)

Replace this with clrsetbits_le32()

Quoted 4 lines

I've copied writelrb and pxa2xx_dram_init from pxa2xx.c
and I think there is a reason why it's done that way and not by clrsetbits_le32. But if you insist I can replace all calls to writelrb by clrsetbits.

And can you elaborate on the reason please?

(hint: clrsetbits() wasn't there by the time)

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

I don't know what was the reason. I didn't change becuse I didn't want to break it.

If you have time, replace it with clrsetbits() please ... in the original file.

In arch/arm/cpu/pxa/pxa2xx.c?

Yes, and you don't need the copy of it now.

Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 16 lines
Quoted 11 lines

Review

Quoted 8 lines
(quoted diff) +8 -0
+{
+	writel(val, addr);
+	asm volatile("" : : : "memory");
+	readl(addr);
+	asm volatile("" : : : "memory");
+}
+
+static void h2200_pxa2xx_dram_init(void)

Why do you duplicate it ?!

Quoted 1 line

[...]

Because code in pxa2xx.c disable and then re-enable memory. And u-boot is executed from memory (1st stage bootloder copied it there).

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line

So don't reinit the memory at all, just skip this whole part.

1st stage loader doesn't init everything (for example MSC).

So I checked ... every board calls the dram init on it's own in dram_init() ... so just don't do that.

Do what? Don't call modified pxa2xx_dram_init?

What exactly do you need to do ? What registers do you need to set ? How come the bootloader kick dram in, but won't configure MSC ?

Split out the MSC config and memory config maybe ?

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 9 lines
Quoted 7 lines
Quoted 5 lines
(quoted diff) +4 -0
+
+# define CONFIG_USB_ETHER		1
+# define CONFIG_USBNET_DEV_ADDR		"de:ad:be:ef:00:01"
+# define CONFIG_USBNET_HOST_ADDR	"de:ad:be:ef:00:02"

Definitelly not, any mac address setting should not be present, Joe ?

So tell me how should I specify mac addresses? By EXTRA_ENV_SETTINGS?

Joe explained it, your adapter doesn't carry it's own mac?

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

No.

Then leave it in ?

leave CONFIG_USBNET_DEV_ADDR...?

?ukasz Da?ek

Best regards,
Marek Vasut

#27 lore raw

PATCH 1/6 h2200: Add support for iPAQ h2200

Quoted 15 lines · Marek Vasut
Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
Quoted 10 lines
Quoted 10 lines

Review

Quoted 8 lines
(quoted diff) +8 -0
+{
+	writel(val, addr);
+	asm volatile("" : : : "memory");
+	readl(addr);
+	asm volatile("" : : : "memory");
+}
+
+static void h2200_pxa2xx_dram_init(void)

Why do you duplicate it ?!

Quoted 4 lines
Quoted 1 line

[...]

Because code in pxa2xx.c disable and then re-enable memory. And u-boot is executed from memory (1st stage bootloder copied it there).

So don't reinit the memory at all, just skip this whole part.

Quoted 8 lines
Quoted 4 lines
Quoted 3 lines
Quoted 1 line

1st stage loader doesn't init everything (for example MSC).

So I checked ... every board calls the dram init on it's own in dram_init() ... so just don't do that.

Do what? Don't call modified pxa2xx_dram_init?

What exactly do you need to do ? What registers do you need to set ? How come the bootloader kick dram in, but won't configure MSC ?

Split out the MSC config and memory config maybe ?

Ok, I will rewrite that.

?ukasz Da?ek

#28 lore raw

PATCH 1/6 h2200: Add support for iPAQ h2200

Dear ?ukasz Da?ek,

Quoted 25 lines · Marek Vasut
Quoted 24 lines
Quoted 24 lines
Quoted 23 lines
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 12 lines

Review

Quoted 8 lines
(quoted diff) +8 -0
+{
+	writel(val, addr);
+	asm volatile("" : : : "memory");
+	readl(addr);
+	asm volatile("" : : : "memory");
+}
+
+static void h2200_pxa2xx_dram_init(void)

Why do you duplicate it ?!

[...]

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

Because code in pxa2xx.c disable and then re-enable memory. And u-boot is executed from memory (1st stage bootloder copied it there).

So don't reinit the memory at all, just skip this whole part.

1st stage loader doesn't init everything (for example MSC).

So I checked ... every board calls the dram init on it's own in dram_init() ... so just don't do that.

Quoted 8 lines
Quoted 6 lines
Quoted 1 line

Do what? Don't call modified pxa2xx_dram_init?

What exactly do you need to do ? What registers do you need to set ? How come the bootloader kick dram in, but won't configure MSC ?

Split out the MSC config and memory config maybe ?

Ok, I will rewrite that.

Just pull it out, but make sure you don't break the other boards ...

Quoted 1 line

?ukasz Da?ek

Best regards,
Marek Vasut

#29 lore raw

PATCH 1/6 h2200: Add support for iPAQ h2200

Quoted 21 lines · Marek Vasut

Dear ?ukasz Da?ek,

Quoted 19 lines · Marek Vasut
Quoted 18 lines
Quoted 18 lines
Quoted 18 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines

Review

Quoted 8 lines
(quoted diff) +8 -0
+{
+	writel(val, addr);
+	asm volatile("" : : : "memory");
+	readl(addr);
+	asm volatile("" : : : "memory");
+}
+
+static void h2200_pxa2xx_dram_init(void)

Why do you duplicate it ?!

Quoted 6 lines
Quoted 5 lines
Quoted 4 lines
Quoted 1 line

[...]

Because code in pxa2xx.c disable and then re-enable memory. And u-boot is executed from memory (1st stage bootloder copied it there).

So don't reinit the memory at all, just skip this whole part.

1st stage loader doesn't init everything (for example MSC).

So I checked ... every board calls the dram init on it's own in dram_init() ... so just don't do that.

Quoted 7 lines
Quoted 6 lines
Quoted 5 lines
Quoted 1 line

Do what? Don't call modified pxa2xx_dram_init?

What exactly do you need to do ? What registers do you need to set ? How come the bootloader kick dram in, but won't configure MSC ?

Split out the MSC config and memory config maybe ?

Ok, I will rewrite that.

Just pull it out, but make sure you don't break the other boards ...

I was only thinking about my board...

?ukasz Da?ek

#30 lore raw

PATCH 2/6 pxa25x: Add USB Ethernet driver

In reply to Łukasz Dałek
---
 drivers/usb/gadget/Makefile     |    1 +
 drivers/usb/gadget/pxa25x_udc.c | 2059 +++++++++++++++++++++++++++++++++++++++
 drivers/usb/gadget/pxa25x_udc.h |  162 +++
 3 files changed, 2222 insertions(+), 0 deletions(-)
 create mode 100644 drivers/usb/gadget/pxa25x_udc.c
 create mode 100644 drivers/usb/gadget/pxa25x_udc.h
drivers/usb/gadget/Makefile +1 -0
index 5bbdd36..040eaba 100644
@@ -36,6 +36,7 @@ ifdef CONFIG_USB_ETHER
 COBJS-y += ether.o epautoconf.o config.o usbstring.o
 COBJS-$(CONFIG_USB_ETH_RNDIS) += rndis.o
 COBJS-$(CONFIG_MV_UDC)	+= mv_udc.o
+COBJS-$(CONFIG_CPU_PXA25X) += pxa25x_udc.o
 else
 # Devices not related to the new gadget layer depend on CONFIG_USB_DEVICE
 ifdef CONFIG_USB_DEVICE
drivers/usb/gadget/pxa25x_udc.c new file +2059 -0

2,059 lines not on this page · raw message

drivers/usb/gadget/pxa25x_udc.h new file +162 -0

162 lines not on this page · raw message

Signature · 1 line
1.7.8.6
#31 lore raw

PATCH 2/6 pxa25x: Add USB Ethernet driver

Dear ?ukasz Da?ek,

Patch description is missing ...

are there any changes since your last post?

Quoted 9 lines
---
 drivers/usb/gadget/Makefile     |    1 +
 drivers/usb/gadget/pxa25x_udc.c | 2059
+++++++++++++++++++++++++++++++++++++++ drivers/usb/gadget/pxa25x_udc.h | 
162 +++
 3 files changed, 2222 insertions(+), 0 deletions(-)
 create mode 100644 drivers/usb/gadget/pxa25x_udc.c
 create mode 100644 drivers/usb/gadget/pxa25x_udc.h

[...]

Best regards,
Marek Vasut

A message that is not in the archive (sent off-list or not yet received): [email protected]

#33 lore raw

PATCH 2/6 pxa25x: Add USB Ethernet driver

Dear ?ukasz Da?ek,

Quoted 8 lines · Marek Vasut
Quoted 5 lines

Dear ?ukasz Da?ek,

Patch description is missing ...

are there any changes since your last post?

Just fixed DEBUG_NOISY stuff

See the patches link I posted, it will help you rectify and avoid the remaining issues please.

Best regards,
Marek Vasut

#34 lore raw

PATCH 3/6 pxa: Add some stuff to examine cpu model and rev

In reply to Łukasz Dałek
---
 arch/arm/cpu/pxa/cpuinfo.c          |   11 +++++++++--
 arch/arm/include/asm/arch-pxa/pxa.h |   13 +++++++++++++
 2 files changed, 22 insertions(+), 2 deletions(-)
arch/arm/cpu/pxa/cpuinfo.c +9 -2
index f1cdd40..bab6340 100644
@@ -24,9 +24,11 @@
 #include <errno.h>
 #include <linux/compiler.h>
 
-#define	CPU_MASK_PXA_REVID	0x00f
+#define	CPU_MASK_PXA_PRODID	0x000003f0
+#define	CPU_MASK_PXA_REVID	0x0000000f
+
+#define	CPU_MASK_PRODREV	(CPU_MASK_PXA_PRODID | CPU_MASK_PXA_REVID)
 
-#define	CPU_MASK_PXA_PRODID	0x3f0
 #define	CPU_VALUE_PXA25X	0x100
 #define	CPU_VALUE_PXA27X	0x110
 
@@ -51,6 +53,11 @@ int cpu_is_pxa27x(void)
 	return id == CPU_VALUE_PXA27X;
 }
 
+uint32_t pxa_get_cpu_revision(void)
+{
+	return pxa_get_cpuid() & CPU_MASK_PRODREV;
+}
+
 #ifdef	CONFIG_DISPLAY_CPUINFO
 static const char *pxa25x_get_revision(void)
 {
arch/arm/include/asm/arch-pxa/pxa.h +13 -0
index 49c6552..b67d8f2 100644
@@ -22,8 +22,21 @@
 #ifndef	__PXA_H__
 #define	__PXA_H__
 
+#define PXA255_A0	0x00000106
+#define PXA250_C0	0x00000105
+#define PXA250_B2	0x00000104
+#define PXA250_B1	0x00000103
+#define PXA250_B0	0x00000102
+#define PXA250_A1	0x00000101
+#define PXA250_A0	0x00000100
+#define PXA210_C0	0x00000125
+#define PXA210_B2	0x00000124
+#define PXA210_B1	0x00000123
+#define PXA210_B0	0x00000122
+
 int cpu_is_pxa25x(void);
 int cpu_is_pxa27x(void);
+uint32_t pxa_get_cpu_revision(void);
 void pxa2xx_dram_init(void);
 
 #endif	/* __PXA_H__ */
Signature · 1 line
1.7.8.6
#35 lore raw

PATCH 3/6 pxa: Add some stuff to examine cpu model and rev

Dear ?ukasz Da?ek,

Patch description missing. Properly describe all your patches and repost. Also describe what changed, see

http://www.denx.de/wiki/U-Boot/Patches

Quoted 11 lines
---
 arch/arm/cpu/pxa/cpuinfo.c          |   11 +++++++++--
 arch/arm/include/asm/arch-pxa/pxa.h |   13 +++++++++++++
 2 files changed, 22 insertions(+), 2 deletions(-)
arch/arm/cpu/pxa/cpuinfo.c +0 -0
index f1cdd40..bab6340 100644

arch/arm/cpu/pxa/cpuinfo.c line 30

Quoted 8 lines
arch/arm/cpu/pxa/cpuinfo.c +4 -1
@@ -24,9 +24,11 @@
 #include <errno.h>
 #include <linux/compiler.h>
 
-#define	CPU_MASK_PXA_REVID	0x00f
+#define	CPU_MASK_PXA_PRODID	0x000003f0
+#define	CPU_MASK_PXA_REVID	0x0000000f
+
+#define	CPU_MASK_PRODREV	(CPU_MASK_PXA_PRODID | 

CPU_MASK_PXA_REVID)

Quoted 33 lines
arch/arm/cpu/pxa/cpuinfo.c +5 -1
-#define	CPU_MASK_PXA_PRODID	0x3f0
 #define	CPU_VALUE_PXA25X	0x100
 #define	CPU_VALUE_PXA27X	0x110
 
@@ -51,6 +53,11 @@ int cpu_is_pxa27x(void)
 	return id == CPU_VALUE_PXA27X;
 }
 
+uint32_t pxa_get_cpu_revision(void)
+{
+	return pxa_get_cpuid() & CPU_MASK_PRODREV;
+}
+
 #ifdef	CONFIG_DISPLAY_CPUINFO
 static const char *pxa25x_get_revision(void)
 {
(quoted diff) +0 -0

b/arch/arm/include/asm/arch-pxa/pxa.h index 49c6552..b67d8f2 100644

arch/arm/include/asm/arch-pxa/pxa.h +8 -0
@@ -22,8 +22,21 @@
 #ifndef	__PXA_H__
 #define	__PXA_H__
 
+#define PXA255_A0	0x00000106
+#define PXA250_C0	0x00000105
+#define PXA250_B2	0x00000104
+#define PXA250_B1	0x00000103
+#define PXA250_B0	0x00000102
+#define PXA250_A1	0x00000101
+#define PXA250_A0	0x00000100
+#define PXA210_C0	0x00000125

arch/arm/include/asm/arch-pxa/pxa.h line 42

Quoted 10 lines
arch/arm/include/asm/arch-pxa/pxa.h +5 -0
+#define PXA210_B2	0x00000124
+#define PXA210_B1	0x00000123
+#define PXA210_B0	0x00000122
+
 int cpu_is_pxa25x(void);
 int cpu_is_pxa27x(void);
+uint32_t pxa_get_cpu_revision(void);
 void pxa2xx_dram_init(void);
 
 #endif	/* __PXA_H__ */

Best regards,
Marek Vasut

#36 lore raw

PATCH 4/6 usbether: Fixed bug when using with PXA25X chips

In reply to Łukasz Dałek

PXA25X chips don't support alternate settings so driver uses non-CDC driver.
But only code defined between DEV_CONFIG_CDC signals that network is up. This patch is fixing this bug by signaling that network is up after USB SET_INTERFACE request.

---
 drivers/usb/gadget/ether.c |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)
drivers/usb/gadget/ether.c +16 -1
index d975fb6..9ce2c17 100644
@@ -44,7 +44,12 @@ extern struct platform_data brd;
 
 unsigned packet_received, packet_sent;
 
-#define DEV_CONFIG_CDC	1
+#ifdef CONFIG_USB_GADGET_PXA2XX
+# undef DEV_CONFIG_CDC
+# define DEV_CONFIG_SUBSET 1
+#else
+# define DEV_CONFIG_CDC	1
+#endif
 #define GFP_ATOMIC ((gfp_t) 0)
 #define GFP_KERNEL ((gfp_t) 0)
 
@@ -864,7 +869,9 @@ static struct usb_gadget_strings	stringtab = {
 
 /*============================================================================*/
 static u8 control_req[USB_BUFSIZ];
+#if defined(DEV_CONFIG_CDC) || defined(CONFIG_USB_ETH_RNDIS)
 static u8 status_req[STATUS_BYTECOUNT] __attribute__ ((aligned(4)));
+#endif
 
 
 /**
@@ -1352,6 +1359,14 @@ eth_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
 		if (gadget_is_pxa(gadget)) {
 			value = eth_set_config(dev, DEV_CONFIG_VALUE,
 						GFP_ATOMIC);
+			/*
+			 * PXA25x driver use non-CDC ethernet gadget.
+			 * But only _CDC and _RNDIS code can signalize
+			 * that network is working. So we signalize it
+			 * here.
+			 */
+			l_ethdev.network_started = 1;
+			debug("USB network up!\n");
 			goto done_set_intf;
 		}
 
Signature · 1 line
1.7.8.6
#37 lore raw

PATCH 5/6 usbether: Define CONFIG_USB_ETH_{CDC,SUBSET}

In reply to Łukasz Dałek

Introduced CONFIG_USB_ETH_CDC and CONFIG_USB_ETH_SUBSET as preparation for removal DEV_CONFIG_CDC and DEV_CONFIG_SUBSET

---
 drivers/usb/gadget/ether.c |   19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)
drivers/usb/gadget/ether.c +14 -5
index 9ce2c17..7e6491d 100644
@@ -44,12 +44,21 @@ extern struct platform_data brd;
 
 unsigned packet_received, packet_sent;
 
-#ifdef CONFIG_USB_GADGET_PXA2XX
-# undef DEV_CONFIG_CDC
-# define DEV_CONFIG_SUBSET 1
-#else
-# define DEV_CONFIG_CDC	1
+#undef DEV_CONFIG_CDC
+#undef DEV_CONFIG_SUBSET
+
+#if !defined(CONFIG_USB_ETH_CDC) && !defined(CONFIG_USB_ETH_SUBSET)
+# define DEV_CONFIG_CDC		1	/* preserve default behavior */
+#endif
+
+#if defined(CONFIG_USB_ETH_CDC)
+# define DEV_CONFIG_CDC		1
 #endif
+
+#if defined(CONFIG_USB_ETH_SUBSET)
+# define DEV_CONFIG_SUBSET	1
+#endif
+
 #define GFP_ATOMIC ((gfp_t) 0)
 #define GFP_KERNEL ((gfp_t) 0)
 
Signature · 1 line
1.7.8.6
#38 lore raw

PATCH 6/6 usbether: Removed DEV_CONFIG_{CDC,SUBSET}

In reply to Łukasz Dałek

Removed DEV_CONFIG_CDC and DEV_CONFIG_SUBSET and replaced it with CONFIG_USB_ETH_CDC and CONFIG_USB_ETH_SUBSET.

---
 drivers/usb/gadget/ether.c |   75 +++++++++++++++++--------------------------
 1 files changed, 30 insertions(+), 45 deletions(-)
drivers/usb/gadget/ether.c +30 -45
index 7e6491d..1e187e5 100644
@@ -44,21 +44,6 @@ extern struct platform_data brd;
 
 unsigned packet_received, packet_sent;
 
-#undef DEV_CONFIG_CDC
-#undef DEV_CONFIG_SUBSET
-
-#if !defined(CONFIG_USB_ETH_CDC) && !defined(CONFIG_USB_ETH_SUBSET)
-# define DEV_CONFIG_CDC		1	/* preserve default behavior */
-#endif
-
-#if defined(CONFIG_USB_ETH_CDC)
-# define DEV_CONFIG_CDC		1
-#endif
-
-#if defined(CONFIG_USB_ETH_SUBSET)
-# define DEV_CONFIG_SUBSET	1
-#endif
-
 #define GFP_ATOMIC ((gfp_t) 0)
 #define GFP_KERNEL ((gfp_t) 0)
 
@@ -174,9 +159,9 @@ static struct usb_gadget_driver eth_driver;
 /* "main" config is either CDC, or its simple subset */
 static inline int is_cdc(struct eth_dev *dev)
 {
-#if	!defined(DEV_CONFIG_SUBSET)
+#if	!defined(CONFIG_USB_ETH_SUBSET)
 	return 1;		/* only cdc possible */
-#elif	!defined(DEV_CONFIG_CDC)
+#elif	!defined(CONFIG_USB_ETH_CDC)
 	return 0;		/* only subset possible */
 #else
 	return dev->cdc;	/* depends on what hardware we found */
@@ -420,7 +405,7 @@ rndis_config = {
  * get those drivers from MCCI, or bundled with various products.
  */
 
-#ifdef	DEV_CONFIG_CDC
+#ifdef	CONFIG_USB_ETH_CDC
 static struct usb_interface_descriptor
 control_intf = {
 	.bLength =		sizeof control_intf,
@@ -459,7 +444,7 @@ static const struct usb_cdc_header_desc header_desc = {
 	.bcdCDC =		__constant_cpu_to_le16(0x0110),
 };
 
-#if defined(DEV_CONFIG_CDC) || defined(CONFIG_USB_ETH_RNDIS)
+#if defined(CONFIG_USB_ETH_CDC) || defined(CONFIG_USB_ETH_RNDIS)
 
 static const struct usb_cdc_union_desc union_desc = {
 	.bLength =		sizeof union_desc,
@@ -493,7 +478,7 @@ static const struct usb_cdc_acm_descriptor acm_descriptor = {
 
 #endif
 
-#ifndef DEV_CONFIG_CDC
+#ifndef CONFIG_USB_ETH_CDC
 
 /*
  * "SAFE" loosely follows CDC WMC MDLM, violating the spec in various
@@ -543,7 +528,7 @@ static const struct usb_cdc_ether_desc ether_desc = {
 	.bNumberPowerFilters =	0,
 };
 
-#if defined(DEV_CONFIG_CDC) || defined(CONFIG_USB_ETH_RNDIS)
+#if defined(CONFIG_USB_ETH_CDC) || defined(CONFIG_USB_ETH_RNDIS)
 
 /*
  * include the status endpoint if we can, even where it's optional.
@@ -575,7 +560,7 @@ fs_status_desc = {
 };
 #endif
 
-#ifdef	DEV_CONFIG_CDC
+#ifdef	CONFIG_USB_ETH_CDC
 
 /* the default data interface has no endpoints ... */
 
@@ -630,7 +615,7 @@ rndis_data_intf = {
 
 #endif
 
-#ifdef DEV_CONFIG_SUBSET
+#ifdef CONFIG_USB_ETH_SUBSET
 
 /*
  * "Simple" CDC-subset option is a simple vendor-neutral model that most
@@ -676,7 +661,7 @@ fs_sink_desc = {
 
 static const struct usb_descriptor_header *fs_eth_function[11] = {
 	(struct usb_descriptor_header *) &otg_descriptor,
-#ifdef DEV_CONFIG_CDC
+#ifdef CONFIG_USB_ETH_CDC
 	/* "cdc" mode descriptors */
 	(struct usb_descriptor_header *) &control_intf,
 	(struct usb_descriptor_header *) &header_desc,
@@ -690,12 +675,12 @@ static const struct usb_descriptor_header *fs_eth_function[11] = {
 	(struct usb_descriptor_header *) &fs_source_desc,
 	(struct usb_descriptor_header *) &fs_sink_desc,
 	NULL,
-#endif /* DEV_CONFIG_CDC */
+#endif /* CONFIG_USB_ETH_CDC */
 };
 
 static inline void fs_subset_descriptors(void)
 {
-#ifdef DEV_CONFIG_SUBSET
+#ifdef CONFIG_USB_ETH_SUBSET
 	/* behavior is "CDC Subset"; extra descriptors say "SAFE" */
 	fs_eth_function[1] = (struct usb_descriptor_header *) &subset_data_intf;
 	fs_eth_function[2] = (struct usb_descriptor_header *) &header_desc;
@@ -733,7 +718,7 @@ static const struct usb_descriptor_header *fs_rndis_function[] = {
  * descriptors, unless they only run at full speed.
  */
 
-#if defined(DEV_CONFIG_CDC) || defined(CONFIG_USB_ETH_RNDIS)
+#if defined(CONFIG_USB_ETH_CDC) || defined(CONFIG_USB_ETH_RNDIS)
 static struct usb_endpoint_descriptor
 hs_status_desc = {
 	.bLength =		USB_DT_ENDPOINT_SIZE,
@@ -743,7 +728,7 @@ hs_status_desc = {
 	.wMaxPacketSize =	__constant_cpu_to_le16(STATUS_BYTECOUNT),
 	.bInterval =		LOG2_STATUS_INTERVAL_MSEC + 4,
 };
-#endif /* DEV_CONFIG_CDC */
+#endif /* CONFIG_USB_ETH_CDC */
 
 static struct usb_endpoint_descriptor
 hs_source_desc = {
@@ -776,7 +761,7 @@ dev_qualifier = {
 
 static const struct usb_descriptor_header *hs_eth_function[11] = {
 	(struct usb_descriptor_header *) &otg_descriptor,
-#ifdef DEV_CONFIG_CDC
+#ifdef CONFIG_USB_ETH_CDC
 	/* "cdc" mode descriptors */
 	(struct usb_descriptor_header *) &control_intf,
 	(struct usb_descriptor_header *) &header_desc,
@@ -790,12 +775,12 @@ static const struct usb_descriptor_header *hs_eth_function[11] = {
 	(struct usb_descriptor_header *) &hs_source_desc,
 	(struct usb_descriptor_header *) &hs_sink_desc,
 	NULL,
-#endif /* DEV_CONFIG_CDC */
+#endif /* CONFIG_USB_ETH_CDC */
 };
 
 static inline void hs_subset_descriptors(void)
 {
-#ifdef DEV_CONFIG_SUBSET
+#ifdef CONFIG_USB_ETH_SUBSET
 	/* behavior is "CDC Subset"; extra descriptors say "SAFE" */
 	hs_eth_function[1] = (struct usb_descriptor_header *) &subset_data_intf;
 	hs_eth_function[2] = (struct usb_descriptor_header *) &header_desc;
@@ -857,11 +842,11 @@ static struct usb_string		strings[] = {
 	{ STRING_SERIALNUMBER,	serial_number, },
 	{ STRING_DATA,		"Ethernet Data", },
 	{ STRING_ETHADDR,	ethaddr, },
-#ifdef	DEV_CONFIG_CDC
+#ifdef	CONFIG_USB_ETH_CDC
 	{ STRING_CDC,		"CDC Ethernet", },
 	{ STRING_CONTROL,	"CDC Communications Control", },
 #endif
-#ifdef	DEV_CONFIG_SUBSET
+#ifdef	CONFIG_USB_ETH_SUBSET
 	{ STRING_SUBSET,	"CDC Ethernet Subset", },
 #endif
 #ifdef	CONFIG_USB_ETH_RNDIS
@@ -878,7 +863,7 @@ static struct usb_gadget_strings	stringtab = {
 
 /*============================================================================*/
 static u8 control_req[USB_BUFSIZ];
-#if defined(DEV_CONFIG_CDC) || defined(CONFIG_USB_ETH_RNDIS)
+#if defined(CONFIG_USB_ETH_CDC) || defined(CONFIG_USB_ETH_RNDIS)
 static u8 status_req[STATUS_BYTECOUNT] __attribute__ ((aligned(4)));
 #endif
 
@@ -967,7 +952,7 @@ set_ether_config(struct eth_dev *dev, gfp_t gfp_flags)
 	int					result = 0;
 	struct usb_gadget			*gadget = dev->gadget;
 
-#if defined(DEV_CONFIG_CDC) || defined(CONFIG_USB_ETH_RNDIS)
+#if defined(CONFIG_USB_ETH_CDC) || defined(CONFIG_USB_ETH_RNDIS)
 	/* status endpoint used for RNDIS and (optionally) CDC */
 	if (!subset_active(dev) && dev->status_ep) {
 		dev->status = ep_desc(gadget, &hs_status_desc,
@@ -1148,7 +1133,7 @@ static int eth_set_config(struct eth_dev *dev, unsigned number,
 
 /*-------------------------------------------------------------------------*/
 
-#ifdef	DEV_CONFIG_CDC
+#ifdef	CONFIG_USB_ETH_CDC
 
 /*
  * The interrupt endpoint is used in CDC networking models (Ethernet, ATM)
@@ -1379,7 +1364,7 @@ eth_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
 			goto done_set_intf;
 		}
 
-#ifdef DEV_CONFIG_CDC
+#ifdef CONFIG_USB_ETH_CDC
 		switch (wIndex) {
 		case 0:		/* control/master intf */
 			if (wValue != 0)
@@ -1421,7 +1406,7 @@ eth_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
 		 * all non-PXA hardware talks real CDC ...
 		 */
 		debug("set_interface ignored!\n");
-#endif /* DEV_CONFIG_CDC */
+#endif /* CONFIG_USB_ETH_CDC */
 
 done_set_intf:
 		break;
@@ -1444,7 +1429,7 @@ done_set_intf:
 		value = min(wLength, (u16) 1);
 		break;
 
-#ifdef DEV_CONFIG_CDC
+#ifdef CONFIG_USB_ETH_CDC
 	case USB_CDC_SET_ETHERNET_PACKET_FILTER:
 		/*
 		 * see 6.2.30: no data, wIndex = interface,
@@ -1468,7 +1453,7 @@ done_set_intf:
 	 * case USB_CDC_GET_ETHERNET_STATISTIC:
 	 */
 
-#endif /* DEV_CONFIG_CDC */
+#endif /* CONFIG_USB_ETH_CDC */
 
 #ifdef CONFIG_USB_ETH_RNDIS
 	/*
@@ -2039,7 +2024,7 @@ static int eth_bind(struct usb_gadget *gadget)
 	u8			tmp[7];
 
 	/* these flags are only ever cleared; compiler take note */
-#ifndef	DEV_CONFIG_CDC
+#ifndef	CONFIG_USB_ETH_CDC
 	cdc = 0;
 #endif
 #ifndef	CONFIG_USB_ETH_RNDIS
@@ -2151,7 +2136,7 @@ autoconf_fail:
 		goto autoconf_fail;
 	out_ep->driver_data = out_ep;	/* claim */
 
-#if defined(DEV_CONFIG_CDC) || defined(CONFIG_USB_ETH_RNDIS)
+#if defined(CONFIG_USB_ETH_CDC) || defined(CONFIG_USB_ETH_RNDIS)
 	/*
 	 * CDC Ethernet control interface doesn't require a status endpoint.
 	 * Since some hosts expect one, try to allocate one anyway.
@@ -2163,7 +2148,7 @@ autoconf_fail:
 		} else if (rndis) {
 			error("can't run RNDIS on %s", gadget->name);
 			return -ENODEV;
-#ifdef DEV_CONFIG_CDC
+#ifdef CONFIG_USB_ETH_CDC
 		} else if (cdc) {
 			control_intf.bNumEndpoints = 0;
 			/* FIXME remove endpoint from descriptor list */
@@ -2206,7 +2191,7 @@ autoconf_fail:
 				fs_source_desc.bEndpointAddress;
 		hs_sink_desc.bEndpointAddress =
 				fs_sink_desc.bEndpointAddress;
-#if defined(DEV_CONFIG_CDC) || defined(CONFIG_USB_ETH_RNDIS)
+#if defined(CONFIG_USB_ETH_CDC) || defined(CONFIG_USB_ETH_RNDIS)
 		if (status_ep)
 			hs_status_desc.bEndpointAddress =
 					fs_status_desc.bEndpointAddress;
@@ -2275,7 +2260,7 @@ autoconf_fail:
 	dev->req->complete = eth_setup_complete;
 
 	/* ... and maybe likewise for status transfer */
-#if defined(DEV_CONFIG_CDC) || defined(CONFIG_USB_ETH_RNDIS)
+#if defined(CONFIG_USB_ETH_CDC) || defined(CONFIG_USB_ETH_RNDIS)
 	if (dev->status_ep) {
 		dev->stat_req = usb_ep_alloc_request(dev->status_ep,
 							GFP_KERNEL);
Signature · 1 line
1.7.8.6
#39 lore raw

cover iPAQ h2200 support

In reply to Łukasz Dałek

Dear ?ukasz Da?ek,

Quoted 7 lines

This is set of patches adding support for iPAQ h2200 device

Ad. [PATCH 1/6] h2200: Add support for iPAQ h2200 I've added device id to the mach-types.h file. But I'm pretty sure this is the bad way. The id I took from
http://www.arm.linux.org.uk/developer/machines/list.php?id=341

Quoted 5 lines

Device's 1st stage bootloader requires from 2nd stage loader specific header which I've defined in file h2200-header.S. For now it is build to h2200-header.bin which has to be concatenated with u-boot.bin (cat h2200-header.bin u-boot.bin > u-boot.rdy). I don't know how I can do this another way.

Via some basic-level linker voodoo.

Quoted 1 line

One more, can I add to device folder

directory, this is unix

Quoted 3 lines

program which generates packed
binary with header which device's rescue bootloader can flash into memory?

Show the code, we'll tell you. You usually use mkimage-plugin-stuffs to do this.

Quoted 26 lines

Ad. [PATCH 3/6] pxa: Add some stuff to examine cpu model and rev This patch shuld be already in pxa tree but it's not. Maybe I overlooked or sth. If so I'm sorry for sending it again.

?ukasz Da?ek (6):
h2200: Add support for iPAQ h2200
pxa25x: Add USB Ethernet driver
pxa: Add some stuff to examine cpu model and rev
usbether: Fixed bug when using with PXA25X chips
usbether: Define CONFIG_USB_ETH_{CDC,SUBSET}
usbether: Removed DEV_CONFIG_{CDC,SUBSET}

 arch/arm/cpu/pxa/cpuinfo.c          |   11 +-
 arch/arm/include/asm/arch-pxa/pxa.h |   13 +
 arch/arm/include/asm/mach-types.h   |    1 +
 board/h2200/Makefile                |   51 +
 board/h2200/h2200-header.S          |   27 +
 board/h2200/h2200.c                 |  197 ++++
 board/h2200/h2200.h                 |   28 +
 boards.cfg                          |    2 +
 drivers/usb/gadget/Makefile         |    1 +
 drivers/usb/gadget/ether.c          |   69 +-
 drivers/usb/gadget/pxa25x_udc.c     | 2059
+++++++++++++++++++++++++++++++++++ drivers/usb/gadget/pxa25x_udc.h     | 
162 +++
 include/configs/h2200.h             |  168 +++
Quoted 8 lines
 13 files changed, 2757 insertions(+), 32 deletions(-)
 create mode 100644 board/h2200/Makefile
 create mode 100644 board/h2200/h2200-header.S
 create mode 100644 board/h2200/h2200.c
 create mode 100644 board/h2200/h2200.h
 create mode 100644 drivers/usb/gadget/pxa25x_udc.c
 create mode 100644 drivers/usb/gadget/pxa25x_udc.h
 create mode 100644 include/configs/h2200.h

Best regards,
Marek Vasut

#40 lore raw

cover iPAQ h2200 support

In reply to Łukasz Dałek

Dear ?ukasz Da?ek,

Quoted 5 lines · ?ukasz Da?ek

Device's 1st stage bootloader requires from 2nd stage loader specific header which I've defined in file h2200-header.S. For now it is build to h2200-header.bin which has to be concatenated with u-boot.bin (cat h2200-header.bin u-boot.bin > u-boot.rdy). I don't know how I can do this another way.

Others added this feature to mkimage (imximage, omapimage, kwbimage, ...)

Quoted 3 lines

One more, can I add to device folder program which generates packed binary with header which device's rescue bootloader can flash into memory?

I think mkimage is the right place. Just add a rule to Makefiles to finalize your u-boot.bin to a whatever called binary by utilizing mkimage.

Best regards

Andreas Bie?mann