From 9bb60132610acb4b17bf1500b4916130eb46808a Mon Sep 17 00:00:00 2001 From: yosiokat Date: Wed, 17 Oct 2007 11:37:35 +0000 Subject: [PATCH] =?UTF-8?q?NAND=E3=83=95=E3=82=A9=E3=83=BC=E3=83=9E?= =?UTF-8?q?=E3=83=83=E3=82=BF=E3=83=BC=E3=81=AE=E8=BF=BD=E5=8A=A0=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlIPL/trunk@51 b08762b0-b915-fc4b-9d8c-17b2551a87ff --- build/nand_formatter/ARM7/Makefile | 53 ++ .../ARM7/formatter_sub.lcf.template | 897 ++++++++++++++++++ build/nand_formatter/ARM7/formatter_sub.lsf | 78 ++ .../ARM7/formatter_sub.response.template | 40 + build/nand_formatter/ARM7/src/dummy.EXTWRAM.c | 27 + build/nand_formatter/ARM7/src/dummy.FLXMAIN.c | 27 + build/nand_formatter/ARM7/src/dummy.FLXWRAM.c | 27 + build/nand_formatter/ARM7/src/dummy.LTDMAIN.c | 27 + build/nand_formatter/ARM7/src/dummy.LTDWRAM.c | 27 + build/nand_formatter/ARM7/src/main.c | 311 ++++++ build/nand_formatter/ARM9/Makefile | 42 + build/nand_formatter/ARM9/src/main.c | 89 ++ build/nand_formatter/Makefile | 34 + 13 files changed, 1679 insertions(+) create mode 100644 build/nand_formatter/ARM7/Makefile create mode 100644 build/nand_formatter/ARM7/formatter_sub.lcf.template create mode 100644 build/nand_formatter/ARM7/formatter_sub.lsf create mode 100644 build/nand_formatter/ARM7/formatter_sub.response.template create mode 100644 build/nand_formatter/ARM7/src/dummy.EXTWRAM.c create mode 100644 build/nand_formatter/ARM7/src/dummy.FLXMAIN.c create mode 100644 build/nand_formatter/ARM7/src/dummy.FLXWRAM.c create mode 100644 build/nand_formatter/ARM7/src/dummy.LTDMAIN.c create mode 100644 build/nand_formatter/ARM7/src/dummy.LTDWRAM.c create mode 100644 build/nand_formatter/ARM7/src/main.c create mode 100644 build/nand_formatter/ARM9/Makefile create mode 100644 build/nand_formatter/ARM9/src/main.c create mode 100644 build/nand_formatter/Makefile diff --git a/build/nand_formatter/ARM7/Makefile b/build/nand_formatter/ARM7/Makefile new file mode 100644 index 00000000..74fca805 --- /dev/null +++ b/build/nand_formatter/ARM7/Makefile @@ -0,0 +1,53 @@ +#! make -f +#---------------------------------------------------------------------------- +# Project: TwlIPL +# File: Makefile +# +# Copyright 2007 Nintendo. All rights reserved. +# +# These coded instructions, statements, and computer programs contain +# proprietary information of Nintendo of America Inc. and/or Nintendo +# Company Ltd., and are protected by Federal copyright law. They may +# not be disclosed to third parties or copied or duplicated in any form, +# in whole or in part, without the prior written consent of Nintendo. +# +# $Date:: 2007-10-09#$ +# $Rev: 1486 $ +# $Author: terui $ +#---------------------------------------------------------------------------- + +TARGET_PLATFORM = TWL +TWL_ARCHGEN = LIMITED +TWL_PROC = ARM7 +TWL_NO_STD_PCHDR = TRUE + +#---------------------------------------------------------------------------- + +SRCS = main.c \ + dummy.FLXMAIN.c \ + dummy.FLXWRAM.c \ + dummy.LTDMAIN.c \ + dummy.LTDWRAM.c + +TARGET_NAME = formatter_sub + +TARGET_NEF = $(TARGET_NAME).tef +LCFILE_SPEC = $(TARGET_NAME).lsf +LCFILE_TEMPLATE = $(TARGET_NAME).lcf.template +LDRES_TEMPLATE = $(TARGET_NAME).response.template + +CRT0_O = crt0.LTD.TWL.o + +#---------------------------------------------------------------------------- +include $(TWLSDK_ROOT)/build/buildtools/commondefs + +MACRO_FLAGS += -DSDK_ARM7COMP_LTD + +MAKELCF_FLAGS += -DISTD_LIBS='$(ISTD_LIBS)' + +do-build: $(TARGETS) + +#---------------------------------------------------------------------------- +include $(TWLSDK_ROOT)/build/buildtools/modulerules + +#===== End of Makefile ===== diff --git a/build/nand_formatter/ARM7/formatter_sub.lcf.template b/build/nand_formatter/ARM7/formatter_sub.lcf.template new file mode 100644 index 00000000..87fabc17 --- /dev/null +++ b/build/nand_formatter/ARM7/formatter_sub.lcf.template @@ -0,0 +1,897 @@ +#--------------------------------------------------------------------------- +# Project: TwlSDK - demos - FATFS - formatter - formatter_sub.TWL +# File: mongoose.lcf.template +# +# Copyright 2007 Nintendo. All rights reserved. +# +# These coded instructions, statements, and computer programs contain +# proprietary information of Nintendo of America Inc. and/or Nintendo +# Company Ltd., and are protected by Federal copyright law. They may +# not be disclosed to third parties or copied or duplicated in any form, +# in whole or in part, without the prior written consent of Nintendo. +# +# $Date:: $ +# $Rev$ +# $Author$ +#--------------------------------------------------------------------------- +MEMORY +{ + (RWX) : ORIGIN = , LENGTH = 0x0 > + + + (RWX) : ORIGIN = , LENGTH = 0x0 >> + + binary.AUTOLOAD_INFO (RWX) : ORIGIN = 0, LENGTH = 0x0 >> + + F (RW) : ORIGIN = 0, LENGTH = 0x0 > + F (RW) : ORIGIN = 0, LENGTH = 0x0 > + + (RWXO): ORIGIN = , LENGTH = 0x0 > + + + arena.MAIN (RW) : ORIGIN = AFTER(,), LENGTH = 0x0 + check.WORKRAM (RWX) : ORIGIN = 0x037f8000, LENGTH = 0x18000 > workram.check + check.MAINMEM (RWX) : ORIGIN = 0x02fe0000, LENGTH = 0x1c000 > mainmem.check + + binary.LTDAUTOLOAD_TOP (RW) : ORIGIN = 0, LENGTH = 0x0 > + + (RWX) : ORIGIN = , LENGTH = 0x0 >> + + binary.LTDAUTOLOAD_INFO (RWX) : ORIGIN = 0, LENGTH = 0x0 >> + + L (RW) : ORIGIN = 0, LENGTH = 0x0 > + L (RW) : ORIGIN = 0, LENGTH = 0x0 > + + (RWXO): ORIGIN = , LENGTH = 0x0 > + + + check.LTDWRAM (RWX) : ORIGIN = 0x03000000, LENGTH = 0x40000 > ltdwram.check + check.LTDMAIN (RWX) : ORIGIN = 0x02f88000, LENGTH = 0x58000 > ltdmain.check +} + +KEEP_SECTION +{ + .sinit +} + +SECTIONS +{ + ############################ STATIC ################################# + .: + { + ALIGNALL(4); + . = ALIGN(4); + + # + # Definition to refer overlay segment, when same name symbols exist in multiple overlays. + # + + SEARCH_SYMBOL ; + + + # + # TEXT BLOCK: READ ONLY + # + SDK_STATIC_START =.; + SDK_STATIC_TEXT_START =.; + #:::::::::: text/rodata + OBJECT(_start,*) + + + + + + + + + + + + + + + + + + + . = ALIGN(4); + SDK_STATIC_SINIT_START =.; + #:::::::::: ctor + + + + + + + + + + + + + WRITEW 0; + #:::::::::: ctor + SDK_STATIC_SINIT_END =.; + #:::::::::: text/rodata + SDK_STATIC_TEXT_END =.; + + # + # DATA BLOCK: READ WRITE + # + . = ALIGN(4); + SDK_STATIC_DATA_START =.; + #:::::::::: data + + + + + + + + + + + + + #:::::::::: data + SDK_STATIC_DATA_END =.; + . = ALIGN(4); + SDK_STATIC_END =.; + + SDK_STATIC_TEXT_SIZE = SDK_STATIC_TEXT_END - SDK_STATIC_TEXT_START; + SDK_STATIC_DATA_SIZE = SDK_STATIC_DATA_END - SDK_STATIC_DATA_START; + SDK_STATIC_SIZE = SDK_STATIC_END - SDK_STATIC_START; + __sinit__ = SDK_STATIC_SINIT_START; # for static initializer + + } > + + ..bss: + { + ALIGNALL(4); + . = ALIGN(4); + + # + # Definition to refer overlay segment, when same name symbols exist in multiple overlays. + # + + SEARCH_SYMBOL ; + + + # + # BSS BLOCK + # + SDK_STATIC_BSS_START =.; + #:::::::::: bss + + + + + + + + + + + + + #:::::::::: bss + . = ALIGN(4); + SDK_STATIC_BSS_END = .; + + SDK_STATIC_BSS_SIZE = SDK_STATIC_BSS_END - SDK_STATIC_BSS_START; + + } >> + + + ############################ AUTOLOADS ############################## + SDK_AUTOLOAD.MAIN.START = 0x02fe0000; + SDK_AUTOLOAD.MAIN.END = SDK_AUTOLOAD.MAIN.START; + SDK_AUTOLOAD.MAIN.BSS_END = SDK_AUTOLOAD.MAIN.START; + SDK_AUTOLOAD.MAIN.SIZE = 0; + SDK_AUTOLOAD.MAIN.BSS_SIZE = 0; + SDK_AUTOLOAD.WRAM.START = 0x037f8000; + SDK_AUTOLOAD.WRAM.END = SDK_AUTOLOAD.WRAM.START; + SDK_AUTOLOAD.WRAM.BSS_END = SDK_AUTOLOAD.WRAM.START; + SDK_AUTOLOAD.WRAM.SIZE = 0; + SDK_AUTOLOAD.WRAM.BSS_SIZE = 0; + SDK_AUTOLOAD_START = SDK_STATIC_END; + SDK_AUTOLOAD_SIZE = 0; + SDK_AUTOLOAD_NUMBER = ; + + + .: + { + ALIGNALL(4); + . = ALIGN(4); + + # + # Definition to refer overlay segment, when same name symbols exist in multiple overlays. + # + + SEARCH_SYMBOL ; + + + # + # TEXT BLOCK: READ ONLY + # + SDK_AUTOLOAD__ID =; + SDK_AUTOLOAD..ID =; + SDK_AUTOLOAD..START =.; + SDK_AUTOLOAD..TEXT_START =.; + #:::::::::: text/rodata + + + + + + + + + . = ALIGN(4); + SDK_STATIC_ETABLE_START =.; + __exception_table_start__ =.; + EXCEPTION + __exception_table_end__ =.; + SDK_STATIC_ETABLE_END =.; + + + + + + + + #:::::::::: text/rodata + SDK_AUTOLOAD..TEXT_END =.; + + # + # DATA BLOCK: READ WRITE BLOCK + # + . = ALIGN(4); + SDK_AUTOLOAD..DATA_START =.; + #:::::::::: data + + + + + + + + + + + + + + + + + + + #:::::::::: data + SDK_AUTOLOAD..DATA_END =.; + . = ALIGN(4); + SDK_AUTOLOAD..END =.; + + SDK_AUTOLOAD..TEXT_SIZE = SDK_AUTOLOAD..TEXT_END - SDK_AUTOLOAD..TEXT_START; + SDK_AUTOLOAD..DATA_SIZE = SDK_AUTOLOAD..DATA_END - SDK_AUTOLOAD..DATA_START; + SDK_AUTOLOAD..SIZE = SDK_AUTOLOAD..END - SDK_AUTOLOAD..START; + SDK_AUTOLOAD_SIZE = SDK_AUTOLOAD_SIZE + SDK_AUTOLOAD..SIZE; + + } > + + ..bss: + { + ALIGNALL(4); + . = ALIGN(4); + + # + # Definition to refer overlay segment, when same name symbols exist in multiple overlays. + # + + SEARCH_SYMBOL ; + + + # + # BSS BLOCK + # + SDK_AUTOLOAD..BSS_START = .; + #:::::::::: bss + + + + + + + + + + + + + + + + + + + #:::::::::: bss + . = ALIGN(4); + SDK_AUTOLOAD..BSS_END = .; + + SDK_AUTOLOAD..BSS_SIZE = SDK_AUTOLOAD..BSS_END - SDK_AUTOLOAD..BSS_START; + + } >> + + + + SDK_AUTOLOAD_MAIN_START = SDK_AUTOLOAD.MAIN.START; + SDK_AUTOLOAD_MAIN_END = SDK_AUTOLOAD.MAIN.END; + SDK_AUTOLOAD_MAIN_BSS_END = SDK_AUTOLOAD.MAIN.BSS_END; + SDK_AUTOLOAD_MAIN_SIZE = SDK_AUTOLOAD.MAIN.SIZE; + SDK_AUTOLOAD_MAIN_BSS_SIZE = SDK_AUTOLOAD.MAIN.BSS_SIZE; + SDK_AUTOLOAD_WRAM_START = SDK_AUTOLOAD.WRAM.START; + SDK_AUTOLOAD_WRAM_END = SDK_AUTOLOAD.WRAM.END; + SDK_AUTOLOAD_WRAM_BSS_END = SDK_AUTOLOAD.WRAM.BSS_END; + SDK_AUTOLOAD_WRAM_SIZE = SDK_AUTOLOAD.WRAM.SIZE; + SDK_AUTOLOAD_WRAM_BSS_SIZE = SDK_AUTOLOAD.WRAM.BSS_SIZE; + + ############################ AUTOLOAD_INFO ########################## + .binary.AUTOLOAD_INFO: + { + + WRITEW ADDR(.); + WRITEW SDK_AUTOLOAD..SIZE; + WRITEW SDK_AUTOLOAD..BSS_SIZE; + + + } > binary.AUTOLOAD_INFO + + SDK_AUTOLOAD_LIST = SDK_AUTOLOAD_START + SDK_AUTOLOAD_SIZE; + SDK_AUTOLOAD_LIST_END = SDK_AUTOLOAD_START + SDK_AUTOLOAD_SIZE + SIZEOF(.binary.AUTOLOAD_INFO); + SDK_AUTOLOAD_SIZE = SDK_AUTOLOAD_SIZE + SIZEOF(.binary.AUTOLOAD_INFO); + + ############################ OVERLAYS ############################### + SDK_OVERLAY_NUMBER = ; + + + .: + { + ALIGNALL(4); + . = ALIGN(4); + + # + # Definition to refer overlay segment, when same name symbols exist in multiple overlays. + # + + SEARCH_SYMBOL ; + + + # + # TEXT BLOCK: READ ONLY + # + SDK_OVERLAY__ID =; ### SEGMENT OVERLAY ID + SDK_OVERLAY..ID =; + SDK_OVERLAY..START =.; + SDK_OVERLAY..TEXT_START =.; + #:::::::::: text/rodata + + + + + + + + + + + + + + + + + + + . = ALIGN(4); + SDK_OVERLAY..SINIT_START =.; + #:::::::::: ctor + + + + + + + + + + + + + WRITEW 0; + #:::::::::: ctor + SDK_OVERLAY..SINIT_END =.; + #:::::::::: text/rodata + SDK_OVERLAY..TEXT_END =.; + + # + # DATA BLOCK: READ WRITE + # + . = ALIGN(4); + SDK_OVERLAY..DATA_START =.; + #:::::::::: data + + + + + + + + + + + + + #:::::::::: data + SDK_OVERLAY..DATA_END =.; + . = ALIGN(4); + SDK_OVERLAY..END =.; + + SDK_OVERLAY..TEXT_SIZE = SDK_OVERLAY..TEXT_END - SDK_OVERLAY..TEXT_START; + SDK_OVERLAY..DATA_SIZE = SDK_OVERLAY..DATA_END - SDK_OVERLAY..DATA_START; + SDK_OVERLAY..SIZE = SDK_OVERLAY..END - SDK_OVERLAY..START; + + } > + + ..bss: + { + ALIGNALL(4); + . = ALIGN(4); + + # + # Definition to refer overlay segment, when same name symbols exist in multiple overlays. + # + + SEARCH_SYMBOL ; + + + # + # BSS BLOCK + # + SDK_OVERLAY..BSS_START = .; + #:::::::::: bss + + + + + + + + + + + + + #:::::::::: bss + . = ALIGN(4); + SDK_OVERLAY..BSS_END = .; + + SDK_OVERLAY..BSS_SIZE = SDK_OVERLAY..BSS_END - SDK_OVERLAY..BSS_START; + + } >> + + + + ############################ ARENA ################################## + .arena.MAIN: + { + . = ALIGN(4); + SDK_SECTION_ARENA_START =.; + + } > arena.MAIN + + ############################ OVERLAYDEFS ############################ + .F: + { + ### module information + WRITEW ADDR(.); # load address + WRITEW _start; # entry address + WRITEW SDK_STATIC_SIZE + SDK_AUTOLOAD_SIZE; # size of module + WRITEW _start_AutoloadDoneCallback; # callback autoload done + + ### overlay filename + + WRITES (""); # Overlay + + + } > F + + ############################ OVERLAYTABLE ########################### + .F: + { + + WRITEW ; # overlay ID + WRITEW ADDR(.); # load address + WRITEW SDK_OVERLAY..SIZE; # size of module + WRITEW SDK_OVERLAY..BSS_SIZE; # size of bss + WRITEW SDK_OVERLAY..SINIT_START; # start address of static init + WRITEW SDK_OVERLAY..SINIT_END; # end address of static init + WRITEW ; # ROM file ID + WRITEW 0; # Reserved + + + } > F + + ############################ OTHERS ################################# + SDK_WRAM_ARENA_LO = SDK_AUTOLOAD.WRAM.BSS_END; + SDK_SUBPRIV_ARENA_LO = SDK_AUTOLOAD.MAIN.BSS_END; + SDK_IRQ_STACKSIZE = ; # allocated in WRAM + SDK_SYS_STACKSIZE = ; # allocated in WRAM + SDK_SYS_STACKSIZE_SIGN = (SDK_SYS_STACKSIZE < 0x80000000) * 2 - 1; + + .check.WORKRAM: + { + . = . + SDK_AUTOLOAD.WRAM.BSS_END - SDK_AUTOLOAD.WRAM.START + 0x080 + SDK_IRQ_STACKSIZE + SDK_SYS_STACKSIZE * SDK_SYS_STACKSIZE_SIGN; + + } > check.WORKRAM + + .check.MAINMEM: + { + . = SDK_SUBPRIV_ARENA_LO; + + } > check.MAINMEM + + ########################### LTDAUTOLOADS ############################ + SDK_LTDAUTOLOAD.LTDMAIN.START = SDK_STATIC_BSS_END; + SDK_LTDAUTOLOAD.LTDMAIN.END = SDK_LTDAUTOLOAD.LTDMAIN.START; + SDK_LTDAUTOLOAD.LTDMAIN.BSS_END = SDK_LTDAUTOLOAD.LTDMAIN.START; + SDK_LTDAUTOLOAD.LTDMAIN.SIZE = 0; + SDK_LTDAUTOLOAD.LTDMAIN.BSS_SIZE = 0; + SDK_LTDAUTOLOAD.LTDWRAM.START = 0x03000000; + SDK_LTDAUTOLOAD.LTDWRAM.END = SDK_LTDAUTOLOAD.LTDWRAM.START; + SDK_LTDAUTOLOAD.LTDWRAM.BSS_END = SDK_LTDAUTOLOAD.LTDWRAM.START; + SDK_LTDAUTOLOAD.LTDWRAM.SIZE = 0; + SDK_LTDAUTOLOAD.LTDWRAM.BSS_SIZE = 0; + SDK_LTDAUTOLOAD_TOP_START = 0x02e80000; + SDK_LTDAUTOLOAD_TOP_SIZE = 4; # STATIC 領域が無い代わりに 4 bytes のダミーがバイナリファイルの先頭に入る # + SDK_LTDAUTOLOAD_START = SDK_LTDAUTOLOAD_TOP_START + SDK_LTDAUTOLOAD_TOP_SIZE; + SDK_LTDAUTOLOAD_SIZE = 0; + SDK_LTDAUTOLOAD_NUMBER = ; + + .binary.LTDAUTOLOAD_TOP: + { + WRITEW 0xdeadbeef; + + } > binary.LTDAUTOLOAD_TOP + + + .: + { + ALIGNALL(4); + . = ALIGN(4); + + # + # Definition to refer overlay segment, when same name symbols exist in multiple overlays. + # + + SEARCH_SYMBOL ; + + + SDK_LTDAUTOLOAD__ID =; + SDK_LTDAUTOLOAD..ID =; + SDK_LTDAUTOLOAD..START =.; + # + # TEXT BLOCK: READ ONLY + # + SDK_LTDAUTOLOAD..TEXT_START =.; + #:::::::::: text/rodata + + + + + + + + + + + + + #:::::::::: text/rodata + SDK_LTDAUTOLOAD..TEXT_END =.; + + # + # DATA BLOCK: READ WRITE BLOCK + # + . = ALIGN(4); + SDK_LTDAUTOLOAD..DATA_START =.; + #:::::::::: data + + + + + + + + + + + + + + + + + + + + + + + + + #:::::::::: data + SDK_LTDAUTOLOAD..DATA_END =.; + . = ALIGN(4); + SDK_LTDAUTOLOAD..END =.; + + SDK_LTDAUTOLOAD..TEXT_SIZE = SDK_LTDAUTOLOAD..TEXT_END - SDK_LTDAUTOLOAD..TEXT_START; + SDK_LTDAUTOLOAD..DATA_SIZE = SDK_LTDAUTOLOAD..DATA_END - SDK_LTDAUTOLOAD..DATA_START; + SDK_LTDAUTOLOAD..SIZE = SDK_LTDAUTOLOAD..END - SDK_LTDAUTOLOAD..START; + SDK_LTDAUTOLOAD_SIZE = SDK_LTDAUTOLOAD_SIZE + SDK_LTDAUTOLOAD..SIZE; + + } > + + ..bss: + { + ALIGNALL(4); + . = ALIGN(4); + + # + # Definition to refer overlay segment, when same name symbols exist in multiple overlays. + # + + SEARCH_SYMBOL ; + + + # + # BSS BLOCK + # + SDK_LTDAUTOLOAD..BSS_START =.; + #:::::::::: bss + + + + + + + + + + + + + + + + + + + + + + + + + #:::::::::: bss + . = ALIGN(4); + SDK_LTDAUTOLOAD..BSS_END =.; + + SDK_LTDAUTOLOAD..BSS_SIZE = SDK_LTDAUTOLOAD..BSS_END - SDK_LTDAUTOLOAD..BSS_START; + + } >> + + + + SDK_LTDAUTOLOAD_LTDMAIN_START = SDK_LTDAUTOLOAD.LTDMAIN.START; + SDK_LTDAUTOLOAD_LTDMAIN_END = SDK_LTDAUTOLOAD.LTDMAIN.END; + SDK_LTDAUTOLOAD_LTDMAIN_BSS_END = SDK_LTDAUTOLOAD.LTDMAIN.BSS_END; + SDK_LTDAUTOLOAD_LTDMAIN_SIZE = SDK_LTDAUTOLOAD.LTDMAIN.SIZE; + SDK_LTDAUTOLOAD_LTDMAIN_BSS_SIZE = SDK_LTDAUTOLOAD.LTDMAIN.BSS_SIZE; + SDK_LTDAUTOLOAD_LTDWRAM_START = SDK_LTDAUTOLOAD.LTDWRAM.START; + SDK_LTDAUTOLOAD_LTDWRAM_END = SDK_LTDAUTOLOAD.LTDWRAM.END; + SDK_LTDAUTOLOAD_LTDWRAM_BSS_END = SDK_LTDAUTOLOAD.LTDWRAM.BSS_END; + SDK_LTDAUTOLOAD_LTDWRAM_SIZE = SDK_LTDAUTOLOAD.LTDWRAM.SIZE; + SDK_LTDAUTOLOAD_LTDWRAM_BSS_SIZE = SDK_LTDAUTOLOAD.LTDWRAM.BSS_SIZE; + + ######################### LTDAUTOLOAD_INFO ########################## + .binary.LTDAUTOLOAD_INFO: + { + + WRITEW ADDR(.); + WRITEW SDK_LTDAUTOLOAD..SIZE; + WRITEW SDK_LTDAUTOLOAD..BSS_SIZE; + + + } > binary.LTDAUTOLOAD_INFO + + SDK_LTDAUTOLOAD_LIST = SDK_LTDAUTOLOAD_START + SDK_LTDAUTOLOAD_SIZE; + SDK_LTDAUTOLOAD_LIST_END = SDK_LTDAUTOLOAD_LIST + SIZEOF(.binary.LTDAUTOLOAD_INFO); + SDK_LTDAUTOLOAD_SIZE = SDK_LTDAUTOLOAD_SIZE + SIZEOF(.binary.LTDAUTOLOAD_INFO); + + ########################### LTDOVERLAYS ############################# + SDK_LTDOVERLAY_NUMBER = ; + + + .: + { + ALIGNALL(4); + . = ALIGN(4); + + # + # Definition to refer overlay segment, when same name symbols exist in multiple overlays. + # + + SEARCH_SYMBOL ; + + + SDK_LTDOVERLAY__ID =; + SDK_LTDOVERLAY..ID =; + SDK_LTDOVERLAY..START =.; + # + # TEXT BLOCK: READ ONLY + # + SDK_LTDOVERLAY..TEXT_START =.; + #:::::::::: text/rodata + + + + + + + + + + + + + + + + + + + . = ALIGN(4); + SDK_LTDOVERLAY..SINIT_START =.; + #:::::::::: ctor + + + + + + + + + + + + + WRITEW 0; + #:::::::::: ctor + SDK_LTDOVERLAY..SINIT_END =.; + #:::::::::: text/rodata + SDK_LTDOVERLAY..TEXT_END =.; + + # + # DATA BLOCK: READ WRITE + # + . = ALIGN(4); + SDK_LTDOVERLAY..DATA_START =.; + #:::::::::: data + + + + + + + + + + + + + #:::::::::: data + SDK_LTDOVERLAY..DATA_END =.; + . = ALIGN(4); + SDK_LTDOVERLAY..END =.; + + SDK_LTDOVERLAY..TEXT_SIZE = SDK_LTDOVERLAY..TEXT_END - SDK_LTDOVERLAY..TEXT_START; + SDK_LTDOVERLAY..DATA_SIZE = SDK_LTDOVERLAY..DATA_END - SDK_LTDOVERLAY..DATA_START; + SDK_LTDOVERLAY..SIZE = SDK_LTDOVERLAY..END - SDK_LTDOVERLAY..START; + + } > + + ..bss: + { + ALIGNALL(4); + . = ALIGN(4); + + # + # Definition to refer overlay segment, when same name symbols exist in multiple overlays. + # + + SEARCH_SYMBOL ; + + + # + # BSS BLOCK + # + SDK_LTDOVERLAY..BSS_START =.; + #:::::::::: bss + + + + + + + + + + + + + #:::::::::: bss + . = ALIGN(4); + SDK_LTDOVERLAY..BSS_END =.; + + SDK_LTDOVERLAY..BSS_SIZE = SDK_LTDOVERLAY..BSS_END - SDK_LTDOVERLAY..BSS_START; + + } >> + + + + ########################## LTDOVERLAYDEFS ########################### + .L: + { + ### TWL limited extended static module information + WRITEW SDK_LTDAUTOLOAD_TOP_START; # load address + WRITEW 0; # padding + WRITEW SDK_LTDAUTOLOAD_SIZE + SDK_LTDAUTOLOAD_TOP_SIZE; # size of module + WRITEW 0; # padding + + ### TWL limited overlay filename + + WRITES (""); + + + } > L + + ######################### LTDOVERLAYTABLE ########################### + .L: + { + + WRITES # overlay ID + WRITEW ADDR(.); # load address + WRITEW SDK_LTDOVERLAY..SIZE; # size of module + WRITEW SDK_LTDOVERLAY..BSS_SIZE; # size of bss + WRITEW SDK_LTDOVERLAY..SINIT_START; # start address of static init + WRITEW SDK_LTDOVERLAY..SINIT_END; # end address of static init + WRITEW # ROM file ID + WRITEW 0; # Reserved + + + } > L + + ############################ OTHERS ################################# + .check.LTDWRAM: + { + . = SDK_LTDAUTOLOAD.LTDWRAM.BSS_END; + + } > check.LTDWRAM + + .check.LTDMAIN: + { + . = SDK_LTDAUTOLOAD.LTDMAIN.BSS_END; + + } > check.LTDMAIN + +} diff --git a/build/nand_formatter/ARM7/formatter_sub.lsf b/build/nand_formatter/ARM7/formatter_sub.lsf new file mode 100644 index 00000000..05314e09 --- /dev/null +++ b/build/nand_formatter/ARM7/formatter_sub.lsf @@ -0,0 +1,78 @@ +#---------------------------------------------------------------------------- +# Project: TwlSDK - demos - FATFS - formatter - formatter_sub +# File: mongoose.lsf +# +# Copyright 2007 Nintendo. All rights reserved. +# +# These coded insructions, statements, and computer programs contain +# proprietary information of Nintendo of America Inc. and/or Nintendo +# Company Ltd., and are protected by Federal copyright law. They may +# not be disclosed to third parties or copied or duplicated in any form, +# in whole or in part, without the prior written consent of Nintendo. +# +# $Date:: $ +# $Rev$ +# $Author$ +#---------------------------------------------------------------------------- +# +# Nitro LCF SPEC FILE +# +#-------- +Static $(TARGET_NAME) +{ + Address 0x02f88000 + Library crt0.HYB.TWL.o + StackSize 1024 1024 +} + +#-------- +Autoload WRAM +{ + Address 0x037f8000 + + Library libsubpsyscall.a \ + $(CW_LIBS) \ + libos_sp.TWL$(CODEGEN).a \ + libmi_sp.TWL$(CODEGEN).a \ + libpad_sp.TWL$(CODEGEN).a \ + libpxi_sp.TWL$(CODEGEN).a \ + libstd_sp.TWL$(CODEGEN).a \ + libexi_sp.TWL$(CODEGEN).a \ + libspi_sp.TWL$(CODEGEN).a \ + libpm_sp.TWL$(CODEGEN).a \ + libcdc_sp.TWL$(CODEGEN).a \ + libtp_sp.TWL$(CODEGEN).a \ + libtpex_sp.TWL$(CODEGEN).a \ + libnvram_sp.TWL$(CODEGEN).a \ + $(ISTD_LIBS) + + Object * (.etable) + Object * (.wram) + Object $(OBJDIR)/main.o + Object $(OBJDIR)/dummy.FLXWRAM.o +} + +#-------- +Autoload MAIN +{ + Address 0x02fe0000 + Object $(OBJDIR)/dummy.FLXMAIN.o +} + +#-------- +Ltdautoload LTDWRAM +{ + Address 0x03000000 + Object * (.ltdwram) + Object $(OBJDIR)/dummy.LTDWRAM.o +} + +#-------- +Ltdautoload LTDMAIN +{ + After $(TARGET_NAME) + Object * (.ltdmain) + Object $(OBJDIR)/dummy.LTDMAIN.o + Library libfatfs_sp.TWL$(CODEGEN).a +} + diff --git a/build/nand_formatter/ARM7/formatter_sub.response.template b/build/nand_formatter/ARM7/formatter_sub.response.template new file mode 100644 index 00000000..88b18081 --- /dev/null +++ b/build/nand_formatter/ARM7/formatter_sub.response.template @@ -0,0 +1,40 @@ + + + + + -l + + + + + + + -l + + + + -og ,0 -ol + + + + + -l + + + + + + + + -l + + + + -og ,0 -ol + + + + + -l + + diff --git a/build/nand_formatter/ARM7/src/dummy.EXTWRAM.c b/build/nand_formatter/ARM7/src/dummy.EXTWRAM.c new file mode 100644 index 00000000..0f2e61f3 --- /dev/null +++ b/build/nand_formatter/ARM7/src/dummy.EXTWRAM.c @@ -0,0 +1,27 @@ +/*---------------------------------------------------------------------------* + Project: TwlIPL + File: main.c + + Copyright 2007 Nintendo. All rights reserved. + + These coded instructions, statements, and computer programs contain + proprietary information of Nintendo of America Inc. and/or Nintendo + Company Ltd., and are protected by Federal copyright law. They may + not be disclosed to third parties or copied or duplicated in any form, + in whole or in part, without the prior written consent of Nintendo. + + $Date:: $ + $Rev$ + $Author$ + *---------------------------------------------------------------------------*/ + +#include + +extern void Dummy_EXTWRAM(void); + +void +Dummy_EXTWRAM(void) +{ + OS_Printf("Printed from extra wram area. [%p]\n", Dummy_EXTWRAM); +} + diff --git a/build/nand_formatter/ARM7/src/dummy.FLXMAIN.c b/build/nand_formatter/ARM7/src/dummy.FLXMAIN.c new file mode 100644 index 00000000..30014706 --- /dev/null +++ b/build/nand_formatter/ARM7/src/dummy.FLXMAIN.c @@ -0,0 +1,27 @@ +/*---------------------------------------------------------------------------* + Project: TwlIPL + File: main.c + + Copyright 2007 Nintendo. All rights reserved. + + These coded instructions, statements, and computer programs contain + proprietary information of Nintendo of America Inc. and/or Nintendo + Company Ltd., and are protected by Federal copyright law. They may + not be disclosed to third parties or copied or duplicated in any form, + in whole or in part, without the prior written consent of Nintendo. + + $Date:: $ + $Rev$ + $Author$ + *---------------------------------------------------------------------------*/ + +#include + +extern void Dummy_FLXMAIN(void); + +void +Dummy_FLXMAIN(void) +{ + OS_Printf("Printed from flexible main memory area. [%p]\n", Dummy_FLXMAIN); +} + diff --git a/build/nand_formatter/ARM7/src/dummy.FLXWRAM.c b/build/nand_formatter/ARM7/src/dummy.FLXWRAM.c new file mode 100644 index 00000000..75e70578 --- /dev/null +++ b/build/nand_formatter/ARM7/src/dummy.FLXWRAM.c @@ -0,0 +1,27 @@ +/*---------------------------------------------------------------------------* + Project: TwlIPL + File: main.c + + Copyright 2007 Nintendo. All rights reserved. + + These coded instructions, statements, and computer programs contain + proprietary information of Nintendo of America Inc. and/or Nintendo + Company Ltd., and are protected by Federal copyright law. They may + not be disclosed to third parties or copied or duplicated in any form, + in whole or in part, without the prior written consent of Nintendo. + + $Date:: $ + $Rev$ + $Author$ + *---------------------------------------------------------------------------*/ + +#include + +extern void Dummy_FLXWRAM(void); + +void +Dummy_FLXWRAM(void) +{ + OS_Printf("Printed from flexible wram area. [%p]\n", Dummy_FLXWRAM); +} + diff --git a/build/nand_formatter/ARM7/src/dummy.LTDMAIN.c b/build/nand_formatter/ARM7/src/dummy.LTDMAIN.c new file mode 100644 index 00000000..48d46a1c --- /dev/null +++ b/build/nand_formatter/ARM7/src/dummy.LTDMAIN.c @@ -0,0 +1,27 @@ +/*---------------------------------------------------------------------------* + Project: TwlIPL + File: main.c + + Copyright 2007 Nintendo. All rights reserved. + + These coded instructions, statements, and computer programs contain + proprietary information of Nintendo of America Inc. and/or Nintendo + Company Ltd., and are protected by Federal copyright law. They may + not be disclosed to third parties or copied or duplicated in any form, + in whole or in part, without the prior written consent of Nintendo. + + $Date:: $ + $Rev$ + $Author$ + *---------------------------------------------------------------------------*/ + +#include + +extern void Dummy_LTDMAIN(void); + +void +Dummy_LTDMAIN(void) +{ + OS_Printf("Printed from limited main memory area. [%p]\n", Dummy_LTDMAIN); +} + diff --git a/build/nand_formatter/ARM7/src/dummy.LTDWRAM.c b/build/nand_formatter/ARM7/src/dummy.LTDWRAM.c new file mode 100644 index 00000000..aec15de9 --- /dev/null +++ b/build/nand_formatter/ARM7/src/dummy.LTDWRAM.c @@ -0,0 +1,27 @@ +/*---------------------------------------------------------------------------* + Project: TwlIPL + File: main.c + + Copyright 2007 Nintendo. All rights reserved. + + These coded instructions, statements, and computer programs contain + proprietary information of Nintendo of America Inc. and/or Nintendo + Company Ltd., and are protected by Federal copyright law. They may + not be disclosed to third parties or copied or duplicated in any form, + in whole or in part, without the prior written consent of Nintendo. + + $Date:: $ + $Rev$ + $Author$ + *---------------------------------------------------------------------------*/ + +#include + +extern void Dummy_LTDWRAM(void); + +void +Dummy_LTDWRAM(void) +{ + OS_Printf("Printed from limited wram area. [%p]\n", Dummy_LTDWRAM); +} + diff --git a/build/nand_formatter/ARM7/src/main.c b/build/nand_formatter/ARM7/src/main.c new file mode 100644 index 00000000..2656b4ea --- /dev/null +++ b/build/nand_formatter/ARM7/src/main.c @@ -0,0 +1,311 @@ +/*---------------------------------------------------------------------------* + Project: TwlIPL + File: main.c + + Copyright 2007 Nintendo. All rights reserved. + + These coded instructions, statements, and computer programs contain + proprietary information of Nintendo of America Inc. and/or Nintendo + Company Ltd., and are protected by Federal copyright law. They may + not be disclosed to third parties or copied or duplicated in any form, + in whole or in part, without the prior written consent of Nintendo. + + $Date:: $ + $Rev$ + $Author$ + *---------------------------------------------------------------------------*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +extern void Dummy_FLXWRAM(void); +extern void Dummy_FLXMAIN(void); +#ifdef SDK_WIRELESS_IN_VRAM +extern void Dummy_EXTWRAM(void); +#endif +extern void Dummy_LTDWRAM(void); +extern void Dummy_LTDMAIN(void); + +static void Pragma_LTDWRAM(void); +static void Pragma_LTDMAIN(void); + +static void CreateDirectory( const char *pDrive, const char **ppDirList ); +static void CheckDirectory( const char *pDrive, const char **ppDirList ); + +// const data-------------------------------------------------------- +static const char *s_dirList0[] = { + (const char *)"sys", + (const char *)"title", + (const char *)"ticket", + (const char *)"shared1", + (const char *)"import", + (const char *)"tmp", + NULL, + }; + +static const char *s_dirList1[] = { + (const char *)"data", + (const char *)"photo", + (const char *)"shared2", + (const char *)"tmp", + NULL, + }; + +/*---------------------------------------------------------------------------*/ +#include +static void +Pragma_LTDWRAM(void) +{ + OS_Printf("Printed from limited wram area by pragma. [%p]\n", Pragma_LTDWRAM); +} +#include + +/*---------------------------------------------------------------------------*/ +#include +static void +Pragma_LTDMAIN(void) +{ + OS_Printf("Printed from limited main memory area by pragma. [%p]\n", Pragma_LTDMAIN); +} +#include + + +/*---------------------------------------------------------------------------* + Name: InitializeAllocateSystem + + Description: メモリ割当てシステムを初期化する。 + + Arguments: None. + + Returns: None. + *---------------------------------------------------------------------------*/ +static void InitializeAllocateSystem(void) +{ + void *tempLo; + OSHeapHandle hh; + + OS_TPrintf("OS_GetWramSubPrivArenaLo() = %p\n", OS_GetWramSubPrivArenaLo()); + OS_TPrintf("OS_GetWramSubPrivArenaHi() = %p\n", OS_GetWramSubPrivArenaHi()); + OS_TPrintf("OS_GetWramSubArenaLo() = %p\n", OS_GetWramSubArenaLo()); + OS_TPrintf("OS_GetWramSubArenaHi() = %p\n", OS_GetWramSubArenaHi()); + OS_TPrintf("OS_GetSubPrivArenaLo() = %p\n", OS_GetSubPrivArenaLo()); + OS_TPrintf("OS_GetSubPrivArenaHi() = %p\n", OS_GetSubPrivArenaHi()); + + OS_TPrintf("call OS_SetWramSubPrivArenaHi(0x0380f980); to fix arena.\n"); + OS_SetWramSubPrivArenaHi((void*)0x0380f980); + + // メモリ割当て初期化 + tempLo = OS_InitAlloc(OS_ARENA_WRAM_SUBPRIV, + OS_GetWramSubPrivArenaLo(), OS_GetWramSubPrivArenaHi(), 1); + + // アリーナを0クリア + MI_CpuClear8(tempLo, (u32)OS_GetWramSubPrivArenaHi() - (u32)tempLo); + + // アリーナ下位アドレスを設定 + OS_SetArenaLo(OS_ARENA_WRAM_SUBPRIV, tempLo); + // ヒープ作成 + hh = OS_CreateHeap(OS_ARENA_WRAM_SUBPRIV, + OS_GetWramSubPrivArenaLo(), OS_GetWramSubPrivArenaHi()); + + if (hh < 0) + { + OS_Panic("ARM7: Fail to create heap.\n"); + } + + // カレントヒープに設定 + (void)OS_SetCurrentHeap(OS_ARENA_WRAM_SUBPRIV, hh); +} + +/*---------------------------------------------------------------------------* + Name: TwlSpMain + Description: 起動ベクタ。 + Arguments: None. + Returns: None. + *---------------------------------------------------------------------------*/ +void +TwlSpMain(void) +{ + int nand_fat_partition_num; + + OS_Init(); + SPI_Init(2); + OS_InitTick(); + OS_InitAlarm(); + OS_InitThread(); + (void)PAD_InitXYButton(); + InitializeAllocateSystem(); + + // 割り込みの有効化 + (void)OS_EnableIrq(); + (void)OS_EnableInterrupts(); + + // FATFSライブラリ用ヒープを生成 (応急的にARM9側の空白部分を間借り) + { + OSHeapHandle hh; + u8 *lo = (u8*)0x02A00000; // OS_GetSubPrivArenaLo() + u8 *hi = (u8*)0x02B00000; // OS_GetSubPrivArenaHi() + OS_SetSubPrivArenaLo(OS_InitAlloc(OS_ARENA_MAIN_SUBPRIV, lo, hi, 1)); + hh = OS_CreateHeap(OS_ARENA_MAIN_SUBPRIV, lo + 32, hi - 32); + OS_SetCurrentHeap(OS_ARENA_MAIN_SUBPRIV, hh); + } + + // FATFSライブラリのSDIOとFATパーサを初期化 + if(!FATFS_Init(FATFS_DMA_NOT_USE, 8)) + { + OS_TPanic("FATFS_Init() failed.\n"); + } + + // NANDをフォーマット + { +#define FATAL_ERROR() do {} while (TRUE) + // ここを編集したら、SDKのFATFS_Init内の同パラメータも修正する必要がある。 +#define NAND_SIZE 245 // 256MB mobiNANDでの使用可能サイズ(iNANDでは違う値になる。未定。) +#define PARTITION_RAW_SIZE 4 +#define PARTITION_0_SIZE 190 +#define PARTITION_1_SIZE ( NAND_SIZE - PARTITION_RAW_SIZE - PARTITION_0_SIZE ) +#define NAND_FAT_PARTITION_NUM 2 // FATパーティション数(RAWパーティションを除く) + + int i; + + /* パーティションサイズをプロンプトから設定 */ + u32 partition_MB_size[5]; + partition_MB_size[0] = PARTITION_RAW_SIZE; // RAW領域 + partition_MB_size[1] = PARTITION_0_SIZE; // FAT0領域 + partition_MB_size[2] = PARTITION_1_SIZE; // FAT1領域 + nand_fat_partition_num = NAND_FAT_PARTITION_NUM; + + for( i=0; imain_ram_address = 0x00000000; + } + + while (TRUE) + { + OS_Halt(); + } +} + + +// ディレクトリ作成 +static void CreateDirectory( const char *pDrive, const char **ppDirList ) +{ + // デフォルトドライブの指定 + OS_TPrintf( "\nCreate directory : %s\n", pDrive ); + if( !FATFS_SetDefaultDrive( pDrive ) ) { + FATAL_ERROR(); + } + // 指定されたディレクトリをルートに作成 + while( *ppDirList ) { + OS_TPrintf( " %s...", *ppDirList ); + if( !FATFS_CreateDirectory( *ppDirList, "rwxrwxrwx") ) { + OS_TPrintf( "ng.\n" ); + FATAL_ERROR(); + } + OS_TPrintf( "ok.\n" ); + ppDirList++; + } +} + + +// ディレクトリ存在チェック +static void CheckDirectory( const char *pDrive, const char **ppDirList ) +{ + // デフォルトドライブの指定 + OS_TPrintf( "\nCheck directory : %s\n", pDrive ); + if( !FATFS_SetDefaultDrive( pDrive ) ) { + FATAL_ERROR(); + } + + // 指定されたディレクトリをチェック + while( *ppDirList ) { + FATFSDirectoryHandle dir = FATFS_OpenDirectory( *ppDirList, "rw"); + OS_TPrintf( " %s...", *ppDirList ); + if (dir != NULL) + { + OS_TPrintf( "ok.\n" ); + (void)FATFS_CloseDirectory( dir ); + }else { + OS_TPrintf( "ng.\n" ); + FATAL_ERROR(); + } + ppDirList++; + } +} diff --git a/build/nand_formatter/ARM9/Makefile b/build/nand_formatter/ARM9/Makefile new file mode 100644 index 00000000..74d4a0b2 --- /dev/null +++ b/build/nand_formatter/ARM9/Makefile @@ -0,0 +1,42 @@ +#! make -f +#---------------------------------------------------------------------------- +# Project: TwlIPL +# File: Makefile +# +# Copyright 2007 Nintendo. All rights reserved. +# +# These coded instructions, statements, and computer programs contain +# proprietary information of Nintendo of America Inc. and/or Nintendo +# Company Ltd., and are protected by Federal copyright law. They may +# not be disclosed to third parties or copied or duplicated in any form, +# in whole or in part, without the prior written consent of Nintendo. +# +# $Date:: 2007-09-18 #$ +# $Rev: 972 $ +# $Author: hatamoto_minoru $ +#---------------------------------------------------------------------------- + +TARGET_PLATFORM = TWL + +TWL_PROC = ARM9 +TWL_ARCHGEN = LIMITED +TARGET_BIN = formatter.srl + +MAKEROM_ARM7_BASE = ../ARM7/bin/$(TWL_BUILDTYPE_ARM7)/formatter_sub +MAKEROM_ARM7 = $(MAKEROM_ARM7_BASE).tef + +SRCS = main.c + +include $(TWLSDK_ROOT)/build/buildtools/commondefs + +#---------------------------------------------------------------------------- + +SUBDIRS = ../ARM7 + +#---------------------------------------------------------------------------- + +do-build: $(TARGETS) + +include $(TWLSDK_ROOT)/build/buildtools/modulerules + +#===== End of Makefile ===== diff --git a/build/nand_formatter/ARM9/src/main.c b/build/nand_formatter/ARM9/src/main.c new file mode 100644 index 00000000..6446b4d8 --- /dev/null +++ b/build/nand_formatter/ARM9/src/main.c @@ -0,0 +1,89 @@ +/*---------------------------------------------------------------------------* + Project: TwlIPL + File: main.c + + Copyright 2007 Nintendo. All rights reserved. + + These coded instructions, statements, and computer programs contain + proprietary information of Nintendo of America Inc. and/or Nintendo + Company Ltd., and are protected by Federal copyright law. They may + not be disclosed to third parties or copied or duplicated in any form, + in whole or in part, without the prior written consent of Nintendo. + + $Date:: $ + $Rev$ + $Author$ + *---------------------------------------------------------------------------*/ + + +#include +#include +#include + + +//================================================================================ + + +/*---------------------------------------------------------------------------* + Name: VBlankIntr + + Description: VBlank interrupt handler + + Arguments: None + + Returns: None + *---------------------------------------------------------------------------*/ +static void VBlankIntr(void) +{ + //---- check interrupt flag + OS_SetIrqCheckFlag(OS_IE_V_BLANK); +} + +/*---------------------------------------------------------------------------* + Name: NitroMain + + Description: main + + Arguments: None + + Returns: None + *---------------------------------------------------------------------------*/ +void NitroMain(void) +{ + OS_InitArena(); + PXI_Init(); + OS_InitLock(); + OS_InitArenaEx(); + OS_InitIrqTable(); + OS_SetIrqStackChecker(); + MI_Init(); + OS_InitVAlarm(); + OSi_InitVramExclusive(); + OS_InitThread(); + OS_InitReset(); + OS_Init(); + GX_Init(); + + (void)OS_SetIrqFunction(OS_IE_V_BLANK, VBlankIntr); + (void)OS_EnableIrqMask(OS_IE_V_BLANK); + (void)OS_EnableIrq(); + (void)GX_VBlankIntr(TRUE); + + FATFS_Init(); + + // ARM7からのフォーマット完了通知待ち (てっとりばやく強引な方法で通知している) + OS_TPrintf("now formatting NAND partitions...\n"); + { + const CARDRomHeader *header = CARD_GetOwnRomHeader(); + while (*(u32 *)header->main_ram_address != 0x00000000) + { + OS_WaitVBlankIntr(); + } + } + + OS_TPrintf("format has completed!\n"); + OS_Terminate(); +} + + +/*====== End of main.c ======*/ diff --git a/build/nand_formatter/Makefile b/build/nand_formatter/Makefile new file mode 100644 index 00000000..009e8a80 --- /dev/null +++ b/build/nand_formatter/Makefile @@ -0,0 +1,34 @@ +#! make -f +#---------------------------------------------------------------------------- +# Project: TwlFirm - firmware +# File: Makefile +# +# Copyright 2007 Nintendo. All rights reserved. +# +# These coded instructions, statements, and computer programs contain +# proprietary information of Nintendo of America Inc. and/or Nintendo +# Company Ltd., and are protected by Federal copyright law. They may +# not be disclosed to third parties or copied or duplicated in any form, +# in whole or in part, without the prior written consent of Nintendo. +# +# $Date:: $ +# $Rev:$ +# $Author:$ +#---------------------------------------------------------------------------- + +include $(TWLFIRM_ROOT)/build/buildtools/commondefs + + +#---------------------------------------------------------------------------- + +SUBDIRS = \ + ARM7 \ + ARM9 \ + + +#---------------------------------------------------------------------------- + +include $(TWLFIRM_ROOT)/build/buildtools/modulerules + + +#===== End of Makefile =====