1 /* 2 * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. 3 * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without modification, 6 * are permitted provided that the following conditions are met: 7 * 8 * 1. Redistributions of source code must retain the above copyright notice, this list of 9 * conditions and the following disclaimer. 10 * 11 * 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 * of conditions and the following disclaimer in the documentation and/or other materials 13 * provided with the distribution. 14 * 15 * 3. Neither the name of the copyright holder nor the names of its contributors may be used 16 * to endorse or promote products derived from this software without specific prior written 17 * permission. 18 * 19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 23 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 24 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 28 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 29 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 */ 31 32 #ifndef _LOS_ROOTFS_H 33 #define _LOS_ROOTFS_H 34 35 #include "los_typedef.h" 36 37 #define ROOT_DIR_NAME "/" 38 #define STORAGE_DIR_NAME "/storage" 39 #ifdef LOSCFG_STORAGE_EMMC 40 #define USERDATA_DIR_NAME "/userdata" 41 #ifdef LOSCFG_PLATFORM_PATCHFS 42 #define PATCH_DIR_NAME "/patch" 43 #endif 44 #endif 45 #define DEFAULT_MOUNT_DIR_MODE 0755 46 #define DEFAULT_MOUNT_DATA NULL 47 48 #ifdef LOSCFG_STORAGE_SPINOR 49 #define FLASH_TYPE "spinor" 50 #define ROOT_DEV_NAME "/dev/spinorblk0" 51 #define USER_DEV_NAME "/dev/spinorblk2" 52 #define ROOTFS_ADDR 0x600000 53 #define ROOTFS_SIZE 0x800000 54 #define USERFS_SIZE 0x80000 55 #elif defined (LOSCFG_STORAGE_SPINAND) 56 #define FLASH_TYPE "nand" 57 #define ROOT_DEV_NAME "/dev/nandblk0" 58 #define USER_DEV_NAME "/dev/nandblk2" 59 #define ROOTFS_ADDR 0x600000 60 #define ROOTFS_SIZE 0x800000 61 #define USERFS_SIZE 0x80000 62 #elif defined (LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7) 63 #define ROOT_DEV_NAME "/dev/cfiflash0" 64 #define USER_DEV_NAME "/dev/cfiflash2" 65 #define ROOTFS_ADDR CFIFLASH_ROOT_ADDR 66 #define ROOTFS_SIZE 0x1B00000 67 #define USERFS_SIZE (CFIFLASH_CAPACITY - ROOTFS_ADDR - ROOTFS_SIZE) 68 #elif defined (LOSCFG_STORAGE_EMMC) 69 #define ROOT_DEV_NAME "/dev/mmcblk0p0" 70 #ifdef LOSCFG_PLATFORM_PATCHFS 71 #define PATCH_DEV_NAME "/dev/mmcblk0p1" 72 #define USER_DEV_NAME "/dev/mmcblk0p2" 73 #define USERDATA_DEV_NAME "/dev/mmcblk0p3" 74 #else 75 #define USER_DEV_NAME "/dev/mmcblk0p1" 76 #define USERDATA_DEV_NAME "/dev/mmcblk0p2" 77 #endif 78 #define ROOTFS_ADDR 0xA00000 79 #define ROOTFS_SIZE 0x1400000 80 #define USERFS_SIZE 0x3200000 81 #ifdef LOSCFG_PLATFORM_PATCHFS 82 #define PATCH_SIZE 0x200000 83 #endif 84 #ifdef DEFAULT_MOUNT_DIR_MODE 85 #undef DEFAULT_MOUNT_DIR_MODE 86 #endif 87 #ifdef DEFAULT_MOUNT_DATA 88 #undef DEFAULT_MOUNT_DATA 89 #endif 90 #define DEFAULT_MOUNT_DIR_MODE 0777 91 #define DEFAULT_MOUNT_DATA "umask=000" 92 #endif 93 94 INT32 OsMountRootfs(VOID); 95 96 #endif /* _LOS_ROOTFS_H */ 97