From: David Gibson <hidden> Date: 2007-06-13 04:50:31
Hi Paul,
Here's my current queue of patches which I'm hoping will go in for
2.6.13. If they could go into an appropriate branch of powerpc.git in
the meantime that would be great.
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
From: David Gibson <hidden> Date: 2007-06-13 04:52:54
arch/powerpc still relies on asm-ppc/mmu.h for most 32-bit MMU types.
This patch is another step towards fixing this. It takes the portions
of asm-ppc/mmu.h related to the "classic" 32-bit hash page table MMU
which are still relevant in arch/powerpc and puts them in a new
asm-powerpc/mmu-hash32.h, included when appropriate from
asm-powerpc/mmu.h.
Signed-off-by: David Gibson <redacted>
---
include/asm-powerpc/mmu-hash32.h | 91 +++++++++++++++++++++++++++++++++++++++
include/asm-powerpc/mmu.h | 3 +
2 files changed, 94 insertions(+)
Index: working-2.6/include/asm-powerpc/mmu-hash32.h
===================================================================
From: David Gibson <hidden> Date: 2007-06-13 04:52:54
These old-fashioned IO mapping functions no longer have any callers in
code which remains relevant on arch/powerpc. Therefore, this patch
removes them from arch/powerpc.
Signed-off-by: David Gibson <redacted>
---
arch/powerpc/mm/pgtable_32.c | 118 ------------------------------------
include/asm-powerpc/io.h | 7 --
include/asm-powerpc/pgtable-ppc32.h | 2
3 files changed, 127 deletions(-)
Index: working-2.6/arch/powerpc/mm/pgtable_32.c
===================================================================
@@ -303,48 +303,6 @@ void __init mapin_ram(void)/* is x a power of 4? */#define is_power_of_4(x) is_power_of_2(x) && (ffs(x) & 1)-/*-*SetupamappingforablockofI/O.-*virt,phys,sizemustallbepage-aligned.-*Thisshouldonlybecalledbeforeioremapiscalled.-*/-void__initio_block_mapping(unsignedlongvirt,phys_addr_tphys,-unsignedintsize,intflags)-{-inti;--if(virt>KERNELBASE&&virt<ioremap_bot)-ioremap_bot=ioremap_base=virt;--#ifdef HAVE_BATS-/*-*UseaBATforthisifpossible...-*/-if(io_bat_index<2&&is_power_of_2(size)-&&(virt&(size-1))==0&&(phys&(size-1))==0){-setbat(io_bat_index,virt,phys,size,flags);-++io_bat_index;-return;-}-#endif /* HAVE_BATS */--#ifdef HAVE_TLBCAM-/*-*UseaCAMforthisifpossible...-*/-if(tlbcam_index<num_tlbcam_entries&&is_power_of_4(size)-&&(virt&(size-1))==0&&(phys&(size-1))==0){-settlbcam(tlbcam_index,virt,phys,size,flags,0);-++tlbcam_index;-return;-}-#endif /* HAVE_TLBCAM */--/* No BATs available, put it in the page tables. */-for(i=0;i<size;i+=PAGE_SIZE)-map_page(virt+i,phys+i,flags);-}-/* Scan the real Linux page tables and return a PTE pointer for*avirtualaddressinacontext.*Returnstrue(1)ifPTEwasfound,zerootherwise.Thepointerto
@@ -379,82 +337,6 @@ get_pteptr(struct mm_struct *mm, unsignereturn(retval);}-/* Find physical address for this virtual address. Normally used by-*I/Ofunctions,butanyonecancallit.-*/-unsignedlongiopa(unsignedlongaddr)-{-unsignedlongpa;--/* I don't know why this won't work on PMacs or CHRP. It-*appearsthereissomebug,orthereissomeimplicit-*mappingdonenotproperlyrepresentedbyBATsorinpage-*tables.......Iamactivelyworkingonresolvingthis,but-*can'tholdupotherstuff.--Dan-*/-pte_t*pte;-structmm_struct*mm;--/* Check the BATs */-pa=v_mapped_by_bats(addr);-if(pa)-returnpa;--/* Allow mapping of user addresses (within the thread)-*forDMAifnecessary.-*/-if(addr<TASK_SIZE)-mm=current->mm;-else-mm=&init_mm;--pa=0;-if(get_pteptr(mm,addr,&pte,NULL)){-pa=(pte_val(*pte)&PAGE_MASK)|(addr&~PAGE_MASK);-pte_unmap(pte);-}--return(pa);-}--/* This is will find the virtual address for a physical one....-*SwipedfromAPUS,couldbedangerous:-).-*ThisisonlyaplaceholderuntilIreallyfindawaytomakethis-*work.--Dan-*/-unsignedlong-mm_ptov(unsignedlongpaddr)-{-unsignedlongret;-#if 0-if(paddr<16*1024*1024)-ret=ZTWO_VADDR(paddr);-else{-inti;--for(i=0;i<kmap_chunk_count;){-unsignedlongphys=kmap_chunks[i++];-unsignedlongsize=kmap_chunks[i++];-unsignedlongvirt=kmap_chunks[i++];-if(paddr>=phys-&&paddr<(phys+size)){-ret=virt+paddr-phys;-gotoexit;-}-}--ret=(unsignedlong)__va(paddr);-}-exit:-#ifdef DEBUGPV-printk("PTOV(%lx)=%lx\n",paddr,ret);-#endif-#else-ret=(unsignedlong)paddr+KERNELBASE;-#endif-returnret;-}-#ifdef CONFIG_DEBUG_PAGEALLOCstaticint__change_page_attr(structpage*page,pgprot_tprot)
@@ -636,13 +636,6 @@ extern int __iounmap_explicit(volatile vexternvoid__iomem*reserve_phb_iospace(unsignedlongsize);-/* Those are more 32 bits only functions */-externunsignedlongiopa(unsignedlongaddr);-externunsignedlongmm_ptov(unsignedlongaddr)__attribute_const__;-externvoidio_block_mapping(unsignedlongvirt,phys_addr_tphys,-unsignedintsize,intflags);--/**WhenCONFIG_PPC_INDIRECT_IOisset,weusethegenericiomapimplementation*whichneedssomeadditionaldefinitionshere.TheybasicallyallowPIO
@@ -756,8 +756,6 @@ extern void paging_init(void);externvoidcache_clear(__u32addr,intlength);externvoidcache_push(__u32addr,intlength);externintmm_end_of_chunk(unsignedlongaddr,intlen);-externunsignedlongiopa(unsignedlongaddr);-externunsignedlongmm_ptov(unsignedlongaddr)__attribute_const__;/* Values for nocacheflag and cmode *//* These are not used by the APUS kernel_map, but prevents
From: David Gibson <hidden> Date: 2007-06-13 04:52:54
Currently, all OF-related code in the bootloader is contained in of.c.
of.c also provides the platform specific things necessary to boot on
an OF platform.
However, there are platforms (such as PReP) which can include an OF
implementation, but are not bootable as pure OF systems. For use by
such platforms, this patch splits out the low-level parts of the OF
code (call_prom() and various wrappers thereof) into a new oflib.c
file. In addition, the code related to bootwrapper console output via
OF are moved to a new ofconsole.c file. Both these files are included
in the wrapper.a library where they can be used by both full-OF and
partial OF platforms.
Signed-off-by: David Gibson <redacted>
---
arch/powerpc/boot/Makefile | 2
arch/powerpc/boot/of.c | 188 +-----------------------------------------
arch/powerpc/boot/of.h | 15 +++
arch/powerpc/boot/ofconsole.c | 45 ++++++++++
arch/powerpc/boot/oflib.c | 172 ++++++++++++++++++++++++++++++++++++++
5 files changed, 240 insertions(+), 182 deletions(-)
Index: working-2.6/arch/powerpc/boot/of.h
===================================================================
From: David Gibson <hidden> Date: 2007-06-13 04:52:54
APUS (the Amiga Power-Up System) is not supported under arch/powerpc
and it's unlikely it ever will be. Therefore, this patch removes the
fragments of APUS support code from arch/powerpc which have been
copied from arch/ppc.
A few APUS references are left in asm-powerpc in .h files which are
still used from arch/ppc.
Signed-off-by: David Gibson <redacted>
---
arch/powerpc/Kconfig | 4 -
arch/powerpc/kernel/head_32.S | 122 ---------------------------------
arch/powerpc/kernel/irq.c | 1
arch/powerpc/mm/44x_mmu.c | 1
arch/powerpc/mm/4xx_mmu.c | 1
arch/powerpc/mm/fsl_booke_mmu.c | 1
arch/powerpc/mm/init_32.c | 1
arch/powerpc/mm/init_64.c | 1
arch/powerpc/mm/mem.c | 1
arch/powerpc/mm/mmu_context_32.c | 1
arch/powerpc/mm/mmu_decl.h | 1
arch/powerpc/mm/pgtable_32.c | 1
arch/powerpc/mm/pgtable_64.c | 1
arch/powerpc/mm/ppc_mmu_32.c | 1
arch/powerpc/mm/tlb_32.c | 1
arch/powerpc/mm/tlb_64.c | 1
arch/powerpc/platforms/Kconfig | 7 -
arch/powerpc/platforms/apus/Kconfig | 130 ------------------------------------
include/asm-powerpc/pgtable-ppc32.h | 26 -------
19 files changed, 5 insertions(+), 298 deletions(-)
Index: working-2.6/include/asm-powerpc/pgtable-ppc32.h
===================================================================
@@ -751,32 +751,6 @@#define pte_to_pgoff(pte) (pte_val(pte) >> 3)#define pgoff_to_pte(off) ((pte_t) { ((off) << 3) | _PAGE_FILE })-/* CONFIG_APUS */-/* For virtual address to physical address conversion */-externvoidcache_clear(__u32addr,intlength);-externvoidcache_push(__u32addr,intlength);-externintmm_end_of_chunk(unsignedlongaddr,intlen);--/* Values for nocacheflag and cmode */-/* These are not used by the APUS kernel_map, but prevents-compilationerrors.*/-#define KERNELMAP_FULL_CACHING 0-#define KERNELMAP_NOCACHE_SER 1-#define KERNELMAP_NOCACHE_NONSER 2-#define KERNELMAP_NO_COPYBACK 3--/*-*Mapsomephysicaladdressrangeintothekerneladdressspace.-*/-externunsignedlongkernel_map(unsignedlongpaddr,unsignedlongsize,-intnocacheflag,unsignedlong*memavailp);--/*-*Setcachemodeof(kernelspace)addressrange.-*/-externvoidkernel_set_cachemode(unsignedlongaddress,unsignedlongsize,-unsignedintcmode);-/* Needs to be defined here and not in linux/mm.h, as it is arch dependent */#define kern_addr_valid(addr) (1)
@@ -1,130 +0,0 @@--config AMIGA- bool- depends on APUS- default y- help- This option enables support for the Amiga series of computers.--config ZORRO- bool- depends on APUS- default y- help- This enables support for the Zorro bus in the Amiga. If you have- expansion cards in your Amiga that conform to the Amiga- AutoConfig(tm) specification, say Y, otherwise N. Note that even- expansion cards that do not fit in the Zorro slots but fit in e.g.- the CPU slot may fall in this category, so you have to say Y to let- Linux use these.--config ABSTRACT_CONSOLE- bool- depends on APUS- default y--config APUS_FAST_EXCEPT- bool- depends on APUS- default y--config AMIGA_PCMCIA- bool "Amiga 1200/600 PCMCIA support"- depends on APUS && EXPERIMENTAL- help- Include support in the kernel for pcmcia on Amiga 1200 and Amiga- 600. If you intend to use pcmcia cards say Y; otherwise say N.--config AMIGA_BUILTIN_SERIAL- tristate "Amiga builtin serial support"- depends on APUS- help- If you want to use your Amiga's built-in serial port in Linux,- answer Y.-- To compile this driver as a module, choose M here.--config GVPIOEXT- tristate "GVP IO-Extender support"- depends on APUS- help- If you want to use a GVP IO-Extender serial card in Linux, say Y.- Otherwise, say N.--config GVPIOEXT_LP- tristate "GVP IO-Extender parallel printer support"- depends on GVPIOEXT- help- Say Y to enable driving a printer from the parallel port on your- GVP IO-Extender card, N otherwise.--config GVPIOEXT_PLIP- tristate "GVP IO-Extender PLIP support"- depends on GVPIOEXT- help- Say Y to enable doing IP over the parallel port on your GVP- IO-Extender card, N otherwise.--config MULTIFACE_III_TTY- tristate "Multiface Card III serial support"- depends on APUS- help- If you want to use a Multiface III card's serial port in Linux,- answer Y.-- To compile this driver as a module, choose M here.--config A2232- tristate "Commodore A2232 serial support (EXPERIMENTAL)"- depends on EXPERIMENTAL && APUS- ---help---- This option supports the 2232 7-port serial card shipped with the- Amiga 2000 and other Zorro-bus machines, dating from 1989. At- a max of 19,200 bps, the ports are served by a 6551 ACIA UART chip- each, plus a 8520 CIA, and a master 6502 CPU and buffer as well. The- ports were connected with 8 pin DIN connectors on the card bracket,- for which 8 pin to DB25 adapters were supplied. The card also had- jumpers internally to toggle various pinning configurations.-- This driver can be built as a module; but then "generic_serial"- will also be built as a module. This has to be loaded before- "ser_a2232". If you want to do this, answer M here.--config WHIPPET_SERIAL- tristate "Hisoft Whippet PCMCIA serial support"- depends on AMIGA_PCMCIA- help- HiSoft has a web page at <http://www.hisoft.co.uk/>, but there- is no listing for the Whippet in their Amiga section.--config APNE- tristate "PCMCIA NE2000 support"- depends on AMIGA_PCMCIA- help- If you have a PCMCIA NE2000 compatible adapter, say Y. Otherwise,- say N.-- To compile this driver as a module, choose M here: the- module will be called apne.--config SERIAL_CONSOLE- bool "Support for serial port console"- depends on APUS && (AMIGA_BUILTIN_SERIAL=y || GVPIOEXT=y || MULTIFACE_III_TTY=y)--config HEARTBEAT- bool "Use power LED as a heartbeat"- depends on APUS- help- Use the power-on LED on your machine as a load meter. The exact- behavior is platform-dependent, but normally the flash frequency is- a hyperbolic function of the 5-minute load average.--config PROC_HARDWARE- bool "/proc/hardware support"- depends on APUS--source "drivers/zorro/Kconfig"--config PCI_PERMEDIA- bool "PCI for Permedia2"- depends on !4xx && !8xx && APUS
From: David Gibson <hidden> Date: 2007-06-13 04:52:56
This patch factors some things defined in both pgtable-ppc32.h and
pgtable-ppc64.h into the common part of asm-powerpc/pgtable.h. These
are all things which have essentially identical definitions, and which
by their nature are very unlikely ever to need different definitions
in the two cases.
Signed-off-by: David Gibson <redacted>
---
include/asm-powerpc/pgtable-ppc32.h | 22 ----------------------
include/asm-powerpc/pgtable-ppc64.h | 29 -----------------------------
include/asm-powerpc/pgtable.h | 28 ++++++++++++++++++++++++++++
3 files changed, 28 insertions(+), 51 deletions(-)
Index: working-2.6/include/asm-powerpc/pgtable-ppc32.h
===================================================================
@@ -6,11 +6,7 @@#ifndef __ASSEMBLY__#include<linux/sched.h>#include<linux/threads.h>-#include<asm/processor.h>/* For TASK_SIZE */-#include<asm/mmu.h>-#include<asm/page.h>#include<asm/io.h>/* For sub-arch specific PPC_PIN_SIZE */-structmm_struct;externunsignedlongva_to_phys(unsignedlongaddress);externpte_t*va_to_pte(unsignedlongaddress);
@@ -751,12 +735,6 @@ extern void paging_init(void);#define pte_to_pgoff(pte) (pte_val(pte) >> 3)#define pgoff_to_pte(off) ((pte_t) { ((off) << 3) | _PAGE_FILE })-/* Needs to be defined here and not in linux/mm.h, as it is arch dependent */-#define kern_addr_valid(addr) (1)--#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \-remap_pfn_range(vma,vaddr,pfn,size,prot)-/**Nopagetablecachestoinitialise*/
From: David Gibson <hidden> Date: 2007-06-13 04:52:56
In arch/powerpc/mm/pgtable_32.c, the varialbe io_bat_index and the
macro is_power_of_4() no longer have any users. This patch removes
them.
Signed-off-by: David Gibson <redacted>
---
arch/powerpc/mm/pgtable_32.c | 4 ----
1 file changed, 4 deletions(-)
Index: working-2.6/arch/powerpc/mm/pgtable_32.c
===================================================================
@@ -299,9 +298,6 @@ void __init mapin_ram(void)}}-/* is x a power of 4? */-#define is_power_of_4(x) is_power_of_2(x) && (ffs(x) & 1)-/* Scan the real Linux page tables and return a PTE pointer for*avirtualaddressinacontext.*Returnstrue(1)ifPTEwasfound,zerootherwise.Thepointerto
From: David Gibson <hidden> Date: 2007-06-13 04:52:56
Using typedefs to rename structure types if frowned on by CodingStyle.
However, we do so for the hash PTE structure on both ppc32 (where it's
called "PTE") and ppc64 (where it's called "hpte_t"). On ppc32 we
also have such a typedef for the BATs ("BAT").
This patch removes this unhelpful use of typedefs, in the process
bringing ppc32 and ppc64 closer together, by using the name "struct
hash_pte" in both cases.
Signed-off-by: David Gibson <redacted>
---
arch/powerpc/mm/hash_native_64.c | 22 +++++++++++-----------
arch/powerpc/mm/hash_utils_64.c | 2 +-
arch/powerpc/mm/mmu_decl.h | 4 ++--
arch/powerpc/mm/ppc_mmu_32.c | 6 +++---
arch/powerpc/platforms/iseries/call_hpt.h | 9 +++++----
arch/powerpc/platforms/iseries/htab.c | 8 ++++----
arch/powerpc/platforms/ps3/htab.c | 14 +++++++-------
include/asm-powerpc/mmu-hash32.h | 8 ++++----
include/asm-powerpc/mmu-hash64.h | 6 +++---
9 files changed, 40 insertions(+), 39 deletions(-)
Index: working-2.6/include/asm-powerpc/mmu-hash32.h
===================================================================
@@ -34,12 +34,12 @@#include"mmu_decl.h"-PTE*Hash,*Hash_end;+structhash_pte*Hash,*Hash_end;unsignedlongHash_size,Hash_mask;unsignedlong_SDR1;unionubat{/* BAT register values to be loaded */-BATbat;+structppc_batbat;u32word[2];}BATS[8][2];/* 8 pairs of IBAT, DBAT */
@@ -244,7 +244,7 @@ void __init MMU_init_hw(void)cacheable_memzero(Hash,Hash_size);_SDR1=__pa(Hash)|SDR1_LOW_BITS;-Hash_end=(PTE*)((unsignedlong)Hash+Hash_size);+Hash_end=(structhash_pte*)((unsignedlong)Hash+Hash_size);printk("Total memory = %ldMB; using %ldkB for hash table (at %p)\n",total_memory>>20,Hash_size>>10,Hash);
@@ -44,7 +44,7 @@ long iSeries_hpte_insert(unsigned long hunsignedlongvflags,intpsize){longslot;-hpte_tlhpte;+structhash_ptelhpte;intsecondary=0;BUG_ON(psize!=MMU_PAGE_4K);
@@ -99,7 +99,7 @@ long iSeries_hpte_insert(unsigned long hstaticunsignedlongiSeries_hpte_getword0(unsignedlongslot){-hpte_thpte;+structhash_ptehpte;HvCallHpt_get(&hpte,slot);returnhpte.v;
@@ -144,7 +144,7 @@ static long iSeries_hpte_remove(unsignedstaticlongiSeries_hpte_updatepp(unsignedlongslot,unsignedlongnewpp,unsignedlongva,intpsize,intlocal){-hpte_thpte;+structhash_ptehpte;unsignedlongwant_v;iSeries_hlock(slot);
@@ -176,7 +176,7 @@ static long iSeries_hpte_updatepp(unsign*/staticlongiSeries_hpte_find(unsignedlongvpn){-hpte_thpte;+structhash_ptehpte;longslot;/*
From: David Gibson <hidden> Date: 2007-06-13 04:52:57
Currently the powerpc kernel has a 64-bit only feature,
COHERENT_ICACHE used for those CPUS which maintain icache/dcache
coherency in hardware (POWER5, essentially). It also has a feature,
SPLIT_ID_CACHE, which is used on CPUs which have separate i and
d-caches, which is to say everything except 601 and Freescale E200.
In nearly all the places we check the SPLIT_ID_CACHE, what we actually
care about is whether the i and d-caches are coherent (which they will
be, trivially, if they're the same cache).
This patch tries to clarify the situation a little. The
COHERENT_ICACHE feature becomes availble on 32-bit and is set for all
CPUs where i and d-cache are effectively coherent, whether this is due
to special logic (POWER5) or because they're unified. We check this,
instead of SPLIT_ID_CACHE nearly everywhere.
The SPLIT_ID_CACHE feature itself is replaced by a UNIFIED_ID_CACHE
feature with reversed sense, set only on 601 and Freescale E200. In
the two places (one Freescale BookE specific) where we really care
whether it's a unified cache, not whether they're coherent, we check
this feature. The CPUs with unified cache are so few, we could
consider replacing this feature bit with explicit checks against the
PVR.
This patch will make unifying the 32-bit and 64-bit cache flush code a
little more straightforward.
Signed-off-by: David Gibson <redacted>
---
arch/powerpc/kernel/misc_32.S | 10 ++--
arch/powerpc/kernel/setup_32.c | 12 ++---
arch/ppc/kernel/misc.S | 8 +--
arch/ppc/kernel/setup.c | 2
include/asm-powerpc/cputable.h | 95 ++++++++++++++++++++---------------------
5 files changed, 62 insertions(+), 65 deletions(-)
Index: working-2.6/include/asm-powerpc/cputable.h
===================================================================
@@ -111,7 +111,7 @@ extern void do_feature_fixups(unsigned l/* CPU kernel features *//* Retain the 32b definitions all use bottom half of word */-#define CPU_FTR_SPLIT_ID_CACHE ASM_CONST(0x0000000000000001)+#define CPU_FTR_COHERENT_ICACHE ASM_CONST(0x0000000000000001)#define CPU_FTR_L2CR ASM_CONST(0x0000000000000002)#define CPU_FTR_SPEC7450 ASM_CONST(0x0000000000000004)#define CPU_FTR_ALTIVEC ASM_CONST(0x0000000000000008)
From: David Gibson <hidden> Date: 2007-06-13 04:52:58
The ebony_exit() function which resets the Ebony board should in fact
be common to most if not all 44x boards. This patch moves the
function out into 44x.c, renaming it, so it can be used by other 44x
platforms.
Signed-off-by: David Gibson <redacted>
---
arch/powerpc/boot/44x.c | 16 ++++++++++++++++
arch/powerpc/boot/44x.h | 2 ++
arch/powerpc/boot/ebony.c | 18 +-----------------
3 files changed, 19 insertions(+), 17 deletions(-)
Index: working-2.6/arch/powerpc/boot/44x.c
===================================================================
From: David Gibson <hidden> Date: 2007-06-13 04:52:59
In the device tree for Ebony, the 'ranges' property in the node for
the EBC bridge shows the mappings from the chip select / address lines
actually used for the EBC peripherals into the address space of the
OPB. At present, these mappings are hardcoded in ebony.dts for the
mappings set up by the OpenBIOS firmware when it configures the EBC
bridge.
This patch replaces the hardcoded mappings with code in the zImage to
read the EBC configuration registers and create an appropriate ranges
property based on them. This should make the zImage and kernel more
robust to changes in firmware configuration. In particular, some of
the Ebony's DIP switches can change the effective address of the Flash
and other peripherals in OPB space. With this patch, the kernel will
be able to cope with at least some of the possible variations.
Signed-off-by: David Gibson <redacted>
---
arch/powerpc/boot/44x.c | 29 +++++++++++++++++++++++++++++
arch/powerpc/boot/44x.h | 1 +
arch/powerpc/boot/dcr.h | 37 +++++++++++++++++++++++++++++++++++++
arch/powerpc/boot/dts/ebony.dts | 8 +++-----
arch/powerpc/boot/ebony.c | 1 +
5 files changed, 71 insertions(+), 5 deletions(-)
Index: working-2.6/arch/powerpc/boot/dcr.h
===================================================================
@@ -135,11 +135,9 @@#address-cells=<2>;#size-cells=<1>;clock-frequency=<0>;// Filled in by zImage-ranges=<000000000fff00000100000-10000000048000000100000-200000000ff800000400000-30000000048200000100000-70000000048300000100000>;+// ranges property is supplied by zImage+// based on firmware's configuration of the+// EBC bridgeinterrupts=<54>;interrupt-parent=<&UIC1>;
@@ -54,3 +54,32 @@ void ibm44x_dbcr_reset(void));}++/* Read 4xx EBC bus bridge registers to get mappings of the peripheral+*banksintotheOPBaddressspace*/+voidibm4xx_fixup_ebc_ranges(constchar*ebc)+{+void*devp;+u32bxcr;+u32ranges[EBC_NUM_BANKS*4];+u32*p=ranges;+inti;++for(i=0;i<EBC_NUM_BANKS;i++){+mtdcr(DCRN_EBC0_CFGADDR,EBC_BXCR(i));+bxcr=mfdcr(DCRN_EBC0_CFGDATA);++if((bxcr&EBC_BXCR_BU)!=EBC_BXCR_BU_OFF){+*p++=i;+*p++=0;+*p++=bxcr&EBC_BXCR_BAS;+*p++=EBC_BXCR_BANK_SIZE(bxcr);+}+}++devp=finddevice(ebc);+if(!devp)+fatal("Couldn't locate EBC node %s\n\r",ebc);++setprop(devp,"ranges",ranges,(p-ranges)*sizeof(u32));+}
From: David Gibson <hidden> Date: 2007-06-13 04:53:00
Currently, the Holly device tree includes a bootargs property in
/chosen, which gives a commandline. This is somewhat inconvenient,
because it means an alternative default command line can't be given in
the kernel config - the value obtained from the dts via the
bootwrapper will always override CONFIG_CMDLINE.
This patch removes the command line from the dts, and instead puts the
same command line as a default in holly_defconfig.
Signed-off-by: David Gibson <redacted>
---
arch/powerpc/boot/dts/holly.dts | 1 -
arch/powerpc/configs/holly_defconfig | 3 ++-
2 files changed, 2 insertions(+), 2 deletions(-)
Index: working-2.6/arch/powerpc/boot/dts/holly.dts
===================================================================
@@ -182,7 +182,8 @@ CONFIG_SPLIT_PTLOCK_CPUS=4 # CONFIG_RESOURCES_64BIT is not set CONFIG_ZONE_DMA_FLAG=1 CONFIG_PROC_DEVICETREE=y-# CONFIG_CMDLINE_BOOL is not set+CONFIG_CMDLINE_BOOL=y+CONFIG_CMDLINE="console=ttyS0,115200" # CONFIG_PM is not set # CONFIG_SECCOMP is not set # CONFIG_WANT_DEVICE_TREE is not set
From: David Gibson <hidden> Date: 2007-06-13 04:53:00
The various cuboot platforms (i.e. pre-device tree aware u-boot for
83xx, 85xx and Ebony) share a certain amount of code for parsing the
boot parameters. To a certain extent that's inevitable, since they
platforms have different definitions of the bd_t structure. However,
with some macro work and a helper function, this patch improves the
situation a bit.
In the process, this fixes a bug on Ebony, which was incorrectly
handling the parameters passed form u-boot for the command line (the
bug was copied from 83xx and 85xx which have subsequently been fixed).
Signed-off-by: David Gibson <redacted>
---
arch/powerpc/boot/Makefile | 2 +-
arch/powerpc/boot/cuboot-83xx.c | 13 ++-----------
arch/powerpc/boot/cuboot-85xx.c | 13 ++-----------
arch/powerpc/boot/cuboot-ebony.c | 16 ++--------------
arch/powerpc/boot/cuboot.c | 35 +++++++++++++++++++++++++++++++++++
arch/powerpc/boot/cuboot.h | 14 ++++++++++++++
6 files changed, 56 insertions(+), 37 deletions(-)
Index: working-2.6/arch/powerpc/boot/cuboot.c
===================================================================
From: David Gibson <hidden> Date: 2007-06-13 04:53:00
This patch fixes some problems with the way the some things
represented in the device tree for the Holly and Taiga boards. This
means changes both to the dts files, and to the code which
instantiates the tsi108 ethernet platform devices based on the device
tree.
- First, and most importantly, the ethernet PHYs are given
with an identical 'reg' property. This reg currently encodes the
accessible register used to initiate mdio interaction with the PHYs,
rather than a meaningful address on the parent bus (mdio in this
case), which is incorrect. Instead we give the address of these
registers as 'reg' in the mdio node itself, and encode the ID of each
phy in their 'reg' propertyies.
- Currently the platform device constructor enables a
workaround in the tsi108 ethernet driver based on the compatible
property of the PHY. This is incorrect, because the workaround in
question is necessary due to the board's wiring of the PHY, not the
model of PHY itself. This patch alters the constructor to instead
enable the workaround based on a new special property in the PHY node.
- The compatible properties on a number of nodes in the device
tree are insufficiently precise. In particular the PHYs give only
"bcm54xx", which is broken, since there are many bcm54xx PHY models,
and they have differences which matter. The mdio had a compatible
property of "tsi-ethernet" identical to the ethernet MAC nodes, which
doesn't make sense. The ethernet, i2c, bridge and PCI nodes were
given only as "tsi-*" which is somewhat inprecise, we replace with
"tsi108-*" in the case of Taiga (which has a TSI108 bridge), and
"tsi109-*", "tsi108-*" in the case of Holly (which has a TSI109
bridge).
- We remove some "model" properties from the ethernets on
Taiga board which were neither useful nor adequately precise.
- On Holly we change to using a dtc label instead of a full
path to reference the MPIC node, which makes the dts a little more
readable.
Signed-off-by: David Gibson <redacted>
---
arch/powerpc/boot/dts/holly.dts | 51 ++++++++++++++++++----------------
arch/powerpc/boot/dts/mpc7448hpc2.dts | 33 ++++++++++------------
arch/powerpc/sysdev/tsi108_dev.c | 33 ++++++++++++++--------
3 files changed, 65 insertions(+), 52 deletions(-)
Index: working-2.6/arch/powerpc/boot/dts/holly.dts
===================================================================
@@ -72,12 +72,11 @@ static int __init tsi108_eth_of_init(voiintret;for(np=NULL,i=0;-(np=of_find_compatible_node(np,"network","tsi-ethernet"))!=NULL;+(np=of_find_compatible_node(np,"network","tsi108-ethernet"))!=NULL;i++){structresourcer[2];-structdevice_node*phy;+structdevice_node*phy,*mdio;hw_infotsi_eth_data;-constunsignedint*id;constunsignedint*phy_id;constvoid*mac_addr;constphandle*ph;
@@ -111,6 +110,13 @@ static int __init tsi108_eth_of_init(voiif(mac_addr)memcpy(tsi_eth_data.mac_addr,mac_addr,6);+ph=of_get_property(np,"mdio-handle",NULL);+mdio=of_find_node_by_phandle(*ph);+ret=of_address_to_resource(mdio,0,&res);+of_node_put(mdio);+if(ret)+gotounreg;+ph=of_get_property(np,"phy-handle",NULL);phy=of_find_node_by_phandle(*ph);
@@ -119,20 +125,25 @@ static int __init tsi108_eth_of_init(voigotounreg;}-id=of_get_property(phy,"reg",NULL);-phy_id=of_get_property(phy,"phy-id",NULL);-ret=of_address_to_resource(phy,0,&res);-if(ret){-of_node_put(phy);-gotounreg;-}+phy_id=of_get_property(phy,"reg",NULL);+tsi_eth_data.regs=r[0].start;tsi_eth_data.phyregs=res.start;tsi_eth_data.phy=*phy_id;tsi_eth_data.irq_num=irq_of_parse_and_map(np,0);-if(of_device_is_compatible(phy,"bcm54xx"))++/* Some boards with the TSI108 bridge (e.g. Holly)+*haveamiswiringoftheethernetPHYswhich+*requiresaworkaround.Thespecial+*"txc-rxc-delay-disable"propertyenablesthis+*workaround.FIXME:Needtoportthetsi108_eth+*driveritselftophylibanduseanon-misleading+*namefortheworkaroundflag-it'snotactuallyto+*dowiththemodelofPHYinuse*/+if(of_get_property(phy,"txc-rxc-delay-disable",NULL))tsi_eth_data.phy_type=TSI108_PHY_BCM54XX;of_node_put(phy);+ret=platform_device_add_data(tsi_eth_dev,&tsi_eth_data,sizeof(hw_info));
Here's my current queue of patches which I'm hoping will go in for
2.6.13. If they could go into an appropriate branch of powerpc.git in
the meantime that would be great.
From: David Gibson <hidden> Date: 2007-06-13 06:09:59
On Wed, Jun 13, 2007 at 02:50:31PM +1000, David Gibson wrote:
Hi Paul,
Here's my current queue of patches which I'm hoping will go in for
2.6.13. If they could go into an appropriate branch of powerpc.git in
the meantime that would be great.
Blah. That should be 2.6.23, of course.
<looks sheepish>
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
+#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \
+ remap_pfn_range(vma, vaddr, pfn, size, prot)
Patch is mangled... This is from the raw source I
received, it isn't my mail reader this time ;-)
Segher
This patch replaces the hardcoded mappings with code in the zImage to
read the EBC configuration registers and create an appropriate ranges
property based on them.
Perhaps you should only do this if the device tree passed
to the bootwrapper doesn't already have a "ranges" property?
Segher
The ethernet, i2c, bridge and PCI nodes were
given only as "tsi-*" which is somewhat inprecise, we replace with
"tsi108-*" in the case of Taiga (which has a TSI108 bridge), and
"tsi109-*", "tsi108-*" in the case of Holly (which has a TSI109
bridge).
To be sure -- are all those ts109 devices actually
compatible to their ancestors on tsi108?
Since I _have_ to complain about _something_ -- don't
you run a spellchecker on your commit messages? :-)
Perfect patch as far as I can see, thank you David!
From: Kumar Gala <hidden> Date: 2007-06-14 21:04:08
On Jun 12, 2007, at 11:52 PM, David Gibson wrote:
quoted hunk
In arch/powerpc/mm/pgtable_32.c, the varialbe io_bat_index and the
macro is_power_of_4() no longer have any users. This patch removes
them.
Signed-off-by: David Gibson <redacted>
---
arch/powerpc/mm/pgtable_32.c | 4 ----
1 file changed, 4 deletions(-)
Index: working-2.6/arch/powerpc/mm/pgtable_32.c
===================================================================
From: Benjamin Herrenschmidt <benh@kernel.crashing.org> Date: 2007-06-16 00:55:58
On Wed, 2007-06-13 at 14:52 +1000, David Gibson wrote:
These old-fashioned IO mapping functions no longer have any callers in
code which remains relevant on arch/powerpc. Therefore, this patch
removes them from arch/powerpc.
I think we still want a way to setup some hand crafted BATs... maybe a
special flag to pass to ioremap_flags ?
It makes sense to map some heavily accessed on chip register space with
a BAT on embedded. The reason I didn't like io_block_mapping() was
because the virtual address was hard coded. But I don't think we should
throw the baby with the bath water. If we can have it allocate the virt
address using the ioremap_bot trick, that would be a good thing to keep
around.
Ben.