Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9daeaa37 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull sparc updates from David Miller:

1) Kill off support for sun4c and Cypress sun4m chips.

   And as a result we were able to also kill off that ugly btfixup thing
   that required multi-stage links of the final vmlinux image in the
   Kbuild system.  This should make the kbuild maintainers really happy.

   Thanks a lot to Sam Ravnborg for his tireless efforts to get this
   going.

2) Convert sparc64 to nobootmem.  I suspect now with sparc32 being a lot
   cleaner, it should be able to fall in line and modernize in this area
   too.

3) Make sparc32 use generic clockevents, from Tkhai Kirill.

[ I fixed up the BPF rules, and tried to clean up the build rules too.
  But I don't have - or want - a sparc cross-build environment, so the
  BPF rule bug and the related build cleanup was all done with just a
  bare "make -n" pseudo-test.      - Linus ]

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next: (110 commits)
  sparc32: use flushi when run-time patching in per_cpu_patch
  sparc32: fix cpuid_patch run-time patching
  sparc32: drop unused inline functions in srmmu.c
  sparc32: drop unused functions in pgtsrmmu.h
  sparc32,leon: move leon mmu functions to leon_mm.c
  sparc32,leon: remove duplicate definitions in leon.h
  sparc32,leon: remove duplicate UART register definitions
  sparc32,leon: move leon ASI definitions to asi.h
  sparc32: move trap table to a separate file
  sparc64: renamed ttable.S to ttable_64.S
  sparc32: Remove asm/sysen.h header.
  sparc32: Delete asm/smpprim.h
  sparc32: Remove unused empty_bad_page{,_table} declarations.
  sparc32: Kill boot_cpu_id4
  sparc32: Move GET_PROCESSOR*_ID() out of asm/asmmacro.h
  sparc32: Remove completely unused code from asm/cache.h
  sparc32: Add ucmpdi2.o to obj-y instead of lib-y.
  sparc32: add ucmpdi2
  sparc: introduce arch/sparc/Kbuild
  sparc: remove obsolete documentation
  ...
parents cb62ab71 1edc1783
Loading
Loading
Loading
Loading

Documentation/sparc/README-2.5

deleted100644 → 0
+0 −46
Original line number Diff line number Diff line
BTFIXUP
-------

To build new kernels you have to issue "make image". The ready kernel
in ELF format is placed in arch/sparc/boot/image. Explanation is below.

BTFIXUP is a unique feature of Linux/sparc among other architectures,
developed by Jakub Jelinek (I think... Obviously David S. Miller took
part, too). It allows to boot the same kernel at different 
sub-architectures, such as sun4c, sun4m, sun4d, where SunOS uses
different kernels. This feature is convinient for people who you move
disks between boxes and for distrution builders.

To function, BTFIXUP must link the kernel "in the draft" first,
analyze the result, write a special stub code based on that, and
build the final kernel with the stub (btfix.o).

Kai Germaschewski improved the build system of the kernel in the 2.5 series
significantly. Unfortunately, the traditional way of running the draft
linking from architecture specific Makefile before the actual linking
by generic Makefile is nearly impossible to support properly in the
new build system. Therefore, the way we integrate BTFIXUP with the
build system was changed in 2.5.40. Now, generic Makefile performs
the draft linking and stores the result in file vmlinux. Architecture
specific post-processing invokes BTFIXUP machinery and final linking
in the same way as other architectures do bootstraps.

Implications of that change are as follows.

1. Hackers must type "make image" now, instead of just "make", in the same
   way as s390 people do now. It is analogous to "make bzImage" on i386.
   This does NOT affect sparc64, you continue to use "make" to build sparc64
   kernels.

2. vmlinux is not the final kernel, so RPM builders have to adjust
   their spec files (if they delivered vmlinux for debugging).
   System.map generated for vmlinux is still valid.

3. Scripts that produce a.out images have to be changed. First, if they
   invoke make, they have to use "make image". Second, they have to pick up
   the new kernel in arch/sparc/boot/image instead of vmlinux.

4. Since we are compliant with Kai's build system now, make -j is permitted.

-- Pete Zaitcev
zaitcev@yahoo.com

arch/sparc/Kbuild

0 → 100644
+8 −0
Original line number Diff line number Diff line
#
# core part of the sparc kernel
#

obj-y += kernel/
obj-y += mm/
obj-y += math-emu/
obj-y += net/
+4 −8
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@ config SPARC
	select USE_GENERIC_SMP_HELPERS if SMP
	select GENERIC_PCI_IOMAP
	select HAVE_NMI_WATCHDOG if SPARC64
	select HAVE_BPF_JIT
	select HAVE_BPF_JIT if NET

config SPARC32
	def_bool !64BIT
@@ -62,6 +62,7 @@ config SPARC64
	select IRQ_PREFLOW_FASTEOI
	select ARCH_HAVE_NMI_SAFE_CMPXCHG
	select HAVE_C_RECORDMCOUNT
	select NO_BOOTMEM

config ARCH_DEFCONFIG
	string
@@ -74,17 +75,12 @@ config BITS
	default 32 if SPARC32
	default 64 if SPARC64

config ARCH_USES_GETTIMEOFFSET
	bool
	default y if SPARC32

config GENERIC_CMOS_UPDATE
	bool
	default y

config GENERIC_CLOCKEVENTS
	bool
	default y if SPARC64
	def_bool y

config IOMMU_HELPER
	bool
@@ -155,7 +151,7 @@ source "kernel/Kconfig.freezer"
menu "Processor type and features"

config SMP
	bool "Symmetric multi-processing support (does not work on sun4/sun4c)"
	bool "Symmetric multi-processing support"
	---help---
	  This enables support for systems with more than one CPU. If you have
	  a system with only one CPU, say N. If you have a system with more
+12 −36
Original line number Diff line number Diff line
@@ -19,39 +19,27 @@ ifeq ($(CONFIG_SPARC32),y)
# sparc32
#

#
# Uncomment the first KBUILD_CFLAGS if you are doing kgdb source level
# debugging of the kernel to get the proper debugging information.

AS             := $(AS) -32
LDFLAGS        := -m elf32_sparc
CHECKFLAGS     += -D__sparc__
LDFLAGS        := -m elf32_sparc
export BITS    := 32
UTS_MACHINE    := sparc

#KBUILD_CFLAGS += -g -pipe -fcall-used-g5 -fcall-used-g7
KBUILD_CFLAGS += -m32 -pipe -mno-fpu -fcall-used-g5 -fcall-used-g7
KBUILD_CFLAGS  += -m32 -mcpu=v8 -pipe -mno-fpu -fcall-used-g5 -fcall-used-g7
KBUILD_AFLAGS  += -m32 -Wa,-Av8

#LDFLAGS_vmlinux = -N -Ttext 0xf0004000
#  Since 2.5.40, the first stage is left not btfix-ed.
#  Actual linking is done with "make image".
LDFLAGS_vmlinux = -r

else
#####
# sparc64
#

CHECKFLAGS    += -D__sparc__ -D__sparc_v9__ -D__arch64__ -m64

LDFLAGS       := -m elf64_sparc
export BITS   := 64
UTS_MACHINE   := sparc64

KBUILD_CFLAGS += -m64 -pipe -mno-fpu -mcpu=ultrasparc -mcmodel=medlow   \
                 -ffixed-g4 -ffixed-g5 -fcall-used-g7 -Wno-sign-compare \
                 -Wa,--undeclared-regs
KBUILD_CFLAGS += -m64 -pipe -mno-fpu -mcpu=ultrasparc -mcmodel=medlow
KBUILD_CFLAGS += -ffixed-g4 -ffixed-g5 -fcall-used-g7 -Wno-sign-compare
KBUILD_CFLAGS += -Wa,--undeclared-regs
KBUILD_CFLAGS += $(call cc-option,-mtune=ultrasparc3)
KBUILD_AFLAGS += -m64 -mcpu=ultrasparc -Wa,--undeclared-regs

@@ -64,26 +52,14 @@ endif
head-y                 := arch/sparc/kernel/head_$(BITS).o
head-y                 += arch/sparc/kernel/init_task.o

core-y                 += arch/sparc/kernel/
core-y                 += arch/sparc/mm/ arch/sparc/math-emu/
core-y                 += arch/sparc/net/
# See arch/sparc/Kbuild for the core part of the kernel
core-y                 += arch/sparc/

libs-y                 += arch/sparc/prom/
libs-y                 += arch/sparc/lib/

drivers-$(CONFIG_OPROFILE)	+= arch/sparc/oprofile/

# Export what is needed by arch/sparc/boot/Makefile
export VMLINUX_INIT VMLINUX_MAIN
VMLINUX_INIT := $(head-y) $(init-y)
VMLINUX_MAIN := $(core-y) kernel/ mm/ fs/ ipc/ security/ crypto/ block/
VMLINUX_MAIN += $(patsubst %/, %/lib.a, $(libs-y)) $(libs-y)
VMLINUX_MAIN += $(drivers-y) $(net-y)

ifdef CONFIG_KALLSYMS
export kallsyms.o := .tmp_kallsyms2.o
endif

boot := arch/sparc/boot

# Default target
+10 −51
Original line number Diff line number Diff line
@@ -6,8 +6,8 @@
ROOT_IMG	:= /usr/src/root.img
ELFTOAOUT	:= elftoaout

hostprogs-y	:= piggyback btfixupprep
targets		:= tftpboot.img btfix.o btfix.S image zImage vmlinux.aout
hostprogs-y	:= piggyback
targets		:= tftpboot.img image zImage vmlinux.aout
clean-files	:= System.map

quiet_cmd_elftoaout	= ELFTOAOUT $@
@@ -17,58 +17,9 @@ quiet_cmd_piggy = PIGGY $@
quiet_cmd_strip		= STRIP   $@
      cmd_strip		= $(STRIP) -R .comment -R .note -K sun4u_init -K _end -K _start $< -o $@

ifeq ($(CONFIG_SPARC32),y)
quiet_cmd_btfix		= BTFIX   $@
      cmd_btfix		= $(OBJDUMP) -x vmlinux | $(obj)/btfixupprep > $@
quiet_cmd_sysmap        = SYSMAP  $(obj)/System.map
      cmd_sysmap        = $(CONFIG_SHELL) $(srctree)/scripts/mksysmap
quiet_cmd_image = LD      $@
      cmd_image = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS_$(@F)) -o $@

define rule_image
	$(if $($(quiet)cmd_image),               \
	  echo '  $($(quiet)cmd_image)' &&)      \
	  $(cmd_image);                          \
	$(if $($(quiet)cmd_sysmap),              \
	  echo '  $($(quiet)cmd_sysmap)' &&)  \
	$(cmd_sysmap) $@ $(obj)/System.map;      \
	if [ $$? -ne 0 ]; then                   \
		rm -f $@;                        \
		/bin/false;                      \
	fi;                                      \
	echo 'cmd_$@ := $(cmd_image)' > $(@D)/.$(@F).cmd
endef

BTOBJS := $(patsubst %/, %/built-in.o, $(VMLINUX_INIT))
BTLIBS := $(patsubst %/, %/built-in.o, $(VMLINUX_MAIN))
LDFLAGS_image := -T arch/sparc/kernel/vmlinux.lds $(BTOBJS) \
                  --start-group $(BTLIBS) --end-group \
                  $(kallsyms.o) $(obj)/btfix.o

# Link the final image including btfixup'ed symbols.
# This is a replacement for the link done in the top-level Makefile.
# Note: No dependency on the prerequisite files since that would require
# make to try check if they are updated - and due to changes
# in gcc options (path for example) this would result in
# these files being recompiled for each build.
$(obj)/image: $(obj)/btfix.o FORCE
	$(call if_changed_rule,image)

$(obj)/zImage: $(obj)/image
	$(call if_changed,strip)
	@echo '  kernel: $@ is ready'

$(obj)/btfix.S: $(obj)/btfixupprep vmlinux FORCE
	$(call if_changed,btfix)

endif

ifeq ($(CONFIG_SPARC64),y)

# Actual linking
$(obj)/image: vmlinux FORCE
	$(call if_changed,strip)
	@echo '  kernel: $@ is ready'

$(obj)/zImage: $(obj)/image
	$(call if_changed,gzip)
@@ -79,6 +30,10 @@ $(obj)/vmlinux.aout: vmlinux FORCE
	@echo '  kernel: $@ is ready'
else

$(obj)/zImage: $(obj)/image
	$(call if_changed,strip)
	@echo '  kernel: $@ is ready'

# The following lines make a readable image for U-Boot.
#  uImage   - Binary file read by U-boot
#  uImage.o - object file of uImage for loading with a
@@ -107,6 +62,10 @@ $(obj)/uImage: $(obj)/image.gz

endif

$(obj)/image: vmlinux FORCE
	$(call if_changed,strip)
	@echo '  kernel: $@ is ready'

$(obj)/tftpboot.img: $(obj)/image $(obj)/piggyback System.map $(ROOT_IMG) FORCE
	$(call if_changed,elftoaout)
	$(call if_changed,piggy)
Loading