The NAND flash partitions can be created in the board file. For eg arch/arm/mach-omap2/board-omap3beagle.c for beagleboard in the kernel source code. Sometimes, a small code can be executed just after basic initial boot to set up the partitions. Fortunately, you can define your own partitions without having to modify the kernel sources.
As an example, for omap2, you can try this on bootloader shell;
mtdparts=omap2-nand.0:128k(X-Loader)ro,256k(U-Boot)ro,128k(Environment),4m(Kernel)ro,32m(RootFS)ro,-(Data).
Here nand.o is nand driver file.
The above command may vary slightly depending on the target device you are working on. These sizes must be multiple of erase blocks which can be found on /sys/class/mtd/mtdx/erasesize.
You can create a flash file system like jffs2, ubifs etc depending on your requirement and each of the file system has its own commands to read info, erase, write.
Following link provides more insight into this discussion.
http://www.linux-mtd.infradead.org/faq/general.html