1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-28 18:38:39 +00:00

core: remove src1

This commit is contained in:
Pavol Rusnak 2020-08-03 15:33:45 +02:00
parent 16a5858544
commit efc5ccdaf0
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
28 changed files with 84 additions and 167 deletions

View File

@ -21,19 +21,6 @@ core fw regular build:
- trezor-fw-regular-*.*.*-$CI_COMMIT_SHORT_SHA.bin
expire_in: 1 week
core fw regular t1 build:
stage: build
variables:
TREZOR_MODEL: "1"
script:
- nix-shell --run "pipenv run make -C core build_firmware"
- cp core/build/firmware/firmware.bin trezor-fw-regular-t1-$CORE_VERSION-$CI_COMMIT_SHORT_SHA.bin
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
paths:
- trezor-fw-regular-t1-*.*.*-$CI_COMMIT_SHORT_SHA.bin
expire_in: 1 week
core fw regular debug build:
stage: build
script:
@ -60,6 +47,20 @@ core fw btconly build:
- trezor-fw-btconly-*.*.*-$CI_COMMIT_SHORT_SHA.bin
expire_in: 1 week
core fw btconly t1 build:
stage: build
variables:
BITCOIN_ONLY: "1"
TREZOR_MODEL: "1"
script:
- nix-shell --run "pipenv run make -C core build_firmware"
- cp core/build/firmware/firmware.bin trezor-fw-btconly-t1-$CORE_VERSION-$CI_COMMIT_SHORT_SHA.bin
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
paths:
- trezor-fw-btconly-t1-$CORE_VERSION-$CI_COMMIT_SHORT_SHA.bin
expire_in: 1 week
core unix regular build:
stage: build
script:

View File

@ -461,12 +461,7 @@ env.Ignore(hdr_moduledefs, qstr_generated)
#
if FROZEN:
if env.get('TREZOR_MODEL') == 'T':
SOURCE_PY_DIR = 'src/'
elif env.get('TREZOR_MODEL') == '1':
SOURCE_PY_DIR = 'src1/'
else:
raise ValueError('Unknown Trezor model')
SOURCE_PY_DIR = 'src/'
SOURCE_PY = Glob(SOURCE_PY_DIR + '*.py')
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/*.py'))

View File

@ -426,12 +426,7 @@ env.Ignore(hdr_moduledefs, qstr_generated)
#
if FROZEN:
if env.get('TREZOR_MODEL') == 'T':
SOURCE_PY_DIR = 'src/'
elif env.get('TREZOR_MODEL') == '1':
SOURCE_PY_DIR = 'src1/'
else:
raise ValueError('Unknown Trezor model')
SOURCE_PY_DIR = 'src/'
SOURCE_PY = Glob(SOURCE_PY_DIR + '*.py')
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/*.py'))

View File

@ -0,0 +1,67 @@
/* TREZORv1 firmware linker script */
ENTRY(reset_handler)
MEMORY {
FLASH (rx) : ORIGIN = 0x08010000, LENGTH = 1024K - 64K
SRAM (wal) : ORIGIN = 0x20000000, LENGTH = 128K
}
main_stack_base = ORIGIN(SRAM) + LENGTH(SRAM); /* 8-byte aligned full descending stack */
_estack = main_stack_base;
/* used by the startup code to populate variables used by the C code */
data_lma = LOADADDR(.data);
data_vma = ADDR(.data);
data_size = SIZEOF(.data);
/* used by the startup code to wipe memory */
/* we have no CCMRAM, so erase the first word of SRAM as hack */
ccmram_start = ORIGIN(SRAM);
ccmram_end = ORIGIN(SRAM) + 4;
/* used by the startup code to wipe memory */
sram_start = ORIGIN(SRAM);
sram_end = ORIGIN(SRAM) + LENGTH(SRAM);
_ram_start = sram_start;
_ram_end = sram_end;
_codelen = SIZEOF(.flash) + SIZEOF(.data);
_flash_start = ORIGIN(FLASH);
_flash_end = ORIGIN(FLASH) + LENGTH(FLASH);
_heap_start = ADDR(.heap);
_heap_end = ADDR(.heap) + SIZEOF(.heap);
SECTIONS {
.header : ALIGN(4) {
KEEP(*(.header));
} >FLASH AT>FLASH
.flash : ALIGN(512) {
KEEP(*(.vector_table));
. = ALIGN(4);
*(.text*);
. = ALIGN(4);
*(.rodata*);
. = ALIGN(512);
} >FLASH AT>FLASH
.data : ALIGN(4) {
*(.data*);
. = ALIGN(512);
} >SRAM AT>FLASH
.bss : ALIGN(4) {
*(.bss*);
. = ALIGN(4);
} >SRAM
.heap : ALIGN(4) {
. = 37K; /* this acts as a build time assertion that at least this much memory is available for heap use */
. = ABSOLUTE(sram_end - 16K); /* this explicitly sets the end of the heap effectively giving the stack at most 16K */
} >SRAM
.stack : ALIGN(8) {
. = 4K; /* this acts as a build time assertion that at least this much memory is available for stack use */
} >SRAM
}

View File

@ -6,11 +6,5 @@ if [ -n "$1" ]; then
exit 1
fi
TREZOR_MODEL="${TREZOR_MODEL:-T}"
if [ "$TREZOR_MODEL" = "T" ]; then
cd src
else
cd "src${TREZOR_MODEL}"
fi
cd src
../build/unix/trezor-emu-core -O$PYOPT -X heapsize=20M

View File

@ -1,85 +0,0 @@
import usb
usb.bus.open()
import trezorio as io
from trezorui import Display
import storage
import storage.resident_credentials
from trezor import config
config.init(False)
salt = None
config.unlock(1, salt)
storage.init_unlocked()
storage.cache.start_session()
print("is_initialized: ", storage.device.is_initialized())
print("version: ", storage.device.is_version_stored())
print("version: ", storage.device.get_version())
print("needs backup: ", storage.device.needs_backup())
storage.device.set_backed_up()
print("needs backup: ", storage.device.needs_backup())
flags = storage.device.get_flags()
print("flags", flags)
storage.device.set_flags(0x200)
print("flags", storage.device.get_flags())
secret = "0"*32
backup_type = 0
storage.device.store_mnemonic_secret(
secret,
backup_type,
needs_backup=True,
no_backup=True,
)
storage.device.set_unfinished_backup(False)
print("unfinished backup: ", storage.device.unfinished_backup())
storage.device.set_unfinished_backup(True)
print("unfinished backup: ", storage.device.unfinished_backup())
key54 = storage.common.get(0x1, 54, public=True)
print("App key 54:", key54)
storage.common.set(0x1, 54, b"asdZ", public=True)
key54 = storage.common.get(0x1, 54, public=True)
print("App key 54 (2):", key54)
key54 = storage.common.delete(0x1, 54, public=True)
key54 = storage.common.get(0x1, 54, public=True)
print("App key 54 (3):", key54)
delay = storage.device.get_autolock_delay_ms()
print("delay", delay)
storage.device.set_autolock_delay_ms(150000)
delay = storage.device.get_autolock_delay_ms()
print("delay", delay)
cache_seed = storage.cache.get(storage.cache.APP_COMMON_SEED)
print("cache seed", cache_seed)
storage.cache.set(storage.cache.APP_COMMON_SEED, 1234)
cache_seed = storage.cache.get(storage.cache.APP_COMMON_SEED)
print("cache seed", cache_seed)
res1 = storage.resident_credentials.get(1)
print("Res credential 1", res1)
res1 = storage.resident_credentials.set(1, b"0"*31 + b"F")
res1 = storage.resident_credentials.get(1)
print("Res credential 1", res1)
i = 0
d = Display()
d.clear()
d.backlight(255)
while True:
d.clear()
d.text(0, 20, "Hamburgefont %d" % i, Display.FONT_NORMAL, 0xFFFF, 0x0000)
d.text(0, 40, "Hamburgefont %d" % i, Display.FONT_BOLD, 0xFFFF, 0x0000)
d.text(0, 60, "Hamburgefont %d" % i, Display.FONT_MONO, 0xFFFF, 0x0000)
i += 1
r = [0, 0]
if io.poll([io.TOUCH], r, 1000000):
print("TOUCH", r)
else:
print("NOTOUCH")
d.refresh()

View File

@ -1 +0,0 @@
../../src/storage/__init__.py

View File

@ -1 +0,0 @@
../../src/storage/cache.py

View File

@ -1 +0,0 @@
../../src/storage/common.py

View File

@ -1 +0,0 @@
../../src/storage/device.py

View File

@ -1 +0,0 @@
../../src/storage/resident_credentials.py

View File

@ -1 +0,0 @@
../../src/trezor/__init__.py

View File

@ -1 +0,0 @@
../../../src/trezor/crypto/__init__.py

View File

@ -1 +0,0 @@
../../../src/trezor/crypto/base32.py

View File

@ -1 +0,0 @@
../../../src/trezor/crypto/base58.py

View File

@ -1 +0,0 @@
../../../src/trezor/crypto/bech32.py

View File

@ -1 +0,0 @@
../../../src/trezor/crypto/cashaddr.py

View File

@ -1 +0,0 @@
../../../src/trezor/crypto/curve.py

View File

@ -1 +0,0 @@
../../../src/trezor/crypto/der.py

View File

@ -1 +0,0 @@
../../../src/trezor/crypto/hashlib.py

View File

@ -1 +0,0 @@
../../../src/trezor/crypto/hmac.py

View File

@ -1 +0,0 @@
../../../src/trezor/crypto/rlp.py

View File

@ -1 +0,0 @@
../../../src/trezor/crypto/scripts.py

View File

@ -1 +0,0 @@
../../../src/trezor/crypto/slip39.py

View File

@ -1 +0,0 @@
../../src/trezor/log.py

View File

@ -1 +0,0 @@
../../../src/trezor/messages/BackupType.py

View File

@ -1 +0,0 @@
../../src/trezor/utils.py

View File

@ -1,29 +0,0 @@
import trezorio as io
iface_wire = io.WebUSB(
iface_num=0,
ep_in=0x81,
ep_out=0x01,
)
iface_vcp = io.VCP(
iface_num=2,
data_iface_num=3,
ep_in=0x83,
ep_out=0x03,
ep_cmd=0x84,
)
bus = io.USB(
vendor_id=0x1209,
product_id=0x53C1,
release_num=0x0100,
manufacturer="SatoshiLabs",
product="TREZOR",
interface="TREZOR Interface",
serial_number="1234",
usb21_landing=False,
)
bus.add(iface_wire)
bus.add(iface_vcp)