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_STORAGE_EMMC) 63 #define ROOT_DEV_NAME "/dev/mmcblk0p0" 64 #ifdef LOSCFG_PLATFORM_PATCHFS 65 #define PATCH_DEV_NAME "/dev/mmcblk0p1" 66 #define USER_DEV_NAME "/dev/mmcblk0p2" 67 #define USERDATA_DEV_NAME "/dev/mmcblk0p3" 68 #else 69 #define USER_DEV_NAME "/dev/mmcblk0p1" 70 #define USERDATA_DEV_NAME "/dev/mmcblk0p2" 71 #endif 72 #define ROOTFS_ADDR 0xA00000 73 #define ROOTFS_SIZE 0x1400000 74 #define USERFS_SIZE 0x3200000 75 #ifdef LOSCFG_PLATFORM_PATCHFS 76 #define PATCH_SIZE 0x200000 77 #endif 78 #ifdef DEFAULT_MOUNT_DIR_MODE 79 #undef DEFAULT_MOUNT_DIR_MODE 80 #endif 81 #ifdef DEFAULT_MOUNT_DATA 82 #undef DEFAULT_MOUNT_DATA 83 #endif 84 #define DEFAULT_MOUNT_DIR_MODE 0777 85 #define DEFAULT_MOUNT_DATA "umask=000" 86 #endif 87 88 INT32 OsMountRootfs(VOID); 89 90 #endif /* _LOS_ROOTFS_H */ 91