summaryrefslogtreecommitdiffstatshomepage
path: root/esp8266/esp_init_data.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2017-09-06 13:40:51 +1000
committerDamien George <damien.p.george@gmail.com>2017-09-06 13:40:51 +1000
commit01dd7804b87d60b2deab16712eccb3b97351a9b7 (patch)
tree1aa21f38a872b8e62a3d4e4f74f68033c6f827e4 /esp8266/esp_init_data.c
parenta9862b30068fc9df1022f08019fb35aaa5085f64 (diff)
downloadmicropython-01dd7804b87d60b2deab16712eccb3b97351a9b7.tar.gz
micropython-01dd7804b87d60b2deab16712eccb3b97351a9b7.zip
ports: Make new ports/ sub-directory and move all ports there.
This is to keep the top-level directory clean, to make it clear what is core and what is a port, and to allow the repository to grow with new ports in a sustainable way.
Diffstat (limited to 'esp8266/esp_init_data.c')
-rw-r--r--esp8266/esp_init_data.c77
1 files changed, 0 insertions, 77 deletions
diff --git a/esp8266/esp_init_data.c b/esp8266/esp_init_data.c
deleted file mode 100644
index b14de573a7..0000000000
--- a/esp8266/esp_init_data.c
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * This file is part of the MicroPython project, http://micropython.org/
- *
- * The MIT License (MIT)
- *
- * Copyright (c) 2016 Paul Sokolovsky
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-#include <stdio.h>
-#include "ets_sys.h"
-#include "etshal.h"
-#include "esp_mphal.h"
-#include "user_interface.h"
-#include "extmod/misc.h"
-
-NORETURN void call_user_start(void);
-void ets_printf(const char *fmt, ...);
-extern char flashchip;
-
-static const uint8_t default_init_data[] __attribute__((aligned(4))) = {
-0x05, 0x00, 0x04, 0x02, 0x05, 0x05, 0x05, 0x02, 0x05, 0x00, 0x04, 0x05, 0x05, 0x04, 0x05, 0x05,
-0x04, 0xfe, 0xfd, 0xff, 0xf0, 0xf0, 0xf0, 0xe0, 0xe0, 0xe0, 0xe1, 0x0a, 0xff, 0xff, 0xf8, 0x00,
-0xf8, 0xf8, 0x52, 0x4e, 0x4a, 0x44, 0x40, 0x38, 0x00, 0x00, 0x01, 0x01, 0x02, 0x03, 0x04, 0x05,
-0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0xe1, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x93, 0x43, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-};
-
-void firmware_start(void) {
- // For SDK 1.5.2, either address has shifted and not mirrored in
- // eagle.rom.addr.v6.ld, or extra initial member was added.
- SpiFlashChip *flash = (SpiFlashChip*)(&flashchip + 4);
-
- char buf[128];
- SPIRead(flash->chip_size - 4 * 0x1000, buf, sizeof(buf));
- /*for (int i = 0; i < sizeof(buf); i++) {
- static char hexf[] = "%x ";
- ets_printf(hexf, buf[i]);
- }*/
-
- bool inited = false;
- for (int i = 0; i < sizeof(buf); i++) {
- if (buf[i] != 0xff) {
- inited = true;
- break;
- }
- }
-
- if (!inited) {
- static char msg[] = "Writing init data\n";
- ets_printf(msg);
- SPIRead((uint32_t)&default_init_data - 0x40200000, buf, sizeof(buf));
- SPIWrite(flash->chip_size - 4 * 0x1000, buf, sizeof(buf));
- }
-
- asm("j call_user_start");
-}