Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[arm] Split out 32-bit-specific code to arch/arm32
Signed-off-by: Michael Brown <mcb30@ipxe.org>
  • Loading branch information
mcb30 committed May 7, 2016
1 parent 2a187f4 commit edea3a4
Show file tree
Hide file tree
Showing 20 changed files with 54 additions and 38 deletions.
21 changes: 4 additions & 17 deletions src/arch/arm/Makefile
Expand Up @@ -3,23 +3,10 @@
ASM_TCHAR := %
ASM_TCHAR_OPS := %%

# ARM-specific directories containing source files
#
SRCDIRS += arch/arm/core
SRCDIRS += arch/arm/libgcc
SRCDIRS += arch/arm/interface/efi

# ARM-specific flags
# Include common ARM headers
#
CFLAGS += -mthumb -mcpu=cortex-a15 -mabi=aapcs -mfloat-abi=soft
CFLAGS += -mword-relocations
ASFLAGS += -mthumb -mcpu=cortex-a15
INCDIRS += arch/arm/include

# EFI requires -fshort-wchar, and nothing else currently uses wchar_t
#
CFLAGS += -fshort-wchar

# Include platform-specific Makefile
# ARM-specific directories containing source files
#
MAKEDEPS += arch/arm/Makefile.$(PLATFORM)
include arch/arm/Makefile.$(PLATFORM)
SRCDIRS += arch/arm/interface/efi
8 changes: 0 additions & 8 deletions src/arch/arm/Makefile.efi
@@ -1,13 +1,5 @@
# -*- makefile -*- : Force emacs to use Makefile mode

# Specify EFI image builder
#
ELF2EFI = $(ELF2EFI32)

# Specify EFI boot file
#
EFI_BOOT_FILE = bootarm.efi

# Include generic EFI Makefile
#
MAKEDEPS += Makefile.efi
Expand Down
26 changes: 13 additions & 13 deletions src/arch/arm/core/arm_io.c
Expand Up @@ -33,7 +33,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
*/

/** An ARM I/O qword */
union arm_io_qword {
union arm32_io_qword {
uint64_t qword;
uint32_t dword[2];
};
Expand All @@ -44,12 +44,12 @@ union arm_io_qword {
* @v io_addr I/O address
* @ret data Value read
*
* This is not atomic for ARM.
* This is not atomic for ARM32.
*/
static uint64_t arm_readq ( volatile uint64_t *io_addr ) {
volatile union arm_io_qword *ptr =
container_of ( io_addr, union arm_io_qword, qword );
union arm_io_qword tmp;
static uint64_t arm32_readq ( volatile uint64_t *io_addr ) {
volatile union arm32_io_qword *ptr =
container_of ( io_addr, union arm32_io_qword, qword );
union arm32_io_qword tmp;

tmp.dword[0] = readl ( &ptr->dword[0] );
tmp.dword[1] = readl ( &ptr->dword[1] );
Expand All @@ -62,12 +62,12 @@ static uint64_t arm_readq ( volatile uint64_t *io_addr ) {
* @v data Value to write
* @v io_addr I/O address
*
* This is not atomic for ARM.
* This is not atomic for ARM32.
*/
static void arm_writeq ( uint64_t data, volatile uint64_t *io_addr ) {
volatile union arm_io_qword *ptr =
container_of ( io_addr, union arm_io_qword, qword );
union arm_io_qword tmp;
static void arm32_writeq ( uint64_t data, volatile uint64_t *io_addr ) {
volatile union arm32_io_qword *ptr =
container_of ( io_addr, union arm32_io_qword, qword );
union arm32_io_qword tmp;

tmp.qword = data;
writel ( tmp.dword[0], &ptr->dword[0] );
Expand All @@ -84,5 +84,5 @@ PROVIDE_IOAPI_INLINE ( arm, writew );
PROVIDE_IOAPI_INLINE ( arm, writel );
PROVIDE_IOAPI_INLINE ( arm, iodelay );
PROVIDE_IOAPI_INLINE ( arm, mb );
PROVIDE_IOAPI ( arm, readq, arm_readq );
PROVIDE_IOAPI ( arm, writeq, arm_writeq );
PROVIDE_IOAPI ( arm, readq, arm32_readq );
PROVIDE_IOAPI ( arm, writeq, arm32_writeq );
23 changes: 23 additions & 0 deletions src/arch/arm32/Makefile
@@ -0,0 +1,23 @@
# ARM32-specific directories containing source files
#
SRCDIRS += arch/arm32/core
SRCDIRS += arch/arm32/libgcc

# ARM32-specific flags
#
CFLAGS += -mthumb -mcpu=cortex-a15 -mabi=aapcs -mfloat-abi=soft
CFLAGS += -mword-relocations
ASFLAGS += -mthumb -mcpu=cortex-a15

# EFI requires -fshort-wchar, and nothing else currently uses wchar_t
#
CFLAGS += -fshort-wchar

# Include common ARM Makefile
MAKEDEPS += arch/arm/Makefile
include arch/arm/Makefile

# Include platform-specific Makefile
#
MAKEDEPS += arch/arm32/Makefile.$(PLATFORM)
include arch/arm32/Makefile.$(PLATFORM)
14 changes: 14 additions & 0 deletions src/arch/arm32/Makefile.efi
@@ -0,0 +1,14 @@
# -*- makefile -*- : Force emacs to use Makefile mode

# Specify EFI image builder
#
ELF2EFI = $(ELF2EFI32)

# Specify EFI boot file
#
EFI_BOOT_FILE = bootarm.efi

# Include generic EFI Makefile
#
MAKEDEPS += arch/arm/Makefile.efi
include arch/arm/Makefile.efi
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit edea3a4

Please sign in to comment.