Skip to contentSkip to conversation

1/4] orion/kirkwood: add RnB line support to orion mtd driver

PATCH New Ben Dooks 1 participant 2 messages Apr 20, 2010 1 message not in the archive

Subsystems (5)
lore
Share & tools
lore

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

Ben Dooks

author
#1 lore raw

PATCH 1/1 1/4] orion/kirkwood: add RnB line support to orion mtd driver

Add support for a board to register a callback to get the state of the RnB line if it has it attached.

arch/arm/plat-orion/include/plat/orion_nand.h +1 -0
Index: linux-2.6-2.6.32.9/arch/arm/plat-orion/include/plat/orion_nand.h
===================================================================
@@ -14,6 +14,7 @@
  */
 struct orion_nand_data {
 	struct mtd_partition *parts;
+	int (*dev_ready)(struct mtd_info *mtd);
 	u32 nr_parts;
 	u8 ale;		/* address line number connected to ALE */
 	u8 cle;		/* address line number connected to CLE */
drivers/mtd/nand/orion_nand.c +3 -0
Index: linux-2.6-2.6.32.9/drivers/mtd/nand/orion_nand.c
===================================================================
@@ -114,6 +114,9 @@
 	if (board->width == 16)
 		nc->options |= NAND_BUSWIDTH_16;
 
+	if (board->dev_ready)
+		nc->dev_ready = board->dev_ready;
+
 	platform_set_drvdata(pdev, mtd);
 
 	if (nand_scan(mtd, 1)) {
author
#2 lore raw

PATCH 1/1 2/4] kirkwood: allow machines to register RnB callback

In reply to a message not in the archive

Add a kirkwood_nand_init_rnb() call to allow boards which have RnB line detection to register this instead of a static delay.

arch/arm/mach-kirkwood/common.c +9 -0
Index: linux-2.6-2.6.32.9/arch/arm/mach-kirkwood/common.c
===================================================================
@@ -305,6 +305,15 @@
 	platform_device_register(&kirkwood_nand_flash);
 }
 
+void __init kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts,
+				   int (*dev_ready)(struct mtd_info *))
+{
+	kirkwood_clk_ctrl |= CGC_RUNIT;
+	kirkwood_nand_data.parts = parts;
+	kirkwood_nand_data.nr_parts = nr_parts;
+	kirkwood_nand_data.dev_ready = dev_ready;
+	platform_device_register(&kirkwood_nand_flash);
+}
 
 /*****************************************************************************
  * SoC RTC
arch/arm/mach-kirkwood/common.h +2 -0
Index: linux-2.6-2.6.32.9/arch/arm/mach-kirkwood/common.h
===================================================================
@@ -16,6 +16,7 @@
 struct mv_sata_platform_data;
 struct mvsdio_platform_data;
 struct mtd_partition;
+struct mtd_info;
 
 /*
  * Basic Kirkwood init functions used early by machine-setup.
@@ -41,6 +42,7 @@
 void kirkwood_uart0_init(void);
 void kirkwood_uart1_init(void);
 void kirkwood_nand_init(struct mtd_partition *parts, int nr_parts, int delay);
+void kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts, int (*dev_ready)(struct mtd_info *));
 
 extern int kirkwood_tclk;
 extern struct sys_timer kirkwood_timer;