1 /*
2  * Copyright 2016 Google Inc. All Rights Reserved.
3  * Author: gkalsi@google.com (Gurjant Kalsi)
4  *
5  * Use of this source code is governed by a MIT-style
6  * license that can be found in the LICENSE file or at
7  * https://opensource.org/licenses/MIT
8  */
9 
10 static char bootloader_primary_flash_name[] = "flash0";
11 static char bootloader_secondary_flash_name[] = "qspi-flash";
12 static char bootloader_mount_point[] = "/spifs";
13 
14 #include <lib/fs.h>
15 #include <lk/err.h>
16 #include <app/moot/stubs.h>
17 #include <stdio.h>
18 
19 #define BOOTLOADER_SIZE_KB (64)
20 #define SYSTEM_FLASH_SIZE_KB (1024)
21 
moot_mount_default_fs(char ** mount_path,char ** device_name)22 status_t moot_mount_default_fs(char **mount_path, char **device_name) {
23     *mount_path = bootloader_mount_point;
24     *device_name = bootloader_secondary_flash_name;
25     return NO_ERROR;
26 }
27 
28 const moot_sysinfo_t moot_system_info = {
29     .sys_base_addr = 0x00210000,
30     .btldr_offset = 0x0,
31     .bootloader_len = 1024 * BOOTLOADER_SIZE_KB,
32     .system_offset = 1024 * BOOTLOADER_SIZE_KB,
33     .system_len = (1024 * (SYSTEM_FLASH_SIZE_KB - BOOTLOADER_SIZE_KB)),
34     .system_flash_name = bootloader_primary_flash_name,
35 };