#include <tinyara/board.h>
#include <arch/board/board.h>
-#include <arch/board/s5jt200_partitions.h>
#include <sys/mount.h>
#ifdef CONFIG_SCSC_WLAN
#include <net/lwip/netif.h>
#include <net/lwip/tcpip.h>
#endif
-#include "up_arch.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
-#define PHY_ADDR(offset) (MTD_SFLASH_ADDR + (offset))
/****************************************************************************
* Public Functions Prototypes
/****************************************************************************
* Private Functions
****************************************************************************/
-static void sflash_partitionmap_dump(void)
-{
- int32_t size;
- int32_t part_no;
- uint32_t end_addr;
- uint32_t start_addr;
-
- dbg("*****************************************************************************\n");
- dbg("*PARTITION NO\tPARTITION NAME\tSTART ADDRESS\tEND ADDRESS\t SIZE\n");
- dbg("*****************************************************************************\n");
-
- /* Bootloader Partition */
- part_no = 1;
- start_addr = PHY_ADDR(MTD_BLK_BOOTLDR_START);
- size = MTD_BLK_BOOTLDR_SIZE;
- end_addr = start_addr + size;
- dbg("*%12d\t%14s\t%#13X\t%#11X\t%10d\n",
- part_no, "BOOTLOADER", start_addr, end_addr, size);
-
- /* OTA0 Partition */
- part_no = 2;
- start_addr = PHY_ADDR(MTD_BLK_OTA0_START);
- size = MTD_BLK_OTA0_SIZE;
- end_addr = start_addr + size;
- dbg("*%12d\t%14s\t%#13X\t%#11X\t%10d\n",
- part_no, "OTA0", start_addr, end_addr, size);
-
- /* LED F/W Partition */
- part_no = 3;
- start_addr = PHY_ADDR(MTD_BLK_LEDFW_START);
- size = MTD_BLK_LEDFW_SIZE;
- end_addr = start_addr + size;
- dbg("*%12d\t%14s\t%#13X\t%#11X\t%10d\n",
- part_no, "LED F/W", start_addr, end_addr, size);
-
- /* SSS F/W Partition */
- part_no = 4;
- start_addr = PHY_ADDR(MTD_BLK_SSSFW_START);
- size = MTD_BLK_SSSFW_SIZE;
- end_addr = start_addr + size;
- dbg("*%12d\t%14s\t%#13X\t%#11X\t%10d\n",
- part_no, "SSS F/W", start_addr, end_addr, size);
-
- /* WLAN F/W Partition */
- part_no = 5;
- start_addr = PHY_ADDR(MTD_BLK_WLANFW_START);
- size = MTD_BLK_WLANFW_SIZE;
- end_addr = start_addr + size;
- dbg("*%12d\t%14s\t%#13X\t%#11X\t%10d\n",
- part_no, "WLAN F/W", start_addr, end_addr, size);
-
- /* SSS KEY Partition */
- part_no = 6;
- start_addr = PHY_ADDR(MTD_BLK_SSSKEY_START);
- size = MTD_BLK_SSSKEY_SIZE;
- end_addr = start_addr + size;
- dbg("*%12d\t%14s\t%#13X\t%#11X\t%10d\n",
- part_no, "SSS KEY", start_addr, end_addr, size);
-
- /* OTA1 Partition */
- part_no = 7;
- start_addr = PHY_ADDR(MTD_BLK_OTA1_START);
- size = MTD_BLK_OTA1_SIZE;
- end_addr = start_addr + size;
- dbg("*%12d\t%14s\t%#13X\t%#11X\t%10d\n",
- part_no, "OTA1", start_addr, end_addr, size);
-
- /* ROMFS Partition */
- part_no = 8;
- start_addr = PHY_ADDR(MTD_BLK_ROMFS_START);
- size = MTD_BLK_ROMFS_SIZE;
- end_addr = start_addr + size;
- dbg("*%12d\t%14s\t%#13X\t%#11X\t%10d\n",
- part_no, "ROMFS", start_addr, end_addr, size);
-
- /* SMARTFS Partition */
- part_no = 9;
- start_addr = PHY_ADDR(MTD_BLK_SMARTFS_START);
- size = MTD_BLK_SMARTFS_SIZE;
- end_addr = start_addr + size;
- dbg("*%12d\t%14s\t%#13X\t%#11X\t%10d\n",
- part_no, "SMARTFS", start_addr, end_addr, size);
-
- /* RAMDUMP Partition */
- part_no = 10;
- start_addr = PHY_ADDR(MTD_BLK_RAMDUMP_START);
- size = MTD_BLK_RAMDUMP_SIZE;
- end_addr = start_addr + size;
- dbg("*%12d\t%14s\t%#13X\t%#11X\t%10d\n",
- part_no, "RAMDUMP", start_addr, end_addr, size);
-
- /* COREDUMP Partition */
- part_no = 11;
- start_addr = PHY_ADDR(MTD_BLK_COREDUMP_START);
- size = MTD_BLK_COREDUMP_SIZE;
- end_addr = start_addr + size;
- dbg("*%12d\t%14s\t%#13X\t%#11X\t%10d\n",
- part_no, "COREDUMP", start_addr, end_addr, size);
-
- /* NV Partition */
- part_no = 12;
- start_addr = PHY_ADDR(MTD_BLK_NV_START);
- size = MTD_BLK_NV_SIZE;
- end_addr = start_addr + size;
- dbg("*%12d\t%14s\t%#13X\t%#11X\t%10d\n",
- part_no, "NV", start_addr, end_addr, size);
-
- /* BOOTPARAM Partition */
- part_no = 13;
- start_addr = PHY_ADDR(MTD_BLK_BOOTPARAM_START);
- size = MTD_BLK_BOOTPARAM_SIZE;
- end_addr = start_addr + size;
- dbg("*%12d\t%14s\t%#13X\t%#11X\t%10d\n",
- part_no, "BOOTPARAM", start_addr, end_addr, size);
-
- dbg("*****************************************************************************\n");
-
-}
/****************************************************************************
* Public Functions
****************************************************************************/
-/****************************************************************************
- * Name: up_create_romdevice
- *
- * Description:
- * It creates a smart device using ROMFS MTD Partition
- ****************************************************************************/
-#ifdef CONFIG_FS_ROMFS
-int up_create_romdevice(void)
-{
- int ret = 0;
- int minor = MTD_ROMFS; /* Use MTD_ROMFS as minor number */
-#ifdef CONFIG_MTD
- FAR struct mtd_dev_s *rom_mtd = NULL;
-
- rom_mtd = get_mtd_partition(MTD_ROMFS);
- if (!rom_mtd) {
- dbg("ERROR: Failed to get ROMFS partition\n");
- ret = 1;
- goto error_out;
- }
-#ifdef CONFIG_MTD_SMART
- ret = smart_initialize(minor, rom_mtd, NULL);
- if (ret != OK) {
- dbg("ERROR: SMART initialization failed: %d\n", -ret);
- goto error_out;
- }
-#endif
-#endif
-error_out:
- return ret > 0 ? -ret : ret;
-}
-#endif
/****************************************************************************
* Name: up_flashinitialize
****************************************************************************/
FAR struct mtd_dev_s *up_flashinitialize(void)
{
- FAR struct mtd_dev_s *mtd = NULL;
- FAR struct spi_dev_s *spi;
-#ifdef CONFIG_MTD_PARTITION
- int ret;
- FAR struct mtd_geometry_s geo;
-#ifdef CONFIG_FS_ROMFS
- FAR struct mtd_dev_s *mtd_romfs;
-#endif
-#ifdef CONFIG_NV_MANAGER
- FAR struct mtd_dev_s *mtd_nvm;
-#endif
- FAR struct mtd_dev_s *mtd_fs;
- uint32_t nblocks;
- uint32_t startblock;
- uint32_t blocksize;
-#endif
-
- spi = (FAR struct spi_dev_s *)up_spiflashinitialize();
- if (!spi) {
- return NULL;
- }
-#ifdef CONFIG_MTD_M25P
- mtd = (FAR struct mtd_dev_s *)m25p_initialize(spi);
- if (!mtd) {
- return NULL;
- }
-#endif
-
-#ifdef CONFIG_MTD_PARTITION
- DEBUGASSERT(mtd);
-
- /* Get the geometry of the FLASH device */
- ret = mtd->ioctl(mtd, MTDIOC_GEOMETRY, (unsigned long)&geo);
- if (ret < 0) {
- dbg("ERROR: mtd->ioctl failed: %d\n", ret);
- return NULL;
- }
-
- blocksize = geo.blocksize;
-
-#ifdef CONFIG_FS_ROMFS
- /* ROMFS Partition */
- startblock = MTD_BLK_ROMFS_START / blocksize;
- nblocks = MTD_BLK_ROMFS_SIZE / blocksize;
- mtd_romfs = mtd_partition(mtd, startblock, nblocks, MTD_ROMFS);
- if (!mtd_romfs) {
- dbg("ERROR: mtd partition failed for romfs\n");
- return NULL;
- }
-#endif
-
-#ifdef CONFIG_NV_MANAGER
- startblock = MTD_BLK_NV_START / blocksize;
- nblocks = MTD_BLK_NV_SIZE / blocksize;
- mtd_nvm = mtd_partition(mtd, startblock, nblocks, MTD_NV);
- if (!mtd_nvm) {
- dbg("ERROR: mtd partition failed for nvm manager\n");
- return NULL;
- }
-#endif
-
- /* FS Partition, SMARTFS will be mounted on it */
- startblock = MTD_BLK_SMARTFS_START / blocksize;
- nblocks = MTD_BLK_SMARTFS_SIZE / blocksize;
- mtd_fs = mtd_partition(mtd, startblock, nblocks, MTD_FS);
- if (!mtd_fs) {
- dbg("ERROR: mtd partition failed for smartfs\n");
- return NULL;
- }
-
-#ifdef CONFIG_MTD_REGISTRATION
- /* register each of MTD here to get info through the procfs */
- if (mtd) {
- mtd_register(mtd, "master");
- }
-
- if (mtd_fs) {
- mtd_register(mtd_fs, "FS");
- }
-#ifdef CONFIG_NV_MANAGER
- if (mtd_nvm) {
- mtd_register(mtd_nvm, "NVM");
- }
-#endif
-#ifdef CONFIG_FS_ROMFS
- if (mtd_romfs) {
- mtd_register(mtd_romfs, "ROMFS");
- }
-#endif /* CONFIG_FS_ROMFS */
-#endif /* CONFIG_MTD_REGISTRATION */
-#endif /* CONFIG_MTD_PARTITION */
-
- return mtd;
+ return NULL;
}
#ifdef CONFIG_SCSC_WLAN
-#include <net/lwip/opt.h>
-#include <net/lwip/netif.h>
-
err_t wlan_init(struct netif *netif);
-struct netif g_wlanif;
struct netif *wlan_netif;
void wlan_initup(struct netif *dev)
{