aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVimal Singh <vimalsingh@ti.com>2010-02-15 13:03:34 -0500
committerTony Lindgren <tony@atomide.com>2010-02-15 13:03:34 -0500
commit88c8460ac32283e2a25e36e4670ff5ab02f3b521 (patch)
tree3405724c8b27911136e557a5d6efbea0c2805790
parentc2798e9342a1394de966c31703e0410ee3988378 (diff)
omap3: Add support for flash on 3430SDP board
This patch adds support for flashes on 3430SDP boards. All three NAND, NOR and OneNAND are supported. I have tested it on 3430SDP (ES2 and ES3.1). This patch can be treated as an example to "how to utilize": 'gpmc-nand.c' and 'board-sdp-flash.c'. Similar patches can be created for 2430sdp and 3630sdp or any other similar board. Signed-off-by: Vimal Singh <vimalsingh@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
-rw-r--r--arch/arm/mach-omap2/Makefile3
-rw-r--r--arch/arm/mach-omap2/board-3430sdp.c111
2 files changed, 113 insertions, 1 deletions
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 0b17dca695f..af5853f13c7 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -100,7 +100,8 @@ obj-$(CONFIG_MACH_OMAP3EVM) += board-omap3evm.o \
100obj-$(CONFIG_MACH_OMAP3_PANDORA) += board-omap3pandora.o \ 100obj-$(CONFIG_MACH_OMAP3_PANDORA) += board-omap3pandora.o \
101 mmc-twl4030.o 101 mmc-twl4030.o
102obj-$(CONFIG_MACH_OMAP_3430SDP) += board-3430sdp.o \ 102obj-$(CONFIG_MACH_OMAP_3430SDP) += board-3430sdp.o \
103 mmc-twl4030.o 103 mmc-twl4030.o \
104 board-sdp-flash.o
104obj-$(CONFIG_MACH_NOKIA_N8X0) += board-n8x0.o 105obj-$(CONFIG_MACH_NOKIA_N8X0) += board-n8x0.o
105obj-$(CONFIG_MACH_NOKIA_RX51) += board-rx51.o \ 106obj-$(CONFIG_MACH_NOKIA_RX51) += board-rx51.o \
106 board-rx51-sdram.o \ 107 board-rx51-sdram.o \
diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
index eda4f6448cc..2e38e5bc1cc 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -41,6 +41,8 @@
41#include <plat/control.h> 41#include <plat/control.h>
42#include <plat/gpmc-smc91x.h> 42#include <plat/gpmc-smc91x.h>
43 43
44#include <mach/board-sdp.h>
45
44#include "mux.h" 46#include "mux.h"
45#include "sdram-qimonda-hyb18m512160af-6.h" 47#include "sdram-qimonda-hyb18m512160af-6.h"
46#include "mmc-twl4030.h" 48#include "mmc-twl4030.h"
@@ -650,6 +652,114 @@ static struct omap_board_mux board_mux[] __initdata = {
650#define board_mux NULL 652#define board_mux NULL
651#endif 653#endif
652 654
655static struct mtd_partition sdp_nor_partitions[] = {
656 /* bootloader (U-Boot, etc) in first sector */
657 {
658 .name = "Bootloader-NOR",
659 .offset = 0,
660 .size = SZ_256K,
661 .mask_flags = MTD_WRITEABLE, /* force read-only */
662 },
663 /* bootloader params in the next sector */
664 {
665 .name = "Params-NOR",
666 .offset = MTDPART_OFS_APPEND,
667 .size = SZ_256K,
668 .mask_flags = 0,
669 },
670 /* kernel */
671 {
672 .name = "Kernel-NOR",
673 .offset = MTDPART_OFS_APPEND,
674 .size = SZ_2M,
675 .mask_flags = 0
676 },
677 /* file system */
678 {
679 .name = "Filesystem-NOR",
680 .offset = MTDPART_OFS_APPEND,
681 .size = MTDPART_SIZ_FULL,
682 .mask_flags = 0
683 }
684};
685
686static struct mtd_partition sdp_onenand_partitions[] = {
687 {
688 .name = "X-Loader-OneNAND",
689 .offset = 0,
690 .size = 4 * (64 * 2048),
691 .mask_flags = MTD_WRITEABLE /* force read-only */
692 },
693 {
694 .name = "U-Boot-OneNAND",
695 .offset = MTDPART_OFS_APPEND,
696 .size = 2 * (64 * 2048),
697 .mask_flags = MTD_WRITEABLE /* force read-only */
698 },
699 {
700 .name = "U-Boot Environment-OneNAND",
701 .offset = MTDPART_OFS_APPEND,
702 .size = 1 * (64 * 2048),
703 },
704 {
705 .name = "Kernel-OneNAND",
706 .offset = MTDPART_OFS_APPEND,
707 .size = 16 * (64 * 2048),
708 },
709 {
710 .name = "File System-OneNAND",
711 .offset = MTDPART_OFS_APPEND,
712 .size = MTDPART_SIZ_FULL,
713 },
714};
715
716static struct mtd_partition sdp_nand_partitions[] = {
717 /* All the partition sizes are listed in terms of NAND block size */
718 {
719 .name = "X-Loader-NAND",
720 .offset = 0,
721 .size = 4 * (64 * 2048),
722 .mask_flags = MTD_WRITEABLE, /* force read-only */
723 },
724 {
725 .name = "U-Boot-NAND",
726 .offset = MTDPART_OFS_APPEND, /* Offset = 0x80000 */
727 .size = 10 * (64 * 2048),
728 .mask_flags = MTD_WRITEABLE, /* force read-only */
729 },
730 {
731 .name = "Boot Env-NAND",
732
733 .offset = MTDPART_OFS_APPEND, /* Offset = 0x1c0000 */
734 .size = 6 * (64 * 2048),
735 },
736 {
737 .name = "Kernel-NAND",
738 .offset = MTDPART_OFS_APPEND, /* Offset = 0x280000 */
739 .size = 40 * (64 * 2048),
740 },
741 {
742 .name = "File System - NAND",
743 .size = MTDPART_SIZ_FULL,
744 .offset = MTDPART_OFS_APPEND, /* Offset = 0x780000 */
745 },
746};
747
748static struct flash_partitions sdp_flash_partitions[] = {
749 {
750 .parts = sdp_nor_partitions,
751 .nr_parts = ARRAY_SIZE(sdp_nor_partitions),
752 },
753 {
754 .parts = sdp_onenand_partitions,
755 .nr_parts = ARRAY_SIZE(sdp_onenand_partitions),
756 },
757 {
758 .parts = sdp_nand_partitions,
759 .nr_parts = ARRAY_SIZE(sdp_nand_partitions),
760 },
761};
762
653static void __init omap_3430sdp_init(void) 763static void __init omap_3430sdp_init(void)
654{ 764{
655 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); 765 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
@@ -666,6 +776,7 @@ static void __init omap_3430sdp_init(void)
666 omap_serial_init(); 776 omap_serial_init();
667 usb_musb_init(); 777 usb_musb_init();
668 board_smc91x_init(); 778 board_smc91x_init();
779 sdp_flash_init(sdp_flash_partitions);
669 sdp3430_display_init(); 780 sdp3430_display_init();
670 enable_board_wakeup_source(); 781 enable_board_wakeup_source();
671 usb_ehci_init(&ehci_pdata); 782 usb_ehci_init(&ehci_pdata);