Skip to contentSkip to conversation

qemu-malta nor flash support

PATCH In review Jean-Christophe PLAGNIOL-VILLARD 2 participants 5 messages Apr 30, 2012 – May 1, 2012 MIPS

lore
Share & tools
lore
#0 lore raw

cover qemu-malta nor flash support

Hi,

The following patch serie add CFI flash support

The following changes since commit 6b489256ee1358973d536e723c77c2483e6b9f5b:

Makefile: add barebox.srec to 'clean' (2012-04-30 14:01:34 +0200)

are available in the git repository at:

git://git.jcrosoft.org/barebox.git tags/malta-cfi-flash

for you to fetch changes up to 37a97ca3fce6a92e25e7855359270f83548793bd:

qemu-malta: add nor flash support (2012-04-30 20:16:28 +0800)

----------------------------------------------------------------
Mips: malta add cfi flash support

----------------------------------------------------------------
Jean-Christophe PLAGNIOL-VILLARD (3):
mips: add in_be16/32 and out_be16/32 for cfi support
qemu-malta: rename serial.c to init.c
qemu-malta: add nor flash support

 arch/mips/boards/qemu-malta/Makefile             |    2 +-
 arch/mips/boards/qemu-malta/{serial.c => init.c} |   14 ++++++++++++++
 arch/mips/configs/qemu-malta_defconfig           |    5 +++++
 arch/mips/include/asm/io.h                       |    5 +++++
 4 files changed, 25 insertions(+), 1 deletions(-)
 rename arch/mips/boards/qemu-malta/{serial.c => init.c} (76%)

Best Regards,
J.

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#1 lore raw

PATCH 1/3 mips: add in_be16/32 and out_be16/32 for cfi support

---
 arch/mips/include/asm/io.h |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
arch/mips/include/asm/io.h +5 -0
index 5e12860..4100e1e 100644
@@ -71,4 +71,9 @@ static inline void __raw_writel(u32 b, volatile void __iomem *addr)
 #define writew(b,addr) __raw_writew(__cpu_to_le16(b),addr)
 #define writel(b,addr) __raw_writel(__cpu_to_le32(b),addr)
 
+#define in_be16(a)	__be16_to_cpu(__raw_readw(a))
+#define in_be32(a)	__be32_to_cpu(__raw_readl(a))
+#define out_be16(a, v)	__raw_writew(__cpu_to_be16(v), a)
+#define out_be32(a, v)	__raw_writel(__cpu_to_be32(v), a)
+
 #endif	/* __ASM_MIPS_IO_H */
Signature · 7 lines
1.7.9.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#3 lore raw

PATCH 3/3 qemu-malta: add nor flash support

In reply to Jean-Christophe PLAGNIOL-VILLARD
---
 arch/mips/boards/qemu-malta/init.c     |   13 +++++++++++++
 arch/mips/configs/qemu-malta_defconfig |    5 +++++
 2 files changed, 18 insertions(+), 0 deletions(-)
arch/mips/boards/qemu-malta/init.c +13 -0
index 502b346..4709989 100644
@@ -25,8 +25,21 @@
 #include <ns16550.h>
 #include <mach/hardware.h>
 #include <io.h>
+#include <partition.h>
+#include <sizes.h>
 #include <asm/common.h>
 
+static int malta_devices_init(void)
+{
+	add_cfi_flash_device(0, 0x1e000000, SZ_4M, 0);
+
+	devfs_add_partition("nor0", 0x0, SZ_512K, PARTITION_FIXED, "self");
+	devfs_add_partition("nor0", SZ_512K, SZ_64K, PARTITION_FIXED, "env0");
+
+	return 0;
+}
+device_initcall(malta_devices_init);
+
 static struct NS16550_plat serial_plat = {
 	.clock = 1843200, /* no matter for emulated port */
 	.shift = 0,
arch/mips/configs/qemu-malta_defconfig +5 -0
index eac21e7..50e0dc4 100644
@@ -50,6 +50,11 @@ CONFIG_NET_TFTP_PUSH=y
 CONFIG_NET_NETCONSOLE=y
 CONFIG_NET_RESOLV=y
 # CONFIG_SPI is not set
+CONFIG_DRIVER_CFI=y
+# CONFIG_DRIVER_CFI_AMD is not set
+# CONFIG_DRIVER_CFI_BANK_WIDTH_1 is not set
+# CONFIG_DRIVER_CFI_BANK_WIDTH_2 is not set
+CONFIG_CFI_BUFFER_WRITE=y
 CONFIG_MTD=y
 CONFIG_FS_CRAMFS=y
 CONFIG_FS_FAT=y
Signature · 7 lines
1.7.9.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#2 lore raw

PATCH 2/3 qemu-malta: rename serial.c to init.c

In reply to Jean-Christophe PLAGNIOL-VILLARD

as the garbage collector will remove the empty function and the add_ns16550_device is a empty inline if the driver is not enabled.

This will simplify add device adding.

---
 arch/mips/boards/qemu-malta/Makefile             |    2 +-
 arch/mips/boards/qemu-malta/{serial.c => init.c} |    0
 2 files changed, 1 insertions(+), 1 deletions(-)
 rename arch/mips/boards/qemu-malta/{serial.c => init.c} (100%)
arch/mips/boards/qemu-malta/Makefile +1 -1
index ff1a655..eb072c0 100644
@@ -1 +1 @@
-obj-$(CONFIG_DRIVER_SERIAL_NS16550) += serial.o
+obj-y += init.o
arch/mips/boards/qemu-malta/init.c renamed from arch/mips/boards/qemu-malta/serial.c +0 -0
similarity index 100%
rename from arch/mips/boards/qemu-malta/serial.c
rename to arch/mips/boards/qemu-malta/init.c
Signature · 7 lines
1.7.9.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#4 lore raw
In reply to Jean-Christophe PLAGNIOL-VILLARD
Quoted 6 lines · Jean-Christophe PLAGNIOL-VILLARD

Hi,

The following patch serie add CFI flash support

The following changes since commit 6b489256ee1358973d536e723c77c2483e6b9f5b:

Quoted 7 lines

Makefile: add barebox.srec to 'clean' (2012-04-30 14:01:34 +0200)

are available in the git repository at:

git://git.jcrosoft.org/barebox.git tags/malta-cfi-flash

for you to fetch changes up to 37a97ca3fce6a92e25e7855359270f83548793bd:

Pulled, thanks.

Sascha

Quoted 27 lines

qemu-malta: add nor flash support (2012-04-30 20:16:28 +0800)

----------------------------------------------------------------
Mips: malta add cfi flash support

----------------------------------------------------------------
Jean-Christophe PLAGNIOL-VILLARD (3):
mips: add in_be16/32 and out_be16/32 for cfi support
qemu-malta: rename serial.c to init.c
qemu-malta: add nor flash support

 arch/mips/boards/qemu-malta/Makefile             |    2 +-
 arch/mips/boards/qemu-malta/{serial.c => init.c} |   14 ++++++++++++++
 arch/mips/configs/qemu-malta_defconfig           |    5 +++++
 arch/mips/include/asm/io.h                       |    5 +++++
 4 files changed, 25 insertions(+), 1 deletions(-)
 rename arch/mips/boards/qemu-malta/{serial.c => init.c} (76%)

Best Regards,
J.

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox