* [patch 3/5] powerpc: Add SAO Feature bit to the cputable
From: Dave Kleikamp @ 2008-07-07 14:28 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev list
In-Reply-To: <20080707142850.034542257@linux.vnet.ibm.com>
Signed-off-by: Joel Schopp <jschopp@austin.ibm.com>
Signed-off-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
---
include/asm-powerpc/cputable.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Index: b/include/asm-powerpc/cputable.h
===================================================================
--- a/include/asm-powerpc/cputable.h
+++ b/include/asm-powerpc/cputable.h
@@ -185,6 +185,7 @@
#define CPU_FTR_1T_SEGMENT LONG_ASM_CONST(0x0004000000000000)
#define CPU_FTR_NO_SLBIE_B LONG_ASM_CONST(0x0008000000000000)
#define CPU_FTR_VSX LONG_ASM_CONST(0x0010000000000000)
+#define CPU_FTR_SAO LONG_ASM_CONST(0x0020000000000000)
#ifndef __ASSEMBLY__
@@ -400,7 +401,7 @@
CPU_FTR_MMCRA | CPU_FTR_SMT | \
CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | \
CPU_FTR_PURR | CPU_FTR_SPURR | CPU_FTR_REAL_LE | \
- CPU_FTR_DSCR)
+ CPU_FTR_DSCR | CPU_FTR_SAO)
#define CPU_FTRS_CELL (CPU_FTR_USE_TB | \
CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \
CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \
--
Dave Kleikamp
IBM Linux Technology Center
^ permalink raw reply
* [patch 4/5] powerpc: Add Strong Access Ordering
From: Dave Kleikamp @ 2008-07-07 14:28 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev list
In-Reply-To: <20080707142850.034542257@linux.vnet.ibm.com>
Allow an application to enable Strong Access Ordering on specific pages of
memory on Power 7 hardware. Currently, power has a weaker memory model than
x86. Implementing a stronger memory model allows an emulator to more
efficiently translate x86 code into power code, resulting in faster code
execution.
On Power 7 hardware, storing 0b1110 in the WIMG bits of the hpte enables
strong access ordering mode for the memory page. This patchset allows a
user to specify which pages are thus enabled by passing a new protection
bit through mmap() and mprotect(). I have tentatively defined this bit,
PROT_SAO, as 0x10.
Signed-off-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
---
arch/powerpc/kernel/syscalls.c | 3 +++
include/asm-powerpc/mman.h | 30 ++++++++++++++++++++++++++++++
2 files changed, 33 insertions(+)
Index: b/arch/powerpc/kernel/syscalls.c
===================================================================
--- a/arch/powerpc/kernel/syscalls.c
+++ b/arch/powerpc/kernel/syscalls.c
@@ -143,6 +143,9 @@
struct file * file = NULL;
unsigned long ret = -EINVAL;
+ if (!arch_validate_prot(prot))
+ goto out;
+
if (shift) {
if (off & ((1 << shift) - 1))
goto out;
Index: b/include/asm-powerpc/mman.h
===================================================================
--- a/include/asm-powerpc/mman.h
+++ b/include/asm-powerpc/mman.h
@@ -1,7 +1,9 @@
#ifndef _ASM_POWERPC_MMAN_H
#define _ASM_POWERPC_MMAN_H
+#include <asm/cputable.h>
#include <asm-generic/mman.h>
+#include <linux/mm.h>
/*
* This program is free software; you can redistribute it and/or
@@ -26,4 +28,32 @@
#define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */
#define MAP_NONBLOCK 0x10000 /* do not block on IO */
+#ifdef CONFIG_PPC64
+/*
+ * This file is included by linux/mman.h, so we can't use cacl_vm_prot_bits()
+ * here. How important is the optimization?
+ */
+static inline unsigned long arch_calc_vm_prot_bits(unsigned long prot)
+{
+ return (prot & PROT_SAO) ? VM_SAO : 0;
+}
+#define arch_calc_vm_prot_bits(prot) arch_calc_vm_prot_bits(prot)
+
+static inline pgprot_t arch_vm_get_page_prot(unsigned long vm_flags)
+{
+ return (vm_flags & VM_SAO) ? __pgprot(_PAGE_SAO) : 0;
+}
+#define arch_vm_get_page_prot(vm_flags) arch_vm_get_page_prot(vm_flags)
+
+static inline int arch_validate_prot(unsigned long prot)
+{
+ if (prot & ~(PROT_READ | PROT_WRITE | PROT_EXEC | PROT_SEM | PROT_SAO))
+ return 0;
+ if ((prot & PROT_SAO) && !cpu_has_feature(CPU_FTR_SAO))
+ return 0;
+ return 1;
+}
+#define arch_validate_prot(prot) arch_validate_prot(prot)
+
+#endif /* CONFIG_PPC64 */
#endif /* _ASM_POWERPC_MMAN_H */
--
Dave Kleikamp
IBM Linux Technology Center
^ permalink raw reply
* [patch 5/5] powerpc: Dont clear _PAGE_COHERENT when _PAGE_SAO is set
From: Dave Kleikamp @ 2008-07-07 14:28 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev list
In-Reply-To: <20080707142850.034542257@linux.vnet.ibm.com>
Signed-off-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
arch/powerpc/platforms/pseries/lpar.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Index: b/arch/powerpc/platforms/pseries/lpar.c
===================================================================
--- a/arch/powerpc/platforms/pseries/lpar.c
+++ b/arch/powerpc/platforms/pseries/lpar.c
@@ -305,7 +305,8 @@
flags = 0;
/* Make pHyp happy */
- if (rflags & (_PAGE_GUARDED|_PAGE_NO_CACHE))
+ if ((rflags & _PAGE_GUARDED) ||
+ ((rflags & _PAGE_NO_CACHE) & !(rflags & _PAGE_WRITETHRU)))
hpte_r &= ~_PAGE_COHERENT;
lpar_rc = plpar_pte_enter(flags, hpte_group, hpte_v, hpte_r, &slot);
--
Dave Kleikamp
IBM Linux Technology Center
^ permalink raw reply
* Re: [RFC/PATCH] powerpc/bootwrapper: Allow user to specify additional default targets
From: Grant Likely @ 2008-07-07 14:29 UTC (permalink / raw)
To: Josh Boyer; +Cc: linuxppc-dev
In-Reply-To: <20080707100704.26f1630c@zod.rchland.ibm.com>
On Mon, Jul 7, 2008 at 8:07 AM, Josh Boyer <jwboyer@linux.vnet.ibm.com> wrote:
> On Mon, 7 Jul 2008 07:34:23 -0600 Grant Likely wrote:
>> Specifically the case I'm thinking of is when a user of a Xilinx FPGA
>> drops a new .dts file into arch/powerpc/boot/dts (say
>> 'super-sexy-platform.dts'). However, instead of modifying the
>> Makefile or always typing 'make simpleImage.super-sexy-platform', then
>> can add 'simpleImage.super-sexy-platform' to their defconfig which I
>> can see being easier for someone to get their head around.
>
> Yeah, I thought about the Virtex case with the differing bitstreams
> after I sent out my original question. For purposes like that, this
> seems like a great fit. For truly discrete boards, I prefer discrete
> defconfigs.
>
> So overall I see value in the patch. If nobody else has objections,
> then it's fine with me.
so.... can I have an ack? :-)
g.
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
^ permalink raw reply
* Re: Please pull linux-2.6-virtex.git
From: Grant Likely @ 2008-07-07 14:31 UTC (permalink / raw)
To: John Linn; +Cc: linuxppc-dev
In-Reply-To: <20080707142652.43C32110807E@mail204-va3.bigfish.com>
On Mon, Jul 7, 2008 at 8:26 AM, John Linn <John.Linn@xilinx.com> wrote:
> Where should I be looking to understand what's needed for dts-v1 format?
>
> I did a quick review of Doc*/powerpc/booting-wihtout-of.txt and didn't
> see it, but maybe I overlooked it.
Primarily all hex values need to be change to the form '0x???' instead
of '???' and '/dtc-v1' needs to be added to the beginning of the file.
g.
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
^ permalink raw reply
* Re: [PATCH 15/16 v3] ibmvscsi: driver enablement for CMO
From: Brian King @ 2008-07-07 14:34 UTC (permalink / raw)
To: Robert Jennings; +Cc: linux-scsi, linuxppc-dev, David Darrington, paulus
In-Reply-To: <20080704125631.GR1310@linux.vnet.ibm.com>
Robert Jennings wrote:
> @@ -1613,6 +1624,26 @@ static struct scsi_host_template driver_
> };
>
> /**
> + * ibmvscsi_get_desired_dma - Calculate IO entitlement needed by the driver
> + *
> + * @vdev: struct vio_dev for the device whose entitlement is to be returned
> + *
> + * Return value:
> + * Number of bytes of IO data the driver will need to perform well.
> + */
> +static unsigned long ibmvscsi_get_desired_dma(struct vio_dev *vdev)
> +{
> + /* iu_storage data allocated in initialize_event_pool */
> + unsigned long io_entitlement = max_requests * sizeof(union viosrp_iu);
Since you are removing the use of "entitlement" in the function description,
you should probably remove it everywhere in this patch.
> +
> + /* add io space for sg data */
> + io_entitlement += (IBMVSCSI_MAX_SECTORS_DEFAULT *
> + IBMVSCSI_CMDS_PER_LUN_DEFAULT);
> +
> + return IOMMU_PAGE_ALIGN(io_entitlement);
I really think this function should just return the number of bytes and
let the caller round it up to any boundary requirements it might have.
-Brian
--
Brian King
Linux on Power Virtualization
IBM Linux Technology Center
^ permalink raw reply
* Re: linux-next: scsi tree build failure
From: James Bottomley @ 2008-07-07 14:39 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: linux-scsi, linuxppc-dev, linux-next, Paul Mackerras
In-Reply-To: <20080707222528.280f0b9e.sfr@canb.auug.org.au>
Correct cc's added
On Mon, 2008-07-07 at 22:25 +1000, Stephen Rothwell wrote:
> Hi James,
>
> Today's linux-next build (powerpc ppc64_defconfig) failed like this:
>
> drivers/scsi/ibmvscsi/ibmvscsi.c: In function 'map_sg_data':
> drivers/scsi/ibmvscsi/ibmvscsi.c:431: error: 'FW_FEATURE_CMO' undeclared (first use in this function)
> drivers/scsi/ibmvscsi/ibmvscsi.c:431: error: (Each undeclared identifier is reported only once
> drivers/scsi/ibmvscsi/ibmvscsi.c:431: error: for each function it appears in.)
> drivers/scsi/ibmvscsi/ibmvscsi.c: In function 'ibmvscsi_queuecommand':
> drivers/scsi/ibmvscsi/ibmvscsi.c:750: error: 'FW_FEATURE_CMO' undeclared (first use in this function)
> drivers/scsi/ibmvscsi/ibmvscsi.c: In function 'send_mad_adapter_info':
> drivers/scsi/ibmvscsi/ibmvscsi.c:864: error: 'FW_FEATURE_CMO' undeclared (first use in this function)
> drivers/scsi/ibmvscsi/ibmvscsi.c: In function 'ibmvscsi_do_host_config':
> drivers/scsi/ibmvscsi/ibmvscsi.c:1412: error: 'FW_FEATURE_CMO' undeclared (first use in this function)
> drivers/scsi/ibmvscsi/ibmvscsi.c: At top level:
> drivers/scsi/ibmvscsi/ibmvscsi.c:1769: error: unknown field 'get_io_entitlement' specified in initializer
> drivers/scsi/ibmvscsi/ibmvscsi.c:1769: warning: missing braces around initializer
> drivers/scsi/ibmvscsi/ibmvscsi.c:1769: warning: (near initialization for 'ibmvscsi_driver.driver')
> drivers/scsi/ibmvscsi/ibmvscsi.c:1769: warning: initialization from incompatible pointer type
>
> Caused because commit 341b56db6804040aa9559e913865108424e3b18b ("[SCSI]
> ibmvscsi: driver enablement for CMO"), which was 15/16 in a series, has
> been merged before any of the other patches in the series. I have
> reverted that commit.
Do I detect the fact that IBM sent a patch for a SCSI driver for which
the core features weren't yet enabled (and which I couldn't check, not
having a ppc build system)?
James
^ permalink raw reply
* Re: Deputy maintainer for powerpc
From: Kumar Gala @ 2008-07-07 14:44 UTC (permalink / raw)
To: Benjamin Herrenschmidt
Cc: linuxppc-dev list, Andrew Morton, Linus Torvalds, Paul Mackerras,
lkml List
In-Reply-To: <18541.48403.490671.815858@cargo.ozlabs.ibm.com>
On Jul 4, 2008, at 1:02 AM, Paul Mackerras wrote:
> I'm going to be on vacation for the next two weeks, and it looks
> highly likely that Linus will open the 2.6.27 merge window during that
> time, so I'm appointing Ben Herrenschmidt as my deputy maintainer.
> During the next two weeks, he'll be the person collecting together any
> further powerpc-related commits that need to go upstream, and sending
> pull requests to Linus as necessary.
>
> This is the start of a longer-term transition which will ultimately
> result in me handing over the powerpc architecture maintainership to
> Ben. Because of various work commitments, this will be a gradual
> transition taking probably around 6 months.
>
> Paul.
Ben, Do you have a tree that you'll be using to collect things in?
- k
^ permalink raw reply
* Re: MPC52xx generic DMA using bestcomm
From: Jon Smirl @ 2008-07-07 14:50 UTC (permalink / raw)
To: Matt Sealey; +Cc: Andre Schwarz, linux-ppc list
In-Reply-To: <487225C4.90405@genesi-usa.com>
On 7/7/08, Matt Sealey <matt@genesi-usa.com> wrote:
>
> Jon Smirl wrote:
>
> > On 7/7/08, Matt Sealey <matt@genesi-usa.com> wrote:
> >
> > >
> > >
> > to do that the samples have to be alternated as they are fed into the
> > AC97 stream. I think the codec can capture that way too but you
> > didn't put a transceiver on the S/PDIF line.
> >
>
> OT, but the IDT STAC9766 doesn't support S/PDIF input, only output.
>
>
> > In my test driver you only get AC97 or S/PDIF. Grant and I are both
> > working on i2s drivers, when we get those sorted out it shouldn't be
> > too hard to add ac97 back in. That codec driver I sent you was about
> > 95% complete.
> >
>
> Indeed and to be honest I only gave it a short glance before having to
> do about a thousand other things, but I will take another peek some
> time this week :)
You should junk my PSC and DMA code and switch to the code Grant
recently posted. Codec should work as is. My PSC code is for a six
month old version of ASOC v2.
Grant's PSC driver needs to be split into a DMA library and i2s
driver. Then make an AC97 version based on his i2s driver that uses
the DMA library. Not hard once he splits the i2s driver.
We are getting closer to having full featured audio drivers for the
mpc5200 platform.
>
> --
> Matt Sealey <matt@genesi-usa.com>
> Genesi, Manager, Developer Relations
>
--
Jon Smirl
jonsmirl@gmail.com
^ permalink raw reply
* Re: linux-next: scsi tree build failure
From: Robert Jennings @ 2008-07-07 14:53 UTC (permalink / raw)
To: James Bottomley
Cc: Stephen Rothwell, linux-scsi, linuxppc-dev, linux-next,
Paul Mackerras
In-Reply-To: <1215441589.3274.17.camel@localhost.localdomain>
* James Bottomley (James.Bottomley@HansenPartnership.com) wrote:
> Correct cc's added
>
> On Mon, 2008-07-07 at 22:25 +1000, Stephen Rothwell wrote:
> > Hi James,
> >
> > Today's linux-next build (powerpc ppc64_defconfig) failed like this:
> >
> > drivers/scsi/ibmvscsi/ibmvscsi.c: In function 'map_sg_data':
> > drivers/scsi/ibmvscsi/ibmvscsi.c:431: error: 'FW_FEATURE_CMO' undeclared (first use in this function)
> > drivers/scsi/ibmvscsi/ibmvscsi.c:431: error: (Each undeclared identifier is reported only once
> > drivers/scsi/ibmvscsi/ibmvscsi.c:431: error: for each function it appears in.)
> > drivers/scsi/ibmvscsi/ibmvscsi.c: In function 'ibmvscsi_queuecommand':
> > drivers/scsi/ibmvscsi/ibmvscsi.c:750: error: 'FW_FEATURE_CMO' undeclared (first use in this function)
> > drivers/scsi/ibmvscsi/ibmvscsi.c: In function 'send_mad_adapter_info':
> > drivers/scsi/ibmvscsi/ibmvscsi.c:864: error: 'FW_FEATURE_CMO' undeclared (first use in this function)
> > drivers/scsi/ibmvscsi/ibmvscsi.c: In function 'ibmvscsi_do_host_config':
> > drivers/scsi/ibmvscsi/ibmvscsi.c:1412: error: 'FW_FEATURE_CMO' undeclared (first use in this function)
> > drivers/scsi/ibmvscsi/ibmvscsi.c: At top level:
> > drivers/scsi/ibmvscsi/ibmvscsi.c:1769: error: unknown field 'get_io_entitlement' specified in initializer
> > drivers/scsi/ibmvscsi/ibmvscsi.c:1769: warning: missing braces around initializer
> > drivers/scsi/ibmvscsi/ibmvscsi.c:1769: warning: (near initialization for 'ibmvscsi_driver.driver')
> > drivers/scsi/ibmvscsi/ibmvscsi.c:1769: warning: initialization from incompatible pointer type
> >
> > Caused because commit 341b56db6804040aa9559e913865108424e3b18b ("[SCSI]
> > ibmvscsi: driver enablement for CMO"), which was 15/16 in a series, has
> > been merged before any of the other patches in the series. I have
> > reverted that commit.
>
> Do I detect the fact that IBM sent a patch for a SCSI driver for which
> the core features weren't yet enabled (and which I couldn't check, not
> having a ppc build system)?
>
> James
I didn't not properly note in the patch description my intent to have
this merged in the linuxppc-dev tree. The patch is part of a larger set
enabling the feature. Linux-scsi was CC'ed for this driver for review.
Robert Jennings
^ permalink raw reply
* Re: [Cbe-oss-dev] [patch 05/11] powerpc/cell: add spu aware cpufreq governor
From: Arnd Bergmann @ 2008-07-07 14:59 UTC (permalink / raw)
To: cbe-oss-dev; +Cc: Stephen Rothwell, linuxppc-dev
In-Reply-To: <20080707162457.e5f3cb9d.sfr@canb.auug.org.au>
T24gTW9uZGF5IDA3IEp1bHkgMjAwOCwgU3RlcGhlbiBSb3Rod2VsbCB3cm90ZToKPiA+ICsjZGVm
aW5lIFBPTExfVElNRcKgwqDCoMKgMTAwMDAwwqDCoMKgwqDCoMKgwqDCoMKgwqAvKiBpbiB1cyAq
Lwo+IMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKg
IMKgIMKgIMKgIMKgIMKgIF4KPiBIb3cgYWJvdXQgzrwgPwoKTm90IHN1cmUsIGhvdyBhYm91dCDC
tSBpbnN0ZWFkPyA7LSkKCglBcm5kIDw+PAo=
^ permalink raw reply
* powerpc/cell/cpufreq: add spu aware cpufreq governor
From: Arnd Bergmann @ 2008-07-07 15:02 UTC (permalink / raw)
To: Dave Jones
Cc: Stephen Rothwell, cpufreq, linuxppc-dev, Jeremy Kerr, cbe-oss-dev
=46rom: Christian Krafft <krafft@de.ibm.com>
This patch adds a cpufreq governor that takes the number of running spus
into account. It's very similar to the ondemand governor, but not as comple=
x.
Instead of hacking spu load into the ondemand governor it might be easier to
have cpufreq accepting multiple governors per cpu in future.
Don't know if this is the right way, but it would keep the governors simple.
Signed-off-by: Christian Krafft <krafft@de.ibm.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
=2D--
Dave or other cpufreq people, can you take a look at this
and add an Acked-by when you're happy?
We have one prerequisite patch in the powerpc code (in spufs),
so should it get merged through powerpc.git?
arch/powerpc/platforms/cell/Kconfig | 10 ++
arch/powerpc/platforms/cell/Makefile | 1 +
arch/powerpc/platforms/cell/cbe_spu_governor.c | 183 ++++++++++++++++++++=
++++
3 files changed, 194 insertions(+), 0 deletions(-)
create mode 100644 arch/powerpc/platforms/cell/cbe_spu_governor.c
Index: linux-2.6/arch/powerpc/platforms/cell/Kconfig
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
=2D-- linux-2.6.orig/arch/powerpc/platforms/cell/Kconfig
+++ linux-2.6/arch/powerpc/platforms/cell/Kconfig
@@ -107,6 +107,16 @@ config CBE_CPUFREQ_PMI
processor will not only be able to run at lower speed,
but also at lower core voltage.
=20
+config CBE_CPUFREQ_SPU_GOVERNOR
+ tristate "CBE frequency scaling based on SPU usage"
+ depends on SPU_FS
+ select CBE_CPUFREQ
+ default m
+ help
+ This governor checks for spu usage to adjust the cpu frequency.
+ If no spu is running on a given cpu, that cpu will be throttled to
+ the minimal possible frequency.
+
endmenu
=20
config OPROFILE_CELL
Index: linux-2.6/arch/powerpc/platforms/cell/Makefile
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
=2D-- linux-2.6.orig/arch/powerpc/platforms/cell/Makefile
+++ linux-2.6/arch/powerpc/platforms/cell/Makefile
@@ -8,6 +8,7 @@ obj-$(CONFIG_CBE_THERM) +=3D cbe_thermal
obj-$(CONFIG_CBE_CPUFREQ_PMI) +=3D cbe_cpufreq_pmi.o
obj-$(CONFIG_CBE_CPUFREQ) +=3D cbe-cpufreq.o
cbe-cpufreq-y +=3D cbe_cpufreq_pervasive.o cbe_cpufreq.o
+obj-$(CONFIG_CBE_CPUFREQ_SPU_GOVERNOR) +=3D cbe_spu_governor.o
=20
ifeq ($(CONFIG_SMP),y)
obj-$(CONFIG_PPC_CELL_NATIVE) +=3D smp.o
Index: linux-2.6/arch/powerpc/platforms/cell/cbe_spu_governor.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
=2D-- /dev/null
+++ linux-2.6/arch/powerpc/platforms/cell/cbe_spu_governor.c
@@ -0,0 +1,184 @@
+/*
+ * spu aware cpufreq governor for the cell processor
+ *
+ * =C2=A9 Copyright IBM Corporation 2006-2008
+ *
+ * Author: Christian Krafft <krafft@de.ibm.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <linux/cpufreq.h>
+#include <linux/sched.h>
+#include <linux/timer.h>
+#include <linux/workqueue.h>
+#include <asm/atomic.h>
+#include <asm/machdep.h>
+#include <asm/spu.h>
+
+#define POLL_TIME 100000 /* in =C2=B5s */
+#define EXP 753 /* exp(-1) in fixed-point */
+
+struct spu_gov_info_struct {
+ unsigned long busy_spus; /* fixed-point */
+ struct cpufreq_policy *policy;
+ struct delayed_work work;
+ unsigned int poll_int; /* =C2=B5s */
+};
+static DEFINE_PER_CPU(struct spu_gov_info_struct, spu_gov_info);
+
+static struct workqueue_struct *kspugov_wq;
+
+static int calc_freq(struct spu_gov_info_struct *info)
+{
+ int cpu;
+ int busy_spus;
+
+ cpu =3D info->policy->cpu;
+ busy_spus =3D atomic_read(&cbe_spu_info[cpu_to_node(cpu)].busy_spus);
+
+ CALC_LOAD(info->busy_spus, EXP, busy_spus * FIXED_1);
+ pr_debug("cpu %d: busy_spus=3D%d, info->busy_spus=3D%ld\n",
+ cpu, busy_spus, info->busy_spus);
+
+ return info->policy->max * info->busy_spus / FIXED_1;
+}
+
+static void spu_gov_work(struct work_struct *work)
+{
+ struct spu_gov_info_struct *info;
+ int delay;
+ unsigned long target_freq;
+
+ info =3D container_of(work, struct spu_gov_info_struct, work.work);
+
+ /* after cancel_delayed_work_sync we unset info->policy */
+ BUG_ON(info->policy =3D=3D NULL);
+
+ target_freq =3D calc_freq(info);
+ __cpufreq_driver_target(info->policy, target_freq, CPUFREQ_RELATION_H);
+
+ delay =3D usecs_to_jiffies(info->poll_int);
+ queue_delayed_work_on(info->policy->cpu, kspugov_wq, &info->work, delay);
+}
+
+static void spu_gov_init_work(struct spu_gov_info_struct *info)
+{
+ int delay =3D usecs_to_jiffies(info->poll_int);
+ INIT_DELAYED_WORK_DEFERRABLE(&info->work, spu_gov_work);
+ queue_delayed_work_on(info->policy->cpu, kspugov_wq, &info->work, delay);
+}
+
+static void spu_gov_cancel_work(struct spu_gov_info_struct *info)
+{
+ cancel_delayed_work_sync(&info->work);
+}
+
+static int spu_gov_govern(struct cpufreq_policy *policy, unsigned int even=
t)
+{
+ unsigned int cpu =3D policy->cpu;
+ struct spu_gov_info_struct *info, *affected_info;
+ int i;
+ int ret =3D 0;
+
+ info =3D &per_cpu(spu_gov_info, cpu);
+
+ switch (event) {
+ case CPUFREQ_GOV_START:
+ if (!cpu_online(cpu)) {
+ printk(KERN_ERR "cpu %d is not online\n", cpu);
+ ret =3D -EINVAL;
+ break;
+ }
+
+ if (!policy->cur) {
+ printk(KERN_ERR "no cpu specified in policy\n");
+ ret =3D -EINVAL;
+ break;
+ }
+
+ /* initialize spu_gov_info for all affected cpus */
+ for_each_cpu_mask(i, policy->cpus) {
+ affected_info =3D &per_cpu(spu_gov_info, i);
+ affected_info->policy =3D policy;
+ }
+
+ info->poll_int =3D POLL_TIME;
+
+ /* setup timer */
+ spu_gov_init_work(info);
+
+ break;
+
+ case CPUFREQ_GOV_STOP:
+ /* cancel timer */
+ spu_gov_cancel_work(info);
+
+ /* clean spu_gov_info for all affected cpus */
+ for_each_cpu_mask (i, policy->cpus) {
+ info =3D &per_cpu(spu_gov_info, i);
+ info->policy =3D NULL;
+ }
+
+ break;
+ }
+
+ return ret;
+}
+
+static struct cpufreq_governor spu_governor =3D {
+ .name =3D "spu_governor",
+ .governor =3D spu_gov_govern,
+ .owner =3D THIS_MODULE,
+};
+
+/*
+ * module init and destoy
+ */
+
+static int __init spu_gov_init(void)
+{
+ int ret;
+
+ kspugov_wq =3D create_workqueue("kspugov");
+ if (!kspugov_wq) {
+ printk(KERN_ERR "creation of kspugov failed\n");
+ ret =3D -EFAULT;
+ goto out;
+ }
+
+ ret =3D cpufreq_register_governor(&spu_governor);
+ if (ret) {
+ printk(KERN_ERR "registration of governor failed\n");
+ destroy_workqueue(kspugov_wq);
+ goto out;
+ }
+out:
+ return ret;
+}
+
+static void __exit spu_gov_exit(void)
+{
+ cpufreq_unregister_governor(&spu_governor);
+ destroy_workqueue(kspugov_wq);
+}
+
+
+module_init(spu_gov_init);
+module_exit(spu_gov_exit);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Christian Krafft <krafft@de.ibm.com>");
+
^ permalink raw reply
* Re: [PATCH] powerpc: reduce code duplication in legacy_serial, add UART parent types
From: Paul Gortmaker @ 2008-07-07 15:02 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: scottwood, linuxppc-dev, arnd
In-Reply-To: <1215412426.8970.97.camel@pasglop>
In message: Re: [PATCH] powerpc: reduce code duplication in legacy_serial, add UART parent types
on 07/07/2008 Benjamin Herrenschmidt wrote:
> On Fri, 2008-01-25 at 02:17 -0600, Kumar Gala wrote:
> > > The legacy_serial was treating each UART parent in a separate code block.
> > > Rather than continue this trend for the new parent IDs, this condenses
> > > all (soc, tsi, opb, plus two more new types) into one of_device_id array.
> > > The new types are wrs,epld-localbus for the Wind River sbc8560, and a
> > > more generic "simple-bus" as requested by Scott Wood.
> > >
> > > Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> > > ---
> > > arch/powerpc/kernel/legacy_serial.c | 45 +++++++++++++---------------------
> > > 1 files changed, 17 insertions(+), 28 deletions(-)
> > >
> > applied
>
> (Catching that old patch on patchworks by accident)
>
> Hrm... please next time don't take patches to generic stuff like
> legacy_serial through your tree. This one has definitely not been
> properly reviewed.
>
> In this case, there are at least two problems with the patch:
>
> - The parents array should be called something better, as-is, go figure
> where you crashed when all you find is a symbol called "parents"
While looking around at what other names were used, I saw the ibmebus
used an equally non-descript name too, so I'll fix that as well. Patch
to follow shortly.
Thanks,
Paul.
>
> - The array isn't terminated (or did I miss something ?) which means
> that non-matching parents will probably crash.
>
> Ben.
>
>
^ permalink raw reply
* Re: [PATCH 1/2] elf loader support for auxvec base platform string
From: Steven Munroe @ 2008-07-07 15:14 UTC (permalink / raw)
To: linuxppc-dev
Roland McGrath writes:
> I understand why you think so. But let's not be too abstract. The
> purpose of the addition is to drive ld.so's selection of libraries, yes?
The is one possible usage of this AT_BASE_PLATFORM. There is also a
requirement from performance tools and large applications to understand
their environment. As it needs to be a public and durable ABI.
Virtualization and multi-core are only going to make everyones life more
complicated. Applications and performance tools will require more info
about the system to do their jobs. This is the problem I am trying to
solve. And I thought this was the simplest way to solve several use
cases.
I proposes for this and the possible extension to library selection
because it would become part of the ABI and any application could
access it.
So if you want to propose another (Better) mechanism for ld.so library
search shaping I would be glad to discuss it.
But in my mind the requirement for AT_BASE_PLATFORM still stands.
^ permalink raw reply
* Re: [Libhugetlbfs-devel] libbugetlbfs: Test case for powerpc huge_ptep_set_wrprotect() bug
From: Adam Litke @ 2008-07-07 15:27 UTC (permalink / raw)
To: David Gibson; +Cc: linuxppc-dev, libhugetlbfs-devel
In-Reply-To: <20080707071955.GA27709@yookeroo.seuss>
On Mon, 2008-07-07 at 17:19 +1000, David Gibson wrote:
> Until very recently (in fact, even now in mainline) powerpc kernels
> had a bug in huge_ptep_set_wrprotect() which meant the 'huge' flag was
> not passed down to pte_update() and hpte_need_flush(). This meant the
> hash ptes for hugepages would not be correctly flushed on fork(),
> allowing the parent to pollute the child's mapping after the fork().
>
> This patch adds a testcase to libhugetlbfs for this behaviour, also
> doing some other checking of the COW semantics over a fork().
>
> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Good test David, thanks...
Acked-by: Adam Litke <agl@us.ibm.com>
--
Adam Litke - (agl at us.ibm.com)
IBM Linux Technology Center
^ permalink raw reply
* Re: New fsl device bindings file
From: Kumar Gala @ 2008-07-07 15:28 UTC (permalink / raw)
To: Olof Johansson; +Cc: Scott Wood, linuxppc-dev list, David Gibson
In-Reply-To: <E7B91ECF-0D87-442D-B99A-1BBB14697E09@lixom.net>
On Jul 6, 2008, at 8:45 PM, Olof Johansson wrote:
>
> On Jul 6, 2008, at 8:39 PM, David Gibson wrote:
>
>> Well... they may be Linux specific by default, but they're supposed
>> to
>> be general enough that they (or at least, very small extensions)
>> *could* become official OF bindings, if there was still an OF group
>> to
>> make them so. It certainly should be possible to use these bindings
>> in a firmware which provides an OF client interface as well as in
>> flat-tree-only firmwares which don't.
>
> Right, it's a classic case of embrace and extend. Calling it OF is
> just plain misleading, especially since the original document was
> called booting _WITHOUT_ OF.
I agree With Olof and plain on calling it:
Documentation/powerpc/dts-bindings/fsl/
- k
^ permalink raw reply
* Re: Support for low power mode for powerpc processors
From: Josh Boyer @ 2008-07-07 15:27 UTC (permalink / raw)
To: prodyut hazarika; +Cc: linuxppc-dev
In-Reply-To: <1215128571.7960.10.camel@pasglop>
On Fri, 04 Jul 2008 09:42:51 +1000
Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
> On Thu, 2008-07-03 at 12:52 -0700, prodyut hazarika wrote:
> > But a lot of SoC like 440GT/EX support two modes of power save -
> > - Cut off power to other cores like PCIExpress/USB/MAC/UART etc
> > - Lower the CPU frequency
> >
> > Is it possible to scale down CPU freq or cut off power to unused cores
> > while the CPU is idle? The ideal way would be that the SoC registers a
> > set of handlers to the Kernel that can power off/up the SoC components
> > or reduce/restore CPU frequency. Does any such framework exist for
> > PowerPC processors, because most PowerPC based SoC (FreeScale/AMCC
> > etc) support the above two modes of power save.
>
> Cutting off power to individual cores should be done by the drivers for
> those cores (let's call the devices). For example, the USB driver could
> cut of power when nothing is connected, though I'm not sure if it can do
> that without losing the ability to detect new connections, but then, USB
> has a suspend state that should make it mostly unnecessary. For the
> UART, you may lose the ability to receive.
>
> At the end of the day, if you don't use at all a core, disable it from
> your firmware and set it as unused in the device-tree.
Right.
To answer the "can the CPU frequency be scaled" question, the answer is
"maybe". You certainly want to make sure that timebase stays constant
in those transitions, which is easiest to do if timebase is driven by
an external clock and not the CPU clock.
There are also PLB/OPB divisor ratios that have to be taken into
account when changing the CPU frequency. If the hardware can handle
this for you, then it should work well enough. I know of at least one
4xx chip that has had CPU frequency scaling working.
If you pursue this at all, you will want to do it as a cpufreq driver.
That will allow you to use the generic cpufreq infrastructure in the
kernel, including the governors.
josh
^ permalink raw reply
* Re: [Cbe-oss-dev] [patch 05/11] powerpc/cell: add spu aware cpufreq governor
From: Josh Boyer @ 2008-07-07 15:35 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: Stephen Rothwell, cbe-oss-dev, linuxppc-dev
In-Reply-To: <200807071659.23476.arnd@arndb.de>
On Mon, 2008-07-07 at 16:59 +0200, Arnd Bergmann wrote:
> On Monday 07 July 2008, Stephen Rothwell wrote:
> > > +#define POLL_TIME 100000 /* in us */
> > ^
> > How about μ ?
>
> Not sure, how about µ instead? ;-)
Erm... don't get it. You have identical characters here.
josh
^ permalink raw reply
* [PATCH] [V3] powerpc: Xilinx: PS2: Added new XPS PS2 driver
From: John Linn @ 2008-07-07 15:38 UTC (permalink / raw)
To: linuxppc-dev, linux-input; +Cc: dmitry.torokhov, Sadanand, John Linn
Added a new driver for Xilinx XPS PS2 IP. This driver is
a flat driver to better match the Linux driver pattern.
Signed-off-by: Sadanand <sadanan@xilinx.com>
Signed-off-by: John Linn <john.linn@xilinx.com>
---
V2
Updated the driver based on feedback from Dmitry, Peter, and Grant.
We believe Montavista copyright is still valid.
V3
Incorporated Dmitry and Grant's 2nd set of comments which were some
minor cleanup and removal of the mutex which was not needed.
drivers/input/serio/Kconfig | 5 +
drivers/input/serio/Makefile | 1 +
drivers/input/serio/xilinx_ps2.c | 384 ++++++++++++++++++++++++++++++++++++++
3 files changed, 390 insertions(+), 0 deletions(-)
create mode 100644 drivers/input/serio/xilinx_ps2.c
diff --git a/drivers/input/serio/Kconfig b/drivers/input/serio/Kconfig
index ec4b661..0e62b39 100644
--- a/drivers/input/serio/Kconfig
+++ b/drivers/input/serio/Kconfig
@@ -190,4 +190,9 @@ config SERIO_RAW
To compile this driver as a module, choose M here: the
module will be called serio_raw.
+config SERIO_XILINX_XPS_PS2
+ tristate "Xilinx XPS PS/2 Controller Support"
+ help
+ This driver supports XPS PS/2 IP from Xilinx EDK.
+
endif
diff --git a/drivers/input/serio/Makefile b/drivers/input/serio/Makefile
index 38b8868..9b6c813 100644
--- a/drivers/input/serio/Makefile
+++ b/drivers/input/serio/Makefile
@@ -21,3 +21,4 @@ obj-$(CONFIG_SERIO_PCIPS2) += pcips2.o
obj-$(CONFIG_SERIO_MACEPS2) += maceps2.o
obj-$(CONFIG_SERIO_LIBPS2) += libps2.o
obj-$(CONFIG_SERIO_RAW) += serio_raw.o
+obj-$(CONFIG_SERIO_XILINX_XPS_PS2) += xilinx_ps2.o
diff --git a/drivers/input/serio/xilinx_ps2.c b/drivers/input/serio/xilinx_ps2.c
new file mode 100644
index 0000000..e86f11b
--- /dev/null
+++ b/drivers/input/serio/xilinx_ps2.c
@@ -0,0 +1,384 @@
+/*
+ * Xilinx XPS PS/2 device driver
+ *
+ * (c) 2005 MontaVista Software, Inc.
+ * (c) 2008 Xilinx, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+
+#include <linux/module.h>
+#include <linux/serio.h>
+#include <linux/interrupt.h>
+#include <linux/errno.h>
+#include <linux/init.h>
+#include <linux/list.h>
+#include <linux/io.h>
+
+#include <linux/of_device.h>
+#include <linux/of_platform.h>
+
+#define DRIVER_NAME "xilinx_ps2"
+
+/* Register offsets for the xps2 device */
+#define XPS2_SRST_OFFSET 0x00000000 /* Software Reset register */
+#define XPS2_STATUS_OFFSET 0x00000004 /* Status register */
+#define XPS2_RX_DATA_OFFSET 0x00000008 /* Receive Data register */
+#define XPS2_TX_DATA_OFFSET 0x0000000C /* Transmit Data register */
+#define XPS2_GIER_OFFSET 0x0000002C /* Global Interrupt Enable reg */
+#define XPS2_IPISR_OFFSET 0x00000030 /* Interrupt Status register */
+#define XPS2_IPIER_OFFSET 0x00000038 /* Interrupt Enable register */
+
+/* Reset Register Bit Definitions */
+#define XPS2_SRST_RESET 0x0000000A /* Software Reset */
+
+/* Status Register Bit Positions */
+#define XPS2_STATUS_RX_FULL 0x00000001 /* Receive Full */
+#define XPS2_STATUS_TX_FULL 0x00000002 /* Transmit Full */
+
+/* Bit definitions for ISR/IER registers. Both the registers have the same bit
+ * definitions and are only defined once. */
+#define XPS2_IPIXR_WDT_TOUT 0x00000001 /* Watchdog Timeout Interrupt */
+#define XPS2_IPIXR_TX_NOACK 0x00000002 /* Transmit No ACK Interrupt */
+#define XPS2_IPIXR_TX_ACK 0x00000004 /* Transmit ACK (Data) Interrupt */
+#define XPS2_IPIXR_RX_OVF 0x00000008 /* Receive Overflow Interrupt */
+#define XPS2_IPIXR_RX_ERR 0x00000010 /* Receive Error Interrupt */
+#define XPS2_IPIXR_RX_FULL 0x00000020 /* Receive Data Interrupt */
+
+/* Mask for all the Transmit Interrupts */
+#define XPS2_IPIXR_TX_ALL (XPS2_IPIXR_TX_NOACK | XPS2_IPIXR_TX_ACK)
+
+/* Mask for all the Receive Interrupts */
+#define XPS2_IPIXR_RX_ALL (XPS2_IPIXR_RX_OVF | XPS2_IPIXR_RX_ERR | \
+ XPS2_IPIXR_RX_FULL)
+
+/* Mask for all the Interrupts */
+#define XPS2_IPIXR_ALL (XPS2_IPIXR_TX_ALL | XPS2_IPIXR_RX_ALL | \
+ XPS2_IPIXR_WDT_TOUT)
+
+/* Global Interrupt Enable mask */
+#define XPS2_GIER_GIE_MASK 0x80000000
+
+struct xps2data {
+ int irq;
+ u32 phys_addr;
+ u32 remap_size;
+ spinlock_t lock;
+ u8 rxb; /* Rx buffer */
+ void __iomem *base_address; /* virt. address of control registers */
+ unsigned int dfl;
+ struct serio serio; /* serio */
+};
+
+/************************************/
+/* XPS PS/2 data transmission calls */
+/************************************/
+
+/*
+ * xps2_recv() will attempt to receive a byte of data from the PS/2 port.
+ */
+static int xps2_recv(struct xps2data *drvdata, u8 *byte)
+{
+ u32 sr;
+ int status = -1;
+
+ /* If there is data available in the PS/2 receiver, read it */
+ sr = in_be32(drvdata->base_address + XPS2_STATUS_OFFSET);
+ if (sr & XPS2_STATUS_RX_FULL) {
+ *byte = in_be32(drvdata->base_address + XPS2_RX_DATA_OFFSET);
+ status = 0;
+ }
+
+ return status;
+}
+
+/*********************/
+/* Interrupt handler */
+/*********************/
+static irqreturn_t xps2_interrupt(int irq, void *dev_id)
+{
+ struct xps2data *drvdata = (struct xps2data *)dev_id;
+ u32 intr_sr;
+ u8 c;
+ int status;
+
+ /* Get the PS/2 interrupts and clear them */
+ intr_sr = in_be32(drvdata->base_address + XPS2_IPISR_OFFSET);
+ out_be32(drvdata->base_address + XPS2_IPISR_OFFSET, intr_sr);
+
+ /* Check which interrupt is active */
+ if (intr_sr & XPS2_IPIXR_RX_OVF) {
+ printk(KERN_ERR "%s: receive overrun error\n",
+ drvdata->serio.name);
+ }
+
+ if (intr_sr & XPS2_IPIXR_RX_ERR)
+ drvdata->dfl |= SERIO_PARITY;
+
+ if (intr_sr & (XPS2_IPIXR_TX_NOACK | XPS2_IPIXR_WDT_TOUT))
+ drvdata->dfl |= SERIO_TIMEOUT;
+
+ if (intr_sr & XPS2_IPIXR_RX_FULL) {
+ status = xps2_recv(drvdata, &drvdata->rxb);
+
+ /* Error, if a byte is not received */
+ if (status) {
+ printk(KERN_ERR
+ "%s: wrong rcvd byte count (%d)\n",
+ drvdata->serio.name, status);
+ } else {
+ c = drvdata->rxb;
+ serio_interrupt(&drvdata->serio, c, drvdata->dfl);
+ drvdata->dfl = 0;
+ }
+ }
+
+ if (intr_sr & XPS2_IPIXR_TX_ACK)
+ drvdata->dfl = 0;
+
+ return IRQ_HANDLED;
+}
+
+/*******************/
+/* serio callbacks */
+/*******************/
+
+/*
+ * sxps2_write() sends a byte out through the PS/2 interface.
+ */
+static int sxps2_write(struct serio *pserio, unsigned char c)
+{
+ struct xps2data *drvdata = pserio->port_data;
+ unsigned long flags;
+ u32 sr;
+ int status = -1;
+
+ spin_lock_irqsave(&drvdata->lock, flags);
+ /* If the PS/2 transmitter is empty send a byte of data */
+ sr = in_be32(drvdata->base_address + XPS2_STATUS_OFFSET);
+ if ((sr & XPS2_STATUS_TX_FULL) == 0) {
+ out_be32(drvdata->base_address + XPS2_TX_DATA_OFFSET, c);
+ status = 0;
+ }
+ spin_unlock_irqrestore(&drvdata->lock, flags);
+
+ return status;
+}
+
+/*
+ * sxps2_open() is called when a port is open by the higher layer.
+ */
+static int sxps2_open(struct serio *pserio)
+{
+ struct xps2data *drvdata = pserio->port_data;
+ int retval;
+
+ retval = request_irq(drvdata->irq, &xps2_interrupt, 0,
+ DRIVER_NAME, drvdata);
+ if (retval) {
+ printk(KERN_ERR
+ "%s: Couldn't allocate interrupt %d\n",
+ drvdata->serio.name, drvdata->irq);
+ return retval;
+ }
+
+ /* start reception by enabling the interrupts */
+ out_be32(drvdata->base_address + XPS2_GIER_OFFSET, XPS2_GIER_GIE_MASK);
+ out_be32(drvdata->base_address + XPS2_IPIER_OFFSET, XPS2_IPIXR_RX_ALL);
+ (void)xps2_recv(drvdata, &drvdata->rxb);
+
+ return 0; /* success */
+}
+
+/*
+ * sxps2_close() frees the interrupt.
+ */
+static void sxps2_close(struct serio *pserio)
+{
+ struct xps2data *drvdata = pserio->port_data;
+
+ /* Disable the PS2 interrupts */
+ out_be32(drvdata->base_address + XPS2_GIER_OFFSET, 0x00);
+ out_be32(drvdata->base_address + XPS2_IPIER_OFFSET, 0x00);
+ free_irq(drvdata->irq, drvdata);
+}
+
+/*********************/
+/* Device setup code */
+/*********************/
+
+static int xps2_setup(struct device *dev, struct resource *regs_res,
+ struct resource *irq_res)
+{
+ struct xps2data *drvdata;
+ struct serio *serio;
+ unsigned long remap_size;
+ int retval;
+
+ if (!dev)
+ return -EINVAL;
+
+ drvdata = kzalloc(sizeof(struct xps2data), GFP_KERNEL);
+ if (!drvdata) {
+ dev_err(dev, "Couldn't allocate device private record\n");
+ return -ENOMEM;
+ }
+ spin_lock_init(&drvdata->lock);
+ dev_set_drvdata(dev, drvdata);
+
+ if (!regs_res || !irq_res) {
+ dev_err(dev, "IO resource(s) not found\n");
+ retval = -EFAULT;
+ goto failed1;
+ }
+
+ drvdata->irq = irq_res->start;
+ remap_size = regs_res->end - regs_res->start + 1;
+ if (!request_mem_region(regs_res->start, remap_size, DRIVER_NAME)) {
+
+ dev_err(dev, "Couldn't lock memory region at 0x%08X\n",
+ (unsigned int)regs_res->start);
+ retval = -EBUSY;
+ goto failed1;
+ }
+
+ /* Fill in configuration data and add them to the list */
+ drvdata->phys_addr = regs_res->start;
+ drvdata->remap_size = remap_size;
+ drvdata->base_address = ioremap(regs_res->start, remap_size);
+ if (drvdata->base_address == NULL) {
+
+ dev_err(dev, "Couldn't ioremap memory at 0x%08X\n",
+ (unsigned int)regs_res->start);
+ retval = -EFAULT;
+ goto failed2;
+ }
+
+ /* Disable all the interrupts, just in case */
+ out_be32(drvdata->base_address + XPS2_IPIER_OFFSET, 0);
+
+ /* Reset the PS2 device and abort any current transaction, to make sure
+ * we have the PS2 in a good state */
+ out_be32(drvdata->base_address + XPS2_SRST_OFFSET, XPS2_SRST_RESET);
+
+ dev_info(dev, "Xilinx PS2 at 0x%08X mapped to 0x%08X, irq=%d\n",
+ drvdata->phys_addr, (u32)drvdata->base_address, drvdata->irq);
+
+ serio = &drvdata->serio;
+ serio->id.type = SERIO_8042;
+ serio->write = sxps2_write;
+ serio->open = sxps2_open;
+ serio->close = sxps2_close;
+ serio->port_data = drvdata;
+ serio->dev.parent = dev;
+ snprintf(drvdata->serio.name, sizeof(serio->name),
+ "Xilinx XPS PS/2 at %08X", drvdata->phys_addr);
+ snprintf(drvdata->serio.phys, sizeof(serio->phys),
+ "xilinxps2/serio at %08X", drvdata->phys_addr);
+ serio_register_port(serio);
+
+ return 0; /* success */
+
+failed2:
+ release_mem_region(regs_res->start, remap_size);
+
+failed1:
+ kfree(drvdata);
+ dev_set_drvdata(dev, NULL);
+
+ return retval;
+}
+
+/***************************/
+/* OF Platform Bus Support */
+/***************************/
+
+static int __devinit xps2_of_probe(struct of_device *ofdev, const struct
+ of_device_id * match)
+{
+ struct resource r_irq; /* Interrupt resources */
+ struct resource r_mem; /* IO mem resources */
+ int rc = 0;
+
+ printk(KERN_INFO "Device Tree Probing \'%s\'\n",
+ ofdev->node->name);
+
+ /* Get iospace for the device */
+ rc = of_address_to_resource(ofdev->node, 0, &r_mem);
+ if (rc) {
+ dev_err(&ofdev->dev, "invalid address\n");
+ return rc;
+ }
+
+ /* Get IRQ for the device */
+ rc = of_irq_to_resource(ofdev->node, 0, &r_irq);
+ if (rc == NO_IRQ) {
+ dev_err(&ofdev->dev, "no IRQ found\n");
+ return rc;
+ }
+
+ return xps2_setup(&ofdev->dev, &r_mem, &r_irq);
+}
+
+static int __devexit xps2_of_remove(struct of_device *of_dev)
+{
+ struct xps2data *drvdata;
+ struct device *dev;
+
+ dev = &of_dev->dev;
+ if (!dev)
+ return -EINVAL;
+
+ drvdata = (struct xps2data *)dev_get_drvdata(dev);
+
+ serio_unregister_port(&drvdata->serio);
+
+ iounmap(drvdata->base_address);
+
+ release_mem_region(drvdata->phys_addr, drvdata->remap_size);
+
+ kfree(drvdata);
+ dev_set_drvdata(dev, NULL);
+
+ return 0; /* success */
+}
+
+/* Match table for of_platform binding */
+static struct of_device_id xps2_of_match[] __devinitdata = {
+ { .compatible = "xlnx,xps-ps2-1.00.a", },
+ { /* end of list */ },
+};
+MODULE_DEVICE_TABLE(of, xps2_of_match);
+
+static struct of_platform_driver xps2_of_driver = {
+ .name = DRIVER_NAME,
+ .match_table = xps2_of_match,
+ .probe = xps2_of_probe,
+ .remove = __devexit_p(xps2_of_remove),
+};
+
+static int __init xps2_init(void)
+{
+ return of_register_platform_driver(&xps2_of_driver);
+}
+
+static void __exit xps2_cleanup(void)
+{
+ of_unregister_platform_driver(&xps2_of_driver);
+}
+
+module_init(xps2_init);
+module_exit(xps2_cleanup);
+
+MODULE_AUTHOR("Xilinx, Inc.");
+MODULE_DESCRIPTION("Xilinx XPS PS/2 driver");
+MODULE_LICENSE("GPL");
+
--
1.5.2.1
This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.
^ permalink raw reply related
* Re: AZFS file system proposal
From: Maxim Shchetynin @ 2008-07-07 15:39 UTC (permalink / raw)
To: linux-fsdevel, linux-kernel, linuxppc-dev; +Cc: Arnd Bergmann
In-Reply-To: <200807011659.33413.arnd@arndb.de>
Thank you Arnd for your comments. I have changed my patch accordinly (I wil=
l send it in a few minutes).
> > Subject: azfs: initial submit of azfs, a non-buffered filesystem
>=20
> Please make the patch subject the actual subject of your email next time,
> and put the introductory text below the Signed-off-by: lines, separated
> by a "---" line. That will make the standard tools work without extra
> effort on my side. Also, please always Cc the person you want to merge
> the patch, in this case probably me.
Done.
> All other file systems are in separate directories, so it would be better
> to rename fs/azfs.c to fs/azfs/inode.c
Done.
> > +#define AZFS_SUPERBLOCK_FLAGS MS_NOEXEC | \
> > + MS_SYNCHRONOUS | \
> > + MS_DIRSYNC | \
> > + MS_ACTIVE
>=20
> Why MS_NOEXEC? What happens on a remount if the user does not specifies
> -o remount,exec?
I also don't see any reason of keeping MS_NOEXEC - have just removed it.
> > +static unsigned long
> > +azfs_block_find(struct inode *inode, enum azfs_direction direction,
> > + unsigned long from, unsigned long *size)
> > +{
> > ...
> > +}
>=20
> This overloading of the return type to mean either a pointer or an offset
> on the block device is rather confusing. Why not just return the raw bloc=
k_id
> before the last +=3D and leave that part up to the caller?
Changed.
> > + if (copy_to_user(target, (void*) pin, size)) {
> > + rc =3D -EFAULT;
> > + goto out;
> > + }
>=20
> Question to the powerpc folks: is copy_to_user safe for an __iomem source?
> Should there be two copies (memcpy_fromio and copy_to_user) instead?
I leave this question open.
> > + page_prot =3D pgprot_val(vma->vm_page_prot);
> > + page_prot |=3D (_PAGE_NO_CACHE | _PAGE_RW);
> > + page_prot &=3D ~_PAGE_GUARDED;
> > + vma->vm_page_prot =3D __pgprot(page_prot);
>=20
> The pgprot modifications rely on powerpc specific flags, but the
> file system should not really need to be powerpc only.
>=20
> The flags we want are more or less the same as PAGE_AGP, because
> both are I/O mapped memory that needs to be uncached but should
> not be guarded, for performance reasons.
>=20
> Maybe we can introduce a new PAGE_IOMEM here that we can use
> in all places that need something like this. In spufs we need
> the same flags for the local store mappings.
>=20
> I wouldn't hold up merging the file system for this problem, but
> until it is solved, the Kconfig entry should probably have
> a "depends on PPC".
Done.
--=20
Mit freundlichen Gr=C3=BC=C3=9Fen / met vriendelijke groeten / avec regards
Maxim V. Shchetynin
Linux Kernel Entwicklung
IBM Deutschland Entwicklung GmbH
Linux f=C3=BCr Cell, Abteilung 3250
Sch=C3=B6naicher Stra=C3=9Fe 220
71032 B=C3=B6blingen
Vorsitzender des Aufsichtsrats: Johann Weihen
Gesch=C3=A4ftsf=C3=BChrung: Herbert Kircher
Sitz der Gesellschaft: B=C3=B6blingen
Registriergericht: Amtsgericht Stuttgart, HRB 243294
Fahr nur so schnell wie dein Schutzengel fliegen kann!
^ permalink raw reply
* azfs: initial submit of azfs, a non-buffered filesystem
From: Maxim Shchetynin @ 2008-07-07 15:42 UTC (permalink / raw)
To: linux-fsdevel, linux-kernel, linuxppc-dev; +Cc: Arnd Bergmann
In-Reply-To: <200807011659.33413.arnd@arndb.de>
AZFS is a file system which keeps all files on memory mapped random
access storage. It was designed to work on the axonram device driver
for IBM QS2x blade servers, but can operate on any block device
that exports a direct_access method.
Signed-off-by: Maxim Shchetynin <maxim@de.ibm.com>
---
diff -Nuar linux-2.6.26-rc9/Documentation/filesystems/azfs.txt linux-2.6.26=
-rc9-azfs/Documentation/filesystems/azfs.txt
--- linux-2.6.26-rc9/Documentation/filesystems/azfs.txt 1970-01-01 01:00:00=
.000000000 +0100
+++ linux-2.6.26-rc9-azfs/Documentation/filesystems/azfs.txt 2008-07-07 13:=
43:45.235739896 +0200
@@ -0,0 +1,22 @@
+AZFS is a file system which keeps all files on memory mapped random
+access storage. It was designed to work on the axonram device driver
+for IBM QS2x blade servers, but can operate on any block device
+that exports a direct_access method.
+
+Everything in AZFS is temporary in the sense that all the data stored
+therein is lost when you switch off or reboot a system. If you unmount
+an AZFS instance, all the data will be kept on device as long your system
+is not shut down or rebooted. You can later mount AZFS on from device again
+to get access to your files.
+
+AZFS uses a block device only for data but not for file information.
+All inodes (file and directory information) is kept in RAM.
+
+When you mount AZFS you are able to specify a file system block size with
+'-o bs=3D<size in bytes>' option. There are no software limitations for
+a block size but you would not be able to mmap files on AZFS if block size
+is less than a system page size. If no '-o bs' option is specified on mount
+a block size of the used block device is used as a default block size for =
AZFS.
+
+Other available mount options for AZFS are '-o uid=3D<id>' and '-o gid=3D<=
id>',
+which allow you to set the owner and group of the root of the file system.
diff -Nuar linux-2.6.26-rc9/arch/powerpc/configs/cell_defconfig linux-2.6.2=
6-rc9-azfs/arch/powerpc/configs/cell_defconfig
--- linux-2.6.26-rc9/arch/powerpc/configs/cell_defconfig 2008-07-06 00:53:2=
2.000000000 +0200
+++ linux-2.6.26-rc9-azfs/arch/powerpc/configs/cell_defconfig 2008-07-07 13=
:43:45.244738607 +0200
@@ -240,6 +240,7 @@
# CPU Frequency drivers
#
CONFIG_AXON_RAM=3Dm
+CONFIG_AZ_FS=3Dm
# CONFIG_FSL_ULI1575 is not set
=20
#
diff -Nuar linux-2.6.26-rc9/fs/Kconfig linux-2.6.26-rc9-azfs/fs/Kconfig
--- linux-2.6.26-rc9/fs/Kconfig 2008-07-06 00:53:22.000000000 +0200
+++ linux-2.6.26-rc9-azfs/fs/Kconfig 2008-07-07 13:45:29.397644341 +0200
@@ -1017,6 +1017,22 @@
config HUGETLB_PAGE
def_bool HUGETLBFS
=20
+config AZ_FS
+ tristate "AZFS filesystem support"
+ depends on PPC
+ help
+ azfs is a file system for I/O attached memory backing. It requires
+ a block device with direct_access capability, e.g. axonram.
+ Mounting such device with azfs gives memory mapped access to the
+ underlying memory to user space.
+
+ Read <file:Documentation/filesystems/azfs.txt> for details.
+
+ To compile this file system support as a module, choose M here: the
+ module will be called azfs.
+
+ If unsure, say N.
+
config CONFIGFS_FS
tristate "Userspace-driven configuration filesystem"
depends on SYSFS
diff -Nuar linux-2.6.26-rc9/fs/Makefile linux-2.6.26-rc9-azfs/fs/Makefile
--- linux-2.6.26-rc9/fs/Makefile 2008-07-06 00:53:22.000000000 +0200
+++ linux-2.6.26-rc9-azfs/fs/Makefile 2008-07-07 13:45:49.436832234 +0200
@@ -119,3 +119,4 @@
obj-$(CONFIG_DEBUG_FS) +=3D debugfs/
obj-$(CONFIG_OCFS2_FS) +=3D ocfs2/
obj-$(CONFIG_GFS2_FS) +=3D gfs2/
+obj-$(CONFIG_AZ_FS) +=3D azfs/
diff -Nuar linux-2.6.26-rc9/fs/azfs/Makefile linux-2.6.26-rc9-azfs/fs/azfs/=
Makefile
--- linux-2.6.26-rc9/fs/azfs/Makefile 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.26-rc9-azfs/fs/azfs/Makefile 2008-07-07 13:46:38.413264402 +0=
200
@@ -0,0 +1,7 @@
+#
+# Makefile for azfs routines
+#
+
+obj-$(CONFIG_AZ_FS) +=3D azfs.o
+
+azfs-y :=3D inode.o
diff -Nuar linux-2.6.26-rc9/fs/azfs/inode.c linux-2.6.26-rc9-azfs/fs/azfs/i=
node.c
--- linux-2.6.26-rc9/fs/azfs/inode.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.26-rc9-azfs/fs/azfs/inode.c 2008-07-07 17:31:06.183098986 +02=
00
@@ -0,0 +1,1176 @@
+/*
+ * (C) Copyright IBM Deutschland Entwicklung GmbH 2007
+ *
+ * Author: Maxim Shchetynin <maxim@de.ibm.com>
+ *
+ * Non-buffered filesystem driver.
+ * It registers a filesystem which may be used for all kind of block devic=
es
+ * which have a direct_access() method in block_device_operations.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <linux/backing-dev.h>
+#include <linux/blkdev.h>
+#include <linux/cache.h>
+#include <linux/dcache.h>
+#include <linux/device.h>
+#include <linux/err.h>
+#include <linux/fs.h>
+#include <linux/genhd.h>
+#include <linux/kernel.h>
+#include <linux/limits.h>
+#include <linux/list.h>
+#include <linux/module.h>
+#include <linux/mount.h>
+#include <linux/mm.h>
+#include <linux/mm_types.h>
+#include <linux/mutex.h>
+#include <linux/namei.h>
+#include <linux/pagemap.h>
+#include <linux/parser.h>
+#include <linux/slab.h>
+#include <linux/spinlock.h>
+#include <linux/stat.h>
+#include <linux/statfs.h>
+#include <linux/string.h>
+#include <linux/time.h>
+#include <linux/types.h>
+#include <linux/aio.h>
+#include <linux/uio.h>
+#include <asm/bug.h>
+#include <asm/page.h>
+#include <asm/pgtable.h>
+#include <asm/string.h>
+
+#define AZFS_FILESYSTEM_NAME "azfs"
+#define AZFS_FILESYSTEM_FLAGS FS_REQUIRES_DEV
+
+#define AZFS_SUPERBLOCK_MAGIC 0xABBA1972
+#define AZFS_SUPERBLOCK_FLAGS MS_SYNCHRONOUS | \
+ MS_DIRSYNC | \
+ MS_ACTIVE
+
+#define AZFS_BDI_CAPABILITIES BDI_CAP_NO_ACCT_DIRTY | \
+ BDI_CAP_NO_WRITEBACK | \
+ BDI_CAP_MAP_COPY | \
+ BDI_CAP_MAP_DIRECT | \
+ BDI_CAP_VMFLAGS
+
+#define AZFS_CACHE_FLAGS SLAB_HWCACHE_ALIGN | \
+ SLAB_RECLAIM_ACCOUNT | \
+ SLAB_MEM_SPREAD
+
+struct azfs_super {
+ struct list_head list;
+ unsigned long media_size;
+ unsigned long block_size;
+ unsigned short block_shift;
+ unsigned long sector_size;
+ unsigned short sector_shift;
+ uid_t uid;
+ gid_t gid;
+ unsigned long ph_addr;
+ unsigned long io_addr;
+ struct block_device *blkdev;
+ struct dentry *root;
+ struct list_head block_list;
+ rwlock_t lock;
+};
+
+struct azfs_super_list {
+ struct list_head head;
+ spinlock_t lock;
+};
+
+struct azfs_block {
+ struct list_head list;
+ unsigned long id;
+ unsigned long count;
+};
+
+struct azfs_znode {
+ struct list_head block_list;
+ rwlock_t lock;
+ loff_t size;
+ struct inode vfs_inode;
+};
+
+static struct azfs_super_list super_list;
+static struct kmem_cache *azfs_znode_cache __read_mostly =3D NULL;
+static struct kmem_cache *azfs_block_cache __read_mostly =3D NULL;
+
+#define I2S(inode) \
+ inode->i_sb->s_fs_info
+#define I2Z(inode) \
+ container_of(inode, struct azfs_znode, vfs_inode)
+
+#define for_each_block(block, block_list) \
+ list_for_each_entry(block, block_list, list)
+#define for_each_block_reverse(block, block_list) \
+ list_for_each_entry_reverse(block, block_list, list)
+#define for_each_block_safe(block, temp, block_list) \
+ list_for_each_entry_safe(block, temp, block_list, list)
+#define for_each_block_safe_reverse(block, temp, block_list) \
+ list_for_each_entry_safe_reverse(block, temp, block_list, list)
+
+/**
+ * azfs_block_init - create and initialise a new block in a list
+ * @block_list: destination list
+ * @id: block id
+ * @count: size of a block
+ */
+static inline struct azfs_block*
+azfs_block_init(struct list_head *block_list,
+ unsigned long id, unsigned long count)
+{
+ struct azfs_block *block;
+
+ block =3D kmem_cache_alloc(azfs_block_cache, GFP_KERNEL);
+ if (!block)
+ return NULL;
+
+ block->id =3D id;
+ block->count =3D count;
+
+ INIT_LIST_HEAD(&block->list);
+ list_add_tail(&block->list, block_list);
+
+ return block;
+}
+
+/**
+ * azfs_block_free - remove block from a list and free it back in cache
+ * @block: block to be removed
+ */
+static inline void
+azfs_block_free(struct azfs_block *block)
+{
+ list_del(&block->list);
+ kmem_cache_free(azfs_block_cache, block);
+}
+
+/**
+ * azfs_block_move - move block to another list
+ * @block: block to be moved
+ * @block_list: destination list
+ */
+static inline void
+azfs_block_move(struct azfs_block *block, struct list_head *block_list)
+{
+ list_move_tail(&block->list, block_list);
+}
+
+/**
+ * azfs_block_find - get a block id of a part of a file
+ * @inode: inode
+ * @from: offset for read/write operation
+ * @size: pointer to a value of the amount of data to be read/written
+ */
+static unsigned long
+azfs_block_find(struct inode *inode, unsigned long from, unsigned long *si=
ze)
+{
+ struct azfs_super *super;
+ struct azfs_znode *znode;
+ struct azfs_block *block;
+ unsigned long block_id, west, east;
+
+ super =3D I2S(inode);
+ znode =3D I2Z(inode);
+
+ read_lock(&znode->lock);
+
+ while (from + *size > znode->size) {
+ read_unlock(&znode->lock);
+ i_size_write(inode, from + *size);
+ inode->i_op->truncate(inode);
+ read_lock(&znode->lock);
+ }
+
+ if (list_empty(&znode->block_list)) {
+ read_unlock(&znode->lock);
+ *size =3D 0;
+ return 0;
+ }
+
+ block_id =3D from >> super->block_shift;
+
+ for_each_block(block, &znode->block_list) {
+ if (block->count > block_id)
+ break;
+ block_id -=3D block->count;
+ }
+
+ west =3D from % super->block_size;
+ east =3D ((block->count - block_id) << super->block_shift) - west;
+
+ if (*size > east)
+ *size =3D east;
+
+ block_id =3D ((block->id + block_id) << super->block_shift) + west;
+
+ read_unlock(&znode->lock);
+
+ return block_id;
+}
+
+static struct inode*
+azfs_new_inode(struct super_block *, struct inode *, int, dev_t);
+
+/**
+ * azfs_mknod - mknod() method for inode_operations
+ * @dir, @dentry, @mode, @dev: see inode_operations methods
+ */
+static int
+azfs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t dev)
+{
+ struct inode *inode;
+
+ inode =3D azfs_new_inode(dir->i_sb, dir, mode, dev);
+ if (!inode)
+ return -ENOSPC;
+
+ if (S_ISREG(mode))
+ I2Z(inode)->size =3D 0;
+
+ dget(dentry);
+ d_instantiate(dentry, inode);
+
+ return 0;
+}
+
+/**
+ * azfs_create - create() method for inode_operations
+ * @dir, @dentry, @mode, @nd: see inode_operations methods
+ */
+static int
+azfs_create(struct inode *dir, struct dentry *dentry, int mode,
+ struct nameidata *nd)
+{
+ return azfs_mknod(dir, dentry, mode | S_IFREG, 0);
+}
+
+/**
+ * azfs_mkdir - mkdir() method for inode_operations
+ * @dir, @dentry, @mode: see inode_operations methods
+ */
+static int
+azfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
+{
+ int rc;
+
+ rc =3D azfs_mknod(dir, dentry, mode | S_IFDIR, 0);
+ if (!rc)
+ inc_nlink(dir);
+
+ return rc;
+}
+
+/**
+ * azfs_symlink - symlink() method for inode_operations
+ * @dir, @dentry, @name: see inode_operations methods
+ */
+static int
+azfs_symlink(struct inode *dir, struct dentry *dentry, const char *name)
+{
+ struct inode *inode;
+ int rc;
+
+ inode =3D azfs_new_inode(dir->i_sb, dir, S_IFLNK | S_IRWXUGO, 0);
+ if (!inode)
+ return -ENOSPC;
+
+ rc =3D page_symlink(inode, name, strlen(name) + 1);
+ if (rc) {
+ iput(inode);
+ return rc;
+ }
+
+ dget(dentry);
+ d_instantiate(dentry, inode);
+
+ return 0;
+}
+
+/**
+ * azfs_aio_read - aio_read() method for file_operations
+ * @iocb, @iov, @nr_segs, @pos: see file_operations methods
+ */
+static ssize_t
+azfs_aio_read(struct kiocb *iocb, const struct iovec *iov,
+ unsigned long nr_segs, loff_t pos)
+{
+ struct azfs_super *super;
+ struct inode *inode;
+ void *target;
+ unsigned long pin;
+ unsigned long size, todo, step;
+ ssize_t rc;
+
+ inode =3D iocb->ki_filp->f_mapping->host;
+ super =3D I2S(inode);
+
+ mutex_lock(&inode->i_mutex);
+
+ if (pos >=3D i_size_read(inode)) {
+ rc =3D 0;
+ goto out;
+ }
+
+ target =3D iov->iov_base;
+ todo =3D min((loff_t) iov->iov_len, i_size_read(inode) - pos);
+
+ for (step =3D todo; step; step -=3D size) {
+ size =3D step;
+ pin =3D azfs_block_find(inode, pos, &size);
+ if (!size) {
+ rc =3D -ENOSPC;
+ goto out;
+ }
+ pin +=3D super->io_addr;
+ if (copy_to_user(target, (void*) pin, size)) {
+ rc =3D -EFAULT;
+ goto out;
+ }
+
+ iocb->ki_pos +=3D size;
+ pos +=3D size;
+ target +=3D size;
+ }
+
+ rc =3D todo;
+
+out:
+ mutex_unlock(&inode->i_mutex);
+
+ return rc;
+}
+
+/**
+ * azfs_aio_write - aio_write() method for file_operations
+ * @iocb, @iov, @nr_segs, @pos: see file_operations methods
+ */
+static ssize_t
+azfs_aio_write(struct kiocb *iocb, const struct iovec *iov,
+ unsigned long nr_segs, loff_t pos)
+{
+ struct azfs_super *super;
+ struct inode *inode;
+ void *source;
+ unsigned long pin;
+ unsigned long size, todo, step;
+ ssize_t rc;
+
+ inode =3D iocb->ki_filp->f_mapping->host;
+ super =3D I2S(inode);
+
+ source =3D iov->iov_base;
+ todo =3D iov->iov_len;
+
+ mutex_lock(&inode->i_mutex);
+
+ for (step =3D todo; step; step -=3D size) {
+ size =3D step;
+ pin =3D azfs_block_find(inode, pos, &size);
+ if (!size) {
+ rc =3D -ENOSPC;
+ goto out;
+ }
+ pin +=3D super->io_addr;
+ if (copy_from_user((void*) pin, source, size)) {
+ rc =3D -EFAULT;
+ goto out;
+ }
+
+ iocb->ki_pos +=3D size;
+ pos +=3D size;
+ source +=3D size;
+ }
+
+ rc =3D todo;
+
+out:
+ mutex_unlock(&inode->i_mutex);
+
+ return rc;
+}
+
+/**
+ * azfs_open - open() method for file_operations
+ * @inode, @file: see file_operations methods
+ */
+static int
+azfs_open(struct inode *inode, struct file *file)
+{
+ if (file->f_flags & O_TRUNC) {
+ i_size_write(inode, 0);
+ inode->i_op->truncate(inode);
+ }
+ if (file->f_flags & O_APPEND)
+ inode->i_fop->llseek(file, 0, SEEK_END);
+
+ return 0;
+}
+
+/**
+ * azfs_mmap - mmap() method for file_operations
+ * @file, @vm: see file_operations methods
+ */
+static int
+azfs_mmap(struct file *file, struct vm_area_struct *vma)
+{
+ struct azfs_super *super;
+ struct azfs_znode *znode;
+ struct inode *inode;
+ unsigned long cursor, pin;
+ unsigned long todo, size, vm_start;
+ pgprot_t page_prot;
+
+ inode =3D file->f_dentry->d_inode;
+ znode =3D I2Z(inode);
+ super =3D I2S(inode);
+
+ if (super->block_size < PAGE_SIZE)
+ return -EINVAL;
+
+ cursor =3D vma->vm_pgoff << super->block_shift;
+ todo =3D vma->vm_end - vma->vm_start;
+
+ if (cursor + todo > i_size_read(inode))
+ return -EINVAL;
+
+ page_prot =3D pgprot_val(vma->vm_page_prot);
+#ifdef CONFIG_PPC
+ page_prot |=3D (_PAGE_NO_CACHE | _PAGE_RW);
+ page_prot &=3D ~_PAGE_GUARDED;
+#else
+#warning You need to set in pgprot the PAGE_* flags specific to you archit=
ecture
+#endif
+ vma->vm_page_prot =3D __pgprot(page_prot);
+
+ vm_start =3D vma->vm_start;
+ for (size =3D todo; todo; todo -=3D size, size =3D todo) {
+ pin =3D azfs_block_find(inode, cursor, &size);
+ if (!size)
+ return -EAGAIN;
+ pin +=3D super->ph_addr;
+ pin >>=3D PAGE_SHIFT;
+ if (remap_pfn_range(vma, vm_start, pin, size, vma->vm_page_prot))
+ return -EAGAIN;
+
+ vm_start +=3D size;
+ cursor +=3D size;
+ }
+
+ return 0;
+}
+
+/**
+ * azfs_truncate - truncate() method for inode_operations
+ * @inode: see inode_operations methods
+ */
+static void
+azfs_truncate(struct inode *inode)
+{
+ struct azfs_super *super;
+ struct azfs_znode *znode;
+ struct azfs_block *block, *tmp_block, *temp, *west, *east;
+ unsigned long id, count;
+ signed long delta;
+
+ super =3D I2S(inode);
+ znode =3D I2Z(inode);
+
+ delta =3D i_size_read(inode) + (super->block_size - 1);
+ delta >>=3D super->block_shift;
+ delta -=3D inode->i_blocks;
+
+ if (delta =3D=3D 0) {
+ znode->size =3D i_size_read(inode);
+ return;
+ }
+
+ write_lock(&znode->lock);
+
+ while (delta > 0) {
+ west =3D east =3D NULL;
+
+ write_lock(&super->lock);
+
+ if (list_empty(&super->block_list)) {
+ write_unlock(&super->lock);
+ break;
+ }
+
+ for (count =3D delta; count; count--) {
+ for_each_block(block, &super->block_list)
+ if (block->count >=3D count) {
+ east =3D block;
+ break;
+ }
+ if (east)
+ break;
+ }
+
+ for_each_block_reverse(block, &znode->block_list) {
+ if (block->id + block->count =3D=3D east->id)
+ west =3D block;
+ break;
+ }
+
+ if (east->count =3D=3D count) {
+ if (west) {
+ west->count +=3D east->count;
+ azfs_block_free(east);
+ } else {
+ azfs_block_move(east, &znode->block_list);
+ }
+ } else {
+ if (west) {
+ west->count +=3D count;
+ } else {
+ if (!azfs_block_init(&znode->block_list,
+ east->id, count)) {
+ write_unlock(&super->lock);
+ break;
+ }
+ }
+
+ east->id +=3D count;
+ east->count -=3D count;
+ }
+
+ write_unlock(&super->lock);
+
+ inode->i_blocks +=3D count;
+
+ delta -=3D count;
+ }
+
+ while (delta < 0) {
+ for_each_block_safe_reverse(block, tmp_block, &znode->block_list) {
+ id =3D block->id;
+ count =3D block->count;
+ if ((signed long) count + delta > 0) {
+ block->count +=3D delta;
+ id +=3D block->count;
+ count -=3D block->count;
+ block =3D NULL;
+ }
+
+ west =3D east =3D NULL;
+
+ write_lock(&super->lock);
+
+ for_each_block(temp, &super->block_list) {
+ if (!west && (temp->id + temp->count =3D=3D id))
+ west =3D temp;
+ else if (!east && (id + count =3D=3D temp->id))
+ east =3D temp;
+ if (west && east)
+ break;
+ }
+
+ if (west && east) {
+ west->count +=3D count + east->count;
+ azfs_block_free(east);
+ if (block)
+ azfs_block_free(block);
+ } else if (west) {
+ west->count +=3D count;
+ if (block)
+ azfs_block_free(block);
+ } else if (east) {
+ east->id -=3D count;
+ east->count +=3D count;
+ if (block)
+ azfs_block_free(block);
+ } else {
+ if (!block) {
+ if (!azfs_block_init(&super->block_list,
+ id, count)) {
+ write_unlock(&super->lock);
+ break;
+ }
+ } else {
+ azfs_block_move(block, &super->block_list);
+ }
+ }
+
+ write_unlock(&super->lock);
+
+ inode->i_blocks -=3D count;
+
+ delta +=3D count;
+
+ break;
+ }
+ }
+
+ write_unlock(&znode->lock);
+
+ znode->size =3D min(i_size_read(inode),
+ (loff_t) inode->i_blocks << super->block_shift);
+}
+
+/**
+ * azfs_getattr - getattr() method for inode_operations
+ * @mnt, @dentry, @stat: see inode_operations methods
+ */
+static int
+azfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *st=
at)
+{
+ struct azfs_super *super;
+ struct inode *inode;
+ unsigned short shift;
+
+ inode =3D dentry->d_inode;
+ super =3D I2S(inode);
+
+ generic_fillattr(inode, stat);
+ stat->blocks =3D inode->i_blocks;
+ shift =3D super->block_shift - super->sector_shift;
+ if (shift)
+ stat->blocks <<=3D shift;
+
+ return 0;
+}
+
+static const struct address_space_operations azfs_aops =3D {
+ .write_begin =3D simple_write_begin,
+ .write_end =3D simple_write_end
+};
+
+static struct backing_dev_info azfs_bdi =3D {
+ .ra_pages =3D 0,
+ .capabilities =3D AZFS_BDI_CAPABILITIES
+};
+
+static struct inode_operations azfs_dir_iops =3D {
+ .create =3D azfs_create,
+ .lookup =3D simple_lookup,
+ .link =3D simple_link,
+ .unlink =3D simple_unlink,
+ .symlink =3D azfs_symlink,
+ .mkdir =3D azfs_mkdir,
+ .rmdir =3D simple_rmdir,
+ .mknod =3D azfs_mknod,
+ .rename =3D simple_rename
+};
+
+static const struct file_operations azfs_reg_fops =3D {
+ .llseek =3D generic_file_llseek,
+ .aio_read =3D azfs_aio_read,
+ .aio_write =3D azfs_aio_write,
+ .open =3D azfs_open,
+ .mmap =3D azfs_mmap,
+ .fsync =3D simple_sync_file,
+};
+
+static struct inode_operations azfs_reg_iops =3D {
+ .truncate =3D azfs_truncate,
+ .getattr =3D azfs_getattr
+};
+
+/**
+ * azfs_new_inode - cook a new inode
+ * @sb: super-block
+ * @dir: parent directory
+ * @mode: file mode
+ * @dev: to be forwarded to init_special_inode()
+ */
+static struct inode*
+azfs_new_inode(struct super_block *sb, struct inode *dir, int mode, dev_t =
dev)
+{
+ struct azfs_super *super;
+ struct inode *inode;
+
+ inode =3D new_inode(sb);
+ if (!inode)
+ return NULL;
+
+ inode->i_atime =3D inode->i_mtime =3D inode->i_ctime =3D CURRENT_TIME;
+
+ inode->i_mode =3D mode;
+ if (dir) {
+ dir->i_mtime =3D dir->i_ctime =3D inode->i_mtime;
+ inode->i_uid =3D current->fsuid;
+ if (dir->i_mode & S_ISGID) {
+ if (S_ISDIR(mode))
+ inode->i_mode |=3D S_ISGID;
+ inode->i_gid =3D dir->i_gid;
+ } else {
+ inode->i_gid =3D current->fsgid;
+ }
+ } else {
+ super =3D sb->s_fs_info;
+ inode->i_uid =3D super->uid;
+ inode->i_gid =3D super->gid;
+ }
+
+ inode->i_blocks =3D 0;
+ inode->i_mapping->a_ops =3D &azfs_aops;
+ inode->i_mapping->backing_dev_info =3D &azfs_bdi;
+
+ switch (mode & S_IFMT) {
+ case S_IFDIR:
+ inode->i_op =3D &azfs_dir_iops;
+ inode->i_fop =3D &simple_dir_operations;
+ inc_nlink(inode);
+ break;
+
+ case S_IFREG:
+ inode->i_op =3D &azfs_reg_iops;
+ inode->i_fop =3D &azfs_reg_fops;
+ break;
+
+ case S_IFLNK:
+ inode->i_op =3D &page_symlink_inode_operations;
+ break;
+
+ default:
+ init_special_inode(inode, mode, dev);
+ break;
+ }
+
+ return inode;
+}
+
+/**
+ * azfs_alloc_inode - alloc_inode() method for super_operations
+ * @sb: see super_operations methods
+ */
+static struct inode*
+azfs_alloc_inode(struct super_block *sb)
+{
+ struct azfs_znode *znode;
+
+ znode =3D kmem_cache_alloc(azfs_znode_cache, GFP_KERNEL);
+ if (znode) {
+ INIT_LIST_HEAD(&znode->block_list);
+ rwlock_init(&znode->lock);
+
+ inode_init_once(&znode->vfs_inode);
+
+ return &znode->vfs_inode;
+ }
+
+ return NULL;
+}
+
+/**
+ * azfs_destroy_inode - destroy_inode() method for super_operations
+ * @inode: see super_operations methods
+ */
+static void
+azfs_destroy_inode(struct inode *inode)
+{
+ kmem_cache_free(azfs_znode_cache, I2Z(inode));
+}
+
+/**
+ * azfs_delete_inode - delete_inode() method for super_operations
+ * @inode: see super_operations methods
+ */
+static void
+azfs_delete_inode(struct inode *inode)
+{
+ if (S_ISREG(inode->i_mode)) {
+ i_size_write(inode, 0);
+ azfs_truncate(inode);
+ }
+ truncate_inode_pages(&inode->i_data, 0);
+ clear_inode(inode);
+}
+
+/**
+ * azfs_statfs - statfs() method for super_operations
+ * @dentry, @stat: see super_operations methods
+ */
+static int
+azfs_statfs(struct dentry *dentry, struct kstatfs *stat)
+{
+ struct super_block *sb;
+ struct azfs_super *super;
+ struct inode *inode;
+ unsigned long inodes, blocks;
+
+ sb =3D dentry->d_sb;
+ super =3D sb->s_fs_info;
+
+ inodes =3D blocks =3D 0;
+ mutex_lock(&sb->s_lock);
+ list_for_each_entry(inode, &sb->s_inodes, i_sb_list) {
+ inodes++;
+ blocks +=3D inode->i_blocks;
+ }
+ mutex_unlock(&sb->s_lock);
+
+ stat->f_type =3D AZFS_SUPERBLOCK_MAGIC;
+ stat->f_bsize =3D super->block_size;
+ stat->f_blocks =3D super->media_size >> super->block_shift;
+ stat->f_bfree =3D stat->f_blocks - blocks;
+ stat->f_bavail =3D stat->f_blocks - blocks;
+ stat->f_files =3D inodes + blocks;
+ stat->f_ffree =3D blocks + 1;
+ stat->f_namelen =3D NAME_MAX;
+
+ return 0;
+}
+
+static struct super_operations azfs_ops =3D {
+ .alloc_inode =3D azfs_alloc_inode,
+ .destroy_inode =3D azfs_destroy_inode,
+ .drop_inode =3D generic_delete_inode,
+ .delete_inode =3D azfs_delete_inode,
+ .statfs =3D azfs_statfs
+};
+
+enum {
+ Opt_blocksize_short,
+ Opt_blocksize_long,
+ Opt_uid,
+ Opt_gid,
+ Opt_err
+};
+
+static match_table_t tokens =3D {
+ {Opt_blocksize_short, "bs=3D%u"},
+ {Opt_blocksize_long, "blocksize=3D%u"},
+ {Opt_uid, "uid=3D%u"},
+ {Opt_gid, "gid=3D%u"},
+ {Opt_err, NULL}
+};
+
+/**
+ * azfs_parse_mount_parameters - parse options given to mount with -o
+ * @super: azfs super block extension
+ * @options: comma separated options
+ */
+static int
+azfs_parse_mount_parameters(struct azfs_super *super, char *options)
+{
+ char *option;
+ int token, value;
+ substring_t args[MAX_OPT_ARGS];
+
+ if (!options)
+ return 1;
+
+ while ((option =3D strsep(&options, ",")) !=3D NULL) {
+ if (!*option)
+ continue;
+
+ token =3D match_token(option, tokens, args);
+ switch (token) {
+ case Opt_blocksize_short:
+ case Opt_blocksize_long:
+ if (match_int(&args[0], &value))
+ goto syntax_error;
+ super->block_size =3D value;
+ break;
+
+ case Opt_uid:
+ if (match_int(&args[0], &value))
+ goto syntax_error;
+ super->uid =3D value;
+ break;
+
+ case Opt_gid:
+ if (match_int(&args[0], &value))
+ goto syntax_error;
+ super->gid =3D value;
+ break;
+
+ default:
+ goto syntax_error;
+ }
+ }
+
+ return 1;
+
+syntax_error:
+ printk(KERN_ERR "%s: invalid mount option\n",
+ AZFS_FILESYSTEM_NAME);
+
+ return 0;
+}
+
+/**
+ * azfs_fill_super - fill_super routine for get_sb
+ * @sb, @data, @silent: see file_system_type methods
+ */
+static int
+azfs_fill_super(struct super_block *sb, void *data, int silent)
+{
+ struct gendisk *disk;
+ struct azfs_super *super =3D NULL, *tmp_super;
+ struct azfs_block *block =3D NULL;
+ struct inode *inode =3D NULL;
+ void *kaddr;
+ unsigned long pfn;
+ int rc;
+
+ BUG_ON(!sb->s_bdev);
+
+ disk =3D sb->s_bdev->bd_disk;
+
+ BUG_ON(!disk || !disk->queue);
+
+ if (!disk->fops->direct_access) {
+ printk(KERN_ERR "%s needs a block device with a "
+ "direct_access() method\n",
+ AZFS_FILESYSTEM_NAME);
+ return -ENOSYS;
+ }
+
+ get_device(disk->driverfs_dev);
+
+ sb->s_magic =3D AZFS_SUPERBLOCK_MAGIC;
+ sb->s_flags =3D AZFS_SUPERBLOCK_FLAGS;
+ sb->s_op =3D &azfs_ops;
+ sb->s_maxbytes =3D get_capacity(disk) * disk->queue->hardsect_size;
+ sb->s_time_gran =3D 1;
+
+ spin_lock(&super_list.lock);
+ list_for_each_entry(tmp_super, &super_list.head, list)
+ if (tmp_super->blkdev =3D=3D sb->s_bdev) {
+ super =3D tmp_super;
+ break;
+ }
+ spin_unlock(&super_list.lock);
+
+ if (super) {
+ if (data && strlen((char*) data))
+ printk(KERN_WARNING "/dev/%s was already mounted with "
+ "%s before, it will be mounted with "
+ "mount options used last time, "
+ "options just given would be ignored\n",
+ disk->disk_name, AZFS_FILESYSTEM_NAME);
+ sb->s_fs_info =3D super;
+ } else {
+ super =3D kzalloc(sizeof(struct azfs_super), GFP_KERNEL);
+ if (!super) {
+ rc =3D -ENOMEM;
+ goto failed;
+ }
+ sb->s_fs_info =3D super;
+
+ if (!azfs_parse_mount_parameters(super, (char*) data)) {
+ rc =3D -EINVAL;
+ goto failed;
+ }
+
+ inode =3D azfs_new_inode(sb, NULL, S_IFDIR | S_IRWXUGO, 0);
+ if (!inode) {
+ rc =3D -ENOMEM;
+ goto failed;
+ }
+
+ super->root =3D d_alloc_root(inode);
+ if (!super->root) {
+ rc =3D -ENOMEM;
+ goto failed;
+ }
+ dget(super->root);
+
+ INIT_LIST_HEAD(&super->list);
+ INIT_LIST_HEAD(&super->block_list);
+ rwlock_init(&super->lock);
+
+ super->media_size =3D sb->s_maxbytes;
+
+ if (!super->block_size)
+ super->block_size =3D sb->s_blocksize;
+ super->block_shift =3D blksize_bits(super->block_size);
+
+ super->sector_size =3D disk->queue->hardsect_size;
+ super->sector_shift =3D blksize_bits(super->sector_size);
+
+ super->blkdev =3D sb->s_bdev;
+
+ block =3D azfs_block_init(&super->block_list,
+ 0, super->media_size >> super->block_shift);
+ if (!block) {
+ rc =3D -ENOMEM;
+ goto failed;
+ }
+
+ rc =3D disk->fops->direct_access(super->blkdev, 0, &kaddr, &pfn);
+ if (rc < 0) {
+ rc =3D -EFAULT;
+ goto failed;
+ }
+ super->ph_addr =3D (unsigned long) kaddr;
+
+ super->io_addr =3D (unsigned long) ioremap_flags(
+ super->ph_addr, super->media_size, _PAGE_NO_CACHE);
+ if (!super->io_addr) {
+ rc =3D -EFAULT;
+ goto failed;
+ }
+
+ spin_lock(&super_list.lock);
+ list_add(&super->list, &super_list.head);
+ spin_unlock(&super_list.lock);
+ }
+
+ sb->s_root =3D super->root;
+ disk->driverfs_dev->driver_data =3D super;
+ disk->driverfs_dev->platform_data =3D sb;
+
+ if (super->block_size < PAGE_SIZE)
+ printk(KERN_INFO "Block size on %s is smaller then system "
+ "page size: mmap() would not be supported\n",
+ disk->disk_name);
+
+ return 0;
+
+failed:
+ if (super) {
+ sb->s_root =3D NULL;
+ sb->s_fs_info =3D NULL;
+ if (block)
+ azfs_block_free(block);
+ if (super->root)
+ dput(super->root);
+ if (inode)
+ iput(inode);
+ disk->driverfs_dev->driver_data =3D NULL;
+ kfree(super);
+ disk->driverfs_dev->platform_data =3D NULL;
+ put_device(disk->driverfs_dev);
+ }
+
+ return rc;
+}
+
+/**
+ * azfs_get_sb - get_sb() method for file_system_type
+ * @fs_type, @flags, @dev_name, @data, @mount: see file_system_type methods
+ */
+static int
+azfs_get_sb(struct file_system_type *fs_type, int flags,
+ const char *dev_name, void *data, struct vfsmount *mount)
+{
+ return get_sb_bdev(fs_type, flags,
+ dev_name, data, azfs_fill_super, mount);
+}
+
+/**
+ * azfs_kill_sb - kill_sb() method for file_system_type
+ * @sb: see file_system_type methods
+ */
+static void
+azfs_kill_sb(struct super_block *sb)
+{
+ sb->s_root =3D NULL;
+ kill_block_super(sb);
+}
+
+static struct file_system_type azfs_fs =3D {
+ .owner =3D THIS_MODULE,
+ .name =3D AZFS_FILESYSTEM_NAME,
+ .get_sb =3D azfs_get_sb,
+ .kill_sb =3D azfs_kill_sb,
+ .fs_flags =3D AZFS_FILESYSTEM_FLAGS
+};
+
+/**
+ * azfs_init
+ */
+static int __init
+azfs_init(void)
+{
+ int rc;
+
+ INIT_LIST_HEAD(&super_list.head);
+ spin_lock_init(&super_list.lock);
+
+ azfs_znode_cache =3D kmem_cache_create("azfs_znode_cache",
+ sizeof(struct azfs_znode), 0, AZFS_CACHE_FLAGS, NULL);
+ if (!azfs_znode_cache) {
+ printk(KERN_ERR "Could not allocate inode cache for %s\n",
+ AZFS_FILESYSTEM_NAME);
+ rc =3D -ENOMEM;
+ goto failed;
+ }
+
+ azfs_block_cache =3D kmem_cache_create("azfs_block_cache",
+ sizeof(struct azfs_block), 0, AZFS_CACHE_FLAGS, NULL);
+ if (!azfs_block_cache) {
+ printk(KERN_ERR "Could not allocate block cache for %s\n",
+ AZFS_FILESYSTEM_NAME);
+ rc =3D -ENOMEM;
+ goto failed;
+ }
+
+ rc =3D register_filesystem(&azfs_fs);
+ if (rc !=3D 0) {
+ printk(KERN_ERR "Could not register %s\n",
+ AZFS_FILESYSTEM_NAME);
+ goto failed;
+ }
+
+ return 0;
+
+failed:
+ if (azfs_block_cache)
+ kmem_cache_destroy(azfs_block_cache);
+
+ if (azfs_znode_cache)
+ kmem_cache_destroy(azfs_znode_cache);
+
+ return rc;
+}
+
+/**
+ * azfs_exit
+ */
+static void __exit
+azfs_exit(void)
+{
+ struct azfs_super *super, *tmp_super;
+ struct azfs_block *block, *tmp_block;
+ struct gendisk *disk;
+
+ spin_lock(&super_list.lock);
+ list_for_each_entry_safe(super, tmp_super, &super_list.head, list) {
+ disk =3D super->blkdev->bd_disk;
+ list_del(&super->list);
+ iounmap((void*) super->io_addr);
+ write_lock(&super->lock);
+ for_each_block_safe(block, tmp_block, &super->block_list)
+ azfs_block_free(block);
+ write_unlock(&super->lock);
+ disk->driverfs_dev->driver_data =3D NULL;
+ disk->driverfs_dev->platform_data =3D NULL;
+ kfree(super);
+ put_device(disk->driverfs_dev);
+ }
+ spin_unlock(&super_list.lock);
+
+ unregister_filesystem(&azfs_fs);
+
+ kmem_cache_destroy(azfs_block_cache);
+ kmem_cache_destroy(azfs_znode_cache);
+}
+
+module_init(azfs_init);
+module_exit(azfs_exit);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Maxim Shchetynin <maxim@de.ibm.com>");
+MODULE_DESCRIPTION("Non-buffered file system for IO devices");
--=20
Mit freundlichen Gr=C3=BC=C3=9Fen / met vriendelijke groeten / avec regards
Maxim V. Shchetynin
Linux Kernel Entwicklung
IBM Deutschland Entwicklung GmbH
Linux f=C3=BCr Cell, Abteilung 3250
Sch=C3=B6naicher Stra=C3=9Fe 220
71032 B=C3=B6blingen
Vorsitzender des Aufsichtsrats: Johann Weihen
Gesch=C3=A4ftsf=C3=BChrung: Herbert Kircher
Sitz der Gesellschaft: B=C3=B6blingen
Registriergericht: Amtsgericht Stuttgart, HRB 243294
Fahr nur so schnell wie dein Schutzengel fliegen kann!
^ permalink raw reply
* Re: [PATCH 1/2] elf loader support for auxvec base platform string
From: Nathan Lynch @ 2008-07-07 15:55 UTC (permalink / raw)
To: Mikael Pettersson
Cc: Benjamin, linux-kernel, linuxppc-dev, Paul Mackerras,
Roland McGrath
In-Reply-To: <18541.35978.437115.957054@harpo.it.uu.se>
Mikael Pettersson wrote:
> Nathan Lynch writes:
> > Some IBM POWER-based platforms have the ability to run in a
> > mode which mostly appears to the OS as a different processor from the
> > actual hardware. For example, a Power6 system may appear to be a
> > Power5+, which makes the AT_PLATFORM value "power5+".
> >
> > However, some applications (virtual machines, optimized libraries) can
> > benefit from knowledge of the underlying CPU model. A new aux vector
> > entry, AT_BASE_PLATFORM, will denote the actual hardware. For
> > example, on a Power6 system in Power5+ compatibility mode, AT_PLATFORM
> > will be "power5+" and AT_BASE_PLATFORM will be "power6".
>
> Why on earth would you ever want AT_PLATFORM to differ from AT_BASE_PLATFORM?
> In cases that matter you admit that AT_BASE_PLATFORM takes precedence,
> so why involve a fake lame not-quite-the-platform in the first place?
>
> Workaround for buggy software?
My apologies, I did not explain the motivation well.
The idea is that while AT_PLATFORM indicates the instruction set
supported, AT_BASE_PLATFORM indicates the underlying
microarchitecture. It's not a matter of buggy software, or of one
value taking precedence over the other.
^ permalink raw reply
* Re: [PATCH 1/2] elf loader support for auxvec base platform string
From: Nathan Lynch @ 2008-07-07 16:16 UTC (permalink / raw)
To: Roland McGrath; +Cc: Paul Mackerras, linux-kernel, linuxppc-dev
In-Reply-To: <20080707061811.19989154246@magilla.localdomain>
Roland McGrath wrote:
> > Well, we use strings to represent the platforms already (ie, the actual
> > CPU microarchitecture). Fitting those into bits would be annoying, it
>
> Then use dsocaps.
>
> > makes sense to have AT_BASE_PLATFORM to be the "base" variant of
> > AT_PLATFORM.
>
> I understand why you think so. But let's not be too abstract. The
> purpose of the addition is to drive ld.so's selection of libraries, yes?
That is one purpose. But there are others (JVMs, performance tools).
dsocaps seems to be an ld.so-specific thing... or am I missing how a
"third-party" program would use it?
^ permalink raw reply
* [PATCH] legacy-serial: more meaningful names, terminate array
From: Paul Gortmaker @ 2008-07-07 15:05 UTC (permalink / raw)
To: linuxppc-dev; +Cc: scottwood, arnd, Paul Gortmaker
In-Reply-To: <1215412426.8970.97.camel@pasglop>
Terminate the array of possible legacy serial parents, and
choose more meaningful names for better autopsy value. Fix
and cleanups as suggested by Benjamin Herrenschmidt.
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
arch/powerpc/kernel/ibmebus.c | 4 ++--
arch/powerpc/kernel/legacy_serial.c | 5 +++--
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/kernel/ibmebus.c b/arch/powerpc/kernel/ibmebus.c
index 9971159..58da8f8 100644
--- a/arch/powerpc/kernel/ibmebus.c
+++ b/arch/powerpc/kernel/ibmebus.c
@@ -53,7 +53,7 @@ static struct device ibmebus_bus_device = { /* fake "parent" device */
struct bus_type ibmebus_bus_type;
/* These devices will automatically be added to the bus during init */
-static struct of_device_id __initdata builtin_matches[] = {
+static struct of_device_id __initdata ibmebus_matches[] = {
{ .compatible = "IBM,lhca" },
{ .compatible = "IBM,lhea" },
{},
@@ -350,7 +350,7 @@ static int __init ibmebus_bus_init(void)
return err;
}
- err = ibmebus_create_devices(builtin_matches);
+ err = ibmebus_create_devices(ibmebus_matches);
if (err) {
device_unregister(&ibmebus_bus_device);
bus_unregister(&ibmebus_bus_type);
diff --git a/arch/powerpc/kernel/legacy_serial.c b/arch/powerpc/kernel/legacy_serial.c
index 61dd174..4b01c2b 100644
--- a/arch/powerpc/kernel/legacy_serial.c
+++ b/arch/powerpc/kernel/legacy_serial.c
@@ -33,13 +33,14 @@ static struct legacy_serial_info {
phys_addr_t taddr;
} legacy_serial_infos[MAX_LEGACY_SERIAL_PORTS];
-static struct __initdata of_device_id parents[] = {
+static struct __initdata of_device_id uart_match[] = {
{.type = "soc",},
{.type = "tsi-bridge",},
{.type = "opb", },
{.compatible = "ibm,opb",},
{.compatible = "simple-bus",},
{.compatible = "wrs,epld-localbus",},
+ {},
};
static unsigned int legacy_serial_count;
@@ -322,7 +323,7 @@ void __init find_legacy_serial_ports(void)
struct device_node *parent = of_get_parent(np);
if (!parent)
continue;
- if (of_match_node(parents, parent) != NULL) {
+ if (of_match_node(uart_match, parent) != NULL) {
index = add_legacy_soc_port(np, np);
if (index >= 0 && np == stdout)
legacy_serial_console = index;
--
1.5.6.6.gd3e97
^ permalink raw reply related
* Re: linux-next: kbuild tree build failure
From: Roman Zippel @ 2008-07-07 16:13 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: Paul Mackerras, linux-next, Sam Ravnborg, linuxppc-dev
In-Reply-To: <20080707184038.aaeb8d40.sfr@canb.auug.org.au>
Hi,
On Mon, 7 Jul 2008, Stephen Rothwell wrote:
> Hi Sam,
>
> Today's linux-next build (powerpc ppc64_defconfig) failed like this:
>
> arch/powerpc/platforms/cell/spu_base.c: In function '__spu_trap_data_seg':
> arch/powerpc/platforms/cell/spu_base.c:194: error: duplicate case value
> arch/powerpc/platforms/cell/spu_base.c:177: error: previously used here
I guess there also has been a kconfig warning somewhere. :)
I should have gone through all archs to test this, sorry about that.
Luckily it's only powerpc that uses 64bit values. I would prefer to
standardize on 32bit values, as it doesn't really make sense to expect
from the user to input full 64bit values and it's easy to generate the
full value in a header. This would also ease on any portability issues
(kconfig is compiled with the host compiler not the target compiler).
Below is a patch that fixes this for all archs (generated against the git
tree). The powerpc parts need a more careful review, the rest isn't really
critical.
bye, Roman
Fix remaining warnings generated kconfig to normalize all constant values.
Generate powerpc 64bit page offset via header instead of kconfig.
Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
---
arch/arm/Kconfig | 4 ++--
arch/arm/Kconfig-nommu | 10 +++++-----
arch/arm/mm/Kconfig | 4 ++--
arch/blackfin/Kconfig | 12 ++++++------
arch/blackfin/mach-bf548/Kconfig | 8 ++++----
arch/cris/arch-v10/Kconfig | 26 +++++++++++++-------------
arch/cris/arch-v10/drivers/Kconfig | 14 +++++++-------
arch/cris/arch-v32/Kconfig | 28 ++++++++++++++--------------
arch/cris/arch-v32/drivers/Kconfig | 30 ++++++++++++------------------
arch/cris/arch-v32/mach-a3/Kconfig | 14 +++++++-------
arch/cris/arch-v32/mach-fs/Kconfig | 32 ++++++++++++++++----------------
arch/frv/Kconfig | 4 ++--
arch/m32r/Kconfig | 36 ++++++++++++++++++------------------
arch/powerpc/Kconfig | 16 ++++++----------
arch/ppc/Kconfig | 8 ++++----
arch/sh/Kconfig | 10 +++++-----
arch/sh/Kconfig.debug | 2 +-
arch/sh/mm/Kconfig | 6 +++---
include/asm-powerpc/page.h | 10 ++++++++--
19 files changed, 135 insertions(+), 139 deletions(-)
Index: linux-2.6/arch/arm/Kconfig
===================================================================
--- linux-2.6.orig/arch/arm/Kconfig
+++ linux-2.6/arch/arm/Kconfig
@@ -168,7 +168,7 @@ config VECTORS_BASE
hex
default 0xffff0000 if MMU || CPU_HIGH_VECTOR
default DRAM_BASE if REMAP_VECTORS_TO_RAM
- default 0x00000000
+ default 0
help
The base address of exception vectors.
@@ -924,7 +924,7 @@ config XIP_KERNEL
config XIP_PHYS_ADDR
hex "XIP Kernel Physical Location"
depends on XIP_KERNEL
- default "0x00080000"
+ default "0x80000"
help
This is the physical address in your flash memory the kernel will
be linked for and stored to. This address is dependent on your
Index: linux-2.6/arch/arm/Kconfig-nommu
===================================================================
--- linux-2.6.orig/arch/arm/Kconfig-nommu
+++ linux-2.6/arch/arm/Kconfig-nommu
@@ -11,23 +11,23 @@ config SET_MEM_PARAM
config DRAM_BASE
hex '(S)DRAM Base Address' if SET_MEM_PARAM
- default 0x00800000
+ default 0x800000
config DRAM_SIZE
hex '(S)DRAM SIZE' if SET_MEM_PARAM
- default 0x00800000
+ default 0x800000
config FLASH_MEM_BASE
hex 'FLASH Base Address' if SET_MEM_PARAM
- default 0x00400000
+ default 0x400000
config FLASH_SIZE
hex 'FLASH Size' if SET_MEM_PARAM
- default 0x00400000
+ default 0x400000
config PROCESSOR_ID
hex 'Hard wire the processor ID'
- default 0x00007700
+ default 0x7700
depends on !CPU_CP15
help
If processor has no CP15 register, this processor ID is
Index: linux-2.6/arch/arm/mm/Kconfig
===================================================================
--- linux-2.6.orig/arch/arm/mm/Kconfig
+++ linux-2.6/arch/arm/mm/Kconfig
@@ -649,8 +649,8 @@ config CPU_DCACHE_DISABLE
config CPU_DCACHE_SIZE
hex
depends on CPU_ARM740T || CPU_ARM946E
- default 0x00001000 if CPU_ARM740T
- default 0x00002000 # default size for ARM946E-S
+ default 0x1000 if CPU_ARM740T
+ default 0x2000 # default size for ARM946E-S
help
Some cores are synthesizable to have various sized cache. For
ARM946E-S case, it can vary from 0KB to 1MB.
Index: linux-2.6/arch/blackfin/Kconfig
===================================================================
--- linux-2.6.orig/arch/blackfin/Kconfig
+++ linux-2.6/arch/blackfin/Kconfig
@@ -819,20 +819,20 @@ endmenu
menu "EBIU_AMBCTL Control"
config BANK_0
hex "Bank 0"
- default 0x7BB0
+ default 0x7bb0
config BANK_1
hex "Bank 1"
- default 0x7BB0
+ default 0x7bb0
default 0x5558 if BF54x
config BANK_2
hex "Bank 2"
- default 0x7BB0
+ default 0x7bb0
config BANK_3
hex "Bank 3"
- default 0x99B3
+ default 0x99b3
endmenu
config EBIU_MBSCTLVAL
@@ -843,12 +843,12 @@ config EBIU_MBSCTLVAL
config EBIU_MODEVAL
hex "Flash Memory Mode Control Register"
depends on BF54x
- default 1
+ default 0x1
config EBIU_FCTLVAL
hex "Flash Memory Bank Control Register"
depends on BF54x
- default 6
+ default 0x6
endmenu
#############################################################################
Index: linux-2.6/arch/blackfin/mach-bf548/Kconfig
===================================================================
--- linux-2.6.orig/arch/blackfin/mach-bf548/Kconfig
+++ linux-2.6/arch/blackfin/mach-bf548/Kconfig
@@ -304,19 +304,19 @@ config PINTx_REASSIGN
config PINT0_ASSIGN
hex "PINT0_ASSIGN"
depends on PINTx_REASSIGN
- default 0x00000101
+ default 0x101
config PINT1_ASSIGN
hex "PINT1_ASSIGN"
depends on PINTx_REASSIGN
- default 0x01010000
+ default 0x1010000
config PINT2_ASSIGN
hex "PINT2_ASSIGN"
depends on PINTx_REASSIGN
- default 0x07000101
+ default 0x7000101
config PINT3_ASSIGN
hex "PINT3_ASSIGN"
depends on PINTx_REASSIGN
- default 0x02020303
+ default 0x2020303
endmenu
Index: linux-2.6/arch/cris/arch-v10/Kconfig
===================================================================
--- linux-2.6.orig/arch/cris/arch-v10/Kconfig
+++ linux-2.6/arch/cris/arch-v10/Kconfig
@@ -11,8 +11,8 @@ config CRIS_LOW_MAP
config ETRAX_DRAM_VIRTUAL_BASE
hex
depends on ETRAX_ARCH_V10
- default "c0000000" if !ETRAX100LX
- default "60000000" if ETRAX100LX
+ default "0xc0000000" if !ETRAX100LX
+ default "0x60000000" if ETRAX100LX
choice
prompt "Product LED port"
@@ -262,7 +262,7 @@ endchoice
config ETRAX_DEF_R_WAITSTATES
hex "R_WAITSTATES"
depends on ETRAX_ARCH_V10
- default "95a6"
+ default "0x95a6"
help
Waitstates for SRAM, Flash and peripherals (not DRAM). 95f8 is a
good choice for most Axis products...
@@ -270,7 +270,7 @@ config ETRAX_DEF_R_WAITSTATES
config ETRAX_DEF_R_BUS_CONFIG
hex "R_BUS_CONFIG"
depends on ETRAX_ARCH_V10
- default "104"
+ default "0x104"
help
Assorted bits controlling write mode, DMA burst length etc. 104 is
a good choice for most Axis products...
@@ -285,7 +285,7 @@ config ETRAX_SDRAM
config ETRAX_DEF_R_DRAM_CONFIG
hex "R_DRAM_CONFIG"
depends on ETRAX_ARCH_V10 && !ETRAX_SDRAM
- default "1a200040"
+ default "0x1a200040"
help
The R_DRAM_CONFIG register specifies everything on how the DRAM
chips in the system are connected to the ETRAX CPU. This is
@@ -296,7 +296,7 @@ config ETRAX_DEF_R_DRAM_CONFIG
config ETRAX_DEF_R_DRAM_TIMING
hex "R_DRAM_TIMING"
depends on ETRAX_ARCH_V10 && !ETRAX_SDRAM
- default "5611"
+ default "0x5611"
help
Different DRAM chips have different speeds. Current Axis products
use 50ns DRAM chips which can use the timing: 5611.
@@ -304,7 +304,7 @@ config ETRAX_DEF_R_DRAM_TIMING
config ETRAX_DEF_R_SDRAM_CONFIG
hex "R_SDRAM_CONFIG"
depends on ETRAX_ARCH_V10 && ETRAX_SDRAM
- default "d2fa7878"
+ default "0xd2fa7878"
help
The R_SDRAM_CONFIG register specifies everything on how the SDRAM
chips in the system are connected to the ETRAX CPU. This is
@@ -315,14 +315,14 @@ config ETRAX_DEF_R_SDRAM_CONFIG
config ETRAX_DEF_R_SDRAM_TIMING
hex "R_SDRAM_TIMING"
depends on ETRAX_ARCH_V10 && ETRAX_SDRAM
- default "80004801"
+ default "0x80004801"
help
Different SDRAM chips have different timing.
config ETRAX_DEF_R_PORT_PA_DIR
hex "R_PORT_PA_DIR"
depends on ETRAX_ARCH_V10
- default "1c"
+ default "0x1c"
help
Configures the direction of general port A bits. 1 is out, 0 is in.
This is often totally different depending on the product used.
@@ -336,7 +336,7 @@ config ETRAX_DEF_R_PORT_PA_DIR
config ETRAX_DEF_R_PORT_PA_DATA
hex "R_PORT_PA_DATA"
depends on ETRAX_ARCH_V10
- default "00"
+ default "0"
help
Configures the initial data for the general port A bits. Most
products should use 00 here.
@@ -344,7 +344,7 @@ config ETRAX_DEF_R_PORT_PA_DATA
config ETRAX_DEF_R_PORT_PB_CONFIG
hex "R_PORT_PB_CONFIG"
depends on ETRAX_ARCH_V10
- default "00"
+ default "0"
help
Configures the type of the general port B bits. 1 is chip select,
0 is port. Most products should use 00 here.
@@ -352,7 +352,7 @@ config ETRAX_DEF_R_PORT_PB_CONFIG
config ETRAX_DEF_R_PORT_PB_DIR
hex "R_PORT_PB_DIR"
depends on ETRAX_ARCH_V10
- default "00"
+ default "0"
help
Configures the direction of general port B bits. 1 is out, 0 is in.
This is often totally different depending on the product used. Bits
@@ -365,7 +365,7 @@ config ETRAX_DEF_R_PORT_PB_DIR
config ETRAX_DEF_R_PORT_PB_DATA
hex "R_PORT_PB_DATA"
depends on ETRAX_ARCH_V10
- default "ff"
+ default "0xff"
help
Configures the initial data for the general port A bits. Most
products should use FF here.
Index: linux-2.6/arch/cris/arch-v10/drivers/Kconfig
===================================================================
--- linux-2.6.orig/arch/cris/arch-v10/drivers/Kconfig
+++ linux-2.6/arch/cris/arch-v10/drivers/Kconfig
@@ -531,20 +531,20 @@ config ETRAX_GPIO
config ETRAX_PA_BUTTON_BITMASK
hex "PA-buttons bitmask"
depends on ETRAX_GPIO
- default "02"
+ default "0x2"
help
This is a bitmask with information about what bits on PA that
are used for buttons.
Most products has a so called TEST button on PA1, if that's true
- use 02 here.
- Use 00 if there are no buttons on PA.
+ use 0x2 here.
+ Use 0x0 if there are no buttons on PA.
If the bitmask is <> 00 a button driver will be included in the gpio
driver. ETRAX general I/O support must be enabled.
config ETRAX_PA_CHANGEABLE_DIR
hex "PA user changeable dir mask"
depends on ETRAX_GPIO
- default "00"
+ default "0"
help
This is a bitmask with information of what bits in PA that a user
can change direction on using ioctl's.
@@ -554,7 +554,7 @@ config ETRAX_PA_CHANGEABLE_DIR
config ETRAX_PA_CHANGEABLE_BITS
hex "PA user changeable bits mask"
depends on ETRAX_GPIO
- default "FF"
+ default "0xff"
help
This is a bitmask with information of what bits in PA that a user
can change the value on using ioctl's.
@@ -564,7 +564,7 @@ config ETRAX_PA_CHANGEABLE_BITS
config ETRAX_PB_CHANGEABLE_DIR
hex "PB user changeable dir mask"
depends on ETRAX_GPIO
- default "00"
+ default "0"
help
This is a bitmask with information of what bits in PB that a user
can change direction on using ioctl's.
@@ -574,7 +574,7 @@ config ETRAX_PB_CHANGEABLE_DIR
config ETRAX_PB_CHANGEABLE_BITS
hex "PB user changeable bits mask"
depends on ETRAX_GPIO
- default "FF"
+ default "0xff"
help
This is a bitmask with information of what bits in PB that a user
can change the value on using ioctl's.
Index: linux-2.6/arch/cris/arch-v32/Kconfig
===================================================================
--- linux-2.6.orig/arch/cris/arch-v32/Kconfig
+++ linux-2.6/arch/cris/arch-v32/Kconfig
@@ -8,7 +8,7 @@ source drivers/cpufreq/Kconfig
config ETRAX_DRAM_VIRTUAL_BASE
hex
depends on ETRAX_ARCH_V32
- default "c0000000"
+ default "0xc0000000"
choice
prompt "Nbr of Ethernet LED groups"
@@ -119,7 +119,7 @@ endchoice
config ETRAX_MEM_GRP1_CONFIG
hex "MEM_GRP1_CONFIG"
depends on ETRAX_ARCH_V32
- default "4044a"
+ default "0x4044a"
help
Waitstates for flash. The default value is suitable for the
standard flashes used in axis products (120 ns).
@@ -150,7 +150,7 @@ config ETRAX_MEM_GRP4_CONFIG
config ETRAX_SDRAM_GRP0_CONFIG
hex "SDRAM_GRP0_CONFIG"
depends on ETRAX_ARCH_V32
- default "336"
+ default "0x336"
help
SDRAM configuration for group 0. The value depends on the
hardware configuration. The default value is suitable
@@ -170,7 +170,7 @@ config ETRAX_SDRAM_GRP1_CONFIG
config ETRAX_SDRAM_TIMING
hex "SDRAM_TIMING"
depends on ETRAX_ARCH_V32
- default "104a"
+ default "0x104a"
help
SDRAM timing parameters. The default value is ok for
most hardwares but large SDRAMs may require a faster
@@ -189,7 +189,7 @@ config ETRAX_SDRAM_COMMAND
config ETRAX_DEF_GIO_PA_OE
hex "GIO_PA_OE"
depends on ETRAX_ARCH_V32
- default "1c"
+ default "0x1c"
help
Configures the direction of general port A bits. 1 is out, 0 is in.
This is often totally different depending on the product used.
@@ -203,7 +203,7 @@ config ETRAX_DEF_GIO_PA_OE
config ETRAX_DEF_GIO_PA_OUT
hex "GIO_PA_OUT"
depends on ETRAX_ARCH_V32
- default "00"
+ default "0"
help
Configures the initial data for the general port A bits. Most
products should use 00 here.
@@ -211,7 +211,7 @@ config ETRAX_DEF_GIO_PA_OUT
config ETRAX_DEF_GIO_PB_OE
hex "GIO_PB_OE"
depends on ETRAX_ARCH_V32
- default "00000"
+ default "0"
help
Configures the direction of general port B bits. 1 is out, 0 is in.
This is often totally different depending on the product used.
@@ -225,7 +225,7 @@ config ETRAX_DEF_GIO_PB_OE
config ETRAX_DEF_GIO_PB_OUT
hex "GIO_PB_OUT"
depends on ETRAX_ARCH_V32
- default "00000"
+ default "0"
help
Configures the initial data for the general port B bits. Most
products should use 00000 here.
@@ -233,7 +233,7 @@ config ETRAX_DEF_GIO_PB_OUT
config ETRAX_DEF_GIO_PC_OE
hex "GIO_PC_OE"
depends on ETRAX_ARCH_V32
- default "00000"
+ default "0"
help
Configures the direction of general port C bits. 1 is out, 0 is in.
This is often totally different depending on the product used.
@@ -247,7 +247,7 @@ config ETRAX_DEF_GIO_PC_OE
config ETRAX_DEF_GIO_PC_OUT
hex "GIO_PC_OUT"
depends on ETRAX_ARCH_V32
- default "00000"
+ default "0"
help
Configures the initial data for the general port C bits. Most
products should use 00000 here.
@@ -255,7 +255,7 @@ config ETRAX_DEF_GIO_PC_OUT
config ETRAX_DEF_GIO_PD_OE
hex "GIO_PD_OE"
depends on ETRAX_ARCH_V32
- default "00000"
+ default "0"
help
Configures the direction of general port D bits. 1 is out, 0 is in.
This is often totally different depending on the product used.
@@ -269,7 +269,7 @@ config ETRAX_DEF_GIO_PD_OE
config ETRAX_DEF_GIO_PD_OUT
hex "GIO_PD_OUT"
depends on ETRAX_ARCH_V32
- default "00000"
+ default "0"
help
Configures the initial data for the general port D bits. Most
products should use 00000 here.
@@ -277,7 +277,7 @@ config ETRAX_DEF_GIO_PD_OUT
config ETRAX_DEF_GIO_PE_OE
hex "GIO_PE_OE"
depends on ETRAX_ARCH_V32
- default "00000"
+ default "0"
help
Configures the direction of general port E bits. 1 is out, 0 is in.
This is often totally different depending on the product used.
@@ -291,7 +291,7 @@ config ETRAX_DEF_GIO_PE_OE
config ETRAX_DEF_GIO_PE_OUT
hex "GIO_PE_OUT"
depends on ETRAX_ARCH_V32
- default "00000"
+ default "0"
help
Configures the initial data for the general port E bits. Most
products should use 00000 here.
Index: linux-2.6/arch/cris/arch-v32/drivers/Kconfig
===================================================================
--- linux-2.6.orig/arch/cris/arch-v32/drivers/Kconfig
+++ linux-2.6/arch/cris/arch-v32/drivers/Kconfig
@@ -513,8 +513,7 @@ config ETRAX_VIRTUAL_GPIO_INTERRUPT_PA_P
config ETRAX_PA_CHANGEABLE_DIR
hex "PA user changeable dir mask"
depends on ETRAX_GPIO
- default "0x00" if ETRAXFS
- default "0x00000000" if !ETRAXFS
+ default "0"
help
This is a bitmask (8 bits) with information of what bits in PA that a
user can change direction on using ioctl's.
@@ -524,8 +523,7 @@ config ETRAX_PA_CHANGEABLE_DIR
config ETRAX_PA_CHANGEABLE_BITS
hex "PA user changeable bits mask"
depends on ETRAX_GPIO
- default "0x00" if ETRAXFS
- default "0x00000000" if !ETRAXFS
+ default "0"
help
This is a bitmask (8 bits) with information of what bits in PA
that a user can change the value on using ioctl's.
@@ -534,8 +532,7 @@ config ETRAX_PA_CHANGEABLE_BITS
config ETRAX_PB_CHANGEABLE_DIR
hex "PB user changeable dir mask"
depends on ETRAX_GPIO
- default "0x00000" if ETRAXFS
- default "0x00000000" if !ETRAXFS
+ default "0"
help
This is a bitmask (18 bits) with information of what bits in PB
that a user can change direction on using ioctl's.
@@ -545,8 +542,7 @@ config ETRAX_PB_CHANGEABLE_DIR
config ETRAX_PB_CHANGEABLE_BITS
hex "PB user changeable bits mask"
depends on ETRAX_GPIO
- default "0x00000" if ETRAXFS
- default "0x00000000" if !ETRAXFS
+ default "0"
help
This is a bitmask (18 bits) with information of what bits in PB
that a user can change the value on using ioctl's.
@@ -555,8 +551,7 @@ config ETRAX_PB_CHANGEABLE_BITS
config ETRAX_PC_CHANGEABLE_DIR
hex "PC user changeable dir mask"
depends on ETRAX_GPIO
- default "0x00000" if ETRAXFS
- default "0x00000000" if !ETRAXFS
+ default "0"
help
This is a bitmask (18 bits) with information of what bits in PC
that a user can change direction on using ioctl's.
@@ -566,8 +561,7 @@ config ETRAX_PC_CHANGEABLE_DIR
config ETRAX_PC_CHANGEABLE_BITS
hex "PC user changeable bits mask"
depends on ETRAX_GPIO
- default "0x00000" if ETRAXFS
- default "0x00000000" if ETRAXFS
+ default "0"
help
This is a bitmask (18 bits) with information of what bits in PC
that a user can change the value on using ioctl's.
@@ -576,7 +570,7 @@ config ETRAX_PC_CHANGEABLE_BITS
config ETRAX_PD_CHANGEABLE_DIR
hex "PD user changeable dir mask"
depends on ETRAX_GPIO && ETRAXFS
- default "0x00000"
+ default "0"
help
This is a bitmask (18 bits) with information of what bits in PD
that a user can change direction on using ioctl's.
@@ -586,7 +580,7 @@ config ETRAX_PD_CHANGEABLE_DIR
config ETRAX_PD_CHANGEABLE_BITS
hex "PD user changeable bits mask"
depends on ETRAX_GPIO && ETRAXFS
- default "0x00000"
+ default "0"
help
This is a bitmask (18 bits) with information of what bits in PD
that a user can change the value on using ioctl's.
@@ -595,7 +589,7 @@ config ETRAX_PD_CHANGEABLE_BITS
config ETRAX_PE_CHANGEABLE_DIR
hex "PE user changeable dir mask"
depends on ETRAX_GPIO && ETRAXFS
- default "0x00000"
+ default "0"
help
This is a bitmask (18 bits) with information of what bits in PE
that a user can change direction on using ioctl's.
@@ -605,7 +599,7 @@ config ETRAX_PE_CHANGEABLE_DIR
config ETRAX_PE_CHANGEABLE_BITS
hex "PE user changeable bits mask"
depends on ETRAX_GPIO && ETRAXFS
- default "0x00000"
+ default "0"
help
This is a bitmask (18 bits) with information of what bits in PE
that a user can change the value on using ioctl's.
@@ -614,7 +608,7 @@ config ETRAX_PE_CHANGEABLE_BITS
config ETRAX_PV_CHANGEABLE_DIR
hex "PV user changeable dir mask"
depends on ETRAX_VIRTUAL_GPIO
- default "0x0000"
+ default "0"
help
This is a bitmask (16 bits) with information of what bits in PV
that a user can change direction on using ioctl's.
@@ -624,7 +618,7 @@ config ETRAX_PV_CHANGEABLE_DIR
config ETRAX_PV_CHANGEABLE_BITS
hex "PV user changeable bits mask"
depends on ETRAX_VIRTUAL_GPIO
- default "0x0000"
+ default "0"
help
This is a bitmask (16 bits) with information of what bits in PV
that a user can change the value on using ioctl's.
Index: linux-2.6/arch/cris/arch-v32/mach-a3/Kconfig
===================================================================
--- linux-2.6.orig/arch/cris/arch-v32/mach-a3/Kconfig
+++ linux-2.6/arch/cris/arch-v32/mach-a3/Kconfig
@@ -5,7 +5,7 @@ menu "Artpec-3 options"
config ETRAX_DRAM_VIRTUAL_BASE
hex
- default "c0000000"
+ default "0xc0000000"
config ETRAX_L2CACHE
bool
@@ -47,7 +47,7 @@ config ETRAX_PIO_CE2_CFG
config ETRAX_DEF_GIO_PA_OE
hex "GIO_PA_OE"
- default "00000000"
+ default "0"
help
Configures the direction of general port A bits. 1 is out, 0 is in.
This is often totally different depending on the product used.
@@ -60,14 +60,14 @@ config ETRAX_DEF_GIO_PA_OE
config ETRAX_DEF_GIO_PA_OUT
hex "GIO_PA_OUT"
- default "00000000"
+ default "0"
help
Configures the initial data for the general port A bits. Most
products should use 00 here.
config ETRAX_DEF_GIO_PB_OE
hex "GIO_PB_OE"
- default "000000000"
+ default "0"
help
Configures the direction of general port B bits. 1 is out, 0 is in.
This is often totally different depending on the product used.
@@ -80,14 +80,14 @@ config ETRAX_DEF_GIO_PB_OE
config ETRAX_DEF_GIO_PB_OUT
hex "GIO_PB_OUT"
- default "000000000"
+ default "0"
help
Configures the initial data for the general port B bits. Most
products should use 00000 here.
config ETRAX_DEF_GIO_PC_OE
hex "GIO_PC_OE"
- default "00000"
+ default "0"
help
Configures the direction of general port C bits. 1 is out, 0 is in.
This is often totally different depending on the product used.
@@ -100,7 +100,7 @@ config ETRAX_DEF_GIO_PC_OE
config ETRAX_DEF_GIO_PC_OUT
hex "GIO_PC_OUT"
- default "00000"
+ default "0"
help
Configures the initial data for the general port C bits. Most
products should use 00000 here.
Index: linux-2.6/arch/cris/arch-v32/mach-fs/Kconfig
===================================================================
--- linux-2.6.orig/arch/cris/arch-v32/mach-fs/Kconfig
+++ linux-2.6/arch/cris/arch-v32/mach-fs/Kconfig
@@ -6,7 +6,7 @@ menu "ETRAX FS options"
config ETRAX_DRAM_VIRTUAL_BASE
hex
depends on ETRAX_ARCH_V32
- default "c0000000"
+ default "0xc0000000"
config ETRAX_SERIAL_PORTS
int
@@ -15,7 +15,7 @@ config ETRAX_SERIAL_PORTS
config ETRAX_MEM_GRP1_CONFIG
hex "MEM_GRP1_CONFIG"
depends on ETRAX_ARCH_V32
- default "4044a"
+ default "0x4044a"
help
Waitstates for flash. The default value is suitable for the
standard flashes used in axis products (120 ns).
@@ -46,7 +46,7 @@ config ETRAX_MEM_GRP4_CONFIG
config ETRAX_SDRAM_GRP0_CONFIG
hex "SDRAM_GRP0_CONFIG"
depends on ETRAX_ARCH_V32
- default "336"
+ default "0x336"
help
SDRAM configuration for group 0. The value depends on the
hardware configuration. The default value is suitable
@@ -66,7 +66,7 @@ config ETRAX_SDRAM_GRP1_CONFIG
config ETRAX_SDRAM_TIMING
hex "SDRAM_TIMING"
depends on ETRAX_ARCH_V32
- default "104a"
+ default "0x104a"
help
SDRAM timing parameters. The default value is ok for
most hardwares but large SDRAMs may require a faster
@@ -85,7 +85,7 @@ config ETRAX_SDRAM_COMMAND
config ETRAX_DEF_GIO_PA_OE
hex "GIO_PA_OE"
depends on ETRAX_ARCH_V32
- default "1c"
+ default "0x1c"
help
Configures the direction of general port A bits. 1 is out, 0 is in.
This is often totally different depending on the product used.
@@ -99,7 +99,7 @@ config ETRAX_DEF_GIO_PA_OE
config ETRAX_DEF_GIO_PA_OUT
hex "GIO_PA_OUT"
depends on ETRAX_ARCH_V32
- default "00"
+ default "0"
help
Configures the initial data for the general port A bits. Most
products should use 00 here.
@@ -107,7 +107,7 @@ config ETRAX_DEF_GIO_PA_OUT
config ETRAX_DEF_GIO_PB_OE
hex "GIO_PB_OE"
depends on ETRAX_ARCH_V32
- default "00000"
+ default "0"
help
Configures the direction of general port B bits. 1 is out, 0 is in.
This is often totally different depending on the product used.
@@ -121,7 +121,7 @@ config ETRAX_DEF_GIO_PB_OE
config ETRAX_DEF_GIO_PB_OUT
hex "GIO_PB_OUT"
depends on ETRAX_ARCH_V32
- default "00000"
+ default "0"
help
Configures the initial data for the general port B bits. Most
products should use 00000 here.
@@ -129,7 +129,7 @@ config ETRAX_DEF_GIO_PB_OUT
config ETRAX_DEF_GIO_PC_OE
hex "GIO_PC_OE"
depends on ETRAX_ARCH_V32
- default "00000"
+ default "0"
help
Configures the direction of general port C bits. 1 is out, 0 is in.
This is often totally different depending on the product used.
@@ -143,7 +143,7 @@ config ETRAX_DEF_GIO_PC_OE
config ETRAX_DEF_GIO_PC_OUT
hex "GIO_PC_OUT"
depends on ETRAX_ARCH_V32
- default "00000"
+ default "0"
help
Configures the initial data for the general port C bits. Most
products should use 00000 here.
@@ -151,7 +151,7 @@ config ETRAX_DEF_GIO_PC_OUT
config ETRAX_DEF_GIO_PD_OE
hex "GIO_PD_OE"
depends on ETRAX_ARCH_V32
- default "00000"
+ default "0"
help
Configures the direction of general port D bits. 1 is out, 0 is in.
This is often totally different depending on the product used.
@@ -165,7 +165,7 @@ config ETRAX_DEF_GIO_PD_OE
config ETRAX_DEF_GIO_PD_OUT
hex "GIO_PD_OUT"
depends on ETRAX_ARCH_V32
- default "00000"
+ default "0"
help
Configures the initial data for the general port D bits. Most
products should use 00000 here.
@@ -173,7 +173,7 @@ config ETRAX_DEF_GIO_PD_OUT
config ETRAX_DEF_GIO_PE_OE
hex "GIO_PE_OE"
depends on ETRAX_ARCH_V32
- default "00000"
+ default "0"
help
Configures the direction of general port E bits. 1 is out, 0 is in.
This is often totally different depending on the product used.
@@ -187,7 +187,7 @@ config ETRAX_DEF_GIO_PE_OE
config ETRAX_DEF_GIO_PE_OUT
hex "GIO_PE_OUT"
depends on ETRAX_ARCH_V32
- default "00000"
+ default "0"
help
Configures the initial data for the general port E bits. Most
products should use 00000 here.
@@ -195,7 +195,7 @@ config ETRAX_DEF_GIO_PE_OUT
config ETRAX_DEF_GIO_PV_OE
hex "GIO_PV_OE"
depends on ETRAX_VIRTUAL_GPIO
- default "0000"
+ default "0"
help
Configures the direction of virtual general port V bits. 1 is out,
0 is in. This is often totally different depending on the product
@@ -206,7 +206,7 @@ config ETRAX_DEF_GIO_PV_OE
config ETRAX_DEF_GIO_PV_OUT
hex "GIO_PV_OUT"
depends on ETRAX_VIRTUAL_GPIO
- default "0000"
+ default "0"
help
Configures the initial data for the virtual general port V bits.
Most products should use 0000 here.
Index: linux-2.6/arch/frv/Kconfig
===================================================================
--- linux-2.6.orig/arch/frv/Kconfig
+++ linux-2.6/arch/frv/Kconfig
@@ -149,8 +149,8 @@ config PAGE_OFFSET
default 0x40000000 if UCPAGE_OFFSET_40000000
default 0x60000000 if UCPAGE_OFFSET_60000000
default 0x80000000 if UCPAGE_OFFSET_80000000
- default 0xA0000000 if UCPAGE_OFFSET_A0000000
- default 0xC0000000
+ default 0xa0000000 if UCPAGE_OFFSET_A0000000
+ default 0xc0000000
config PROTECT_KERNEL
bool "Protect core kernel against userspace"
Index: linux-2.6/arch/m32r/Kconfig
===================================================================
--- linux-2.6.orig/arch/m32r/Kconfig
+++ linux-2.6/arch/m32r/Kconfig
@@ -199,22 +199,22 @@ config CPU_LITTLE_ENDIAN
config MEMORY_START
hex "Physical memory start address (hex)"
- default "08000000" if PLAT_MAPPI || PLAT_MAPPI2 || PLAT_MAPPI3
- default "08000000" if PLAT_USRV
- default "08000000" if PLAT_M32700UT
- default "08000000" if PLAT_OPSPUT
- default "04000000" if PLAT_M32104UT
- default "01000000" if PLAT_OAKS32R
+ default "0x8000000" if PLAT_MAPPI || PLAT_MAPPI2 || PLAT_MAPPI3
+ default "0x8000000" if PLAT_USRV
+ default "0x8000000" if PLAT_M32700UT
+ default "0x8000000" if PLAT_OPSPUT
+ default "0x4000000" if PLAT_M32104UT
+ default "0x1000000" if PLAT_OAKS32R
config MEMORY_SIZE
hex "Physical memory size (hex)"
- default "08000000" if PLAT_MAPPI3
- default "04000000" if PLAT_MAPPI || PLAT_MAPPI2
- default "02000000" if PLAT_USRV
- default "01000000" if PLAT_M32700UT
- default "01000000" if PLAT_OPSPUT
- default "01000000" if PLAT_M32104UT
- default "00800000" if PLAT_OAKS32R
+ default "0x8000000" if PLAT_MAPPI3
+ default "0x4000000" if PLAT_MAPPI || PLAT_MAPPI2
+ default "0x2000000" if PLAT_USRV
+ default "0x1000000" if PLAT_M32700UT
+ default "0x1000000" if PLAT_OPSPUT
+ default "0x1000000" if PLAT_M32104UT
+ default "0x800000" if PLAT_OAKS32R
config NOHIGHMEM
bool
@@ -229,16 +229,16 @@ source "mm/Kconfig"
config IRAM_START
hex "Internal memory start address (hex)"
- default "00f00000" if !CHIP_M32104
- default "00700000" if CHIP_M32104
+ default "0xf00000" if !CHIP_M32104
+ default "0x700000" if CHIP_M32104
depends on (CHIP_M32700 || CHIP_M32102 || CHIP_VDEC2 || CHIP_OPSP || CHIP_M32104) && DISCONTIGMEM
config IRAM_SIZE
hex "Internal memory size (hex)"
depends on (CHIP_M32700 || CHIP_M32102 || CHIP_VDEC2 || CHIP_OPSP || CHIP_M32104) && DISCONTIGMEM
- default "00080000" if CHIP_M32700
- default "00010000" if CHIP_M32102 || CHIP_OPSP || CHIP_M32104
- default "00008000" if CHIP_VDEC2
+ default "0x80000" if CHIP_M32700
+ default "0x10000" if CHIP_M32102 || CHIP_OPSP || CHIP_M32104
+ default "0x8000" if CHIP_VDEC2
#
# Define implied options from the CPU selection here
Index: linux-2.6/arch/powerpc/Kconfig
===================================================================
--- linux-2.6.orig/arch/powerpc/Kconfig
+++ linux-2.6/arch/powerpc/Kconfig
@@ -714,8 +714,8 @@ config PHYSICAL_START_BOOL
config PHYSICAL_START
hex "Physical address where the kernel is loaded" if PHYSICAL_START_BOOL
- default "0x02000000" if PPC_STD_MMU && CRASH_DUMP
- default "0x00000000"
+ default "0x2000000" if PPC_STD_MMU && CRASH_DUMP
+ default "0"
config PHYSICAL_ALIGN
hex
@@ -763,7 +763,7 @@ config CONSISTENT_SIZE_BOOL
config CONSISTENT_SIZE
hex "Size of consistent memory pool" if CONSISTENT_SIZE_BOOL
- default "0x00200000" if NOT_COHERENT_CACHE
+ default "0x200000" if NOT_COHERENT_CACHE
config PIN_TLB
bool "Pinned Kernel TLBs (860 ONLY)"
@@ -773,15 +773,11 @@ endmenu
if PPC64
config PAGE_OFFSET
hex
- default "0xc000000000000000"
-config KERNEL_START
- hex
- default "0xc000000002000000" if CRASH_DUMP
- default "0xc000000000000000"
+ default "0xc0000000"
config PHYSICAL_START
hex
- default "0x02000000" if CRASH_DUMP
- default "0x00000000"
+ default "0x2000000" if CRASH_DUMP
+ default "0"
endif
source "net/Kconfig"
Index: linux-2.6/arch/ppc/Kconfig
===================================================================
--- linux-2.6.orig/arch/ppc/Kconfig
+++ linux-2.6/arch/ppc/Kconfig
@@ -1120,7 +1120,7 @@ config CONSISTENT_SIZE_BOOL
config CONSISTENT_SIZE
hex "Size of consistent memory pool" if CONSISTENT_SIZE_BOOL
- default "0x00200000" if NOT_COHERENT_CACHE
+ default "0x200000" if NOT_COHERENT_CACHE
config BOOT_LOAD_BOOL
bool "Set the boot link/load address"
@@ -1134,9 +1134,9 @@ config BOOT_LOAD_BOOL
config BOOT_LOAD
hex "Link/load address for booting" if BOOT_LOAD_BOOL
- default "0x00400000" if 40x || 8xx || 8260
- default "0x01000000" if 44x
- default "0x00800000"
+ default "0x400000" if 40x || 8xx || 8260
+ default "0x1000000" if 44x
+ default "0x800000"
config PIN_TLB
bool "Pinned Kernel TLBs (860 ONLY)"
Index: linux-2.6/arch/sh/Kconfig
===================================================================
--- linux-2.6.orig/arch/sh/Kconfig
+++ linux-2.6/arch/sh/Kconfig
@@ -753,16 +753,16 @@ menu "Boot options"
config ZERO_PAGE_OFFSET
hex "Zero page offset"
- default "0x00004000" if SH_SH03
- default "0x00010000" if PAGE_SIZE_64KB
- default "0x00002000" if PAGE_SIZE_8KB
- default "0x00001000"
+ default "0x4000" if SH_SH03
+ default "0x10000" if PAGE_SIZE_64KB
+ default "0x2000" if PAGE_SIZE_8KB
+ default "0x1000"
help
This sets the default offset of zero page.
config BOOT_LINK_OFFSET
hex "Link address offset for booting"
- default "0x00800000"
+ default "0x800000"
help
This option allows you to set the link address offset of the zImage.
This can be useful if you are on a board which has a small amount of
Index: linux-2.6/arch/sh/Kconfig.debug
===================================================================
--- linux-2.6.orig/arch/sh/Kconfig.debug
+++ linux-2.6/arch/sh/Kconfig.debug
@@ -41,7 +41,7 @@ config EARLY_SCIF_CONSOLE_PORT
default "0xffea0000" if CPU_SUBTYPE_SH7785
default "0xfffe8000" if CPU_SUBTYPE_SH7203
default "0xfffe9800" if CPU_SUBTYPE_SH7206 || CPU_SUBTYPE_SH7263
- default "0x00000000"
+ default "0"
config EARLY_PRINTK
bool "Early printk support"
Index: linux-2.6/arch/sh/mm/Kconfig
===================================================================
--- linux-2.6.orig/arch/sh/mm/Kconfig
+++ linux-2.6/arch/sh/mm/Kconfig
@@ -19,11 +19,11 @@ config PAGE_OFFSET
hex
default "0x80000000" if MMU && SUPERH32
default "0x20000000" if MMU && SUPERH64
- default "0x00000000"
+ default "0"
config MEMORY_START
hex "Physical memory start address"
- default "0x08000000"
+ default "0x8000000"
---help---
Computers built with Hitachi SuperH processors always
map the ROM starting at address zero. But the processor
@@ -39,7 +39,7 @@ config MEMORY_START
config MEMORY_SIZE
hex "Physical memory size"
- default "0x04000000"
+ default "0x4000000"
help
This sets the default memory size assumed by your SH kernel. It can
be overridden as normal by the 'mem=' argument on the kernel command
Index: linux-2.6/include/asm-powerpc/page.h
===================================================================
--- linux-2.6.orig/include/asm-powerpc/page.h
+++ linux-2.6/include/asm-powerpc/page.h
@@ -67,9 +67,15 @@
* If you want to test if something's a kernel address, use is_kernel_addr().
*/
-#define KERNELBASE ASM_CONST(CONFIG_KERNEL_START)
+#ifdef CONFIG_PPC64
+#define PAGE_OFFSET (ASM_CONST(CONFIG_PAGE_OFFSET) << 32)
+#define KERNELBASE (PAGE_OFFSET+ASM_CONST(CONFIG_PHYSICAL_START))
+#define LOAD_OFFSET PAGE_OFFSET
+#else
+#define KERNELBASE ASM_CONST(CONFIG_KERNEL_START)
#define PAGE_OFFSET ASM_CONST(CONFIG_PAGE_OFFSET)
-#define LOAD_OFFSET ASM_CONST((CONFIG_KERNEL_START-CONFIG_PHYSICAL_START))
+#define LOAD_OFFSET (ASM_CONST(CONFIG_KERNEL_START)-ASM_CONST(CONFIG_PHYSICAL_START))
+#endif
#if defined(CONFIG_RELOCATABLE) && defined(CONFIG_FLATMEM)
#ifndef __ASSEMBLY__
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox