LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: powerpc allnoconfig
From: Andrew Morton @ 2009-03-03  2:40 UTC (permalink / raw)
  To: Michael Neuling; +Cc: linuxppc-dev
In-Reply-To: <12051.1236047470@neuling.org>

On Tue, 03 Mar 2009 13:31:10 +1100 Michael Neuling <mikey@neuling.org> wrote:

> > make mrproper
> > make allnoconfig
> > make vmlinux
> > 
> > gives:
> > 
> > scripts/kconfig/conf -s arch/powerpc/Kconfig
> >   CHK     include/linux/version.h
> >   UPD     include/linux/version.h
> >   CHK     include/linux/utsrelease.h
> >   UPD     include/linux/utsrelease.h
> >   SYMLINK include/asm -> include/asm-powerpc
> >   HOSTCC  scripts/ihex2fw
> >   HOSTCC  scripts/kallsyms
> >   HOSTCC  scripts/conmakehash
> >   CC      scripts/mod/empty.o
> >   HOSTCC  scripts/mod/mk_elfconfig
> > scripts/mod/empty.c:1: error: -m64 requires a PowerPC64 cpu
> > make[2]: *** [scripts/mod/empty.o] Error 1
> > make[2]: *** Waiting for unfinished jobs....
> > make[1]: *** [scripts/mod] Error 2
> > make[1]: *** Waiting for unfinished jobs....
> > make: *** [scripts] Error 2
> 
> I can't replicate this with Linus' latest tree with gcc 4.3 or 4.0.

ho hum.

> What's your tool chain?  Does it compile 32 or 64bit by default?

It's a cross-compiler: http://userweb.kernel.org/~akpm/cross-compilers/

Here's a `make V=1':

rm -f include/config/kernel.release
echo 2.6.29-rc6 > include/config/kernel.release
set -e; : '  CHK     include/linux/version.h'; mkdir -p include/linux/; 	(echo \#define LINUX_VERSION_CODE 132637; echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))';) < /usr/src/25/Makefile > include/linux/version.h.tmp; if [ -r include/linux/version.h ] && cmp -s include/linux/version.h include/linux/version.h.tmp; then rm -f include/linux/version.h.tmp; else : '  UPD     include/linux/version.h'; mv -f include/linux/version.h.tmp include/linux/version.h; fi
set -e; : '  CHK     include/linux/utsrelease.h'; mkdir -p include/linux/; 	if [ `echo -n "2.6.29-rc6" | wc -c ` -gt 64 ]; then echo '"2.6.29-rc6" exceeds 64 characters' >&2; exit 1; fi; (echo \#define UTS_RELEASE \"2.6.29-rc6\";) < include/config/kernel.release > include/linux/utsrelease.h.tmp; if [ -r include/linux/utsrelease.h ] && cmp -s include/linux/utsrelease.h include/linux/utsrelease.h.tmp; then rm -f include/linux/utsrelease.h.tmp; else : '  UPD     include/linux/utsrelease.h'; mv -f include/linux/utsrelease.h.tmp include/linux/utsrelease.h; fi
set -e; if [ -L include/asm ]; then asmlink=`readlink include/asm | cut -d '-' -f 2`; if [ "$asmlink" != "powerpc" ]; then echo "ERROR: the symlink include/asm points to asm-$asmlink but asm-powerpc was expected"; echo "       set ARCH or save .config and run 'make mrproper' to fix it"; exit 1; fi; test -e $asmlink || rm include/asm; elif [ -d include/asm ]; then echo "ERROR: include/asm is a directory but a symlink was expected"; exit 1; fi
make -f scripts/Makefile.build obj=scripts/basic
if [ ! -L include/asm ]; then : '  SYMLINK include/asm -> include/asm-powerpc'; if [ ! -d include/asm-powerpc ]; then mkdir -p include/asm-powerpc; fi; ln -fsn asm-powerpc include/asm; fi
mkdir -p .tmp_versions 
make -f scripts/Makefile.build obj=scripts
make -f scripts/Makefile.build obj=scripts/mod
  /opt/crosstool/gcc-4.1.0-glibc-2.3.6/powerpc64-unknown-linux-gnu/bin/powerpc64-unknown-linux-gnu-gcc -Wp,-MD,scripts/mod/.empty.o.d  -nostdinc -isystem /opt/crosstool/gcc-4.1.0-glibc-2.3.6/powerpc64-unknown-linux-gnu/lib/gcc/powerpc64-unknown-linux-gnu/4.1.0/./include -Iinclude  -I/usr/src/25/arch/powerpc/include -include include/linux/autoconf.h -D__KERNEL__ -Iarch/powerpc -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -O2 -msoft-float -pipe -Iarch/powerpc -ffixed-r2 -mmultiple -mno-altivec -mno-spe -mspe=no -funit-at-a-time -mno-string -mcpu=powerpc -Wa,-maltivec -fno-stack-protector -fomit-frame-pointer -Wdeclaration-after-statement -Wno-pointer-sign  -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(empty)"  -D"KBUILD_MODNAME=KBUILD_STR(empty)"  -c -o scripts/mod/empty.o scripts/mod/empty.c
scripts/mod/empty.c:1: error: -m64 requires a PowerPC64 cpu
make[2]: *** [scripts/mod/empty.o] Error 1
make[1]: *** [scripts/mod] Error 2
make: *** [scripts] Error 2
**FAILED**

^ permalink raw reply

* Re: powerpc allnoconfig
From: Stephen Rothwell @ 2009-03-03  2:52 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linuxppc-dev, Michael Neuling
In-Reply-To: <20090302184049.27a73395.akpm@linux-foundation.org>

[-- Attachment #1: Type: text/plain, Size: 520 bytes --]

Hi Andrew,

On Mon, 2 Mar 2009 18:40:49 -0800 Andrew Morton <akpm@linux-foundation.org> wrote:
>
> It's a cross-compiler: http://userweb.kernel.org/~akpm/cross-compilers/

What does
"/opt/crosstool/gcc-4.1.0-glibc-2.3.6/powerpc64-unknown-linux-gnu/bin/powerpc64-unknown-linux-gnu-gcc -v" say?

I suspect you have a 64 bit only compiler and allnoconfig produces a 32
bit kernel.  Is this a new error?

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply

* Re: powerpc allnoconfig
From: Andrew Morton @ 2009-03-03  2:55 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linuxppc-dev, Michael Neuling
In-Reply-To: <20090303135203.b36312a0.sfr@canb.auug.org.au>

On Tue, 3 Mar 2009 13:52:03 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:

> Hi Andrew,
> 
> On Mon, 2 Mar 2009 18:40:49 -0800 Andrew Morton <akpm@linux-foundation.org> wrote:
> >
> > It's a cross-compiler: http://userweb.kernel.org/~akpm/cross-compilers/
> 
> What does
> "/opt/crosstool/gcc-4.1.0-glibc-2.3.6/powerpc64-unknown-linux-gnu/bin/powerpc64-unknown-linux-gnu-gcc -v" say?

Using built-in specs.
Target: powerpc64-unknown-linux-gnu
Configured with: /home/axboe/crosstool-0.43/build/powerpc64-unknown-linux-gnu/gcc-4.1.0-glibc-2.3.6/gcc-4.1.0/configure --target=powerpc64-unknown-linux-gnu --host=x86_64-host_unknown-linux-gnu --prefix=/opt/crosstool/gcc-4.1.0-glibc-2.3.6/powerpc64-unknown-linux-gnu --disable-multilib --with-sysroot=/opt/crosstool/gcc-4.1.0-glibc-2.3.6/powerpc64-unknown-linux-gnu/powerpc64-unknown-linux-gnu/sys-root --with-local-prefix=/opt/crosstool/gcc-4.1.0-glibc-2.3.6/powerpc64-unknown-linux-gnu/powerpc64-unknown-linux-gnu/sys-root --disable-nls --enable-threads=posix --enable-symvers=gnu --enable-__cxa_atexit --enable-languages=c --enable-shared --enable-c99 --enable-long-long
Thread model: posix
gcc version 4.1.0

> I suspect you have a 64 bit only compiler and allnoconfig produces a 32
> bit kernel.  Is this a new error?

2.6.28 does the same thing.  I don't recall having tested allnoconfig
for ages if at all, so I don't know if it's a regression.

^ permalink raw reply

* Re: powerpc allnoconfig
From: Stephen Rothwell @ 2009-03-03  3:19 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linuxppc-dev, Michael Neuling
In-Reply-To: <20090302185514.2cc73512.akpm@linux-foundation.org>

[-- Attachment #1: Type: text/plain, Size: 1567 bytes --]

Hi Andrew,

On Mon, 2 Mar 2009 18:55:14 -0800 Andrew Morton <akpm@linux-foundation.org> wrote:
>
> Using built-in specs.
> Target: powerpc64-unknown-linux-gnu
> Configured with: /home/axboe/crosstool-0.43/build/powerpc64-unknown-linux-gnu/gcc-4.1.0-glibc-2.3.6/gcc-4.1.0/configure --target=powerpc64-unknown-linux-gnu --host=x86_64-host_unknown-linux-gnu --prefix=/opt/crosstool/gcc-4.1.0-glibc-2.3.6/powerpc64-unknown-linux-gnu --disable-multilib --with-sysroot=/opt/crosstool/gcc-4.1.0-glibc-2.3.6/powerpc64-unknown-linux-gnu/powerpc64-unknown-linux-gnu/sys-root --with-local-prefix=/opt/crosstool/gcc-4.1.0-glibc-2.3.6/powerpc64-unknown-linux-gnu/powerpc64-unknown-linux-gnu/sys-root --disable-nls --enable-threads=posix --enable-symvers=gnu --enable-__cxa_atexit --enable-languages=c --enable-shared --enable-c99 --enable-long-long
> Thread model: posix
> gcc version 4.1.0
> 
> > I suspect you have a 64 bit only compiler and allnoconfig produces a 32
> > bit kernel.  Is this a new error?
> 
> 2.6.28 does the same thing.  I don't recall having tested allnoconfig
> for ages if at all, so I don't know if it's a regression.

Right, you have a 64 bit only compiler. Also it is version 4.1.0 which we now black ban (I think).  You need to either build a biarch cross compiler (--enable-targets=all) or try:

$ cat >xxx <<EOF
CONFIG_PPC64=y
EOF
$ KCONFIG_ALLCONFIG=xxx make allnoconfig
$ make vmlinux

let us know if that works :-)
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply

* Re: powerpc allnoconfig
From: Andrew Morton @ 2009-03-03  4:08 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linuxppc-dev, Michael Neuling
In-Reply-To: <20090303141905.52dbf9b1.sfr@canb.auug.org.au>

On Tue, 3 Mar 2009 14:19:05 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:

> Hi Andrew,
> 
> On Mon, 2 Mar 2009 18:55:14 -0800 Andrew Morton <akpm@linux-foundation.org> wrote:
> >
> > Using built-in specs.
> > Target: powerpc64-unknown-linux-gnu
> > Configured with: /home/axboe/crosstool-0.43/build/powerpc64-unknown-linux-gnu/gcc-4.1.0-glibc-2.3.6/gcc-4.1.0/configure --target=powerpc64-unknown-linux-gnu --host=x86_64-host_unknown-linux-gnu --prefix=/opt/crosstool/gcc-4.1.0-glibc-2.3.6/powerpc64-unknown-linux-gnu --disable-multilib --with-sysroot=/opt/crosstool/gcc-4.1.0-glibc-2.3.6/powerpc64-unknown-linux-gnu/powerpc64-unknown-linux-gnu/sys-root --with-local-prefix=/opt/crosstool/gcc-4.1.0-glibc-2.3.6/powerpc64-unknown-linux-gnu/powerpc64-unknown-linux-gnu/sys-root --disable-nls --enable-threads=posix --enable-symvers=gnu --enable-__cxa_atexit --enable-languages=c --enable-shared --enable-c99 --enable-long-long
> > Thread model: posix
> > gcc version 4.1.0
> > 
> > > I suspect you have a 64 bit only compiler and allnoconfig produces a 32
> > > bit kernel.  Is this a new error?
> > 
> > 2.6.28 does the same thing.  I don't recall having tested allnoconfig
> > for ages if at all, so I don't know if it's a regression.
> 
> Right, you have a 64 bit only compiler. Also it is version 4.1.0 which we now black ban (I think).

Probably.  But I only use it for compilation testing, so the `Your
version of gcc miscompiles the __weak directive' thing is a pointless
PITA, so I patch it out.

>  You need to either build a biarch cross compiler (--enable-targets=all) or try:
> 
> $ cat >xxx <<EOF
> CONFIG_PPC64=y
> EOF
> $ KCONFIG_ALLCONFIG=xxx make allnoconfig
> $ make vmlinux
> 
> let us know if that works :-)

didn't.  Oh well.

It seems odd that it breaks an allnoconfig build, whereas defconfig and
allmodconfig are OK.

^ permalink raw reply

* RE: Can't load module spi_mpc83xx : No such device
From: Dushara Jayasinghe @ 2009-03-03  4:11 UTC (permalink / raw)
  To: 'avorontsov@ru.mvista.com'; +Cc: linuxppc-dev@ozlabs.org
In-Reply-To: <20090227125456.GA21435@oksana.dev.rtsoft.ru>

Hi All,

> Linus' tree is still lacking few patches for spi_mpc83xx driver, the
> patches makes spi_mpc83xx work with the device tree directly.

I modified the spi_mpc83xx to work with the device tree using mpc52xx_psc_s=
pi.c as a guide.=20
However, the device->dev->platform_data member is NULL (I thought the child=
 node would provide that).=20
What am I missing?

I'm trying to create the SPI driver as a loadable module which will be used=
 by the m25p80 chip driver (drivers/mtd/devices) which also will be a loada=
ble module. Am I on the right track?

> [...]
> > Part of my device tree is as follows:
> >
> > 	soc8349@e0000000 {
> > 		...
> > 		spi@7000 {
> > 			#address-cells =3D <1>;
> > 			#size-cells =3D <0>;
> > 			compatible =3D "fsl,spi";
> > 			reg =3D <0x7000 0x1000>;
> > 			interrupts =3D <0x10 0x8>;
> > 			interrupt-parent =3D < &ipic >;
>=20
> You don't seem to have any chip-selects (i.e. gpios =3D <>) specified.

Could you elaborate on this point please? I couldn't find any examples of g=
pios defined within SPI nodes.

[...]

> >
> > 			m25p40@2 {
> > 				compatible =3D "m25p80";
> > 				spi-max-frequency =3D <25000000>;
> > 				reg =3D <2>;

Thanks again.
D

^ permalink raw reply

* Re: Please pull 'next' branch
From: Benjamin Herrenschmidt @ 2009-03-03  4:28 UTC (permalink / raw)
  To: Josh Boyer; +Cc: linuxppc-dev
In-Reply-To: <20090302132518.GA2447@yoda.jdub.homelinux.org>

On Mon, 2009-03-02 at 08:25 -0500, Josh Boyer wrote:
> On Tue, Feb 24, 2009 at 09:08:00AM -0500, Josh Boyer wrote:
> >Hi Ben,
> >
> >Please pull the next branch of the 4xx tree.  It has a few small commits
> >for 2.6.30, as well as the 256K page size patch for 44x.
> 
> Ben, ping?

It's up now.

Cheers,
Ben.

^ permalink raw reply

* Re: powerpc allnoconfig
From: Stephen Rothwell @ 2009-03-03  4:40 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linuxppc-dev, Michael Neuling
In-Reply-To: <20090302200809.26b5d5bb.akpm@linux-foundation.org>

[-- Attachment #1: Type: text/plain, Size: 1598 bytes --]

Hi Andrew,

On Mon, 2 Mar 2009 20:08:09 -0800 Andrew Morton <akpm@linux-foundation.org> wrote:
>
> > Right, you have a 64 bit only compiler. Also it is version 4.1.0 which we now black ban (I think).
> 
> Probably.  But I only use it for compilation testing, so the `Your
> version of gcc miscompiles the __weak directive' thing is a pointless
> PITA, so I patch it out.

Ah, ok.

> > let us know if that works :-)
> 
> didn't.  Oh well.

Rats!

I think we need a better bug report :-)
Kernel version? What error do you get now?

It works for me:

$ /home/sfr/kernels/cross/bin/powerpc64-linux-gcc -v
Using built-in specs.
Target: powerpc64-linux
Configured with: /home/sfr/kernels/tools/gcc-4.3.2/configure --target=powerpc64-linux --enable-targets=all --prefix=/home/sfr/kernels/cross --with-mpfr=/usr --enable-languages=c --without-headers --enable-sjlj-exceptions --with-system-libunwind --disable-nls --disable-threads --disable-shared --disable-libmudflap --disable-libssp --disable-libgomp --disable-decimal-float --enable-checking=release
Thread model: single
gcc version 4.3.2 (GCC) 
$ git describe --all
tags/next-20090302

also Linus' recent tree works:

$ git describe
v2.6.29-rc6-216-g778ef1e

> It seems odd that it breaks an allnoconfig build, whereas defconfig and
> allmodconfig are OK.

allmodconfig and defconfig turn CONFIG_PPC64 on.  allnoconfig turns it
off so you are trying to build a 32 bit kernel with a 64 bit compiler.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply

* next branch status
From: Benjamin Herrenschmidt @ 2009-03-03  4:55 UTC (permalink / raw)
  To: linuxppc-dev list

Hoy hoy !

So I somewhat lost track of what I announced and what not already so
here's a full shortlog of what's in today vs. Linus, followed by a
diffstat.

Heads up as the merge window is opening soon.

I still have to scrub patchwork for new stuff that got posted since the
last "test" update last week, don't go bonkers if you don't see your
patch in if you posted it last week, only if it's older than that.

Note: Test is empty right now (ie. == next)

Note: Kumar and Grant, pls be a bit more careful with files outside of
arch/powerpc ... like the 5200 fec driver change, even if it's really
powerpc only stuff and quite clearly so, it's in drivers/net, it
wouldn't have hurt to seek davem ack for it... No big deal, it's only 2
or 3 files that I might need to give Linus an explanation about tho :-)

Cheers,
Ben.

Anton Blanchard (11):
      powerpc/mm: Move 64-bit unmapped_area to top of address space
      powerpc/mm: Reduce hashtable size when using 64kB pages
      powerpc: Move is_32bit_task
      powerpc: Rearrange mmap.c
      powerpc: Randomise mmap start address
      powerpc: More stack randomisation for 64bit binaries
      powerpc: Randomise lower bits of stack address
      powerpc: Randomise the brk region
      powerpc: Ensure random space between stack and mmaps
      powerpc: Increase stack gap on 64bit binaries
      powerpc: Randomise PIEs

Anton Vorontsov (5):
      powerpc/fsl_pci: Add MPC83xx PCI-E controller RC mode support
      powerpc/83xx: Add PCI-E support for all MPC83xx boards with PCI-E
      powerpc: Document FSL eSDHC bindings
      powerpc/83xx: Convert existing sdhc nodes to new bindings
      powerpc/83xx: Add FSL eSDHC support for MPC837x-RDB boards

Arnd Bergmann (1):
      powerpc/cell: Fix dependency in cpufreq

Benjamin Herrenschmidt (3):
      powerpc/mm: Rework I$/D$ coherency (v3)
      powerpc/4xx: Add missing USB and i2c devices to Canyonlands
      powerpc/4xx: Enable PCI domains on 4xx

Benjamin Krill (1):
      powerpc/cell: Add rtas rtc calls for the QPACE platform

Brian King (1):
      powerpc/pseries: Fix partition migration hang under load

Gabriel Paubert (1):
      powerpc: Disable mv643xx Ethernet port 0 on Pegasos

Gerhard Pircher (4):
      powerpc/amigaone: Add platform support for AmigaOne
      powerpc/amigaone: Generic device tree for all AmigaOne boards
      powerpc/amigaone: Bootwrapper and serial console support for AmigaOne
      powerpc/amigaone: Default config for AmigaOne boards

Giuliano Pochini (1):
      powerpc/powermac: Hotplug /sys entries are missing

Grant Likely (7):
      powerpc/5200: Stop using device_type and port-number properties
      powerpc/5200: Trim cruft from device trees
      powerpc/5200: Don't specify IRQF_SHARED in PSC UART driver
      powerpc/5200: Remove pr_debug() from hot paths in irq driver
      powerpc/5200: Refactor mpc5200 interrupt controller driver
      powerpc/5200: Rework GPT driver to also be an IRQ controller
      powerpc/5200: Add support for the Media5200 board from Freescale

Grzegorz Bernacki (1):
      powerpc/5200: Add support for the digsy MTC board.

Ilya Yanok (1):
      powerpc: Rework dma-noncoherent to use generic vmalloc layer

Jeremy Kerr (3):
      powerpc/spufs: Use correct return value for spu_handle_mm_fault
      powerpc/spufs: Clear purge status before setting up isolated mode
      powerpc/spufs: Constify context contents and coredump callback constants

Kumar Gala (10):
      powerpc/fsl-booke: Cleanup init/exception setup to be runtime
      powerpc/fsl: Ensure PCI_QUIRKS are enabled for FSL_PCI
      powerpc/85xx: Fixed PCI IO region sizes in mpc8572ds*.dts
      powerpc/85xx: Added 36-bit physical device tree for mpc8572ds board
      powerpc/fsl-booke: Add new ISA 2.06 page sizes and MAS defines
      powerpc/book-3e: Introduce concept of Book-3e MMU
      powerpc/fsl-booke: Fix compile warning
      powerpc: Unify opcode definitions and support
      powerpc: Fix warnings from make headers_check
      powerpc: Add support for using doorbells for SMP IPI

Laurent Pinchart (1):
      cpm2: Round the baud-rate clock divider to the nearest integer.

Madhulika Madishetty (1):
      AMCC PPC 460SX redwood SoC platform initial framework

Martyn Welch (3):
      powerpc/86xx: Board support for GE Fanuc SBC310
      powerpc/86xx: Default configutation for GE Fanuc's SBC310
      powerpc/86xx: Extend GE Fanuc GPIO driver for the SBC310

Michael Ellerman (9):
      powerpc: Remove unused ppc64_terminate_msg()
      powerpc: Allow debugging of LMBs with lmb=debug
      lmb: Rework lmb_dump_all() output
      powerpc/pseries: Fix MSI-X interrupt querying
      powerpc/pseries: Add support for ibm,req#msi-x
      powerpc/pseries: Check for MSI-X also in rtas_msi_pci_irq_fixup()
      powerpc/pseries: Return the number of MSIs we could allocate
      powerpc/pseries: Return req#msi(-x) if request is larger
      powerpc/pseries: Implement a quota system for MSIs

Michael Neuling (2):
      powerpc: Add alignment handler for new lfiwzx instruction
      powerpc: Fix load/store float double alignment handler

Mike Mason (1):
      powerpc/eeh: Only disable/enable LSI interrupts in EEH

Milton Miller (4):
      powerpc/numa: Avoid possible reference beyond prop. length in find_min_common_depth()
      powerpc/numa: Remove redundant find_cpu_node()
      powerpc/pseries: Remove write only variable in PCI DLPAR
      powerpc/pci: Move hose_list and pci_address_to_pio to pci-common

Nathan Fontenot (1):
      powerpc/numa: Cleanup hot_add_scn_to_nid

Peter Korsgaard (1):
      powerpc: convert dts-bindings/fsl/dma.txt to dts-v1 syntax

Reynes Philippe (3):
      powerpc/83xx: Add i2c eeprom to dts for MPC837x RDB
      powerpc/83xx: Add gpio to MPC837x RDB
      powerpc/83xx: Add lm75 to MPC837x RDB dts

Steven Rostedt (11):
      tracing/function-graph-tracer: make arch generic push pop functions
      ftrace, powerpc: replace debug macro with proper pr_deug
      powerpc, ftrace: fix compile error when modules not configured
      powerpc64: port of the function graph tracer
      powerpc64, tracing: add function graph tracer with dynamic tracing
      powerpc64, ftrace: save toc only on modules for function graph
      powerpc32, ftrace: save and restore mcount regs with macro
      powerpc32, ftrace: port function graph tracer to ppc32, static only
      powerpc32, ftrace: dynamic function graph tracer
      powerpc, ftrace: use unsigned int for instruction manipulation
      powerpc, ftrace: use create_branch lib function

Tom Arbuckle (1):
      powerpc/pci: Fix PCI<->OF matching of old style multifunc devices

Trent Piepho (3):
      powerpc/fsl-booke: Remove code duplication in lowmem mapping
      powerpc/fsl-booke: Allow larger CAM sizes than 256 MB
      powerpc/fsl-booke: Make CAM entries used for lowmem configurable

Wolfgang Grandegger (2):
      powerpc/85xx: TQM85xx - fix sensitivity of CAN interrupts
      powerpc/85xx: TQM85xx - add i2c device nodes for LM75

Yuri Tikhonov (1):
      powerpc/44x: Support for 256KB PAGE_SIZE

roel kluin (1):
      therm_adt746x: Fix signed/unsigned confusion


 Documentation/powerpc/dts-bindings/fsl/dma.txt   |   34 
 Documentation/powerpc/dts-bindings/fsl/esdhc.txt |   24 
 arch/powerpc/Kconfig                             |   72 +
 arch/powerpc/boot/Makefile                       |    9 
 arch/powerpc/boot/cuboot-amigaone.c              |   35 
 arch/powerpc/boot/dts/amigaone.dts               |  173 ++
 arch/powerpc/boot/dts/canyonlands.dts            |   28 
 arch/powerpc/boot/dts/cm5200.dts                 |   49 -
 arch/powerpc/boot/dts/digsy_mtc.dts              |  254 +++
 arch/powerpc/boot/dts/gef_sbc310.dts             |  364 +++++
 arch/powerpc/boot/dts/lite5200.dts               |   52 -
 arch/powerpc/boot/dts/lite5200b.dts              |   63 -
 arch/powerpc/boot/dts/media5200.dts              |  318 ++++
 arch/powerpc/boot/dts/motionpro.dts              |   42 -
 arch/powerpc/boot/dts/mpc8315erdb.dts            |   64 +
 arch/powerpc/boot/dts/mpc8377_mds.dts            |   71 +
 arch/powerpc/boot/dts/mpc8377_rdb.dts            |  102 +
 arch/powerpc/boot/dts/mpc8378_mds.dts            |   71 +
 arch/powerpc/boot/dts/mpc8378_rdb.dts            |  102 +
 arch/powerpc/boot/dts/mpc8379_mds.dts            |    7 
 arch/powerpc/boot/dts/mpc8379_rdb.dts            |   38 +
 arch/powerpc/boot/dts/mpc8572ds.dts              |   10 
 arch/powerpc/boot/dts/mpc8572ds_36b.dts          |  787 +++++++++++
 arch/powerpc/boot/dts/mpc8572ds_camp_core0.dts   |    8 
 arch/powerpc/boot/dts/mpc8572ds_camp_core1.dts   |    4 
 arch/powerpc/boot/dts/pcm030.dts                 |  182 +-
 arch/powerpc/boot/dts/redwood.dts                |  244 +++
 arch/powerpc/boot/dts/tqm5200.dts                |   32 
 arch/powerpc/boot/dts/tqm8540.dts                |    5 
 arch/powerpc/boot/dts/tqm8541.dts                |    5 
 arch/powerpc/boot/dts/tqm8548-bigflash.dts       |    9 
 arch/powerpc/boot/dts/tqm8548.dts                |    9 
 arch/powerpc/boot/dts/tqm8555.dts                |    5 
 arch/powerpc/boot/dts/tqm8560.dts                |    9 
 arch/powerpc/boot/serial.c                       |    3 
 arch/powerpc/boot/wrapper                        |    3 
 arch/powerpc/configs/44x/canyonlands_defconfig   |  266 +++-
 arch/powerpc/configs/44x/redwood_defconfig       | 1176 ++++++++++++++++
 arch/powerpc/configs/86xx/gef_sbc310_defconfig   | 1613 ++++++++++++++++++++++
 arch/powerpc/configs/amigaone_defconfig          | 1636 ++++++++++++++++++++++
 arch/powerpc/include/asm/bootx.h                 |    2 
 arch/powerpc/include/asm/code-patching.h         |    4 
 arch/powerpc/include/asm/cputable.h              |    4 
 arch/powerpc/include/asm/dbell.h                 |   43 +
 arch/powerpc/include/asm/elf.h                   |   14 
 arch/powerpc/include/asm/ftrace.h                |   39 +
 arch/powerpc/include/asm/highmem.h               |   12 
 arch/powerpc/include/asm/kvm.h                   |    2 
 arch/powerpc/include/asm/machdep.h               |    2 
 arch/powerpc/include/asm/mmu-44x.h               |    2 
 arch/powerpc/include/asm/mmu-book3e.h            |   66 +
 arch/powerpc/include/asm/mmu.h                   |    6 
 arch/powerpc/include/asm/page.h                  |    6 
 arch/powerpc/include/asm/page_32.h               |    4 
 arch/powerpc/include/asm/pgtable-ppc32.h         |   57 -
 arch/powerpc/include/asm/pgtable-ppc64.h         |   29 
 arch/powerpc/include/asm/pgtable.h               |   84 +
 arch/powerpc/include/asm/ppc-opcode.h            |   73 +
 arch/powerpc/include/asm/ppc_asm.h               |    6 
 arch/powerpc/include/asm/ps3fb.h                 |    1 
 arch/powerpc/include/asm/reg_booke.h             |    1 
 arch/powerpc/include/asm/spu_info.h              |    3 
 arch/powerpc/include/asm/swab.h                  |    2 
 arch/powerpc/include/asm/system.h                |    2 
 arch/powerpc/include/asm/thread_info.h           |   11 
 arch/powerpc/kernel/Makefile                     |   10 
 arch/powerpc/kernel/align.c                      |    2 
 arch/powerpc/kernel/cpu_setup_44x.S              |    1 
 arch/powerpc/kernel/cpu_setup_fsl_booke.S        |   31 
 arch/powerpc/kernel/cputable.c                   |   22 
 arch/powerpc/kernel/crash_dump.c                 |    2 
 arch/powerpc/kernel/dbell.c                      |   44 +
 arch/powerpc/kernel/entry_32.S                   |  129 +-
 arch/powerpc/kernel/entry_64.S                   |   89 +
 arch/powerpc/kernel/ftrace.c                     |  222 ++-
 arch/powerpc/kernel/head_booke.h                 |   19 
 arch/powerpc/kernel/head_fsl_booke.S             |  101 +
 arch/powerpc/kernel/module_64.c                  |    2 
 arch/powerpc/kernel/pci-common.c                 |   41 -
 arch/powerpc/kernel/pci_32.c                     |   36 
 arch/powerpc/kernel/pci_64.c                     |   19 
 arch/powerpc/kernel/process.c                    |   58 +
 arch/powerpc/kernel/prom.c                       |    6 
 arch/powerpc/kernel/rtas.c                       |   10 
 arch/powerpc/kernel/setup_64.c                   |    7 
 arch/powerpc/kernel/signal.h                     |   10 
 arch/powerpc/kernel/traps.c                      |   79 +
 arch/powerpc/kernel/vmlinux.lds.S                |    1 
 arch/powerpc/lib/dma-noncoherent.c               |  303 +---
 arch/powerpc/lib/feature-fixups.c                |    4 
 arch/powerpc/mm/fault.c                          |   46 -
 arch/powerpc/mm/fsl_booke_mmu.c                  |   95 +
 arch/powerpc/mm/hash_utils_64.c                  |    5 
 arch/powerpc/mm/mem.c                            |   33 
 arch/powerpc/mm/mmap.c                           |   64 +
 arch/powerpc/mm/numa.c                           |  174 +-
 arch/powerpc/mm/pgtable.c                        |  131 ++
 arch/powerpc/platforms/44x/Kconfig               |   19 
 arch/powerpc/platforms/44x/ppc44x_simple.c       |    1 
 arch/powerpc/platforms/52xx/Kconfig              |   12 
 arch/powerpc/platforms/52xx/Makefile             |    3 
 arch/powerpc/platforms/52xx/media5200.c          |  273 ++++
 arch/powerpc/platforms/52xx/mpc5200_simple.c     |    1 
 arch/powerpc/platforms/52xx/mpc52xx_gpio.c       |   85 -
 arch/powerpc/platforms/52xx/mpc52xx_gpt.c        |  435 ++++++
 arch/powerpc/platforms/52xx/mpc52xx_pic.c        |  170 +-
 arch/powerpc/platforms/83xx/mpc831x_rdb.c        |    2 
 arch/powerpc/platforms/83xx/mpc837x_mds.c        |   10 
 arch/powerpc/platforms/83xx/mpc837x_rdb.c        |    2 
 arch/powerpc/platforms/86xx/Kconfig              |   10 
 arch/powerpc/platforms/86xx/Makefile             |    1 
 arch/powerpc/platforms/86xx/gef_gpio.c           |   36 
 arch/powerpc/platforms/86xx/gef_sbc310.c         |  230 +++
 arch/powerpc/platforms/Kconfig                   |   10 
 arch/powerpc/platforms/Kconfig.cputype           |    4 
 arch/powerpc/platforms/Makefile                  |    1 
 arch/powerpc/platforms/amigaone/Kconfig          |   18 
 arch/powerpc/platforms/amigaone/Makefile         |    1 
 arch/powerpc/platforms/amigaone/setup.c          |  170 ++
 arch/powerpc/platforms/cell/Kconfig              |   22 
 arch/powerpc/platforms/cell/qpace_setup.c        |    2 
 arch/powerpc/platforms/cell/spu_fault.c          |   48 -
 arch/powerpc/platforms/cell/spufs/file.c         |    8 
 arch/powerpc/platforms/cell/spufs/inode.c        |    5 
 arch/powerpc/platforms/cell/spufs/run.c          |    3 
 arch/powerpc/platforms/cell/spufs/spufs.h        |    8 
 arch/powerpc/platforms/chrp/pegasos_eth.c        |   72 -
 arch/powerpc/platforms/powermac/setup.c          |    3 
 arch/powerpc/platforms/pseries/eeh_driver.c      |   68 +
 arch/powerpc/platforms/pseries/msi.c             |  224 +++
 arch/powerpc/platforms/pseries/pci_dlpar.c       |    2 
 arch/powerpc/sysdev/cpm2.c                       |    3 
 arch/powerpc/sysdev/fsl_pci.c                    |  244 +++
 arch/powerpc/sysdev/ppc4xx_pci.c                 |    2 
 arch/x86/include/asm/ftrace.h                    |   25 
 arch/x86/kernel/dumpstack.c                      |    1 
 arch/x86/kernel/ftrace.c                         |   75 -
 drivers/macintosh/therm_adt746x.c                |    4 
 drivers/net/fec_mpc52xx.c                        |    6 
 drivers/serial/mpc52xx_uart.c                    |   40 -
 drivers/watchdog/Kconfig                         |    2 
 include/linux/ftrace.h                           |   24 
 include/linux/pci_ids.h                          |    8 
 kernel/trace/trace_functions_graph.c             |   75 +
 lib/lmb.c                                        |   42 -
 145 files changed, 10930 insertions(+), 1829 deletions(-)
 create mode 100644 Documentation/powerpc/dts-bindings/fsl/esdhc.txt
 create mode 100644 arch/powerpc/boot/cuboot-amigaone.c
 create mode 100644 arch/powerpc/boot/dts/amigaone.dts
 create mode 100644 arch/powerpc/boot/dts/digsy_mtc.dts
 create mode 100644 arch/powerpc/boot/dts/gef_sbc310.dts
 create mode 100644 arch/powerpc/boot/dts/media5200.dts
 create mode 100644 arch/powerpc/boot/dts/mpc8572ds_36b.dts
 create mode 100644 arch/powerpc/boot/dts/redwood.dts
 create mode 100644 arch/powerpc/configs/44x/redwood_defconfig
 create mode 100644 arch/powerpc/configs/86xx/gef_sbc310_defconfig
 create mode 100644 arch/powerpc/configs/amigaone_defconfig
 create mode 100644 arch/powerpc/include/asm/dbell.h
 rename arch/powerpc/include/asm/{mmu-fsl-booke.h => mmu-book3e.h} (52%)
 create mode 100644 arch/powerpc/include/asm/ppc-opcode.h
 create mode 100644 arch/powerpc/kernel/cpu_setup_fsl_booke.S
 create mode 100644 arch/powerpc/kernel/dbell.c
 create mode 100644 arch/powerpc/platforms/52xx/media5200.c
 create mode 100644 arch/powerpc/platforms/52xx/mpc52xx_gpt.c
 create mode 100644 arch/powerpc/platforms/86xx/gef_sbc310.c
 create mode 100644 arch/powerpc/platforms/amigaone/Kconfig
 create mode 100644 arch/powerpc/platforms/amigaone/Makefile
 create mode 100644 arch/powerpc/platforms/amigaone/setup.c

^ permalink raw reply

* [PATCH 1/2] powerpc/mm: Tweak PTE bit combination definitions (v2)
From: Benjamin Herrenschmidt @ 2009-03-03  5:22 UTC (permalink / raw)
  To: linuxppc-dev

This patch tweaks the way some PTE bit combinations are defined, in such a
way that the 32 and 64-bit variant become almost identical and that will
make it easier to bring in a new common pte-* file for the new variant
of the Book3-E support.

The combination of bits defining access to kernel pages are now clearly
separated from the combination used by userspace and the core VM. The
resulting generated code should remain identical unless I made a mistake.

Note: While at it, I removed a non-sensical statement related to CONFIG_KGDB
in ppc_mmu_32.c which could cause kernel mappings to be user accessible when
that option is enabled. Probably something that bitrot.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---

v2: Fix mixup with next patch

 arch/powerpc/include/asm/fixmap.h        |    2 -
 arch/powerpc/include/asm/pgtable-ppc32.h |   39 ++++++++++++-------------
 arch/powerpc/include/asm/pgtable-ppc64.h |   44 +++++++++++++++++------------
 arch/powerpc/include/asm/pgtable.h       |    4 ++
 arch/powerpc/include/asm/pte-8xx.h       |    3 +
 arch/powerpc/include/asm/pte-hash32.h    |    1 
 arch/powerpc/include/asm/pte-hash64-4k.h |    3 -
 arch/powerpc/include/asm/pte-hash64.h    |   47 +++++++++++++++++--------------
 arch/powerpc/mm/fsl_booke_mmu.c          |    2 -
 arch/powerpc/mm/pgtable_32.c             |    4 +-
 arch/powerpc/mm/ppc_mmu_32.c             |   10 +-----
 arch/powerpc/sysdev/cpm_common.c         |    2 -
 12 files changed, 86 insertions(+), 75 deletions(-)

--- linux-work.orig/arch/powerpc/include/asm/pgtable-ppc64.h	2009-03-03 16:09:33.000000000 +1100
+++ linux-work/arch/powerpc/include/asm/pgtable-ppc64.h	2009-03-03 16:17:29.000000000 +1100
@@ -81,11 +81,6 @@
  */
 #include <asm/pte-hash64.h>
 
-/* To make some generic powerpc code happy */
-#ifndef _PAGE_HWEXEC
-#define _PAGE_HWEXEC		0
-#endif
-
 /* Some other useful definitions */
 #define PTE_RPN_MAX	(1UL << (64 - PTE_RPN_SHIFT))
 #define PTE_RPN_MASK	(~((1UL<<PTE_RPN_SHIFT)-1))
@@ -96,24 +91,38 @@
 #define _PAGE_CHG_MASK	(PTE_RPN_MASK | _PAGE_HPTEFLAGS | _PAGE_DIRTY | \
                          _PAGE_ACCESSED | _PAGE_SPECIAL)
 
+#define _PAGE_BASE_NC	(_PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_PSIZE)
+#define _PAGE_BASE	(_PAGE_BASE_NC | _PAGE_COHERENT)
 
 
-/* __pgprot defined in arch/powerpc/include/asm/page.h */
-#define PAGE_NONE	__pgprot(_PAGE_PRESENT | _PAGE_ACCESSED)
-
-#define PAGE_SHARED	__pgprot(_PAGE_BASE | _PAGE_RW | _PAGE_USER)
-#define PAGE_SHARED_X	__pgprot(_PAGE_BASE | _PAGE_RW | _PAGE_USER | _PAGE_EXEC)
+/* Permission masks used to generate the __P and __S table,
+ *
+ * Note:__pgprot is defined in arch/powerpc/include/asm/page.h
+ */
+#define PAGE_NONE	__pgprot(_PAGE_BASE)
+#define PAGE_SHARED	__pgprot(_PAGE_BASE | _PAGE_USER | _PAGE_RW)
+#define PAGE_SHARED_X	__pgprot(_PAGE_BASE | _PAGE_USER | _PAGE_RW | _PAGE_EXEC)
 #define PAGE_COPY	__pgprot(_PAGE_BASE | _PAGE_USER)
 #define PAGE_COPY_X	__pgprot(_PAGE_BASE | _PAGE_USER | _PAGE_EXEC)
 #define PAGE_READONLY	__pgprot(_PAGE_BASE | _PAGE_USER)
 #define PAGE_READONLY_X	__pgprot(_PAGE_BASE | _PAGE_USER | _PAGE_EXEC)
-#define PAGE_KERNEL	__pgprot(_PAGE_BASE | _PAGE_WRENABLE)
-#define PAGE_KERNEL_CI	__pgprot(_PAGE_PRESENT | _PAGE_ACCESSED | \
-			       _PAGE_WRENABLE | _PAGE_NO_CACHE | _PAGE_GUARDED)
-#define PAGE_KERNEL_EXEC __pgprot(_PAGE_BASE | _PAGE_WRENABLE | _PAGE_EXEC)
 
-#define PAGE_AGP	__pgprot(_PAGE_BASE | _PAGE_WRENABLE | _PAGE_NO_CACHE)
-#define HAVE_PAGE_AGP
+/* Permission masks used for kernel mappings */
+#define PAGE_KERNEL	__pgprot(_PAGE_BASE | _PAGE_KERNEL_RW)
+#define PAGE_KERNEL_NC	__pgprot(_PAGE_BASE_NC | _PAGE_KERNEL_RW | \
+				 _PAGE_NO_CACHE)
+#define PAGE_KERNEL_NCG	__pgprot(_PAGE_BASE_NC | _PAGE_KERNEL_RW | \
+				 _PAGE_NO_CACHE | _PAGE_GUARDED)
+#define PAGE_KERNEL_X __pgprot(_PAGE_BASE | _PAGE_KERNEL_RW | _PAGE_EXEC)
+#define PAGE_KERNEL_RO __pgprot(_PAGE_BASE | _PAGE_KERNEL_RO)
+#define PAGE_KERNEL_ROX __pgprot(_PAGE_BASE | _PAGE_KERNEL_RO | _PAGE_EXEC)
+
+/* Protection bits for use by pte_pgprot() */
+#define PAGE_PROT_BITS	(_PAGE_GUARDED | _PAGE_COHERENT | \
+			 _PAGE_NO_CACHE | _PAGE_WRITETHRU |		\
+			 _PAGE_4K_PFN | _PAGE_USER | _PAGE_RW |		\
+			 _PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_EXEC)
+
 
 /* We always have _PAGE_SPECIAL on 64 bit */
 #define __HAVE_ARCH_PTE_SPECIAL
@@ -395,7 +404,8 @@ static inline void pte_clear(struct mm_s
 static inline void __ptep_set_access_flags(pte_t *ptep, pte_t entry)
 {
 	unsigned long bits = pte_val(entry) &
-		(_PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_RW | _PAGE_EXEC);
+		(_PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_RW |
+		 _PAGE_EXEC | _PAGE_HWEXEC);
 	unsigned long old, tmp;
 
 	__asm__ __volatile__(
Index: linux-work/arch/powerpc/include/asm/pte-hash64-4k.h
===================================================================
--- linux-work.orig/arch/powerpc/include/asm/pte-hash64-4k.h	2009-03-03 16:09:33.000000000 +1100
+++ linux-work/arch/powerpc/include/asm/pte-hash64-4k.h	2009-03-03 16:11:28.000000000 +1100
@@ -8,9 +8,6 @@
 #define _PAGE_F_GIX     _PAGE_GROUP_IX
 #define _PAGE_SPECIAL	0x10000 /* software: special page */
 
-/* There is no 4K PFN hack on 4K pages */
-#define _PAGE_4K_PFN	0
-
 /* PTE flags to conserve for HPTE identification */
 #define _PAGE_HPTEFLAGS (_PAGE_BUSY | _PAGE_HASHPTE | \
 			 _PAGE_SECONDARY | _PAGE_GROUP_IX)
Index: linux-work/arch/powerpc/include/asm/pte-hash64.h
===================================================================
--- linux-work.orig/arch/powerpc/include/asm/pte-hash64.h	2009-03-03 16:09:34.000000000 +1100
+++ linux-work/arch/powerpc/include/asm/pte-hash64.h	2009-03-03 16:11:28.000000000 +1100
@@ -6,36 +6,41 @@
  * Common bits between 4K and 64K pages in a linux-style PTE.
  * These match the bits in the (hardware-defined) PowerPC PTE as closely
  * as possible. Additional bits may be defined in pgtable-hash64-*.h
+ *
+ * Note: We only support user read/write permissions. Supervisor always
+ * have full read/write to pages above PAGE_OFFSET (pages below that
+ * always use the user access permissions).
+ *
+ * We could create separate kernel read-only if we used the 3 PP bits
+ * combinations that newer processors provide but we currently don't.
  */
-#define _PAGE_PRESENT	0x0001 /* software: pte contains a translation */
-#define _PAGE_USER	0x0002 /* matches one of the PP bits */
-#define _PAGE_FILE	0x0002 /* (!present only) software: pte holds file offset */
-#define _PAGE_EXEC	0x0004 /* No execute on POWER4 and newer (we invert) */
-#define _PAGE_GUARDED	0x0008
-#define _PAGE_COHERENT	0x0010 /* M: enforce memory coherence (SMP systems) */
-#define _PAGE_NO_CACHE	0x0020 /* I: cache inhibit */
-#define _PAGE_WRITETHRU	0x0040 /* W: cache write-through */
-#define _PAGE_DIRTY	0x0080 /* C: page changed */
-#define _PAGE_ACCESSED	0x0100 /* R: page referenced */
-#define _PAGE_RW	0x0200 /* software: user write access allowed */
-#define _PAGE_BUSY	0x0800 /* software: PTE & hash are busy */
+#define _PAGE_PRESENT		0x0001 /* software: pte contains a translation */
+#define _PAGE_USER		0x0002 /* matches one of the PP bits */
+#define _PAGE_FILE		0x0002 /* (!present only) software: pte holds file offset */
+#define _PAGE_EXEC		0x0004 /* No execute on POWER4 and newer (we invert) */
+#define _PAGE_GUARDED		0x0008
+#define _PAGE_COHERENT		0x0010 /* M: enforce memory coherence (SMP systems) */
+#define _PAGE_NO_CACHE		0x0020 /* I: cache inhibit */
+#define _PAGE_WRITETHRU		0x0040 /* W: cache write-through */
+#define _PAGE_DIRTY		0x0080 /* C: page changed */
+#define _PAGE_ACCESSED		0x0100 /* R: page referenced */
+#define _PAGE_RW		0x0200 /* software: user write access allowed */
+#define _PAGE_BUSY		0x0800 /* software: PTE & hash are busy */
+
+/* No separate kernel read-only */
+#define _PAGE_KERNEL_RW		(_PAGE_RW | _PAGE_DIRTY) /* user access blocked by key */
+#define _PAGE_KERNEL_RO		 _PAGE_KERNEL_RW
 
 /* Strong Access Ordering */
-#define _PAGE_SAO	(_PAGE_WRITETHRU | _PAGE_NO_CACHE | _PAGE_COHERENT)
+#define _PAGE_SAO		(_PAGE_WRITETHRU | _PAGE_NO_CACHE | _PAGE_COHERENT)
 
-#define _PAGE_BASE	(_PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_COHERENT)
-
-#define _PAGE_WRENABLE	(_PAGE_RW | _PAGE_DIRTY)
+/* No page size encoding in the linux PTE */
+#define _PAGE_PSIZE		0
 
 /* PTEIDX nibble */
 #define _PTEIDX_SECONDARY	0x8
 #define _PTEIDX_GROUP_IX	0x7
 
-#define PAGE_PROT_BITS	(_PAGE_GUARDED | _PAGE_COHERENT | \
-			 _PAGE_NO_CACHE | _PAGE_WRITETHRU |		\
-			 _PAGE_4K_PFN | _PAGE_RW | _PAGE_USER |		\
-			 _PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_EXEC)
-
 
 #ifdef CONFIG_PPC_64K_PAGES
 #include <asm/pte-hash64-64k.h>
Index: linux-work/arch/powerpc/include/asm/pgtable-ppc32.h
===================================================================
--- linux-work.orig/arch/powerpc/include/asm/pgtable-ppc32.h	2009-03-03 16:09:34.000000000 +1100
+++ linux-work/arch/powerpc/include/asm/pgtable-ppc32.h	2009-03-03 16:18:34.000000000 +1100
@@ -144,6 +144,13 @@ extern int icache_44x_need_flush;
 #define PMD_PAGE_SIZE(pmd)	bad_call_to_PMD_PAGE_SIZE()
 #endif
 
+#ifndef _PAGE_KERNEL_RO
+#define _PAGE_KERNEL_RO	0
+#endif
+#ifndef _PAGE_KERNEL_RW
+#define _PAGE_KERNEL_RW	(_PAGE_DIRTY | _PAGE_RW | _PAGE_HWWRITE)
+#endif
+
 #define _PAGE_HPTEFLAGS _PAGE_HASHPTE
 
 /* Location of the PFN in the PTE. Most platforms use the same as _PAGE_SHIFT
@@ -186,30 +193,25 @@ extern int icache_44x_need_flush;
 #else
 #define _PAGE_BASE	(_PAGE_PRESENT | _PAGE_ACCESSED)
 #endif
-#define _PAGE_BASE_NC	(_PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_NO_CACHE)
+#define _PAGE_BASE_NC	(_PAGE_PRESENT | _PAGE_ACCESSED)
 
-#define _PAGE_WRENABLE	(_PAGE_RW | _PAGE_DIRTY | _PAGE_HWWRITE)
-#define _PAGE_KERNEL	(_PAGE_BASE | _PAGE_SHARED | _PAGE_WRENABLE)
-#define _PAGE_KERNEL_NC	(_PAGE_BASE_NC | _PAGE_SHARED | _PAGE_WRENABLE)
-
-#ifdef CONFIG_PPC_STD_MMU
-/* On standard PPC MMU, no user access implies kernel read/write access,
- * so to write-protect kernel memory we must turn on user access */
-#define _PAGE_KERNEL_RO	(_PAGE_BASE | _PAGE_SHARED | _PAGE_USER)
-#else
-#define _PAGE_KERNEL_RO	(_PAGE_BASE | _PAGE_SHARED)
-#endif
-
-#define _PAGE_IO	(_PAGE_KERNEL_NC | _PAGE_GUARDED)
-#define _PAGE_RAM	(_PAGE_KERNEL | _PAGE_HWEXEC)
+/* Permission masks used for kernel mappings */
+#define PAGE_KERNEL	__pgprot(_PAGE_BASE | _PAGE_KERNEL_RW)
+#define PAGE_KERNEL_NC	__pgprot(_PAGE_BASE_NC | _PAGE_KERNEL_RW | \
+				 _PAGE_NO_CACHE)
+#define PAGE_KERNEL_NCG	__pgprot(_PAGE_BASE_NC | _PAGE_KERNEL_RW | \
+				 _PAGE_NO_CACHE | _PAGE_GUARDED)
+#define PAGE_KERNEL_X __pgprot(_PAGE_BASE | _PAGE_KERNEL_RW | _PAGE_EXEC)
+#define PAGE_KERNEL_RO __pgprot(_PAGE_BASE | _PAGE_KERNEL_RO)
+#define PAGE_KERNEL_ROX __pgprot(_PAGE_BASE | _PAGE_KERNEL_RO | _PAGE_EXEC)
 
 #if defined(CONFIG_KGDB) || defined(CONFIG_XMON) || defined(CONFIG_BDI_SWITCH) ||\
 	defined(CONFIG_KPROBES)
 /* We want the debuggers to be able to set breakpoints anywhere, so
  * don't write protect the kernel text */
-#define _PAGE_RAM_TEXT	_PAGE_RAM
+#define PAGE_KERNEL_TEXT	PAGE_KERNEL_X
 #else
-#define _PAGE_RAM_TEXT	(_PAGE_KERNEL_RO | _PAGE_HWEXEC)
+#define PAGE_KERNEL_TEXT	PAGE_KERNEL_ROX
 #endif
 
 #define PAGE_NONE	__pgprot(_PAGE_BASE)
@@ -220,9 +222,6 @@ extern int icache_44x_need_flush;
 #define PAGE_COPY	__pgprot(_PAGE_BASE | _PAGE_USER)
 #define PAGE_COPY_X	__pgprot(_PAGE_BASE | _PAGE_USER | _PAGE_EXEC)
 
-#define PAGE_KERNEL		__pgprot(_PAGE_RAM)
-#define PAGE_KERNEL_NOCACHE	__pgprot(_PAGE_IO)
-
 /*
  * The PowerPC can only do execute protection on a segment (256MB) basis,
  * not on a page basis.  So we consider execute permission the same as read.
Index: linux-work/arch/powerpc/include/asm/pte-8xx.h
===================================================================
--- linux-work.orig/arch/powerpc/include/asm/pte-8xx.h	2009-03-03 16:09:34.000000000 +1100
+++ linux-work/arch/powerpc/include/asm/pte-8xx.h	2009-03-03 16:11:28.000000000 +1100
@@ -59,6 +59,9 @@
 /* Until my rework is finished, 8xx still needs atomic PTE updates */
 #define PTE_ATOMIC_UPDATES	1
 
+/* We need to add _PAGE_SHARED to kernel pages */
+#define _PAGE_KERNEL_RO	(_PAGE_SHARED)
+#define _PAGE_KERNEL_RW	(_PAGE_DIRTY | _PAGE_RW | _PAGE_HWWRITE)
 
 #endif /* __KERNEL__ */
 #endif /*  _ASM_POWERPC_PGTABLE_8xx_H */
Index: linux-work/arch/powerpc/include/asm/pte-hash32.h
===================================================================
--- linux-work.orig/arch/powerpc/include/asm/pte-hash32.h	2009-03-03 16:09:34.000000000 +1100
+++ linux-work/arch/powerpc/include/asm/pte-hash32.h	2009-03-03 16:11:28.000000000 +1100
@@ -44,6 +44,5 @@
 /* Hash table based platforms need atomic updates of the linux PTE */
 #define PTE_ATOMIC_UPDATES	1
 
-
 #endif /* __KERNEL__ */
 #endif /*  _ASM_POWERPC_PGTABLE_HASH32_H */
Index: linux-work/arch/powerpc/mm/pgtable_32.c
===================================================================
--- linux-work.orig/arch/powerpc/mm/pgtable_32.c	2009-03-03 16:09:34.000000000 +1100
+++ linux-work/arch/powerpc/mm/pgtable_32.c	2009-03-03 16:11:28.000000000 +1100
@@ -164,7 +164,7 @@ __ioremap_caller(phys_addr_t addr, unsig
 
 	/* Make sure we have the base flags */
 	if ((flags & _PAGE_PRESENT) == 0)
-		flags |= _PAGE_KERNEL;
+		flags |= PAGE_KERNEL;
 
 	/* Non-cacheable page cannot be coherent */
 	if (flags & _PAGE_NO_CACHE)
@@ -296,7 +296,7 @@ void __init mapin_ram(void)
 	p = memstart_addr + s;
 	for (; s < total_lowmem; s += PAGE_SIZE) {
 		ktext = ((char *) v >= _stext && (char *) v < etext);
-		f = ktext ?_PAGE_RAM_TEXT : _PAGE_RAM;
+		f = ktext ? PAGE_KERNEL_TEXT : PAGE_KERNEL;
 		map_page(v, p, f);
 #ifdef CONFIG_PPC_STD_MMU_32
 		if (ktext)
Index: linux-work/arch/powerpc/mm/ppc_mmu_32.c
===================================================================
--- linux-work.orig/arch/powerpc/mm/ppc_mmu_32.c	2009-03-03 16:09:34.000000000 +1100
+++ linux-work/arch/powerpc/mm/ppc_mmu_32.c	2009-03-03 16:11:28.000000000 +1100
@@ -74,9 +74,6 @@ unsigned long p_mapped_by_bats(phys_addr
 
 unsigned long __init mmu_mapin_ram(void)
 {
-#ifdef CONFIG_POWER4
-	return 0;
-#else
 	unsigned long tot, bl, done;
 	unsigned long max_size = (256<<20);
 
@@ -95,7 +92,7 @@ unsigned long __init mmu_mapin_ram(void)
 			break;
 	}
 
-	setbat(2, PAGE_OFFSET, 0, bl, _PAGE_RAM);
+	setbat(2, PAGE_OFFSET, 0, bl, PAGE_KERNEL_X);
 	done = (unsigned long)bat_addrs[2].limit - PAGE_OFFSET + 1;
 	if ((done < tot) && !bat_addrs[3].limit) {
 		/* use BAT3 to cover a bit more */
@@ -103,12 +100,11 @@ unsigned long __init mmu_mapin_ram(void)
 		for (bl = 128<<10; bl < max_size; bl <<= 1)
 			if (bl * 2 > tot)
 				break;
-		setbat(3, PAGE_OFFSET+done, done, bl, _PAGE_RAM);
+		setbat(3, PAGE_OFFSET+done, done, bl, PAGE_KERNEL_X);
 		done = (unsigned long)bat_addrs[3].limit - PAGE_OFFSET + 1;
 	}
 
 	return done;
-#endif
 }
 
 /*
@@ -136,9 +132,7 @@ void __init setbat(int index, unsigned l
 		wimgxpp |= (flags & _PAGE_RW)? BPP_RW: BPP_RX;
 		bat[1].batu = virt | (bl << 2) | 2; /* Vs=1, Vp=0 */
 		bat[1].batl = BAT_PHYS_ADDR(phys) | wimgxpp;
-#ifndef CONFIG_KGDB /* want user access for breakpoints */
 		if (flags & _PAGE_USER)
-#endif
 			bat[1].batu |= 1; 	/* Vp = 1 */
 		if (flags & _PAGE_GUARDED) {
 			/* G bit must be zero in IBATs */
Index: linux-work/arch/powerpc/sysdev/cpm_common.c
===================================================================
--- linux-work.orig/arch/powerpc/sysdev/cpm_common.c	2009-03-03 16:09:34.000000000 +1100
+++ linux-work/arch/powerpc/sysdev/cpm_common.c	2009-03-03 16:11:28.000000000 +1100
@@ -56,7 +56,7 @@ void __init udbg_init_cpm(void)
 {
 	if (cpm_udbg_txdesc) {
 #ifdef CONFIG_CPM2
-		setbat(1, 0xf0000000, 0xf0000000, 1024*1024, _PAGE_IO);
+		setbat(1, 0xf0000000, 0xf0000000, 1024*1024, PAGE_KERNEL_NCG);
 #endif
 		udbg_putc = udbg_putc_cpm;
 	}
Index: linux-work/arch/powerpc/include/asm/fixmap.h
===================================================================
--- linux-work.orig/arch/powerpc/include/asm/fixmap.h	2009-03-03 16:09:34.000000000 +1100
+++ linux-work/arch/powerpc/include/asm/fixmap.h	2009-03-03 16:11:28.000000000 +1100
@@ -61,7 +61,7 @@ extern void __set_fixmap (enum fixed_add
  * Some hardware wants to get fixmapped without caching.
  */
 #define set_fixmap_nocache(idx, phys) \
-		__set_fixmap(idx, phys, PAGE_KERNEL_NOCACHE)
+		__set_fixmap(idx, phys, PAGE_KERNEL_NCG)
 
 #define clear_fixmap(idx) \
 		__set_fixmap(idx, 0, __pgprot(0))
Index: linux-work/arch/powerpc/include/asm/pgtable.h
===================================================================
--- linux-work.orig/arch/powerpc/include/asm/pgtable.h	2009-03-03 16:09:34.000000000 +1100
+++ linux-work/arch/powerpc/include/asm/pgtable.h	2009-03-03 16:17:29.000000000 +1100
@@ -25,6 +25,10 @@ static inline void assert_pte_locked(str
 #  include <asm/pgtable-ppc32.h>
 #endif
 
+/* Special mapping for AGP */
+#define PAGE_AGP	(PAGE_KERNEL_NC)
+#define HAVE_PAGE_AGP
+
 #ifndef __ASSEMBLY__
 
 /* Insert a PTE, top-level function is out of line. It uses an inline
Index: linux-work/arch/powerpc/mm/fsl_booke_mmu.c
===================================================================
--- linux-work.orig/arch/powerpc/mm/fsl_booke_mmu.c	2009-03-03 16:09:34.000000000 +1100
+++ linux-work/arch/powerpc/mm/fsl_booke_mmu.c	2009-03-03 16:11:28.000000000 +1100
@@ -162,7 +162,7 @@ unsigned long __init mmu_mapin_ram(void)
 	phys_addr_t phys = memstart_addr;
 
 	while (cam[tlbcam_index] && tlbcam_index < ARRAY_SIZE(cam)) {
-		settlbcam(tlbcam_index, virt, phys, cam[tlbcam_index], _PAGE_KERNEL, 0);
+		settlbcam(tlbcam_index, virt, phys, cam[tlbcam_index], PAGE_KERNEL_X, 0);
 		virt += cam[tlbcam_index];
 		phys += cam[tlbcam_index];
 		tlbcam_index++;

^ permalink raw reply

* [PATCH 2/2] powerpc/mm: Merge various PTE bits and accessors definitions (v2)
From: Benjamin Herrenschmidt @ 2009-03-03  5:22 UTC (permalink / raw)
  To: linuxppc-dev

Now that they are almost identical, we can merge some of the definitions
related to the PTE format into common files.

This creates a new pte-common.h which is included by both 32 and 64-bit
right after the CPU specific pte-*.h file, and which defines some
bits to "default" values if they haven't been defined already, and
then provides a generic definition of most of the bit combinations
based on these and exposed to the rest of the kernel.

I also moved to the common pgtable.h most of the "small" accessors to the
PTE bits and modification helpers (pte_mk*). The actual accessors remain
in their separate files.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---

v2: Fix mixup with previous patch

 arch/powerpc/include/asm/pgtable-ppc32.h |  204 -------------------------------
 arch/powerpc/include/asm/pgtable-ppc64.h |  130 -------------------
 arch/powerpc/include/asm/pgtable.h       |   53 +++++++-
 arch/powerpc/include/asm/pte-common.h    |  177 ++++++++++++++++++++++++++
 4 files changed, 229 insertions(+), 335 deletions(-)

--- linux-work.orig/arch/powerpc/include/asm/pgtable-ppc32.h	2009-03-03 16:18:34.000000000 +1100
+++ linux-work/arch/powerpc/include/asm/pgtable-ppc32.h	2009-03-03 16:19:23.000000000 +1100
@@ -97,174 +97,11 @@ extern int icache_44x_need_flush;
 #include <asm/pte-hash32.h>
 #endif
 
-/* If _PAGE_SPECIAL is defined, then we advertise our support for it */
-#ifdef _PAGE_SPECIAL
-#define __HAVE_ARCH_PTE_SPECIAL
-#endif
-
-/*
- * Some bits are only used on some cpu families... Make sure that all
- * the undefined gets defined as 0
- */
-#ifndef _PAGE_HASHPTE
-#define _PAGE_HASHPTE	0
-#endif
-#ifndef _PTE_NONE_MASK
-#define _PTE_NONE_MASK 0
-#endif
-#ifndef _PAGE_SHARED
-#define _PAGE_SHARED	0
-#endif
-#ifndef _PAGE_HWWRITE
-#define _PAGE_HWWRITE	0
-#endif
-#ifndef _PAGE_HWEXEC
-#define _PAGE_HWEXEC	0
-#endif
-#ifndef _PAGE_EXEC
-#define _PAGE_EXEC	0
-#endif
-#ifndef _PAGE_ENDIAN
-#define _PAGE_ENDIAN	0
-#endif
-#ifndef _PAGE_COHERENT
-#define _PAGE_COHERENT	0
-#endif
-#ifndef _PAGE_WRITETHRU
-#define _PAGE_WRITETHRU	0
-#endif
-#ifndef _PAGE_SPECIAL
-#define _PAGE_SPECIAL	0
-#endif
-#ifndef _PMD_PRESENT_MASK
-#define _PMD_PRESENT_MASK	_PMD_PRESENT
-#endif
-#ifndef _PMD_SIZE
-#define _PMD_SIZE	0
-#define PMD_PAGE_SIZE(pmd)	bad_call_to_PMD_PAGE_SIZE()
-#endif
-
-#ifndef _PAGE_KERNEL_RO
-#define _PAGE_KERNEL_RO	0
-#endif
-#ifndef _PAGE_KERNEL_RW
-#define _PAGE_KERNEL_RW	(_PAGE_DIRTY | _PAGE_RW | _PAGE_HWWRITE)
-#endif
-
-#define _PAGE_HPTEFLAGS _PAGE_HASHPTE
-
-/* Location of the PFN in the PTE. Most platforms use the same as _PAGE_SHIFT
- * here (ie, naturally aligned). Platform who don't just pre-define the
- * value so we don't override it here
- */
-#ifndef PTE_RPN_SHIFT
-#define PTE_RPN_SHIFT	(PAGE_SHIFT)
-#endif
-
-#ifdef CONFIG_PTE_64BIT
-#define PTE_RPN_MAX	(1ULL << (64 - PTE_RPN_SHIFT))
-#define PTE_RPN_MASK	(~((1ULL<<PTE_RPN_SHIFT)-1))
-#else
-#define PTE_RPN_MAX	(1UL << (32 - PTE_RPN_SHIFT))
-#define PTE_RPN_MASK	(~((1UL<<PTE_RPN_SHIFT)-1))
-#endif
-
-/* _PAGE_CHG_MASK masks of bits that are to be preserved accross
- * pgprot changes
- */
-#define _PAGE_CHG_MASK	(PTE_RPN_MASK | _PAGE_HPTEFLAGS | _PAGE_DIRTY | \
-                         _PAGE_ACCESSED | _PAGE_SPECIAL)
-
-/* Mask of bits returned by pte_pgprot() */
-#define PAGE_PROT_BITS	(_PAGE_GUARDED | _PAGE_COHERENT | _PAGE_NO_CACHE | \
-			 _PAGE_WRITETHRU | _PAGE_ENDIAN | \
-			 _PAGE_USER | _PAGE_ACCESSED | \
-			 _PAGE_RW | _PAGE_HWWRITE | _PAGE_DIRTY | \
-			 _PAGE_EXEC | _PAGE_HWEXEC)
-
-/*
- * We define 2 sets of base prot bits, one for basic pages (ie,
- * cacheable kernel and user pages) and one for non cacheable
- * pages. We always set _PAGE_COHERENT when SMP is enabled or
- * the processor might need it for DMA coherency.
- */
-#if defined(CONFIG_SMP) || defined(CONFIG_PPC_STD_MMU)
-#define _PAGE_BASE	(_PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_COHERENT)
-#else
-#define _PAGE_BASE	(_PAGE_PRESENT | _PAGE_ACCESSED)
-#endif
-#define _PAGE_BASE_NC	(_PAGE_PRESENT | _PAGE_ACCESSED)
-
-/* Permission masks used for kernel mappings */
-#define PAGE_KERNEL	__pgprot(_PAGE_BASE | _PAGE_KERNEL_RW)
-#define PAGE_KERNEL_NC	__pgprot(_PAGE_BASE_NC | _PAGE_KERNEL_RW | \
-				 _PAGE_NO_CACHE)
-#define PAGE_KERNEL_NCG	__pgprot(_PAGE_BASE_NC | _PAGE_KERNEL_RW | \
-				 _PAGE_NO_CACHE | _PAGE_GUARDED)
-#define PAGE_KERNEL_X __pgprot(_PAGE_BASE | _PAGE_KERNEL_RW | _PAGE_EXEC)
-#define PAGE_KERNEL_RO __pgprot(_PAGE_BASE | _PAGE_KERNEL_RO)
-#define PAGE_KERNEL_ROX __pgprot(_PAGE_BASE | _PAGE_KERNEL_RO | _PAGE_EXEC)
-
-#if defined(CONFIG_KGDB) || defined(CONFIG_XMON) || defined(CONFIG_BDI_SWITCH) ||\
-	defined(CONFIG_KPROBES)
-/* We want the debuggers to be able to set breakpoints anywhere, so
- * don't write protect the kernel text */
-#define PAGE_KERNEL_TEXT	PAGE_KERNEL_X
-#else
-#define PAGE_KERNEL_TEXT	PAGE_KERNEL_ROX
-#endif
-
-#define PAGE_NONE	__pgprot(_PAGE_BASE)
-#define PAGE_READONLY	__pgprot(_PAGE_BASE | _PAGE_USER)
-#define PAGE_READONLY_X	__pgprot(_PAGE_BASE | _PAGE_USER | _PAGE_EXEC)
-#define PAGE_SHARED	__pgprot(_PAGE_BASE | _PAGE_USER | _PAGE_RW)
-#define PAGE_SHARED_X	__pgprot(_PAGE_BASE | _PAGE_USER | _PAGE_RW | _PAGE_EXEC)
-#define PAGE_COPY	__pgprot(_PAGE_BASE | _PAGE_USER)
-#define PAGE_COPY_X	__pgprot(_PAGE_BASE | _PAGE_USER | _PAGE_EXEC)
-
-/*
- * The PowerPC can only do execute protection on a segment (256MB) basis,
- * not on a page basis.  So we consider execute permission the same as read.
- * Also, write permissions imply read permissions.
- * This is the closest we can get..
- */
-#define __P000	PAGE_NONE
-#define __P001	PAGE_READONLY_X
-#define __P010	PAGE_COPY
-#define __P011	PAGE_COPY_X
-#define __P100	PAGE_READONLY
-#define __P101	PAGE_READONLY_X
-#define __P110	PAGE_COPY
-#define __P111	PAGE_COPY_X
-
-#define __S000	PAGE_NONE
-#define __S001	PAGE_READONLY_X
-#define __S010	PAGE_SHARED
-#define __S011	PAGE_SHARED_X
-#define __S100	PAGE_READONLY
-#define __S101	PAGE_READONLY_X
-#define __S110	PAGE_SHARED
-#define __S111	PAGE_SHARED_X
+/* And here we include common definitions */
+#include <asm/pte-common.h>
 
 #ifndef __ASSEMBLY__
-/* Make sure we get a link error if PMD_PAGE_SIZE is ever called on a
- * kernel without large page PMD support */
-extern unsigned long bad_call_to_PMD_PAGE_SIZE(void);
 
-/*
- * Conversions between PTE values and page frame numbers.
- */
-
-#define pte_pfn(x)		(pte_val(x) >> PTE_RPN_SHIFT)
-#define pte_page(x)		pfn_to_page(pte_pfn(x))
-
-#define pfn_pte(pfn, prot)	__pte(((pte_basic_t)(pfn) << PTE_RPN_SHIFT) |\
-					pgprot_val(prot))
-#define mk_pte(page, prot)	pfn_pte(page_to_pfn(page), prot)
-#endif /* __ASSEMBLY__ */
-
-#define pte_none(pte)		((pte_val(pte) & ~_PTE_NONE_MASK) == 0)
-#define pte_present(pte)	(pte_val(pte) & _PAGE_PRESENT)
 #define pte_clear(mm, addr, ptep) \
 	do { pte_update(ptep, ~_PAGE_HASHPTE, 0); } while (0)
 
@@ -273,43 +110,6 @@ extern unsigned long bad_call_to_PMD_PAG
 #define	pmd_present(pmd)	(pmd_val(pmd) & _PMD_PRESENT_MASK)
 #define	pmd_clear(pmdp)		do { pmd_val(*(pmdp)) = 0; } while (0)
 
-#ifndef __ASSEMBLY__
-/*
- * The following only work if pte_present() is true.
- * Undefined behaviour if not..
- */
-static inline int pte_write(pte_t pte)		{ return pte_val(pte) & _PAGE_RW; }
-static inline int pte_dirty(pte_t pte)		{ return pte_val(pte) & _PAGE_DIRTY; }
-static inline int pte_young(pte_t pte)		{ return pte_val(pte) & _PAGE_ACCESSED; }
-static inline int pte_file(pte_t pte)		{ return pte_val(pte) & _PAGE_FILE; }
-static inline int pte_special(pte_t pte)	{ return pte_val(pte) & _PAGE_SPECIAL; }
-
-static inline pte_t pte_wrprotect(pte_t pte) {
-	pte_val(pte) &= ~(_PAGE_RW | _PAGE_HWWRITE); return pte; }
-static inline pte_t pte_mkclean(pte_t pte) {
-	pte_val(pte) &= ~(_PAGE_DIRTY | _PAGE_HWWRITE); return pte; }
-static inline pte_t pte_mkold(pte_t pte) {
-	pte_val(pte) &= ~_PAGE_ACCESSED; return pte; }
-
-static inline pte_t pte_mkwrite(pte_t pte) {
-	pte_val(pte) |= _PAGE_RW; return pte; }
-static inline pte_t pte_mkdirty(pte_t pte) {
-	pte_val(pte) |= _PAGE_DIRTY; return pte; }
-static inline pte_t pte_mkyoung(pte_t pte) {
-	pte_val(pte) |= _PAGE_ACCESSED; return pte; }
-static inline pte_t pte_mkspecial(pte_t pte) {
-	pte_val(pte) |= _PAGE_SPECIAL; return pte; }
-static inline pgprot_t pte_pgprot(pte_t pte)
-{
-	return __pgprot(pte_val(pte) & PAGE_PROT_BITS);
-}
-
-static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
-{
-	pte_val(pte) = (pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot);
-	return pte;
-}
-
 /*
  * When flushing the tlb entry for a page, we also need to flush the hash
  * table entry.  flush_hash_pages is assembler (for speed) in hashtable.S.
Index: linux-work/arch/powerpc/include/asm/pgtable-ppc64.h
===================================================================
--- linux-work.orig/arch/powerpc/include/asm/pgtable-ppc64.h	2009-03-03 16:17:29.000000000 +1100
+++ linux-work/arch/powerpc/include/asm/pgtable-ppc64.h	2009-03-03 16:18:45.000000000 +1100
@@ -80,80 +80,8 @@
  * Include the PTE bits definitions
  */
 #include <asm/pte-hash64.h>
+#include <asm/pte-common.h>
 
-/* Some other useful definitions */
-#define PTE_RPN_MAX	(1UL << (64 - PTE_RPN_SHIFT))
-#define PTE_RPN_MASK	(~((1UL<<PTE_RPN_SHIFT)-1))
-
-/* _PAGE_CHG_MASK masks of bits that are to be preserved accross
- * pgprot changes
- */
-#define _PAGE_CHG_MASK	(PTE_RPN_MASK | _PAGE_HPTEFLAGS | _PAGE_DIRTY | \
-                         _PAGE_ACCESSED | _PAGE_SPECIAL)
-
-#define _PAGE_BASE_NC	(_PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_PSIZE)
-#define _PAGE_BASE	(_PAGE_BASE_NC | _PAGE_COHERENT)
-
-
-/* Permission masks used to generate the __P and __S table,
- *
- * Note:__pgprot is defined in arch/powerpc/include/asm/page.h
- */
-#define PAGE_NONE	__pgprot(_PAGE_BASE)
-#define PAGE_SHARED	__pgprot(_PAGE_BASE | _PAGE_USER | _PAGE_RW)
-#define PAGE_SHARED_X	__pgprot(_PAGE_BASE | _PAGE_USER | _PAGE_RW | _PAGE_EXEC)
-#define PAGE_COPY	__pgprot(_PAGE_BASE | _PAGE_USER)
-#define PAGE_COPY_X	__pgprot(_PAGE_BASE | _PAGE_USER | _PAGE_EXEC)
-#define PAGE_READONLY	__pgprot(_PAGE_BASE | _PAGE_USER)
-#define PAGE_READONLY_X	__pgprot(_PAGE_BASE | _PAGE_USER | _PAGE_EXEC)
-
-/* Permission masks used for kernel mappings */
-#define PAGE_KERNEL	__pgprot(_PAGE_BASE | _PAGE_KERNEL_RW)
-#define PAGE_KERNEL_NC	__pgprot(_PAGE_BASE_NC | _PAGE_KERNEL_RW | \
-				 _PAGE_NO_CACHE)
-#define PAGE_KERNEL_NCG	__pgprot(_PAGE_BASE_NC | _PAGE_KERNEL_RW | \
-				 _PAGE_NO_CACHE | _PAGE_GUARDED)
-#define PAGE_KERNEL_X __pgprot(_PAGE_BASE | _PAGE_KERNEL_RW | _PAGE_EXEC)
-#define PAGE_KERNEL_RO __pgprot(_PAGE_BASE | _PAGE_KERNEL_RO)
-#define PAGE_KERNEL_ROX __pgprot(_PAGE_BASE | _PAGE_KERNEL_RO | _PAGE_EXEC)
-
-/* Protection bits for use by pte_pgprot() */
-#define PAGE_PROT_BITS	(_PAGE_GUARDED | _PAGE_COHERENT | \
-			 _PAGE_NO_CACHE | _PAGE_WRITETHRU |		\
-			 _PAGE_4K_PFN | _PAGE_USER | _PAGE_RW |		\
-			 _PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_EXEC)
-
-
-/* We always have _PAGE_SPECIAL on 64 bit */
-#define __HAVE_ARCH_PTE_SPECIAL
-
-
-/*
- * POWER4 and newer have per page execute protection, older chips can only
- * do this on a segment (256MB) basis.
- *
- * Also, write permissions imply read permissions.
- * This is the closest we can get..
- *
- * Note due to the way vm flags are laid out, the bits are XWR
- */
-#define __P000	PAGE_NONE
-#define __P001	PAGE_READONLY
-#define __P010	PAGE_COPY
-#define __P011	PAGE_COPY
-#define __P100	PAGE_READONLY_X
-#define __P101	PAGE_READONLY_X
-#define __P110	PAGE_COPY_X
-#define __P111	PAGE_COPY_X
-
-#define __S000	PAGE_NONE
-#define __S001	PAGE_READONLY
-#define __S010	PAGE_SHARED
-#define __S011	PAGE_SHARED
-#define __S100	PAGE_READONLY_X
-#define __S101	PAGE_READONLY_X
-#define __S110	PAGE_SHARED_X
-#define __S111	PAGE_SHARED_X
 
 #ifdef CONFIG_PPC_MM_SLICES
 #define HAVE_ARCH_UNMAPPED_AREA
@@ -194,34 +122,8 @@
 #endif /* __real_pte */
 
 
-/*
- * Conversion functions: convert a page and protection to a page entry,
- * and a page entry and page directory to the page they refer to.
- *
- * mk_pte takes a (struct page *) as input
- */
-#define mk_pte(page, pgprot)	pfn_pte(page_to_pfn(page), (pgprot))
-
-static inline pte_t pfn_pte(unsigned long pfn, pgprot_t pgprot)
-{
-	pte_t pte;
-
-
-	pte_val(pte) = (pfn << PTE_RPN_SHIFT) | pgprot_val(pgprot);
-	return pte;
-}
-
-#define pte_modify(_pte, newprot) \
-  (__pte((pte_val(_pte) & _PAGE_CHG_MASK) | pgprot_val(newprot)))
-
-#define pte_none(pte)		((pte_val(pte) & ~_PAGE_HPTEFLAGS) == 0)
-#define pte_present(pte)	(pte_val(pte) & _PAGE_PRESENT)
-
 /* pte_clear moved to later in this file */
 
-#define pte_pfn(x)		((unsigned long)((pte_val(x)>>PTE_RPN_SHIFT)))
-#define pte_page(x)		pfn_to_page(pte_pfn(x))
-
 #define PMD_BAD_BITS		(PTE_TABLE_SIZE-1)
 #define PUD_BAD_BITS		(PMD_TABLE_SIZE-1)
 
@@ -269,36 +171,6 @@ static inline pte_t pfn_pte(unsigned lon
 /* This now only contains the vmalloc pages */
 #define pgd_offset_k(address) pgd_offset(&init_mm, address)
 
-/*
- * The following only work if pte_present() is true.
- * Undefined behaviour if not..
- */
-static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW;}
-static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY;}
-static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED;}
-static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE;}
-static inline int pte_special(pte_t pte) { return pte_val(pte) & _PAGE_SPECIAL; }
-
-static inline pte_t pte_wrprotect(pte_t pte) {
-	pte_val(pte) &= ~(_PAGE_RW); return pte; }
-static inline pte_t pte_mkclean(pte_t pte) {
-	pte_val(pte) &= ~(_PAGE_DIRTY); return pte; }
-static inline pte_t pte_mkold(pte_t pte) {
-	pte_val(pte) &= ~_PAGE_ACCESSED; return pte; }
-static inline pte_t pte_mkwrite(pte_t pte) {
-	pte_val(pte) |= _PAGE_RW; return pte; }
-static inline pte_t pte_mkdirty(pte_t pte) {
-	pte_val(pte) |= _PAGE_DIRTY; return pte; }
-static inline pte_t pte_mkyoung(pte_t pte) {
-	pte_val(pte) |= _PAGE_ACCESSED; return pte; }
-static inline pte_t pte_mkhuge(pte_t pte) {
-	return pte; }
-static inline pte_t pte_mkspecial(pte_t pte) {
-	pte_val(pte) |= _PAGE_SPECIAL; return pte; }
-static inline pgprot_t pte_pgprot(pte_t pte)
-{
-	return __pgprot(pte_val(pte) & PAGE_PROT_BITS);
-}
 
 /* Atomic PTE updates */
 static inline unsigned long pte_update(struct mm_struct *mm,
Index: linux-work/arch/powerpc/include/asm/pgtable.h
===================================================================
--- linux-work.orig/arch/powerpc/include/asm/pgtable.h	2009-03-03 16:17:29.000000000 +1100
+++ linux-work/arch/powerpc/include/asm/pgtable.h	2009-03-03 16:18:45.000000000 +1100
@@ -25,12 +25,57 @@ static inline void assert_pte_locked(str
 #  include <asm/pgtable-ppc32.h>
 #endif
 
-/* Special mapping for AGP */
-#define PAGE_AGP	(PAGE_KERNEL_NC)
-#define HAVE_PAGE_AGP
-
 #ifndef __ASSEMBLY__
 
+/* Generic accessors to PTE bits */
+static inline int pte_write(pte_t pte)		{ return pte_val(pte) & _PAGE_RW; }
+static inline int pte_dirty(pte_t pte)		{ return pte_val(pte) & _PAGE_DIRTY; }
+static inline int pte_young(pte_t pte)		{ return pte_val(pte) & _PAGE_ACCESSED; }
+static inline int pte_file(pte_t pte)		{ return pte_val(pte) & _PAGE_FILE; }
+static inline int pte_special(pte_t pte)	{ return pte_val(pte) & _PAGE_SPECIAL; }
+static inline int pte_present(pte_t pte)	{ return pte_val(pte) & _PAGE_PRESENT; }
+static inline int pte_none(pte_t pte)		{ return (pte_val(pte) & ~_PTE_NONE_MASK) == 0; }
+static inline pgprot_t pte_pgprot(pte_t pte)	{ return __pgprot(pte_val(pte) & PAGE_PROT_BITS); }
+
+/* Conversion functions: convert a page and protection to a page entry,
+ * and a page entry and page directory to the page they refer to.
+ *
+ * Even if PTEs can be unsigned long long, a PFN is always an unsigned
+ * long for now.
+ */
+static inline pte_t pfn_pte(unsigned long pfn, pgprot_t pgprot) {
+	return __pte((pfn << PTE_RPN_SHIFT) | pgprot_val(pgprot)); }
+static inline unsigned long pte_pfn(pte_t pte)	{
+	return pte_val(pte) >> PTE_RPN_SHIFT; }
+
+/* Keep these as a macros to avoid include dependency mess */
+#define pte_page(x)		pfn_to_page(pte_pfn(x))
+#define mk_pte(page, pgprot)	pfn_pte(page_to_pfn(page), (pgprot))
+
+/* Generic modifiers for PTE bits */
+static inline pte_t pte_wrprotect(pte_t pte) {
+	pte_val(pte) &= ~(_PAGE_RW | _PAGE_HWWRITE); return pte; }
+static inline pte_t pte_mkclean(pte_t pte) {
+	pte_val(pte) &= ~(_PAGE_DIRTY | _PAGE_HWWRITE); return pte; }
+static inline pte_t pte_mkold(pte_t pte) {
+	pte_val(pte) &= ~_PAGE_ACCESSED; return pte; }
+static inline pte_t pte_mkwrite(pte_t pte) {
+	pte_val(pte) |= _PAGE_RW; return pte; }
+static inline pte_t pte_mkdirty(pte_t pte) {
+	pte_val(pte) |= _PAGE_DIRTY; return pte; }
+static inline pte_t pte_mkyoung(pte_t pte) {
+	pte_val(pte) |= _PAGE_ACCESSED; return pte; }
+static inline pte_t pte_mkspecial(pte_t pte) {
+	pte_val(pte) |= _PAGE_SPECIAL; return pte; }
+static inline pte_t pte_mkhuge(pte_t pte) {
+	return pte; }
+static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
+{
+	pte_val(pte) = (pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot);
+	return pte;
+}
+
+
 /* Insert a PTE, top-level function is out of line. It uses an inline
  * low level function in the respective pgtable-* files
  */
Index: linux-work/arch/powerpc/include/asm/pte-common.h
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ linux-work/arch/powerpc/include/asm/pte-common.h	2009-03-03 16:18:45.000000000 +1100
@@ -0,0 +1,177 @@
+/* Included from asm/pgtable-*.h only ! */
+
+/*
+ * Some bits are only used on some cpu families... Make sure that all
+ * the undefined gets a sensible default
+ */
+#ifndef _PAGE_HASHPTE
+#define _PAGE_HASHPTE	0
+#endif
+#ifndef _PAGE_SHARED
+#define _PAGE_SHARED	0
+#endif
+#ifndef _PAGE_HWWRITE
+#define _PAGE_HWWRITE	0
+#endif
+#ifndef _PAGE_HWEXEC
+#define _PAGE_HWEXEC	0
+#endif
+#ifndef _PAGE_EXEC
+#define _PAGE_EXEC	0
+#endif
+#ifndef _PAGE_ENDIAN
+#define _PAGE_ENDIAN	0
+#endif
+#ifndef _PAGE_COHERENT
+#define _PAGE_COHERENT	0
+#endif
+#ifndef _PAGE_WRITETHRU
+#define _PAGE_WRITETHRU	0
+#endif
+#ifndef _PAGE_SPECIAL
+#define _PAGE_SPECIAL	0
+#endif
+#ifndef _PAGE_4K_PFN
+#define _PAGE_4K_PFN		0
+#endif
+#ifndef _PAGE_PSIZE
+#define _PAGE_PSIZE		0
+#endif
+#ifndef _PMD_PRESENT_MASK
+#define _PMD_PRESENT_MASK	_PMD_PRESENT
+#endif
+#ifndef _PMD_SIZE
+#define _PMD_SIZE	0
+#define PMD_PAGE_SIZE(pmd)	bad_call_to_PMD_PAGE_SIZE()
+#endif
+#ifndef _PAGE_KERNEL_RO
+#define _PAGE_KERNEL_RO	0
+#endif
+#ifndef _PAGE_KERNEL_RW
+#define _PAGE_KERNEL_RW	(_PAGE_DIRTY | _PAGE_RW | _PAGE_HWWRITE)
+#endif
+#ifndef _PAGE_HPTEFLAGS
+#define _PAGE_HPTEFLAGS _PAGE_HASHPTE
+#endif
+#ifndef _PTE_NONE_MASK
+#define _PTE_NONE_MASK	_PAGE_HPTEFLAGS
+#endif
+
+/* Make sure we get a link error if PMD_PAGE_SIZE is ever called on a
+ * kernel without large page PMD support
+ */
+#ifndef __ASSEMBLY__
+extern unsigned long bad_call_to_PMD_PAGE_SIZE(void);
+#endif /* __ASSEMBLY__ */
+
+/* Location of the PFN in the PTE. Most 32-bit platforms use the same
+ * as _PAGE_SHIFT here (ie, naturally aligned).
+ * Platform who don't just pre-define the value so we don't override it here
+ */
+#ifndef PTE_RPN_SHIFT
+#define PTE_RPN_SHIFT	(PAGE_SHIFT)
+#endif
+
+/* The mask convered by the RPN must be a ULL on 32-bit platforms with
+ * 64-bit PTEs
+ */
+#if defined(CONFIG_PPC32) && defined(CONFIG_PTE_64BIT)
+#define PTE_RPN_MAX	(1ULL << (64 - PTE_RPN_SHIFT))
+#define PTE_RPN_MASK	(~((1ULL<<PTE_RPN_SHIFT)-1))
+#else
+#define PTE_RPN_MAX	(1UL << (32 - PTE_RPN_SHIFT))
+#define PTE_RPN_MASK	(~((1UL<<PTE_RPN_SHIFT)-1))
+#endif
+
+/* _PAGE_CHG_MASK masks of bits that are to be preserved accross
+ * pgprot changes
+ */
+#define _PAGE_CHG_MASK	(PTE_RPN_MASK | _PAGE_HPTEFLAGS | _PAGE_DIRTY | \
+                         _PAGE_ACCESSED | _PAGE_SPECIAL)
+
+/* Mask of bits returned by pte_pgprot() */
+#define PAGE_PROT_BITS	(_PAGE_GUARDED | _PAGE_COHERENT | _PAGE_NO_CACHE | \
+			 _PAGE_WRITETHRU | _PAGE_ENDIAN | _PAGE_4K_PFN | \
+			 _PAGE_USER | _PAGE_ACCESSED | \
+			 _PAGE_RW | _PAGE_HWWRITE | _PAGE_DIRTY | \
+			 _PAGE_EXEC | _PAGE_HWEXEC)
+
+/*
+ * We define 2 sets of base prot bits, one for basic pages (ie,
+ * cacheable kernel and user pages) and one for non cacheable
+ * pages. We always set _PAGE_COHERENT when SMP is enabled or
+ * the processor might need it for DMA coherency.
+ */
+#define _PAGE_BASE_NC	(_PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_PSIZE)
+#if defined(CONFIG_SMP) || defined(CONFIG_PPC_STD_MMU)
+#define _PAGE_BASE	(_PAGE_BASE_NC | _PAGE_COHERENT)
+#else
+#define _PAGE_BASE	(_PAGE_BASE_NC)
+#endif
+
+/* Permission masks used to generate the __P and __S table,
+ *
+ * Note:__pgprot is defined in arch/powerpc/include/asm/page.h
+ *
+ * Write permissions imply read permissions for now (we could make write-only
+ * pages on BookE but we don't bother for now). Execute permission control is
+ * possible on platforms that define _PAGE_EXEC
+ *
+ * Note due to the way vm flags are laid out, the bits are XWR
+ */
+#define PAGE_NONE	__pgprot(_PAGE_BASE)
+#define PAGE_SHARED	__pgprot(_PAGE_BASE | _PAGE_USER | _PAGE_RW)
+#define PAGE_SHARED_X	__pgprot(_PAGE_BASE | _PAGE_USER | _PAGE_RW | _PAGE_EXEC)
+#define PAGE_COPY	__pgprot(_PAGE_BASE | _PAGE_USER)
+#define PAGE_COPY_X	__pgprot(_PAGE_BASE | _PAGE_USER | _PAGE_EXEC)
+#define PAGE_READONLY	__pgprot(_PAGE_BASE | _PAGE_USER)
+#define PAGE_READONLY_X	__pgprot(_PAGE_BASE | _PAGE_USER | _PAGE_EXEC)
+
+#define __P000	PAGE_NONE
+#define __P001	PAGE_READONLY
+#define __P010	PAGE_COPY
+#define __P011	PAGE_COPY
+#define __P100	PAGE_READONLY_X
+#define __P101	PAGE_READONLY_X
+#define __P110	PAGE_COPY_X
+#define __P111	PAGE_COPY_X
+
+#define __S000	PAGE_NONE
+#define __S001	PAGE_READONLY
+#define __S010	PAGE_SHARED
+#define __S011	PAGE_SHARED
+#define __S100	PAGE_READONLY_X
+#define __S101	PAGE_READONLY_X
+#define __S110	PAGE_SHARED_X
+#define __S111	PAGE_SHARED_X
+
+/* Permission masks used for kernel mappings */
+#define PAGE_KERNEL	__pgprot(_PAGE_BASE | _PAGE_KERNEL_RW)
+#define PAGE_KERNEL_NC	__pgprot(_PAGE_BASE_NC | _PAGE_KERNEL_RW | \
+				 _PAGE_NO_CACHE)
+#define PAGE_KERNEL_NCG	__pgprot(_PAGE_BASE_NC | _PAGE_KERNEL_RW | \
+				 _PAGE_NO_CACHE | _PAGE_GUARDED)
+#define PAGE_KERNEL_X	__pgprot(_PAGE_BASE | _PAGE_KERNEL_RW | _PAGE_EXEC)
+#define PAGE_KERNEL_RO	__pgprot(_PAGE_BASE | _PAGE_KERNEL_RO)
+#define PAGE_KERNEL_ROX	__pgprot(_PAGE_BASE | _PAGE_KERNEL_RO | _PAGE_EXEC)
+
+/* Protection used for kernel text. We want the debuggers to be able to
+ * set breakpoints anywhere, so don't write protect the kernel text
+ * on platforms where such control is possible.
+ */
+#if defined(CONFIG_KGDB) || defined(CONFIG_XMON) || defined(CONFIG_BDI_SWITCH) ||\
+	defined(CONFIG_KPROBES)
+#define PAGE_KERNEL_TEXT	PAGE_KERNEL_X
+#else
+#define PAGE_KERNEL_TEXT	PAGE_KERNEL_ROX
+#endif
+
+/* Advertise special mapping type for AGP */
+#define PAGE_AGP	(PAGE_KERNEL_NC)
+#define HAVE_PAGE_AGP
+
+/* Advertise support for _PAGE_SPECIAL */
+#ifdef _PAGE_SPECIAL
+#define __HAVE_ARCH_PTE_SPECIAL
+#endif
+

^ permalink raw reply

* Re: [PATCH] Enable hashdist by default on 64bit NUMA
From: Benjamin Herrenschmidt @ 2009-03-03  5:27 UTC (permalink / raw)
  To: Anton Blanchard; +Cc: linuxppc-dev, David Miller
In-Reply-To: <20090226112431.GA25330@kryten>

On Thu, 2009-02-26 at 22:24 +1100, Anton Blanchard wrote:
> Hi David,
>  
> > Hmmm... my bad, I think you need to keep the CONFIG_NUMA
> > there too as there is a TLB usage penalty for non-NUMA
> > systems if you only use CONFIG_64BIT there.
> 
> Sorry that was my screwup, here's a fixed version.

Sounds good, how do we proceed for merging that ? Andrew ? Should it hop
by linux-mm ?

Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---

> Anton
> 
> --
> 
> On PowerPC we allocate large boot time hashes on node 0. This leads to
> an imbalance in the free memory, for example on a 64GB box (4 x 16GB
> nodes):
> 
> Free memory:
> Node 0: 97.03%
> Node 1: 98.54%
> Node 2: 98.42%
> Node 3: 98.53%
> 
> If we switch to using vmalloc (like ia64 and x86-64) things are more
> balanced:
> 
> Free memory:
> Node 0: 97.53%
> Node 1: 98.35%
> Node 2: 98.33%
> Node 3: 98.33%
> 
> For many HPC applications we are limited by the free available memory on
> the smallest node, so even though the same amount of memory is used the
> better balancing helps.
> 
> Since all 64bit NUMA capable architectures should have sufficient
> vmalloc space, it makes sense to enable it via CONFIG_64BIT.
> 
> Signed-off-by: Anton Blanchard <anton@samba.org>
> ---
> 
> diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h
> index 95837bf..0c4d4b7 100644
> --- a/include/linux/bootmem.h
> +++ b/include/linux/bootmem.h
> @@ -144,10 +144,10 @@ extern void *alloc_large_system_hash(const char *tablename,
>  
>  #define HASH_EARLY	0x00000001	/* Allocating during early boot? */
>  
> -/* Only NUMA needs hash distribution.
> - * IA64 and x86_64 have sufficient vmalloc space.
> +/* Only NUMA needs hash distribution. 64bit NUMA architectures have
> + * sufficient vmalloc space.
>   */
> -#if defined(CONFIG_NUMA) && (defined(CONFIG_IA64) || defined(CONFIG_X86_64))
> +#if defined(CONFIG_NUMA) && defined(CONFIG_64BIT)
>  #define HASHDIST_DEFAULT 1
>  #else
>  #define HASHDIST_DEFAULT 0
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev

^ permalink raw reply

* Re: [PATCH 1/1] Fix 64bit Mapple Host Bridge Address and Size Nodes
From: Benjamin Herrenschmidt @ 2009-03-03  5:31 UTC (permalink / raw)
  To: Tiejun Chen; +Cc: linuxppc-dev, akpm
In-Reply-To: <7a800c8d0902261755s203ef8a1n52ffa12b51a5a12@mail.gmail.com>

Thanks.

Now, is there any reason you can't fold the fix inside the existing
fixup_device_tree_maple() fixup ?  IE. Does it apply to any Maple board
or only this ATCA6101 ?

If not (if it does only apply to this specific board), then give the
function a better name, such as fixup_device_tree_atca6101() and make it
check for the /model property of the device-tree to make sure you only
hit that board and nothing else.

Cheers,
Ben.
 
On Fri, 2009-02-27 at 09:55 +0800, Tiejun Chen wrote:
> 
> 
> 2009/2/27 Benjamin Herrenschmidt <benh@kernel.crashing.org>
>         On Thu, 2009-02-26 at 18:08 +0800, Tiejun Chen wrote:
>         > In the DTB tree created by firmware on Maple 64bit target,
>         host bridge
>         > parent
>         > node has specified both of these two properties to be 2.
>         However, the
>         > actual
>         > "cell" value for host bridge node is 1. we have to provide
>         one fixup
>         > function.
>         
>         
>         Hi !
>         
>         Thanks for the patch. A couple of things tho: Can you make it
>         a bit
>         more robust by properly checking the board type first ?
> 
> That is ATCA 6101 and the following is from the MOTLoad firmware.
> ------
> Copyright Motorola Inc. 1999-2006, All Rights Reserved
> MOTLoad RTOS Version 2.0,  PAL Version 1.1 RM01
> Built on Tue Jun 13 10:31:56 EDT 2006 by q3316c
> bbs 2.0 build 38
> 
> Part Number          =01-W3930F04A
> Serial Number        =0000001
> 
> MPU-Type             =PPC970FX DD3.1
> MPU-Int Clock Speed  =1800MHz
> Memory Speed         =333MHz
> 
> PCI bus instance 1   =64 bit, 100 MHz, PCI-X
> PCI bus instance 2   =64 bit, 100 MHz, PCI-X
> PCI bus instance 3   =64 bit, 100 MHz, PCI-X
> PCI bus instance 4   =64 bit, 100 MHz, PCI-X
> PCI bus instance 5   =32 bit, 33 MHz, PCI
> 
> HT Link instance 1   =16 bit, 400 MHz
> HT Link instance 2   = 8 bit, 600 MHz
> HT Link instance 3   = 8 bit, 200 MHz
> 
> MOTLoad FLASH Image  =FLASH Bank A
> 
> Local Memory Found   =080000000 (&2147483648)
> User Download Buffer =0611A5000:0613A4FFF
> ------
> 
> Here is some board information I can know:
> ------
> Board revision: 01
> Boot loader version: 2.0
> Silicon revision: 3.1 (pvr 003c 0301) 
> ------
> 
> 
>         
>         
>         Also, what is this "hostbridge" node ? ie, what does it
>         represent ?
> 
>  That means IBM CPC925 system controller resided on the ATCA 6101.
> 
> 
>         
>         
>         Can you send me a full dump of /proc/device-tree from the
>         machine ?
>         (ie tar it up)
> 
> See the attachment.
>  
> 
>         
>         Finally, it looks like your patch was whitespace damaged by
>         your mailer.
> 
> After you confirm others is ok I will send v2 improved patch.
> 
> Thanks & Best Regards
> Tiejun
>  
>         
>         Cheers,
>         Ben.
>         
>         
>         
>         > Signed-off-by: Tiejun Chen <tiejun.china@gmail.com>
>         > ---
>         >  arch/powerpc/kernel/prom_init.c |   42
>         > +++++++++++++++++++++++++++++++++++++++
>         >  1 files changed, 42 insertions(+), 0 deletions(-)
>         >
>         > diff --git a/arch/powerpc/kernel/prom_init.c
>         > b/arch/powerpc/kernel/prom_init.c
>         > index 2445945..9cd23b6 100644
>         > --- a/arch/powerpc/kernel/prom_init.c
>         > +++ b/arch/powerpc/kernel/prom_init.c
>         > @@ -1948,8 +1948,49 @@ static void __init
>         > fixup_device_tree_maple(void)
>         >        prom_setprop(isa, name, "ranges",
>         >                        isa_ranges, sizeof(isa_ranges));
>         >  }
>         > +
>         > +/* On Maple 64bit target host bridge parent node has
>         specified
>         > address and
>         > + * size properties to be 2. But the actual "cell" value for
>         host
>         > bridge node
>         > + * is 1 since early MOTLoad internal bug. */
>         > +static void __init fixup_device_tree_maple_hb(void)
>         > +{
>         > +       phandle hb;
>         > +       u32 hb_ranges[4];
>         > +       u32 size_cell, addr_cell;
>         > +       struct prom_t *_prom = &RELOC(prom);
>         > +       char *name;
>         > +
>         > +       name = "/hostbridge@f8000000";
>         > +       hb = call_prom("finddevice", 1, 1, ADDR(name));
>         > +       if (!PHANDLE_VALID(hb))
>         > +               return;
>         > +
>         > +       if (prom_getproplen(hb, "reg") != 8)
>         > +               return;
>         > +
>         > +       if (prom_getprop(hb, "reg", hb_ranges,
>         (sizeof(hb_ranges))/2)
>         > +               == PROM_ERROR)
>         > +               return;
>         > +
>         > +       prom_getprop(_prom->root, "#address-cells",
>         &addr_cell,
>         > sizeof(addr_cell));
>         > +       prom_getprop(_prom->root, "#size-cells", &size_cell,
>         > sizeof(size_cell));
>         > +
>         > +       if ((addr_cell != 2) || (size_cell != 2) ||
>         > +               (hb_ranges[0] != 0xf8000000))
>         > +               return;
>         > +
>         > +       prom_printf("Fixing up bogus HOSTBRIDGE reg on
>         > Maple/Apache...\n");
>         > +
>         > +       hb_ranges[3] = hb_ranges[1];
>         > +       hb_ranges[1] = hb_ranges[0];
>         > +       hb_ranges[0] = hb_ranges[2] = 0;
>         > +       prom_setprop(hb, name, "reg",
>         > +               hb_ranges, sizeof(hb_ranges));
>         > +}
>         > +
>         >  #else
>         >  #define fixup_device_tree_maple()
>         > +#define fixup_device_tree_maple_hb()
>         >  #endif
>         >
>         >  #ifdef CONFIG_PPC_CHRP
>         > @@ -2190,6 +2231,7 @@ static void __init
>         fixup_device_tree_efika(void)
>         >  static void __init fixup_device_tree(void)
>         >  {
>         >        fixup_device_tree_maple();
>         > +       fixup_device_tree_maple_hb();
>         >        fixup_device_tree_chrp();
>         >        fixup_device_tree_pmac();
>         >        fixup_device_tree_efika();
>         > --
>         > 1.5.6
>         >
>         >
>         >
>         
>         
> 

^ permalink raw reply

* Re: powerpc allnoconfig
From: Andrew Morton @ 2009-03-03  5:38 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linuxppc-dev, Michael Neuling
In-Reply-To: <20090303154043.fee7902e.sfr@canb.auug.org.au>

On Tue, 3 Mar 2009 15:40:43 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:

> Hi Andrew,
> 
> On Mon, 2 Mar 2009 20:08:09 -0800 Andrew Morton <akpm@linux-foundation.org> wrote:
> >
> > > Right, you have a 64 bit only compiler. Also it is version 4.1.0 which we now black ban (I think).
> > 
> > Probably.  But I only use it for compilation testing, so the `Your
> > version of gcc miscompiles the __weak directive' thing is a pointless
> > PITA, so I patch it out.
> 
> Ah, ok.
> 
> > > let us know if that works :-)
> > 
> > didn't.  Oh well.
> 
> Rats!
> 
> I think we need a better bug report :-)
> Kernel version?

Current mainline.

> What error do you get now?

Same as before.

> allmodconfig and defconfig turn CONFIG_PPC64 on.  allnoconfig turns it
> off so you are trying to build a 32 bit kernel with a 64 bit compiler.

Oh.  Well that will tear it.

How does one prepare a powerpc64 allnoconfig?

^ permalink raw reply

* Re: powerpc allnoconfig
From: Stephen Rothwell @ 2009-03-03  6:22 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linuxppc-dev, Michael Neuling
In-Reply-To: <20090302213801.1dd255f3.akpm@linux-foundation.org>

[-- Attachment #1: Type: text/plain, Size: 4046 bytes --]

Hi Andrew,

On Mon, 2 Mar 2009 21:38:01 -0800 Andrew Morton <akpm@linux-foundation.org> wrote:
>
> > I think we need a better bug report :-)
> > Kernel version?
> 
> Current mainline.
> 
> > What error do you get now?
> 
> Same as before.
> 
> > allmodconfig and defconfig turn CONFIG_PPC64 on.  allnoconfig turns it
> > off so you are trying to build a 32 bit kernel with a 64 bit compiler.
> 
> Oh.  Well that will tear it.
> 
> How does one prepare a powerpc64 allnoconfig?

Like above.

See this is what happens for me:

$ git describe
v2.6.29-rc6-305-g2450cf5
$ /home/sfr/kernels/cross/bin/powerpc64-linux-gcc -v
Using built-in specs.
Target: powerpc64-linux
Configured with: /home/sfr/kernels/tools/gcc-4.3.2/configure --target=powerpc64-linux --enable-targets=all --prefix=/home/sfr/kernels/cross --with-mpfr=/usr --enable-languages=c --without-headers --enable-sjlj-exceptions --with-system-libunwind --disable-nls --disable-threads --disable-shared --disable-libmudflap --disable-libssp --disable-libgomp --disable-decimal-float --enable-checking=release
Thread model: single
gcc version 4.3.2 (GCC) 
$ mkdir ../powerpc_allnoconfig
$ echo CONFIG_PPC64=y >../powerpc64_allnoconfig
$ KCONFIG_ALLCONFIG=../powerpc64_allnoconfig make O=../powerpc_allnoconfig ARCH=powerpc CROSS_COMPILE=/home/sfr/kernels/cross/bin/powerpc64-linux- allnoconfig
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/basic/docproc
  HOSTCC  scripts/basic/hash
  GEN     /home/sfr/kernels/powerpc_allnoconfig/Makefile
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/kxgettext.o
  SHIPPED scripts/kconfig/zconf.tab.c
  SHIPPED scripts/kconfig/lex.zconf.c
  SHIPPED scripts/kconfig/zconf.hash.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
scripts/kconfig/conf -n arch/powerpc/Kconfig
#
# configuration written to .config
#
$ make O=../powerpc_allnoconfig ARCH=powerpc CROSS_COMPILE=/home/sfr/kernels/cross/bin/powerpc64-linux- vmlinux
  GEN     /home/sfr/kernels/powerpc_allnoconfig/Makefile
scripts/kconfig/conf -s arch/powerpc/Kconfig
  Using /home/sfr/kernels/work as source for kernel
  GEN     /home/sfr/kernels/powerpc_allnoconfig/Makefile
  CHK     include/linux/version.h
  UPD     include/linux/version.h
  CHK     include/linux/utsrelease.h
  UPD     include/linux/utsrelease.h
  SYMLINK include/asm -> include/asm-powerpc
  CC      kernel/bounds.s
  GEN     include/linux/bounds.h
  CC      arch/powerpc/kernel/asm-offsets.s
  GEN     include/asm/asm-offsets.h
  CALL    /home/sfr/kernels/work/scripts/checksyscalls.sh
  CC      scripts/mod/empty.o
  HOSTCC  scripts/mod/mk_elfconfig
  MKELF   scripts/mod/elfconfig.h
  HOSTCC  scripts/mod/file2alias.o
	.
	.
	.
  CC      kernel/sysctl.o
/home/sfr/kernels/work/kernel/sysctl.c:103: warning: 'one' defined but not used
	.
	.
	.
  LD      vmlinux.o
  MODPOST vmlinux.o
WARNING: modpost: Found 2 section mismatch(es).
To see full details build your kernel with:
'make CONFIG_DEBUG_SECTION_MISMATCH=y'
  GEN     .version
  CHK     include/linux/compile.h
  UPD     include/linux/compile.h
  CC      init/version.o
  LD      init/built-in.o
  LD      .tmp_vmlinux1
  KSYM    .tmp_kallsyms1.S
  AS      .tmp_kallsyms1.o
  LD      .tmp_vmlinux2
  KSYM    .tmp_kallsyms2.S
  AS      .tmp_kallsyms2.o
  LD      vmlinux
  SYSMAP  System.map
  SYSMAP  .tmp_System.map
$ grep CONFIG_PPC64 ../powerpc_allnoconfig/.config
CONFIG_PPC64=y
$ file ../powerpc_allnoconfig/vmlinux
../powerpc_allnoconfig/vmlinux: ELF 64-bit MSB executable, 64-bit PowerPC or cisco 7500, version 1 (SYSV), statically linked, not stripped

So, I can only imagine it is your toolchain that is letting you down.
What is your host machine?  Can I send you a new toolchain? (Mine are only
good for building kernels - they have no libraries - they are build by a
script I got from Segher Boessenkool.)

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply

* Re: powerpc allnoconfig
From: Andrew Morton @ 2009-03-03  6:35 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linuxppc-dev, Michael Neuling
In-Reply-To: <20090303172232.f12ffbf8.sfr@canb.auug.org.au>

On Tue, 3 Mar 2009 17:22:32 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:

> So, I can only imagine it is your toolchain that is letting you down.

hrm.  I blame Rusty.

> What is your host machine?

x86_64/FCx

>  Can I send you a new toolchain? (Mine are only
> good for building kernels - they have no libraries - they are build by a
> script I got from Segher Boessenkool.)

It's OK - I don't really care and as long as it's OK on a realistic
build setup, I guess we're good.

^ permalink raw reply

* Re: PHY not found after migration of gianfar driver to an of_platform_driver
From: Michael Guntsche @ 2009-03-03  7:35 UTC (permalink / raw)
  To: Grant Likely; +Cc: linuxppc-dev
In-Reply-To: <fa686aa40903020708y1f9f8ceeueb13f9146534df8d@mail.gmail.com>

On Mon, 2 Mar 2009 08:08:02 -0700, Grant Likely <grant.likely@secretlab.ca>
wrote:
> On Mon, Mar 2, 2009 at 4:58 AM, Michael Guntsche <mike@it-loops.com>
wrote:
> You mean like loading it of the CF or something?  Yeah, I suppose so
> if you wrote a minimal CF driver, but that seems the hard way around
> also.  You're far better off to statically link in a .dtb image and
> modify it.  If the bootloader doesn't provide you with any useful
> information, you can read the SoC registers to detect memory size and
> clock rate.  If you're lucky, the bootloader will have already
> assigned the correct MAC addresses for you and you can read those out
> also.



> 
> You can also try inspecting the memory pointed to by r3-r7 and seeing
> if any of them point to something interesting.

Regarding the registers I did a 

printf("Reg: %lu\n", r3); 

after the init of the serial console. While r4 to r7 where empty, I got
back a number 8756... from R3. 
I do not know what's in there though. Is there another better way to get to
the data?


> Oh.  So routerboot does understand dtb blobs?  Okay, I didn't
> understand that.  Yes, you can call the libfdt functions in your
> platform_init() to add the missing nodes.
I don't know if routerboot understands dtb blobs. If I boot with a standard
vmlinux image the board boots
as well so I think that the firmware provides a tree the prom code can
read. 
As for adding additional information to the tree, can I also use libfdt
functions in platform/83xx/rbppc.c or is it better to do this via a
dedicated platform_init that simpleboot then uses?


Once again thank you very much for helping me with this,
Michael

^ permalink raw reply

* Re: [PATCH] powerpc/mpc52xx: add Phytec phyCORE-MPC5200B-IO board (pcm032)
From: Robert Schwebel @ 2009-03-03  8:12 UTC (permalink / raw)
  To: Grant Likely; +Cc: linuxppc-dev, Wolfram Sang
In-Reply-To: <fa686aa40903012033x6b6a76d6j7218d076f2c6ad3d@mail.gmail.com>

On Sun, Mar 01, 2009 at 09:33:16PM -0700, Grant Likely wrote:
> On Sun, Mar 1, 2009 at 7:19 PM, Jon Smirl <jonsmirl@gmail.com> wrote:
> > Would it be easier to get Pengutronix to release a new u-boot for
> > the pcm030? I'm using U-Boot 1.2.0-mpc5200b-tiny-2 (Apr 17 2007 -
> > 11:49:20).
>
> Only if it is a chip IO setup problem (like port_config or clock
> setup). Otherwise the kernel should be setting up the PCI controller
> correctly. Regardless, I don't think the kernel should be crashing
> when PCI is in a funny state.

Ack; I didn't follow the thread in detail, but if possible I'd like to
avoid bootloader updates; it's quite a lot of effort because there are
thousends of devices in the field, not to mention the whole
qualification mechanics at Phytec.

Wolfram can check the issue when being back in the office.

rsc
-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

^ permalink raw reply

* Re: PHY not found after migration of gianfar driver to an of_platform_driver
From: Michael Guntsche @ 2009-03-03  9:49 UTC (permalink / raw)
  To: Grant Likely; +Cc: linuxppc-dev
In-Reply-To: <9d38520266f15d80352d1554e63c1ce6@localhost>

On Tue, 03 Mar 2009 08:35:02 +0100, Michael Guntsche <mike@it-loops.com>
wrote:
> As for adding additional information to the tree, can I also use libfdt
> functions in platform/83xx/rbppc.c or is it better to do this via a
> dedicated platform_init that simpleboot then uses?

Sorry, please forget this quesiton. Of course simpleboot only reads the
embedded tree 
so if I change the tree there it is the same as changing the initial DTS
file.
I will try to boot with a standard vmlinux image and then add the values in
rbppc.c.

Michael

^ permalink raw reply

* 2.6.29-rc6-git6 defconfig build failure
From: Sachin P. Sant @ 2009-03-03  9:50 UTC (permalink / raw)
  To: linuxppc-dev, Benjamin Herrenschmidt

2.6.29-rc6-git6 ppc64_defconfig build fails with 

arch/powerpc/kernel/built-in.o: In function `.of_pci_phb_probe':
of_platform.c:(.devinit.text+0xe0): undefined reference to `.pcibios_claim_one_bus'
arch/powerpc/platforms/built-in.o: In function `.remove_phb_dynamic':
(.text+0x120fc): undefined reference to `.pcibios_unmap_io_space'
arch/powerpc/platforms/built-in.o: In function `.pcibios_add_pci_devices':
(.text+0x12338): undefined reference to `.pcibios_finish_adding_to_bus'
arch/powerpc/platforms/built-in.o: In function `.init_phb_dynamic':
(.devinit.text+0x6ec): undefined reference to `.pcibios_finish_adding_to_bus'
make: *** [.tmp_vmlinux1] Error 1

git5 did not have this problem as CONFIG_HOTPLUG was set with ppc64_defconfig.
With git6 defconfig there is no CONFIG_HOTPLUG

# grep CONFIG_HOTPLUG linux-2.6.29-rc6-git6/.config
# 

# grep CONFIG_HOTPLUG linux-2.6.29-rc6-git5/.config
CONFIG_HOTPLUG=y
CONFIG_HOTPLUG_CPU=y
CONFIG_HOTPLUG_PCI=m
# CONFIG_HOTPLUG_PCI_FAKE is not set
# CONFIG_HOTPLUG_PCI_CPCI is not set
# CONFIG_HOTPLUG_PCI_SHPC is not set
CONFIG_HOTPLUG_PCI_RPA=m
CONFIG_HOTPLUG_PCI_RPA_DLPAR=m

Thanks
-Sachin

-- 

---------------------------------
Sachin Sant
IBM Linux Technology Center
India Systems and Technology Labs
Bangalore, India
---------------------------------

^ permalink raw reply

* Re: powerpc allnoconfig
From: Geert Uytterhoeven @ 2009-03-03 10:14 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Stephen Rothwell, Michael Neuling, linuxppc-dev
In-Reply-To: <20090302200809.26b5d5bb.akpm@linux-foundation.org>

On Mon, 2 Mar 2009, Andrew Morton wrote:
> On Tue, 3 Mar 2009 14:19:05 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> > On Mon, 2 Mar 2009 18:55:14 -0800 Andrew Morton <akpm@linux-foundation.org> wrote:
> > > Using built-in specs.
> > > Target: powerpc64-unknown-linux-gnu
> > > Configured with: /home/axboe/crosstool-0.43/build/powerpc64-unknown-linux-gnu/gcc-4.1.0-glibc-2.3.6/gcc-4.1.0/configure --target=powerpc64-unknown-linux-gnu --host=x86_64-host_unknown-linux-gnu --prefix=/opt/crosstool/gcc-4.1.0-glibc-2.3.6/powerpc64-unknown-linux-gnu --disable-multilib --with-sysroot=/opt/crosstool/gcc-4.1.0-glibc-2.3.6/powerpc64-unknown-linux-gnu/powerpc64-unknown-linux-gnu/sys-root --with-local-prefix=/opt/crosstool/gcc-4.1.0-glibc-2.3.6/powerpc64-unknown-linux-gnu/powerpc64-unknown-linux-gnu/sys-root --disable-nls --enable-threads=posix --enable-symvers=gnu --enable-__cxa_atexit --enable-languages=c --enable-shared --enable-c99 --enable-long-long
> > > Thread model: posix
> > > gcc version 4.1.0
> > > 
> > > > I suspect you have a 64 bit only compiler and allnoconfig produces a 32
> > > > bit kernel.  Is this a new error?
> > > 
> > > 2.6.28 does the same thing.  I don't recall having tested allnoconfig
> > > for ages if at all, so I don't know if it's a regression.
> > 
> > Right, you have a 64 bit only compiler. Also it is version 4.1.0 which we now black ban (I think).
> 
> Probably.  But I only use it for compilation testing, so the `Your
> version of gcc miscompiles the __weak directive' thing is a pointless
> PITA, so I patch it out.
> 
> >  You need to either build a biarch cross compiler (--enable-targets=all) or try:
> > 
> > $ cat >xxx <<EOF
> > CONFIG_PPC64=y
> > EOF
> > $ KCONFIG_ALLCONFIG=xxx make allnoconfig
> > $ make vmlinux
> > 
> > let us know if that works :-)
> 
> didn't.  Oh well.

Does allnoconfig work if you force the compiler to be 32-bit, like

    make CC="powerpc64-unknown-linux-gnu-gcc -m32"

? This is what I'm using to compile ppc32 kernels with the Cell SDK ppu-gcc43,
which defaults to -m64 (BTW, I also had to add "-mcpu=440" for gcc 4.3.2, which
I didn't need for the banned 4.1.1).

With kind regards,

Geert Uytterhoeven
Software Architect

Sony Techsoft Centre Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium

Phone:    +32 (0)2 700 8453
Fax:      +32 (0)2 700 8622
E-mail:   Geert.Uytterhoeven@sonycom.com
Internet: http://www.sony-europe.com/

A division of Sony Europe (Belgium) N.V.
VAT BE 0413.825.160 · RPR Brussels
Fortis · BIC GEBABEBB · IBAN BE41293037680010

^ permalink raw reply

* Re: [rtc-linux] Re: [PATCH/RFC 0/5] Generic RTC class driver
From: Geert Uytterhoeven @ 2009-03-03 10:41 UTC (permalink / raw)
  To: Alessandro Zummo
  Cc: Linux/m68k, Richard Zidlicky, rtc-linux, linux-parisc,
	Linux Kernel Development, Kyle McMartin, Linux/PPC Development,
	David Woodhouse
In-Reply-To: <20090302120950.0d35e06c@i1501.lan.towertech.it>

On Mon, 2 Mar 2009, Alessandro Zummo wrote:
> On Mon, 2 Mar 2009 11:28:01 +0100 (CET)
> Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com> wrote:
> > So I can solve my problem (autoloading the RTC driver on PS3 by udev) by
> > converting the old genrtc driver into a platform device driver and creating
> > platform devices where appropriate.
> 
>  yes. btw, if you are building a kernel specific for the PS3, I would
>  compile the rtc driver statically, otherwise it won't be available
>  early on boot.
>  
> > However, this doesn't solve the distro's problem: as the old RTC framework
> > depends on RTC_LIB=n, you cannot have both old and new RTC drivers in your
> > (single) distro kernel. That's why dmwm2 created drivers/rtc/rtc-ppc.c: Fedora
> > had to support machines with both old and new RTC drivers. As all of the old
> > drivers are actually behind the ppc_md.[sg]et_rtc_time() abstraction, this was
> > very easy.
> 
>  ok, generic kernel. you will have to load the modules on initrd. no, sadly you
>  can't have both of them. you might stick with the old interface or
>  convert them all. 
> 
> > Hence it's all or nothing, and we have to convert all of them.
> > 
> > drivers/rtc/rtc-generic.c would allow to have a working system without old
> > RTC drivers, until all low-level code has been converted to individual RTC
> > drivers.
> 
>  I know but I have enough experience to foresee that once a generic over generic
>  framework is in place it's very hard to get rid of it because people
>  will have no incentives.

I know.

>  If you really need rtc-generic you can keep using it even if it's 
>  not in the kernel, distributions often have their specific
>  set of kernel patches.

rtc-generic is already in the kernel, it's just called rtc-parisc ;-)

>  But I'd strongly suggest to plan and execute a conversion process.

So would you accept a patch series that:
  1. Adds the missing module aliases to rtc-parisc (which is a bugfix),
  2. Moves the platform device creation out of rtc-ppc and into arch-specific
     code (which is also a bugfix),
  3. Consolidates rtc-parisc and rtc-ppc into rtc-generic (which is a cleanup),
  4. Makes rtc-generic dependent on PARISC, PPC, and M68K (the existing
     [sg]et_rtc_time() users):
       a. without introducing ARCH_HAS_GENERIC_RTC,
       b. with a big fat warning in the Kconfig comment not relaxing the
          dependencies, as it's supposed to go away.
  4. Converts the PS3 RTC support into a separate driver, called rtc-ps3
     (as a bonus ;-)

? If yes, I'll cook it up.

Other RTC platform support can be converted into separate drivers later.

Thanks!

With kind regards,

Geert Uytterhoeven
Software Architect

Sony Techsoft Centre Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium

Phone:    +32 (0)2 700 8453
Fax:      +32 (0)2 700 8622
E-mail:   Geert.Uytterhoeven@sonycom.com
Internet: http://www.sony-europe.com/

A division of Sony Europe (Belgium) N.V.
VAT BE 0413.825.160 · RPR Brussels
Fortis · BIC GEBABEBB · IBAN BE41293037680010

^ permalink raw reply

* Re: 2.6.29-rc6-git6 defconfig build failure
From: Michael Neuling @ 2009-03-03 11:50 UTC (permalink / raw)
  To: Sachin P. Sant; +Cc: linuxppc-dev
In-Reply-To: <49ACFD4E.8060506@in.ibm.com>

Sachin,

2450cf51a1bdba7037e91b1bcc494b01c58aaf66 fixes this.  Already upstream.

Mikey

In message <49ACFD4E.8060506@in.ibm.com> you wrote:
> 2.6.29-rc6-git6 ppc64_defconfig build fails with 
> 
> arch/powerpc/kernel/built-in.o: In function `.of_pci_phb_probe':
> of_platform.c:(.devinit.text+0xe0): undefined reference to `.pcibios_claim_on
e_bus'
> arch/powerpc/platforms/built-in.o: In function `.remove_phb_dynamic':
> (.text+0x120fc): undefined reference to `.pcibios_unmap_io_space'
> arch/powerpc/platforms/built-in.o: In function `.pcibios_add_pci_devices':
> (.text+0x12338): undefined reference to `.pcibios_finish_adding_to_bus'
> arch/powerpc/platforms/built-in.o: In function `.init_phb_dynamic':
> (.devinit.text+0x6ec): undefined reference to `.pcibios_finish_adding_to_bus'
> make: *** [.tmp_vmlinux1] Error 1
> 
> git5 did not have this problem as CONFIG_HOTPLUG was set with ppc64_defconfig
.
> With git6 defconfig there is no CONFIG_HOTPLUG
> 
> # grep CONFIG_HOTPLUG linux-2.6.29-rc6-git6/.config
> # 
> 
> # grep CONFIG_HOTPLUG linux-2.6.29-rc6-git5/.config
> CONFIG_HOTPLUG=y
> CONFIG_HOTPLUG_CPU=y
> CONFIG_HOTPLUG_PCI=m
> # CONFIG_HOTPLUG_PCI_FAKE is not set
> # CONFIG_HOTPLUG_PCI_CPCI is not set
> # CONFIG_HOTPLUG_PCI_SHPC is not set
> CONFIG_HOTPLUG_PCI_RPA=m
> CONFIG_HOTPLUG_PCI_RPA_DLPAR=m
> 
> Thanks
> -Sachin
> 
> -- 
> 
> ---------------------------------
> Sachin Sant
> IBM Linux Technology Center
> India Systems and Technology Labs
> Bangalore, India
> ---------------------------------
> 
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
> 

^ permalink raw reply

* Re: Can't load module spi_mpc83xx : No such device
From: Anton Vorontsov @ 2009-03-03 12:41 UTC (permalink / raw)
  To: Dushara Jayasinghe; +Cc: linuxppc-dev@ozlabs.org
In-Reply-To: <DE0CCFFBFF707949BEABD4537A14ACBA0C083C19F8@mailsvr>

On Tue, Mar 03, 2009 at 03:11:23PM +1100, Dushara Jayasinghe wrote:
> Hi All,
> 
> > Linus' tree is still lacking few patches for spi_mpc83xx driver, the
> > patches makes spi_mpc83xx work with the device tree directly.
> 
> I modified the spi_mpc83xx to work with the device tree using
> mpc52xx_psc_spi.c as a guide. 
> However, the device->dev->platform_data member is NULL (I thought
> the child node would provide that). 
> What am I missing?

As I said, you should use -mm tree
( http://www.kernel.org/patchtypes/mm.html ), particularly these
patches:

http://userweb.kernel.org/~akpm/mmotm/broken-out/spi_mpc83xx-rework-chip-selects-handling.patch
http://userweb.kernel.org/~akpm/mmotm/broken-out/spi_mpc83xx-add-of-platform-driver-bindings.patch

> I'm trying to create the SPI driver as a loadable module which
> will be used by the m25p80 chip driver (drivers/mtd/devices) which
> also will be a loadable module. Am I on the right track?

> > [...]
> > > Part of my device tree is as follows:
> > >
> > > 	soc8349@e0000000 {
> > > 		...
> > > 		spi@7000 {
> > > 			#address-cells = <1>;
> > > 			#size-cells = <0>;
> > > 			compatible = "fsl,spi";
> > > 			reg = <0x7000 0x1000>;
> > > 			interrupts = <0x10 0x8>;
> > > 			interrupt-parent = < &ipic >;
> > 
> > You don't seem to have any chip-selects (i.e. gpios = <>) specified.
> 
> Could you elaborate on this point please? I couldn't find any examples of
> gpios defined within SPI nodes.

Here is MMC SPI slot example for MPC8323E-RDB boards:

http://userweb.kernel.org/~akpm/mmotm/broken-out/powerpc-83xx-add-mmc-spi-support-via-the-device-tree-for-mpc8323e-rdb.patch

And documentation for the MMC SPI bindings:

http://userweb.kernel.org/~akpm/mmotm/broken-out/powerpc-add-mmc-spi-slot-bindings.patch

The OF MMC SPI bindings themselves are in the latest Linus' tree
already:

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=drivers/mmc/host/of_mmc_spi.c

For m25p80 chip you should do something similar.


Hope this helps,

-- 
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2

^ permalink raw reply

* U-Boot image
From: Günter Leonhardt @ 2009-03-03 13:11 UTC (permalink / raw)
  To: linuxppc-dev

Hello,
I'am looking for an image to boot a embedded device with a single image.

I though the generated uImage in arch/powerpc/boot should work, but =
u-boot cannot but this,
because the addresses of initrd and dtb not found.

Now I'am creating the image by hand with mkimage:
mkimage -A ppc -n F302 -O linux \
		-T multi -C gzip -a 0x0 -e 0x0 \
            -d vmlinux.bin.gz:initramfs_data.cpio.gz:f302.dtb \
            uImage

This file is bootable, but I don't understand how a standard file has to =
be booted.

I read in th u-boot documentation about a new fileformat which is build =
with the dtc.

Can someone explain me the different fileforamts for booting a powerpc =
with u-boot?
Which is the simplest to use?

Shold I reconfigure u-boot?

Thanks for help
G=FCnter

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox