First, leave USB_FULL_INIT on for all non-bootloader builds; this is
needed for devices that don't have a USBSTACK (such as most hosted
targets and ones that provide USB<>ATA in hardware)
Then unwind another hack that is no longer needed now that USB_FULL_INIT
is not set in most bootloaders.
Change-Id: I00881ac76b2469e5cd7700bad2203c58ef1e09e7
The intent here is that when HAVE_USBSTACK is not defined, or we are
in a bootloader wthout HAVE_BOOTLOADER_USB_MODE, a device may still
some of USB subsystem initialized. For example, this may be needed
to enable USB-based charging functionality.
So, get rid of the blanket enables of USB_FULL_INIT based on target SoC,
enabling HAVE_BOOTLOADER_USB_MODE on targets that need it, and clean up
the initial mess. Most of this mess is because usb_core.c has no sense
of USB_FULL_INIT or not, and is always included when HAVE_USBSTACK is
set (even in bootloaders without BOOTLOADER_USB_MODE), but dealing with
that latter case will come later.
Change-Id: I7f805b89dded39aeea2db9038209780069e3b600
Framebuffer access consumes a lot of SDRAM bandwidth.
Moving it to AXI SRAM should be a big improvement as
it's around 8x faster (2x clock speed, 4x bus width).
Also take advantage of explicitly assigning sections
to the special :NONE segment, which means they will
not appear in any ELF program header and thus aren't
visible to the bootloader. They can then overlap
areas used by the bootloader -- by the time they're
written, the bootloader will be long gone -- making
it easier to make efficient use of SRAM.
Change-Id: I2392fd23b17472cc08dc5fe4556f6def3cc186ed
Explicitly set 8-byte alignment as per the AAPCS, which
says the stack should be 8-byte aligned at a public ABI
boundary.
Change-Id: Ie60b664718119ea576e7c6b5efaac011eb907531
ie by only using HAVE_BOOTLOADER_USB_MODE, instead of blanket-enabling
USB_ENABLE_STORAGE for numerous SoC families
Change-Id: Ief433a1d693876072779e714883438c0012ba2e0
Many bootloaders broke because they have only partial USB
implementations -- HAVE_USBSTACK but without HAVE_BOOTLOADER_USB_MODE...
and a pile of exceptions.
Those exceptions need to be cleaned up properly, but for now, get the
build going again by wrapping the new ack-tracking bits with the
USB_FULL_INIT define created by the above conditions.
Change-Id: I936d4989b8c8195ee30d53808f61104a4986942a
currently, exclusive disk mode was enabled at the same time as the
usb insertion. when multiple usb configurations exist, this is not
appropriate.
manage it in the core and enable it only when necessary.
Change-Id: Iadbec05fad1d1319471233227ae0e72c12079295
add second argument to usb_acknowledge.
it can be used for more appropriate connection tracking that does not
rely on timeout in the future.
Change-Id: I8a44366b7c7a1f944524c4ba8ecd6d9673746a65
To avoid problems with SDMMC DMA not being able to
access all SRAMs equally, the ELF binary is loaded
at the top of SDRAM and then copied into place.
Change-Id: Icf16d02bc15605539cbe781dd27709225abca8f9
This is a small & simple ELF loader which just copies
program segments from disk to memory. It only supports
static binaries right now.
Change-Id: I8944feb5b9dafcc5c56e12383aed25e2718ad7ea
Most of system_init() should only be performed once after
reset, and is not safe to re-run when the bootloader jumps
to the application.
Change-Id: I4d2e804ce4884da13b9167ddcda860ef3b5ba7d0
Use flash & AXI SRAM for the bootloader, ITCM/DTCM and
SDRAM for Rockbox. Hardly the most optimal use of SRAMs
but it's good enough to get started.
Fixes the Echo R1 app build, which wasn't fitting in
AXI SRAM.
Change-Id: I4f7e5f618d27b553e5ff8dec1d5c4c61ac9d8eb0
Normally the bootloader won't enable the LCD, but we
still want to call lcd_init() at startup to keep the
code simple.
Change-Id: I866ecd7c81b6c5e6acdd57f5d7680400df3f54f4
The clock helpers are only used for leaf clocks of single
peripherals, which don't benefit from reference counting.
Change-Id: Ica5685e7bc0fce621ae46f758f0ad0b1dcfb2789
Make systick setup less hardcoded, and create a public API
for use by targets, in preparation for moving system_init()
into target-specific code.
Improve the implementation of udelay to make it more robust
against timer wraparound.
Change-Id: I21bb8821cfd1d7e4049fac6e6a4548d80a4276f7
This is mainly useful for bootloaders that want to safely
disable the SD/MMC controller before booting. Disabling a
controller will reset and power down the bus; all attempts
to read or write to a disabled controller will fail.
Change-Id: I4a7ec4287f2b8510a35d964cc806c74be8c86406
FIFO errors shouldn't be possible with hardware flow
control enabled. DMA errors shouldn't occur unless a
bad memory address was passed.
Don't bother checking for ITCM/DTCM in the transfer
setup and instead just wait for the IDMATE error; if
the RM0433 reference manual is to be believed then
SDMMC1 _only_ has access to AXI bus memories, and
checking for all invalid destinations would be very
verbose.
Change-Id: I2b22b56009933e16c5adde4d36b7a906cee57791
Hardware flow control prevents FIFO underruns/overruns
by stopping the bus clock if one would occur. This can
slow down transfers, but that's better than having data
transfer fail due to AXI/AHB bus contention.
Change-Id: I8696d3aff78c17dbbe85907160fa37fd4ee11e85
The following inline assembly in set_irq_level() turned out
to have incorrect constraints:
int newvalue = /* input parameter */;
int oldvalue;
asm volatile ("mrs %0, primask\n"
"msr primask, %1\n"
: "=r"(oldvalue) : "r"(newvalue));
leading to incorrect code generation for common cases like
disable_irq_save(), which compiles to:
mov r5, #1
mrs r5, primask
msr primask, r5
...which doesn't disable IRQs at all, since both of the
operands got assigned to the same register; the write of
'oldvalue' clobbers the 'newvalue' input before it's used.
Apparently GCC assumes that input operands are read before
output operands are written. One way to fix this is adding
the '&' constraint: "=&r"(oldvalue), but it's better to
break things down into separate, simpler asm statements
which GCC can figure out itself.
Also add compiler memory barriers where primask is modified
to ensure loads/stores aren't incorrectly moved outside of
critical sections.
While here, optimize disable_irq_save() a bit by using the
cpsid instruction, which avoids the extra "mov" and register
allocation needed by "msr primask".
Change-Id: Iac94a76db5bac399a1cf028da4241a0473259a46
This enables deeper sleep. On touchscreen devices (HiBy R1) it shuts down both screen and touch (touchscreen needs few seconds before it's actually disabled)
Change-Id: I5e8a7dae840227ddf4433daa461cc7124db7676a
While the binary firmware build succeeded, the 'make zip' process failed
because the script that put the default wps image together runs the
device config header through CPP while only looking into the
configuration header directory.
So move the imx233-config.h header out of the target/arm/imx233 and into
export/config where everything is copacetic.
Change-Id: I9914558a892f8ff7ad839818f0a5ef687cc7b997
3a4da9381e change an underdocumented definition that turns
out to be important, yet not documented in the linux uapi definitions.
Revert that change, and document the magic values so this doesn't happen again.
Change-Id: I0fac4a9d68170920bb5db1018d765e8a2994a95f
Bootloaders don't have support for queue_peek or other advanced
queue functionality, so USB-enabled bootloaders can't play these games.
Change-Id: Ib807b57b84433e7a2ad019648a6c588ab424c6cd
mmc_sleepnow() was accidentally removed from the imx233 sdmmc code,
causing the sansa fuze+ build to fail.
Change-Id: I935f7f4fe99e7353a84dc26e81d85ee55afa0de3