Commit Graph

311 Commits

Author SHA1 Message Date
whitequark d625c43591 libbase: also pass exception PC and EA to exception handler. 2015-08-01 20:15:42 +03:00
whitequark 13a50a93d9 libbase: downstream users should provide fprintf. 2015-08-01 20:14:09 +03:00
whitequark 3f7f0a3151 libdyld: fix dyld_lookup algorithm. 2015-08-01 17:21:31 +03:00
whitequark d43e470e3c libdyld: fix DT_HASH address calculation. 2015-08-01 15:49:33 +03:00
Sebastien Bourdeauducq 04934ff3f1 software/common.mak: use PYTHON env var 2015-07-31 18:31:04 +08:00
whitequark eb643f1132 Export _cache_init from crt0.S. 2015-07-31 02:40:52 +03:00
whitequark 90314052fa Implement a dynamic linker. 2015-07-31 02:38:38 +03:00
whitequark 66839b512a Update libunwind submodule. 2015-07-31 02:38:38 +03:00
Florent Kermarrec 106e4c6962 bios/sdram: fix error_cnt computation in memtest 2015-07-30 23:59:04 +02:00
whitequark 94cb3cbcf6 libbase: define intptr_t. 2015-07-30 10:55:12 +03:00
whitequark 8db098dd8f Make sure the BIOS file ends on an aligned boundary.
If it does not, the address to which mkmscimg.py writes the CRC
and the address from which it is read could differ.
2015-07-29 12:30:57 +03:00
whitequark a4e14f1058 Don't build base libraries and BIOS with -fPIC after all. 2015-07-29 12:09:05 +03:00
Florent Kermarrec 5e6178598c Merge branch 'master' of https://github.com/m-labs/misoc 2015-07-28 11:59:48 +02:00
Florent Kermarrec 405efc5560 update lm32 with "Switch to -fPIC" changes. 2015-07-28 11:11:11 +02:00
whitequark 03ebc736b2 Pass -integrated-as to clang.
This avoids misdetection of target assembler by clang.
2015-07-28 11:51:28 +03:00
whitequark 50cf70140b Update libbase/linker-sdram.ld with -fPIC support. 2015-07-26 16:15:02 +03:00
whitequark c8ffd0c9ee Switch to -fPIC.
Using -fPIC for everything allows to link the MiSoC static libraries
both into static images such as the BIOS as well as
into shared libraries.
2015-07-26 16:06:48 +03:00
whitequark a8cd3b9adc Remove useless includes pulled in by libunwind.
These aren't used by libunwind in any configuration and
should be also removed in upstream.
2015-07-26 13:12:23 +03:00
whitequark f6639c1833 Add libunwind. 2015-07-26 12:59:18 +03:00
whitequark 24463a168a Add a stub getenv() implementation.
This is not strictly necessary to build libunwind (it can
be built with -DNDEBUG), but it will be handy while it is
debugged.

It can be removed afterwards.
2015-07-26 12:55:52 +03:00
whitequark b2710e437c Add a stub pthread header.
The header implements only the pthread rwlock interface, which
never actually locks.

This is necessary to build libunwind.
2015-07-26 12:54:40 +03:00
whitequark b5048f6cf1 Add headers for the dynamic linker interface.
These are required for libunwind to discover
the exception frame headers.
2015-07-26 12:53:18 +03:00
whitequark 7a9975ab5a Add a stub C++ standard library.
This is necessary to build libunwind.
2015-07-26 12:49:21 +03:00
whitequark 5502cec3da Add basic inttypes.h.
This is taken from glibc. Only PRI* definitions are imported;
functions are not.
2015-07-26 12:44:13 +03:00
whitequark eef1aa77ef Mark abort() as __attribute__((noreturn)). 2015-07-26 12:43:22 +03:00
whitequark 10f719a830 Add support for fprintf(stderr, ...). 2015-07-26 12:42:53 +03:00
whitequark f5cc6fb72d Don't use clang for anything except or1k. 2015-07-26 10:00:58 +03:00
whitequark d03dabb460 common.mak: Pass -fexceptions to clang and clang++.
This results in generation of .eh_frame sections. These sections
can be discarded during final linking, or included if exception
handling is desired. For exception handling to work, all sources
must be built with -fexceptions.
2015-07-26 03:30:21 +03:00
whitequark 69c2a705bf common.mak: use clang/clang++ to compile C/C++ sources.
Note that -integrated-as is not active by default on OR1K,
so we're still shelling out to binutils to assemble.
It is not yet possible to build everything using -integrated-as.
2015-07-26 03:28:37 +03:00
whitequark 0f47876d2e common.mak: remove RANLIB.
`ranlib` is not necessary on any system we can possibly build for,
as it is superseded by `ar s` for the last ten years or so (at least).
Thus, change ar invocations to `ar crs`, also removing a `l` flag
that is ignored by binutils.
2015-07-26 03:20:23 +03:00
whitequark f500b906e6 common.mak: remove AS.
$(AS) was never used: $(assemble) invokes the C compiler instead.
In case of LLVM, this will allow us to consistently use the LLVM
internal assembler for both inline assembly in C and assembly
sources; so, avoid ever invoking binutils as explicitly.
2015-07-26 02:46:03 +03:00
Sebastien Bourdeauducq 84514cf8d5 uart: remove option to refill HW from uart_write 2015-07-19 23:41:38 +02:00
Robert Jordens 097248bce9 uart.c: rx overflow fix and tx simplification
* fixes the clearing of the rx ringbuffer on rx-overflow
* removes tx_level and tx_cts by restricting the ringbuffer
  to at least one slot empty
* agnostic of the details of the tx irq: works for uarts that
  generate tx interrupts on !tx-full or on tx-empty.
* only rx_produce and tx_consume need to be volatile
2015-07-19 23:37:00 +02:00
Florent Kermarrec 35250f5b11 bios: add romboot
When firmware is small enough, it can be interesting to run code from an embedded blockram memory (faster and not impacted by memory controller activity).
It can also be a fallback option in case boot from flash failed.
To use this, define ROM_BOOT_ADDRESS and initialize the blockram with the firmware data.
2015-07-14 18:01:44 +02:00
Florent Kermarrec 23541b5949 software/bios: call eth_mode only if we have an ethernet mac (we don't need to call it when we have a hardware UDP/IP stack) 2015-07-04 21:04:23 +02:00
Yann Sionneau 10eb07526d bios: show memtest command in help 2015-07-02 17:20:06 +02:00
Sebastien Bourdeauducq e913fca8a0 libcompiler-rt: add fixdfdi 2015-06-27 23:51:09 +02:00
Florent Kermarrec 351e654e9d software/bios/sdram: flush dcache and l2 in memtest (otherwise we are partially testing the cache) 2015-06-23 09:01:34 +02:00
Florent Kermarrec 781869d6f9 software/libbase/system: fix flush_l2_cache 2015-06-19 09:00:14 +02:00
Florent Kermarrec f44956bfca soc/sdram: add L2_SIZE constant and avoid declaring an empty flush_l2_cache function when L2_SIZE is not defined 2015-06-19 08:39:37 +02:00
Florent Kermarrec 3b9f287bab sdram: use wishbone cache as L2 cache and add optional L2 cache to Minicon 2015-06-17 15:30:30 +02:00
Yann Sionneau a8b9c126cd spiflash: now using 64k sectors 2015-05-27 18:44:14 +08:00
Yann Sionneau 3f7e161867 spiflash: cleanup unnecessary parenthesis 2015-05-27 18:44:14 +08:00
Florent Kermarrec 438a0856c5 misoclib/cpu: merge git.py in identifier 2015-05-02 18:42:33 +02:00
Florent Kermarrec e8c01ff4aa do more test with last changes fix small issues 2015-05-02 16:22:38 +02:00
Florent Kermarrec 8aa3fb3eb7 com/uart: add tx and rx fifos.
Since ressource usage is low with default depth of 16 (implemented in RAM LUTs) we don't keep old behaviour.
Tested successfully with BIOS and flterm.
2015-05-01 15:59:26 +02:00
Sebastien Bourdeauducq 1d9771f574 spiflash: use SoC defines, add write_to_flash function 2015-04-27 13:42:32 +08:00
Florent Kermarrec 0b1a2e1022 liteeth: do MII/GMII detection in gateware for gmii_mii phy 2015-04-26 18:08:07 +02:00
Florent Kermarrec ae71bf2830 liteeth: fix and improve 10/100/1000Mbps speed auto detection 2015-04-26 14:54:53 +02:00
Florent Kermarrec 3710afe7fe microudp.c: add #ifdef on ethmode (bios generation for gmii or mii was broken) 2015-04-12 20:59:50 +02:00