* RE: [PATCH] Fix rounding bug in emulation for double floatoperating
From: Liu Yu @ 2007-12-11 1:38 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev, David Gibson
In-Reply-To: <AD0028E8-E305-443F-8872-C935D4E18F80@kernel.crashing.org>
> -----Original Message-----
> From: Kumar Gala [mailto:galak@kernel.crashing.org]=20
> Sent: Monday, December 10, 2007 11:01 PM
> To: Liu Yu
> Cc: David Gibson; linuxppc-dev@ozlabs.org
> Subject: Re: [PATCH] Fix rounding bug in emulation for double=20
> floatoperating
>=20
>=20
> On Dec 9, 2007, at 11:25 PM, Liu Yu wrote:
> >> -----Original Message-----
> >> From: David Gibson [mailto:david@gibson.dropbear.id.au]
> >> Sent: Monday, December 10, 2007 12:56 PM
> >> To: Liu Yu
> >> Cc: linuxppc-dev@ozlabs.org
> >> Subject: Re: [PATCH] Fix rounding bug in emulation for double=20
> >> floatoperating
> >>
> >>
> >> On Mon, Dec 10, 2007 at 01:00:52PM +0800, Liu Yu wrote:
> >>>
> >>> This patch fixes rounding bug in emulation for double float
> >> operating on PowerPC platform.
> >>>
> >>> When pack double float operand, it need to truncate the
> >> tail due to the limited precision.
> >>> If the truncated part is not zero, the last bit of work bit
> >> (totally 3 bits) need to '|' 1.
> >>>
> >>> This patch is completed in _FP_FRAC_SRS_2(X,N,sz)
> >> (arch/powerpc/math-emu/op-2.h).
> >>> Originally the code leftwards rotates the operand to just=20
> keep the=20
> >>> truncated part, then check whether it is zero. However, the
> >> number it
> >>> rotates is not correct when N is not smaller than
> >> _FP_W_TYPE_SIZE, and it will cause the work bit '|' 1 in=20
> the improper=20
> >> case.
> >>>
> >>> This patch fixes this issue.
> >>>
> >>> Signed-off-by: Liu Yu <b13201@freescale.com>
> >>
> >> Wow someone deciphered the hideous macro hell of the math=20
> emulation=20
> >> code enough to fix a bug. I don't suppose you'd care to fix the=20
> >> millions of warnings that the math-emu code generates...?
> >
> > Oh, I don't like macro define either. But it's really a bug...
>=20
>=20
> how did you find this?
Well, when divide the min positive number by 2, you will get the work
bit "101" which is supposed to be "100".
And the wrong result will influent the succedent rounding operation.
In fact, the similar macro _FP_FRAC_SRS_1 and _FP_FRAC_SRS_4 are
correct. This bug just exists in _FP_FRAC_SRS_2.
>=20
> - k
>=20
^ permalink raw reply
* Re: mmap + segfaults on MPC8349E
From: R. Ebersole (VTI - new) @ 2007-12-11 1:53 UTC (permalink / raw)
To: David Hawkins; +Cc: linuxppc-embedded
In-Reply-To: <475B68AE.5000302@ovro.caltech.edu>
David Hawkins wrote:
> Hi,
Hi.
>
> You haven't really provided enough information.
Sorry about that. I grabbed one of the h/w guys to help out.
>
>> We wrote some simple drivers/modules to mmap() FPGA registers to user
>> space.
>> At the moment, for testing, we reserve the upper x-MB of RAM, and
>> mmap() there, instead.
>
>
> 1. The FPGA is located where? The local bus, or the PCI bus?
> What frequency are you trying to operate at?
On the local bus frequency is 33.0 MHz. (66.0 PCI_CLK_IN). See the
attached .cfg script for memory map.
>
>
> 2. If its on the local bus, do you access it using GPCM or UPM?
> Have you setup either correctly?
> Have you confirmed the bus timing with a logic analyzer?
GPCM.
We have confirmed the timing both in functionality (in the debugger) and
with a logic analyzer (plus oscope for setup and hold times).
We have stand-alone C-code that runs in CodeWarrior that bangs away at
the registers of this device and the hardware runs perfectly using the
.cfg script settings..
>
>
> 3. Have you created a bus functional model of the processor bus
> that you have then run with your FPGA bus in ModelSim to
> confirm that your FPGA performs correctly.
Yes, we have. Also, checked in h/w (see 2 above)
>
>
> 4. Have you tried burst and non-burst access by either using
> DMA, or treating the memory area as cacheable or non-cacheable?
> Have you checked those cases with simulation and then
> with a scope or logic analyzer?
Always non-burst at this point.
>
> 5. Did you try running stand-alone tests in U-Boot, to go for a
> more bare-metal debug approach?
I assume the bare-metal debug approach is using a JTAG debugger
connection and CodeWarrior. We started there and now are trying to
access the same device(s) via linux drivers.
>
> No point in debugging software if you have no idea whether the
> hardware behaves. So confirm that you have tested your hardware
> first.
>
> My board design uses the MPC8349EA, I have an Altera Stratix II
> FPGA on the local bus. I use GPCM to access flash on the local
> bus via the FPGA, and UPM to access FPGA registers. I don't
> have boards yet, but I've got a pretty good handle on how the
> interface should work.
>
> Cheers,
> Dave
>
>
>
--
Sometimes I feel like a red shirt in the Star Trek episode of life.
--
This message contains confidential information and is intended only for the
individual named. If you are not the intended recipient you should not
disseminate, distribute or copy this e-mail. Please notify the sender
immediately by e-mail if you have received this e-mail by mistake and delete
this e-mail from your system.
^ permalink raw reply
* Re: mmap + segfaults on MPC8349E
From: David Hawkins @ 2007-12-11 2:16 UTC (permalink / raw)
To: R. Ebersole (VTI - new); +Cc: linuxppc-embedded
In-Reply-To: <475DED86.1040409@valleytech.com>
Hi,
>> You haven't really provided enough information.
>
> Sorry about that. I grabbed one of the h/w guys to help out.
No problem. Just wanted to check the basics had been covered.
Sounds like they have.
> On the local bus frequency is 33.0 MHz. (66.0 PCI_CLK_IN). See the
> attached .cfg script for memory map.
It got dropped by the mailer. Don't sweat it.
>> 2. If its on the local bus, do you access it using GPCM or UPM?
>> Have you setup either correctly?
>> Have you confirmed the bus timing with a logic analyzer?
>
> GPCM.
> We have confirmed the timing both in functionality (in the debugger) and
> with a logic analyzer (plus oscope for setup and hold times).
> We have stand-alone C-code that runs in CodeWarrior that bangs away at
> the registers of this device and the hardware runs perfectly using the
> .cfg script settings..
Great.
>> 3. Have you created a bus functional model of the processor bus
>> that you have then run with your FPGA bus in ModelSim to
>> confirm that your FPGA performs correctly.
>
> Yes, we have. Also, checked in h/w (see 2 above)
Nice :)
>> 4. Have you tried burst and non-burst access by either using
>> DMA, or treating the memory area as cacheable or non-cacheable?
>> Have you checked those cases with simulation and then
>> with a scope or logic analyzer?
>
> Always non-burst at this point.
Are you sure?
When I was playing with the Yosemite board, I was having trouble
with a PCI card due to caching ... here's a code snippet from
the mmap routine of a driver:
/* Flags to stop the processor treating PCI memory as
* cacheable (see asm-ppc/pgtable.h)
*
* (thanks to Travis Sawyer from the ppc-embedded list)
*
* I could have used '#ifdef CONFIG_44x', but 40x uses
* these flags too, as do other processors. So just check
* whether the flag exists.
*
* TODO:
* p425 Rubini; use pgprot_noncached()
*
* asm-ppc/pgtable.h defines it as setting these two flags
*
* So, that appears to be the 'portable' way to do it.
*
* drivers/char/mem.c uses pgprot_noncached()
*/
#ifdef pgprot_noncached
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
#endif
In that particular case, I think I wasn't seeing data transferred
to the bus until a cache flush occurred. Its possible that in your
case a burst is triggered to your hardware.
How does your BFM+simulation react to bus bursts?
Can you probe the bus when you trigger the seg-fault to see
if caching is the problem?
I'm not sure that a bus error can cause a segfault. When I
get my boards, I'll generate bus parity errors to see what
kernel routines it triggers. So, chances are this is not
the source of your error.
>> 5. Did you try running stand-alone tests in U-Boot, to go for a
>> more bare-metal debug approach?
>
> I assume the bare-metal debug approach is using a JTAG debugger
> connection and CodeWarrior. We started there and now are trying to
> access the same device(s) via linux drivers.
Yep, sounds good.
Ok, so assuming you come back with the fact that the seg-fault
occurs without bursting. Lets take a look at your driver code.
Cheers,
Dave
^ permalink raw reply
* Re: [PATCH] Fix rounding bug in emulation for double floatoperating
From: Zang Roy-r61911 @ 2007-12-11 3:19 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev list, Liu Yu, David Gibson
In-Reply-To: <AD0028E8-E305-443F-8872-C935D4E18F80@kernel.crashing.org>
On Mon, 2007-12-10 at 23:00, Kumar Gala wrote:
> On Dec 9, 2007, at 11:25 PM, Liu Yu wrote:
> >
> >> -----Original Message-----
> >> From: David Gibson [mailto:david@gibson.dropbear.id.au]
> >> Sent: Monday, December 10, 2007 12:56 PM
> >> To: Liu Yu
> >> Cc: linuxppc-dev@ozlabs.org
> >> Subject: Re: [PATCH] Fix rounding bug in emulation for double
> >> floatoperating
> >>
> >>
> >> On Mon, Dec 10, 2007 at 01:00:52PM +0800, Liu Yu wrote:
> >>>
> >>> This patch fixes rounding bug in emulation for double float
> >> operating on PowerPC platform.
> >>>
> >>> When pack double float operand, it need to truncate the
> >> tail due to the limited precision.
> >>> If the truncated part is not zero, the last bit of work bit
> >> (totally 3 bits) need to '|' 1.
> >>>
> >>> This patch is completed in _FP_FRAC_SRS_2(X,N,sz)
> >> (arch/powerpc/math-emu/op-2.h).
> >>> Originally the code leftwards rotates the operand to just keep the
> >>> truncated part, then check whether it is zero. However, the
> >> number it
> >>> rotates is not correct when N is not smaller than
> >> _FP_W_TYPE_SIZE, and it will cause the work bit '|' 1 in the
> >> improper case.
> >>>
> >>> This patch fixes this issue.
> >>>
> >>> Signed-off-by: Liu Yu <b13201@freescale.com>
> >>
> >> Wow someone deciphered the hideous macro hell of the math
> >> emulation code enough to fix a bug. I don't suppose you'd
> >> care to fix the millions of warnings that the math-emu code
> >> generates...?
> >
> > Oh, I don't like macro define either. But it's really a bug...
>
>
> how did you find this?
>
It supposed to run the following test case on a powerpc platform.
Yu's patch fixes the issue.
Could you help to merge this patch in your tree?
---
#include <stdio.h>
#include <math.h>
#include <bits/nan.h>
#ifdef __SPE__
#include <spe.h>
int
getSPEFSCR()
{
return __builtin_spe_mfspefscr();
}
void
setSPEFSCR(int i)
{
__builtin_spe_mtspefscr(i);
}
#else
int
getSPEFSCR()
{
return 0;
}
void
setSPEFSCR(int i)
{
}
#endif
void
dmul(double d, double d1, double expected)
{
double d2;
int before, after;
before = getSPEFSCR();
d2 = d * d1;
after = getSPEFSCR();
printf("dmul %llx * %llx = %llx expected %llx %s [0x%x 0x%x]\n", d, d1, d2, expected,
(d2 == expected) ? "(PASS)" : "(FAIL)", before, after);
}
void
ddiv(double d, double d1, double expected)
{
register double d2;
int before, after;
before = getSPEFSCR();
d2 = d / d1;
after = getSPEFSCR();
printf("ddiv %llx / %llx = %llx expected %llx %s [0x%x 0x%x]\n", d, d1, d2, expected,
(d2 == expected) ? "(PASS)" : "(FAIL)", before, after);
}
main()
{
const double min_double = 4.9406564584124654e-324L;
printf("\n");
dmul(0.5L, min_double, 0.0L);
dmul(-0.5L, min_double, 0.0L);
dmul(-min_double, -0.5L, 0.0L);
printf("\n");
ddiv(min_double, 2.0L, 0.0L);
}
^ permalink raw reply
* Help:To Add NAND Node in Device Tree
From: ashish @ 2007-12-11 4:00 UTC (permalink / raw)
To: linuxppc-dev
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="us-ascii", Size: 1515 bytes --]
Hi,
I am trying to add Nand Node in Device Tree, for My Board(Some what
similar to MPC8548_CDS).
In Board, Nand is attached to LBC UPM Controller.
Currently My NAND Driver working Fine without NAND Device Node in
Device Tree.
But as Requirement, I have to add NAND Device Node in Device Tree.
Can you give me some basic out lines to carry out this task?
I know that:
1. I have to make some changes in My NAND Driver to Read Device
Tree.
2. Add NAND Node in Device Tree. But Again What property I need
for It.
Thanks in Advance.
With Best Regards
Ashish Yadav
--
eInfochips Business Disclaimer:
This message may contain confidential, proprietary or legally Privileged
information. In case you are not the original intended Recipient of the
message, you must not, directly or indirectly, use, Disclose,distribute,
print, or copy any part of this message and you are requested to delete
it and inform the sender. Any views expressed in this message are those
of the individual sender unless otherwise stated.Nothing contained in
this message shall be construed as an offer or acceptance of any offer
by eInfochips Limited and/or eInfochips Inc(eInfochips) unless sent
with that express intent and with due authority of eInfochips.EInfochips
has taken enough precautions to prevent the spread of viruses. However
the company accepts no liability for any damage caused by any virus
transmitted by this email.
[-- Attachment #2: Type: text/html, Size: 5354 bytes --]
^ permalink raw reply
* Patches added to for-2.6.25 and master branches of powerpc.git
From: Paul Mackerras @ 2007-12-11 5:29 UTC (permalink / raw)
To: linuxppc-dev
Benjamin Herrenschmidt (7):
[POWERPC] Make isa_mem_base common to 32 and 64 bits
[POWERPC] Merge pci_process_bridge_OF_ranges()
[POWERPC] Fix powerpc 32-bit resource fixup for 64-bit resources
[POWERPC] Change 32-bit PCI message about resource allocation
[POWERPC] Remove useless volatiles in udbg_16550.c
[POWERPC] Add of_translate_dma_address
[POWERPC] Early debug forces console log level to max
Cyrill Gorcunov (1):
[POWERPC] CELLEB: Fix possible NULL pointer dereference
David Gibson (3):
[POWERPC] Merge libfdt upstream source
[POWERPC] Use embedded libfdt in the bootwrapper
[POWERPC] Kill flatdevtree.c
David Woodhouse (4):
[POWERPC] Create otheros.bld next to specified output file, not in $object directory
[POWERPC] Find device-tree source file in default directory
[POWERPC] Allow for bootwrapper utilities being in different directory to objects
[POWERPC] Implement 'make bootwrapper_install'
Ishizaki Kou (3):
[POWERPC] cell: Fix undefined reference to mmio_nvram_init
[POWERPC] celleb: Add support for native CBE
[POWERPC] Update celleb_defconfig to add support for native CBE
Jon Loeliger (2):
[POWERPC] Clean out asm/of_{platform, device}.h
[POWERPC] Clean out asm/of_{platform, device}.h from sysdev/
Michael Ellerman (1):
[POWERPC] Add for_each_child_of_node() helper for iterating over child nodes
Michael Hanselmann (1):
[POWERPC] Update smu command definitions
Michael Neuling (1):
[POWERPC] Use SLB size from the device tree
Nathan Lynch (1):
[POWERPC] lparcfg: Remove useless buffer allocation
Olof Johansson (5):
[POWERPC] pasemi: clean up mdio_gpio a bit
[POWERPC] pasemi: Broaden specific references to 1682M
[POWERPC] pasemi: Don't enter powersaving states from elevated astates
[POWERPC] pasemi: Move cpus to hold loop before restart
[POWERPC] pasemi: Fix module information for gpio-mdio
Stephen Neuendorffer (1):
[POWERPC] Improved documentation of device tree 'ranges'
Stephen Rothwell (27):
[POWERPC] Use of_register_driver to implement of_register_platform_driver
[POWERPC] kernel_execve is identical in 32 and 64 bit
[POWERPC] iommu_free_table doesn't need the device_node
[POWERPC] pSeries: Remove dependency on pci_dn bussubno
[POWERPC] Clean up pci-bridge.h
[POWERPC] Consolidate pci_controller
[POWERPC] iSeries: Move find_Device_Node to avoid a forward declaration
[POWERPC] iSeries: Cleanup PCI retry code a little
[POWERPC] iSeries: DeCamelCase pci.c
[POWERPC] iSeries: Remove some dead code from pci.c
[POWERPC] iSeries: Unindent and clean iSeries_pci_final_fixup
[POWERPC] iSeries: Consoldiate PCI IO error check
[POWERPC] iSeries: Remove one layer of IO routines
[POWERPC] iSeries: Remove pci_dn dependency from iSeries_Device_Information
[POWERPC] iSeries: iseries_ds_addr is only used in pci.c
[POWERPC] iSeries: Reduce dependence on pci_dn bussubno
[POWERPC] iSeries: Make pcibios_final_fixup not depend on pci_dn
[POWERPC] Inline pci_setup_pci_controller as it has become trivial
[POWERPC] iSeries: Call iSeries_pcibios_init from setup_arch
[POWERPC] iSeries: hose->buid is always zero for iSeries
[POWERPC] Remove some iSeries platform checks from the PCI code
[POWERPC] Don't special case pci_domain_nr() for iSeries
[POWERPC] pci_controller->arch_data really is a struct device_node *
[POWERPC] iSeries: DeCamelCase vpdinfo.c
[POWERPC] iSeries: Clean up and simplify vdpinfo.c
[POWERPC] iSeries: Merge vpdinfo.c into pci.c
[POWERPC] EEH: Avoid a possible NULL pointer dereference
will schmidt (1):
[POWERPC] Update xmon slb code
^ permalink raw reply
* Re: [PATCH] IB/ehca: Serialize HCA-related hCalls on POWER5
From: Joachim Fenkes @ 2007-12-11 8:38 UTC (permalink / raw)
To: Roland Dreier
Cc: Arnd Bergmann, OF-EWG, LKML, linuxppc-dev, Christoph Raisch,
Marcus Eder, OF-General, Stefan Roscher
In-Reply-To: <adahciq9q86.fsf@cisco.com>
Roland Dreier <rdreier@cisco.com> wrote on 10.12.2007 22:47:37:
> It's a big problem. If you cannot implement FMRs in such a way that
> you can handling having map_phys_fmr being called in a context that
> can't sleep, then I think the only option is to remove your FMR
> support.
That's kind of what I feared you would say =)
> It's an optional device feature, so this should be OK
> (although the iSER driver currently seems to depend on a device
> supporting FMRs, which is probably going to be a problem with iWARP
> support in the future anyway).
I don't feel very well with removing code from the driver that iSER seems
to depend on. Are there plans to fix this in iSER?
In reality, PHYP rarely ever returns H_LONG_BUSY, and we haven't had any
problems with iSER in the field yet. I admit that our FMR code is
dangerous, but I prefer "dangerous but working for the customer" over "not
working for the customer at all".
Maybe we can agree on keeping the status quo until no more ULPs depend on
FMR, then remove FMR from ehca? If so, we'd also let the _irqsave
spinlocks around hCalls stay in place.
Regards,
Joachim
^ permalink raw reply
* LPC burst accesses
From: Kári Davíðsson @ 2007-12-11 9:46 UTC (permalink / raw)
To: linuxppc-embedded
Hi,
I am in the process of optimizing read accesses to an FPGA in one of our =
custom mpc5200b boards.
I have attempted to do this in two ways, i.e.
1) With the the general SDMA task. Also used by the AC97 audio codec =
driver.
2) Trought the SCLPC fifo offered in relation with the LP bus.
The documentation on freescales site is somehow very vague and even =
though they talk about
read burst accesses they also seem not to be able to guarantee under =
what conditions
burst accesses are generated/not generated. The result that I am seeing =
is that even though=20
that the DMA task and fifo is working as expected (transfering data from =
the FPGA to memory/fifo)
burst reads are _never_ generated (short burst/long burst).
Is there any enlightened soul out there that might shed a litle light on =
this issue or point me into=20
the right direction where I can find more concrete documentation.
I am using linux 2.6.23 as base for these experiments.
rg
kd
^ permalink raw reply
* Re: Patches added to for-2.6.25 and master branches of powerpc.git
From: Balbir Singh @ 2007-12-11 11:58 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev
In-Reply-To: <18270.8249.393061.840667@cargo.ozlabs.ibm.com>
On Dec 11, 2007 10:59 AM, Paul Mackerras <paulus@samba.org> wrote:
[snip]
Hi, Paul,
Any chance we could get in "Fake NUMA nodes patch" at
http://lkml.org/lkml/2007/12/7/294?
Should I get it into -mm first? It was acked by Olof at
http://lkml.org/lkml/2007/12/10/247.
Thanks,
Balbir Singh
^ permalink raw reply
* Linux 2.6 from git.xilinx and XUPV2P
From: greenlean @ 2007-12-11 13:32 UTC (permalink / raw)
To: linuxppc-embedded
Hi all,
I'm a beginner in Xilinx & Linux world and I'm getting a bit loose. I'm
trying to run linux kernel 2.6 that I downloaded from the xilinx git server
on the PPC405 of the Xilinx university program Virtex II Pro (XUPV2P for the
search engine) board, and I'm using the compiler ELDK 4.1 (I' ve just read
this compiler may cause some error so I'll change it, and try the 4.0
version) and I'm getting a lot of compilation error and warning.
I think this is what I should use, Does anybody if I have to patch this
kernel or if it is still prepatched??
My compiler can find some definitions like TASK_SIZE or CONFIG_KERNEL_START,
now I'm solving it writting the values manually , I google for the error
and make the definition where it's needed, but I don't think this is a good
idea ;). I think this definitions should be defined in the .config file,
because I found the values I wrote on a posted message in this list.
Maybe somebody could guide me a bit through this kernel compilation, or send
me .config file running. I don't know if a revision in the project is a good
way, to put things in situation for beginers.
Thanks, any info would be interesting.
--
View this message in context: http://www.nabble.com/Linux-2.6-from-git.xilinx-and-XUPV2P-tp14274035p14274035.html
Sent from the linuxppc-embedded mailing list archive at Nabble.com.
^ permalink raw reply
* Re: LPC burst accesses
From: WITTROCK @ 2007-12-11 13:43 UTC (permalink / raw)
To: linuxppc-embedded
In-Reply-To: <DD39B5C3F4963040ADC9768BE7E430CB027FEAA7@is-hdq-exchange.marel.net>
I remember doing something like this a while back. I ended up not
implementing it in my project for other reasons, but here is some
correspondence I had with Freescale:
The question
---------------------------------------------------------------------
I am using the LocalPlus bus and BestComm on a MPC5200B to communicate with
an external FPGA.
I am currently using CS2 as the chip select for the FPGA. If I configure
the chip select 2 configuration register for a 16bit address width and 2
byte bus width then all works well (MBAR + 0x0308 = 0x00003500).
I am now trying to configure CS2 to operate in LargeFlash mode with 2 byte
bus width and 26bit address (MBAR + 0x0308 = 0x00003D00) in order to support
a burst read. I have configured the Chip Select Burst Control Register
(BRE2=1), and ensured that PCI is disabled, however I do not see a burst
read performed on the bus.
Before I investigate any further, should it be possible to use the LP in
LargeFlash mode together with its assosciated FIFO and BestComm to perform a
burst read?
The Reply
Local Plus controller performs burst read from LargeFlash or MostGraphic
memory only if an XLB master (CPU) or SCLPC interface initiates burst
access.
In the case of CPU, you should enable cache for Local Plus memory.
In the case of SCLPC, you should define BPT=8 in the SCLPC Control Register
(MBAR + 0x3C08).
Other configurations doesn't force bursting.
Thank you for your interest in Freescale Semiconductor products and for the
opportunity to serve you.
Should you need to contact us with regard to this message, please see the
notes below.
I hope its of some use.
-WITTROCK
--
View this message in context: http://www.nabble.com/LPC-burst-accesses-tp14270986p14274105.html
Sent from the linuxppc-embedded mailing list archive at Nabble.com.
^ permalink raw reply
* [PATCH 2.6.25 1/5] PMU: dont lock_kernel()
From: Johannes Berg @ 2007-12-11 14:21 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev
In-Reply-To: <20071211142122.966506000@sipsolutions.net>
I see nothing that this lock_kernel() actually protects against
so remove it.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
drivers/macintosh/via-pmu.c | 3 ---
1 file changed, 3 deletions(-)
--- everything.orig/drivers/macintosh/via-pmu.c 2007-12-04 19:51:41.356950738 +0100
+++ everything/drivers/macintosh/via-pmu.c 2007-12-04 19:54:37.936951768 +0100
@@ -33,7 +33,6 @@
#include <linux/adb.h>
#include <linux/pmu.h>
#include <linux/cuda.h>
-#include <linux/smp_lock.h>
#include <linux/module.h>
#include <linux/spinlock.h>
#include <linux/pm.h>
@@ -2547,7 +2546,6 @@ pmu_release(struct inode *inode, struct
struct pmu_private *pp = file->private_data;
unsigned long flags;
- lock_kernel();
if (pp != 0) {
file->private_data = NULL;
spin_lock_irqsave(&all_pvt_lock, flags);
@@ -2561,7 +2559,6 @@ pmu_release(struct inode *inode, struct
kfree(pp);
}
- unlock_kernel();
return 0;
}
--
^ permalink raw reply
* [PATCH 2.6.25 3/5] adb: replace sleep notifier with platform driver suspend/resume hooks
From: Johannes Berg @ 2007-12-11 14:21 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev
In-Reply-To: <20071211142122.966506000@sipsolutions.net>
This patch replaces the pmu sleep notifier that adb had with
suspend/resume hooks in a new platform driver/device.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
drivers/macintosh/adb.c | 96 ++++++++++++++++++++++++++++--------------------
1 file changed, 57 insertions(+), 39 deletions(-)
--- everything.orig/drivers/macintosh/adb.c 2007-12-04 19:51:40.646950955 +0100
+++ everything/drivers/macintosh/adb.c 2007-12-04 19:54:40.186972819 +0100
@@ -89,14 +89,6 @@ static int sleepy_trackpad;
static int autopoll_devs;
int __adb_probe_sync;
-#ifdef CONFIG_PM_SLEEP
-static void adb_notify_sleep(struct pmu_sleep_notifier *self, int when);
-static struct pmu_sleep_notifier adb_sleep_notifier = {
- adb_notify_sleep,
- SLEEP_LEVEL_ADB,
-};
-#endif
-
static int adb_scan_bus(void);
static int do_adb_reset_bus(void);
static void adbdev_init(void);
@@ -281,6 +273,36 @@ adb_reset_bus(void)
return 0;
}
+#ifdef CONFIG_PM
+/*
+ * notify clients before sleep
+ */
+static int adb_suspend(struct platform_device *dev, pm_message_t state)
+{
+ adb_got_sleep = 1;
+ /* We need to get a lock on the probe thread */
+ down(&adb_probe_mutex);
+ /* Stop autopoll */
+ if (adb_controller->autopoll)
+ adb_controller->autopoll(0);
+ blocking_notifier_call_chain(&adb_client_list, ADB_MSG_POWERDOWN, NULL);
+
+ return 0;
+}
+
+/*
+ * reset bus after sleep
+ */
+static int adb_resume(struct platform_device *dev)
+{
+ adb_got_sleep = 0;
+ up(&adb_probe_mutex);
+ adb_reset_bus();
+
+ return 0;
+}
+#endif /* CONFIG_PM */
+
int __init adb_init(void)
{
struct adb_driver *driver;
@@ -313,14 +335,12 @@ int __init adb_init(void)
printk(KERN_WARNING "Warning: no ADB interface detected\n");
adb_controller = NULL;
} else {
-#ifdef CONFIG_PM_SLEEP
- pmu_register_sleep_notifier(&adb_sleep_notifier);
-#endif /* CONFIG_PM */
#ifdef CONFIG_PPC
if (machine_is_compatible("AAPL,PowerBook1998") ||
machine_is_compatible("PowerBook1,1"))
sleepy_trackpad = 1;
#endif /* CONFIG_PPC */
+
init_completion(&adb_probe_task_comp);
adbdev_init();
adb_reset_bus();
@@ -330,33 +350,6 @@ int __init adb_init(void)
__initcall(adb_init);
-#ifdef CONFIG_PM
-/*
- * notify clients before sleep and reset bus afterwards
- */
-void
-adb_notify_sleep(struct pmu_sleep_notifier *self, int when)
-{
- switch (when) {
- case PBOOK_SLEEP_REQUEST:
- adb_got_sleep = 1;
- /* We need to get a lock on the probe thread */
- down(&adb_probe_mutex);
- /* Stop autopoll */
- if (adb_controller->autopoll)
- adb_controller->autopoll(0);
- blocking_notifier_call_chain(&adb_client_list,
- ADB_MSG_POWERDOWN, NULL);
- break;
- case PBOOK_WAKE:
- adb_got_sleep = 0;
- up(&adb_probe_mutex);
- adb_reset_bus();
- break;
- }
-}
-#endif /* CONFIG_PM */
-
static int
do_adb_reset_bus(void)
{
@@ -864,7 +857,29 @@ static const struct file_operations adb_
.release = adb_release,
};
-static void
+static struct platform_driver adb_pfdrv = {
+ .driver = {
+ .name = "adb",
+ },
+#ifdef CONFIG_PM
+ .suspend = adb_suspend,
+ .resume = adb_resume,
+#endif
+};
+
+static struct platform_device adb_pfdev = {
+ .name = "adb",
+};
+
+static int __init
+adb_dummy_probe(struct platform_device *dev)
+{
+ if (dev == &adb_pfdev)
+ return 0;
+ return -ENODEV;
+}
+
+static void __init
adbdev_init(void)
{
if (register_chrdev(ADB_MAJOR, "adb", &adb_fops)) {
@@ -876,4 +891,7 @@ adbdev_init(void)
if (IS_ERR(adb_dev_class))
return;
class_device_create(adb_dev_class, NULL, MKDEV(ADB_MAJOR, 0), NULL, "adb");
+
+ platform_device_register(&adb_pfdev);
+ platform_driver_probe(&adb_pfdrv, adb_dummy_probe);
}
--
^ permalink raw reply
* [PATCH 2.6.25 4/5] via-pmu: kill sleep notifiers completely
From: Johannes Berg @ 2007-12-11 14:21 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev
In-Reply-To: <20071211142122.966506000@sipsolutions.net>
This patch kills off the remnants of the ancient sleep notifiers.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
drivers/macintosh/via-pmu.c | 71 --------------------------------------------
include/linux/pmu.h | 36 ----------------------
2 files changed, 107 deletions(-)
--- everything.orig/drivers/macintosh/via-pmu.c 2007-12-04 19:54:39.056952311 +0100
+++ everything/drivers/macintosh/via-pmu.c 2007-12-04 19:54:41.886951985 +0100
@@ -174,7 +174,6 @@ static struct proc_dir_entry *proc_pmu_b
int __fake_sleep;
int asleep;
-BLOCKING_NOTIFIER_HEAD(sleep_notifier_list);
#ifdef CONFIG_ADB
static int adb_dev_map;
@@ -1719,67 +1718,7 @@ pmu_present(void)
return via != 0;
}
-#ifdef CONFIG_PM_SLEEP
-
-static LIST_HEAD(sleep_notifiers);
-
-int
-pmu_register_sleep_notifier(struct pmu_sleep_notifier *n)
-{
- struct list_head *list;
- struct pmu_sleep_notifier *notifier;
-
- for (list = sleep_notifiers.next; list != &sleep_notifiers;
- list = list->next) {
- notifier = list_entry(list, struct pmu_sleep_notifier, list);
- if (n->priority > notifier->priority)
- break;
- }
- __list_add(&n->list, list->prev, list);
- return 0;
-}
-EXPORT_SYMBOL(pmu_register_sleep_notifier);
-
-int
-pmu_unregister_sleep_notifier(struct pmu_sleep_notifier* n)
-{
- if (n->list.next == 0)
- return -ENOENT;
- list_del(&n->list);
- n->list.next = NULL;
- return 0;
-}
-EXPORT_SYMBOL(pmu_unregister_sleep_notifier);
-#endif /* CONFIG_PM_SLEEP */
-
#if defined(CONFIG_PM_SLEEP) && defined(CONFIG_PPC32)
-
-/* Sleep is broadcast last-to-first */
-static void broadcast_sleep(int when)
-{
- struct list_head *list;
- struct pmu_sleep_notifier *notifier;
-
- for (list = sleep_notifiers.prev; list != &sleep_notifiers;
- list = list->prev) {
- notifier = list_entry(list, struct pmu_sleep_notifier, list);
- notifier->notifier_call(notifier, when);
- }
-}
-
-/* Wake is broadcast first-to-last */
-static void broadcast_wake(void)
-{
- struct list_head *list;
- struct pmu_sleep_notifier *notifier;
-
- for (list = sleep_notifiers.next; list != &sleep_notifiers;
- list = list->next) {
- notifier = list_entry(list, struct pmu_sleep_notifier, list);
- notifier->notifier_call(notifier, PBOOK_WAKE);
- }
-}
-
/*
* This struct is used to store config register values for
* PCI devices which may get powered off when we sleep.
@@ -1962,9 +1901,6 @@ pmac_suspend_devices(void)
pm_prepare_console();
- /* Notify old-style device drivers */
- broadcast_sleep(PBOOK_SLEEP_REQUEST);
-
/* Sync the disks. */
/* XXX It would be nice to have some way to ensure that
* nobody is dirtying any new buffers while we wait. That
@@ -1973,12 +1909,9 @@ pmac_suspend_devices(void)
*/
sys_sync();
- broadcast_sleep(PBOOK_SLEEP_NOW);
-
/* Send suspend call to devices, hold the device core's dpm_sem */
ret = device_suspend(PMSG_SUSPEND);
if (ret) {
- broadcast_wake();
printk(KERN_ERR "Driver sleep failed\n");
return -EBUSY;
}
@@ -2019,7 +1952,6 @@ pmac_suspend_devices(void)
local_irq_enable();
preempt_enable();
device_resume();
- broadcast_wake();
printk(KERN_ERR "Driver powerdown failed\n");
return -EBUSY;
}
@@ -2073,9 +2005,6 @@ pmac_wakeup_devices(void)
/* Resume devices */
device_resume();
- /* Notify old style drivers */
- broadcast_wake();
-
pm_restore_console();
return 0;
--- everything.orig/include/linux/pmu.h 2007-12-04 19:51:40.326951823 +0100
+++ everything/include/linux/pmu.h 2007-12-04 19:54:41.896951606 +0100
@@ -159,42 +159,6 @@ extern void pmu_unlock(void);
extern int pmu_present(void);
extern int pmu_get_model(void);
-#ifdef CONFIG_PM
-/*
- * Stuff for putting the powerbook to sleep and waking it again.
- *
- */
-#include <linux/list.h>
-
-struct pmu_sleep_notifier
-{
- void (*notifier_call)(struct pmu_sleep_notifier *self, int when);
- int priority;
- struct list_head list;
-};
-
-/* Code values for calling sleep/wakeup handlers
- */
-#define PBOOK_SLEEP_REQUEST 1
-#define PBOOK_SLEEP_NOW 2
-#define PBOOK_WAKE 3
-
-/* priority levels in notifiers */
-#define SLEEP_LEVEL_VIDEO 100 /* Video driver (first wake) */
-#define SLEEP_LEVEL_MEDIABAY 90 /* Media bay driver */
-#define SLEEP_LEVEL_BLOCK 80 /* IDE, SCSI */
-#define SLEEP_LEVEL_NET 70 /* bmac, gmac */
-#define SLEEP_LEVEL_MISC 60 /* Anything else */
-#define SLEEP_LEVEL_USERLAND 55 /* Reserved for apm_emu */
-#define SLEEP_LEVEL_ADB 50 /* ADB (async) */
-#define SLEEP_LEVEL_SOUND 40 /* Sound driver (blocking) */
-
-/* special register notifier functions */
-int pmu_register_sleep_notifier(struct pmu_sleep_notifier* notifier);
-int pmu_unregister_sleep_notifier(struct pmu_sleep_notifier* notifier);
-
-#endif /* CONFIG_PM */
-
#define PMU_MAX_BATTERIES 2
/* values for pmu_power_flags */
--
^ permalink raw reply
* [PATCH 2.6.25 0/5] PMU updates including suspend
From: Johannes Berg @ 2007-12-11 14:21 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev
Since none of the patches seem to have made it into any git tree so far,
here's a resend of my patch series that removes/replaces the adb suspend
notifiers and makes PMU suspend usable via /sys/power/state.
I have submitted a patch to allow turning off the freezer to Rafael
separately who had only minor comments on the second version which I
fixed in the third version I just sent out.
Please consider these patches for 2.6.25.
johannes
^ permalink raw reply
* [PATCH 2.6.25 2/5] PMU: remove dead code
From: Johannes Berg @ 2007-12-11 14:21 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev
In-Reply-To: <20071211142122.966506000@sipsolutions.net>
Some code in via-pmu.c is never compiled because of "compile options"
within the file. Remove the code completely.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
drivers/macintosh/via-pmu.c | 42 +-----------------------------------------
1 file changed, 1 insertion(+), 41 deletions(-)
--- everything.orig/drivers/macintosh/via-pmu.c 2007-12-04 19:54:37.936951768 +0100
+++ everything/drivers/macintosh/via-pmu.c 2007-12-04 19:54:39.056952311 +0100
@@ -64,9 +64,7 @@
#include "via-pmu-event.h"
/* Some compile options */
-#undef SUSPEND_USES_PMU
#define DEBUG_SLEEP
-#undef HACKED_PCI_SAVE
/* Misc minor number allocated for /dev/pmu */
#define PMU_MINOR 154
@@ -1255,9 +1253,7 @@ void
pmu_suspend(void)
{
unsigned long flags;
-#ifdef SUSPEND_USES_PMU
- struct adb_request *req;
-#endif
+
if (!via)
return;
@@ -1275,17 +1271,10 @@ pmu_suspend(void)
via_pmu_interrupt(0, NULL);
spin_lock_irqsave(&pmu_lock, flags);
if (!adb_int_pending && pmu_state == idle && !req_awaiting_reply) {
-#ifdef SUSPEND_USES_PMU
- pmu_request(&req, NULL, 2, PMU_SET_INTR_MASK, 0);
- spin_unlock_irqrestore(&pmu_lock, flags);
- while(!req.complete)
- pmu_poll();
-#else /* SUSPEND_USES_PMU */
if (gpio_irq >= 0)
disable_irq_nosync(gpio_irq);
out_8(&via[IER], CB1_INT | IER_CLR);
spin_unlock_irqrestore(&pmu_lock, flags);
-#endif /* SUSPEND_USES_PMU */
break;
}
} while (1);
@@ -1306,18 +1295,11 @@ pmu_resume(void)
return;
}
adb_int_pending = 1;
-#ifdef SUSPEND_USES_PMU
- pmu_request(&req, NULL, 2, PMU_SET_INTR_MASK, pmu_intr_mask);
- spin_unlock_irqrestore(&pmu_lock, flags);
- while(!req.complete)
- pmu_poll();
-#else /* SUSPEND_USES_PMU */
if (gpio_irq >= 0)
enable_irq(gpio_irq);
out_8(&via[IER], CB1_INT | IER_SET);
spin_unlock_irqrestore(&pmu_lock, flags);
pmu_poll();
-#endif /* SUSPEND_USES_PMU */
}
/* Interrupt data could be the result data from an ADB cmd */
@@ -1803,14 +1785,10 @@ static void broadcast_wake(void)
* PCI devices which may get powered off when we sleep.
*/
static struct pci_save {
-#ifndef HACKED_PCI_SAVE
u16 command;
u16 cache_lat;
u16 intr;
u32 rom_address;
-#else
- u32 config[16];
-#endif
} *pbook_pci_saves;
static int pbook_npci_saves;
@@ -1856,16 +1834,10 @@ pbook_pci_save(void)
pci_dev_put(pd);
return;
}
-#ifndef HACKED_PCI_SAVE
pci_read_config_word(pd, PCI_COMMAND, &ps->command);
pci_read_config_word(pd, PCI_CACHE_LINE_SIZE, &ps->cache_lat);
pci_read_config_word(pd, PCI_INTERRUPT_LINE, &ps->intr);
pci_read_config_dword(pd, PCI_ROM_ADDRESS, &ps->rom_address);
-#else
- int i;
- for (i=1;i<16;i++)
- pci_read_config_dword(pd, i<<4, &ps->config[i]);
-#endif
++ps;
}
}
@@ -1884,17 +1856,6 @@ pbook_pci_restore(void)
int j;
while ((pd = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pd)) != NULL) {
-#ifdef HACKED_PCI_SAVE
- int i;
- if (npci-- == 0) {
- pci_dev_put(pd);
- return;
- }
- ps++;
- for (i=2;i<16;i++)
- pci_write_config_dword(pd, i<<4, ps->config[i]);
- pci_write_config_dword(pd, 4, ps->config[1]);
-#else
if (npci-- == 0)
return;
ps++;
@@ -1918,7 +1879,6 @@ pbook_pci_restore(void)
pci_write_config_word(pd, PCI_COMMAND, ps->command);
break;
}
-#endif
}
}
--
^ permalink raw reply
* [PATCH 2.6.25 5/5] powermac: proper sleep management
From: Johannes Berg @ 2007-12-11 14:25 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev
In-Reply-To: <20071211142122.966506000@sipsolutions.net>
This adds platform_suspend_ops for PMU based machines, directly in
the PMU driver. This finally allows suspending via /sys/power/state
on powerbooks.
The patch also replaces the PMU ioctl with a simple call to
pm_suspend(PM_SUSPEND_MEM).
Additionally, it cleans up some debug code.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
drivers/macintosh/via-pmu.c | 451 ++++++++++++++++++++------------------------
1 file changed, 206 insertions(+), 245 deletions(-)
--- everything.orig/drivers/macintosh/via-pmu.c 2007-12-11 15:13:33.156913629 +0100
+++ everything/drivers/macintosh/via-pmu.c 2007-12-11 15:19:21.126913032 +0100
@@ -10,13 +10,13 @@
*
* Copyright (C) 1998 Paul Mackerras and Fabio Riccardi.
* Copyright (C) 2001-2002 Benjamin Herrenschmidt
+ * Copyright (C) 2006-2007 Johannes Berg
*
* THIS DRIVER IS BECOMING A TOTAL MESS !
* - Cleanup atomically disabling reply to PMU events after
* a sleep or a freq. switch
- * - Move sleep code out of here to pmac_pm, merge into new
- * common PM infrastructure
- * - Save/Restore PCI space properly
+ * - check if powerbook 3400 really needs the extra PCI
+ * save/restore code we have
*
*/
#include <stdarg.h>
@@ -64,7 +64,7 @@
#include "via-pmu-event.h"
/* Some compile options */
-#define DEBUG_SLEEP
+#undef DEBUG_SLEEP
/* Misc minor number allocated for /dev/pmu */
#define PMU_MINOR 154
@@ -149,12 +149,9 @@ static spinlock_t pmu_lock;
static u8 pmu_intr_mask;
static int pmu_version;
static int drop_interrupts;
-#if defined(CONFIG_PM_SLEEP) && defined(CONFIG_PPC32)
+#if defined(CONFIG_SUSPEND) && defined(CONFIG_PPC32)
static int option_lid_wakeup = 1;
-#endif /* CONFIG_PM_SLEEP && CONFIG_PPC32 */
-#if (defined(CONFIG_PM_SLEEP)&&defined(CONFIG_PPC32))||defined(CONFIG_PMAC_BACKLIGHT_LEGACY)
-static int sleep_in_progress;
-#endif
+#endif /* CONFIG_SUSPEND && CONFIG_PPC32 */
static unsigned long async_req_locks;
static unsigned int pmu_irq_stats[11];
@@ -220,7 +217,7 @@ extern void enable_kernel_fp(void);
#ifdef DEBUG_SLEEP
int pmu_polled_request(struct adb_request *req);
-int pmu_wink(struct adb_request *req);
+void pmu_blink(int n);
#endif
/*
@@ -871,7 +868,7 @@ proc_read_options(char *page, char **sta
{
char *p = page;
-#if defined(CONFIG_PM_SLEEP) && defined(CONFIG_PPC32)
+#if defined(CONFIG_SUSPEND) && defined(CONFIG_PPC32)
if (pmu_kind == PMU_KEYLARGO_BASED &&
pmac_call_feature(PMAC_FTR_SLEEP_STATE,NULL,0,-1) >= 0)
p += sprintf(p, "lid_wakeup=%d\n", option_lid_wakeup);
@@ -912,7 +909,7 @@ proc_write_options(struct file *file, co
*(val++) = 0;
while(*val == ' ')
val++;
-#if defined(CONFIG_PM_SLEEP) && defined(CONFIG_PPC32)
+#if defined(CONFIG_SUSPEND) && defined(CONFIG_PPC32)
if (pmu_kind == PMU_KEYLARGO_BASED &&
pmac_call_feature(PMAC_FTR_SLEEP_STATE,NULL,0,-1) >= 0)
if (!strcmp(label, "lid_wakeup"))
@@ -1718,7 +1715,7 @@ pmu_present(void)
return via != 0;
}
-#if defined(CONFIG_PM_SLEEP) && defined(CONFIG_PPC32)
+#if defined(CONFIG_SUSPEND) && defined(CONFIG_PPC32)
/*
* This struct is used to store config register values for
* PCI devices which may get powered off when we sleep.
@@ -1821,42 +1818,6 @@ pbook_pci_restore(void)
}
}
-#ifdef DEBUG_SLEEP
-/* N.B. This doesn't work on the 3400 */
-void
-pmu_blink(int n)
-{
- struct adb_request req;
-
- memset(&req, 0, sizeof(req));
-
- for (; n > 0; --n) {
- req.nbytes = 4;
- req.done = NULL;
- req.data[0] = 0xee;
- req.data[1] = 4;
- req.data[2] = 0;
- req.data[3] = 1;
- req.reply[0] = ADB_RET_OK;
- req.reply_len = 1;
- req.reply_expected = 0;
- pmu_polled_request(&req);
- mdelay(50);
- req.nbytes = 4;
- req.done = NULL;
- req.data[0] = 0xee;
- req.data[1] = 4;
- req.data[2] = 0;
- req.data[3] = 0;
- req.reply[0] = ADB_RET_OK;
- req.reply_len = 1;
- req.reply_expected = 0;
- pmu_polled_request(&req);
- mdelay(50);
- }
- mdelay(50);
-}
-#endif
/*
* Put the powerbook to sleep.
@@ -1894,122 +1855,6 @@ restore_via_state(void)
extern void pmu_backlight_set_sleep(int sleep);
-static int
-pmac_suspend_devices(void)
-{
- int ret;
-
- pm_prepare_console();
-
- /* Sync the disks. */
- /* XXX It would be nice to have some way to ensure that
- * nobody is dirtying any new buffers while we wait. That
- * could be achieved using the refrigerator for processes
- * that swsusp uses
- */
- sys_sync();
-
- /* Send suspend call to devices, hold the device core's dpm_sem */
- ret = device_suspend(PMSG_SUSPEND);
- if (ret) {
- printk(KERN_ERR "Driver sleep failed\n");
- return -EBUSY;
- }
-
-#ifdef CONFIG_PMAC_BACKLIGHT
- /* Tell backlight code not to muck around with the chip anymore */
- pmu_backlight_set_sleep(1);
-#endif
-
- /* Call platform functions marked "on sleep" */
- pmac_pfunc_i2c_suspend();
- pmac_pfunc_base_suspend();
-
- /* Stop preemption */
- preempt_disable();
-
- /* Make sure the decrementer won't interrupt us */
- asm volatile("mtdec %0" : : "r" (0x7fffffff));
- /* Make sure any pending DEC interrupt occurring while we did
- * the above didn't re-enable the DEC */
- mb();
- asm volatile("mtdec %0" : : "r" (0x7fffffff));
-
- /* We can now disable MSR_EE. This code of course works properly only
- * on UP machines... For SMP, if we ever implement sleep, we'll have to
- * stop the "other" CPUs way before we do all that stuff.
- */
- local_irq_disable();
-
- /* Broadcast power down irq
- * This isn't that useful in most cases (only directly wired devices can
- * use this but still... This will take care of sysdev's as well, so
- * we exit from here with local irqs disabled and PIC off.
- */
- ret = device_power_down(PMSG_SUSPEND);
- if (ret) {
- wakeup_decrementer();
- local_irq_enable();
- preempt_enable();
- device_resume();
- printk(KERN_ERR "Driver powerdown failed\n");
- return -EBUSY;
- }
-
- /* Wait for completion of async requests */
- while (!batt_req.complete)
- pmu_poll();
-
- /* Giveup the lazy FPU & vec so we don't have to back them
- * up from the low level code
- */
- enable_kernel_fp();
-
-#ifdef CONFIG_ALTIVEC
- if (cpu_has_feature(CPU_FTR_ALTIVEC))
- enable_kernel_altivec();
-#endif /* CONFIG_ALTIVEC */
-
- return 0;
-}
-
-static int
-pmac_wakeup_devices(void)
-{
- mdelay(100);
-
-#ifdef CONFIG_PMAC_BACKLIGHT
- /* Tell backlight code it can use the chip again */
- pmu_backlight_set_sleep(0);
-#endif
-
- /* Power back up system devices (including the PIC) */
- device_power_up();
-
- /* Force a poll of ADB interrupts */
- adb_int_pending = 1;
- via_pmu_interrupt(0, NULL);
-
- /* Restart jiffies & scheduling */
- wakeup_decrementer();
-
- /* Re-enable local CPU interrupts */
- local_irq_enable();
- mdelay(10);
- preempt_enable();
-
- /* Call platform functions marked "on wake" */
- pmac_pfunc_base_resume();
- pmac_pfunc_i2c_resume();
-
- /* Resume devices */
- device_resume();
-
- pm_restore_console();
-
- return 0;
-}
-
#define GRACKLE_PM (1<<7)
#define GRACKLE_DOZE (1<<5)
#define GRACKLE_NAP (1<<4)
@@ -2020,19 +1865,12 @@ static int powerbook_sleep_grackle(void)
unsigned long save_l2cr;
unsigned short pmcr1;
struct adb_request req;
- int ret;
struct pci_dev *grackle;
grackle = pci_get_bus_and_slot(0, 0);
if (!grackle)
return -ENODEV;
- ret = pmac_suspend_devices();
- if (ret) {
- printk(KERN_ERR "Sleep rejected by devices\n");
- return ret;
- }
-
/* Turn off various things. Darwin does some retry tests here... */
pmu_request(&req, NULL, 2, PMU_POWER_CTRL0, PMU_POW0_OFF|PMU_POW0_HARD_DRIVE);
pmu_wait_complete(&req);
@@ -2095,8 +1933,6 @@ static int powerbook_sleep_grackle(void)
PMU_POW_ON|PMU_POW_BACKLIGHT|PMU_POW_CHARGER|PMU_POW_IRLED|PMU_POW_MEDIABAY);
pmu_wait_complete(&req);
- pmac_wakeup_devices();
-
return 0;
}
@@ -2106,7 +1942,6 @@ powerbook_sleep_Core99(void)
unsigned long save_l2cr;
unsigned long save_l3cr;
struct adb_request req;
- int ret;
if (pmac_call_feature(PMAC_FTR_SLEEP_STATE,NULL,0,-1) < 0) {
printk(KERN_ERR "Sleep mode not supported on this machine\n");
@@ -2116,12 +1951,6 @@ powerbook_sleep_Core99(void)
if (num_online_cpus() > 1 || cpu_is_offline(0))
return -EAGAIN;
- ret = pmac_suspend_devices();
- if (ret) {
- printk(KERN_ERR "Sleep rejected by devices\n");
- return ret;
- }
-
/* Stop environment and ADB interrupts */
pmu_request(&req, NULL, 2, PMU_SET_INTR_MASK, 0);
pmu_wait_complete(&req);
@@ -2192,41 +2021,24 @@ powerbook_sleep_Core99(void)
/* Restore LPJ, cpufreq will adjust the cpu frequency */
loops_per_jiffy /= 2;
- pmac_wakeup_devices();
-
return 0;
}
#define PB3400_MEM_CTRL 0xf8000000
#define PB3400_MEM_CTRL_SLEEP 0x70
+static void __iomem *pb3400_mem_ctrl;
+
static int
powerbook_sleep_3400(void)
{
- int ret, i, x;
+ int i, x;
unsigned int hid0;
unsigned long p;
struct adb_request sleep_req;
- void __iomem *mem_ctrl;
unsigned int __iomem *mem_ctrl_sleep;
- /* first map in the memory controller registers */
- mem_ctrl = ioremap(PB3400_MEM_CTRL, 0x100);
- if (mem_ctrl == NULL) {
- printk("powerbook_sleep_3400: ioremap failed\n");
- return -ENOMEM;
- }
- mem_ctrl_sleep = mem_ctrl + PB3400_MEM_CTRL_SLEEP;
-
- /* Allocate room for PCI save */
- pbook_alloc_pci_save();
-
- ret = pmac_suspend_devices();
- if (ret) {
- pbook_free_pci_save();
- printk(KERN_ERR "Sleep rejected by devices\n");
- return ret;
- }
+ mem_ctrl_sleep = pb3400_mem_ctrl + PB3400_MEM_CTRL_SLEEP;
/* Save the state of PCI config space for some slots */
pbook_pci_save();
@@ -2271,14 +2083,10 @@ powerbook_sleep_3400(void)
while (asleep)
mb();
- pmac_wakeup_devices();
- pbook_free_pci_save();
- iounmap(mem_ctrl);
-
return 0;
}
-#endif /* CONFIG_PM_SLEEP && CONFIG_PPC32 */
+#endif /* CONFIG_SUSPEND && CONFIG_PPC32 */
/*
* Support for /dev/pmu device
@@ -2451,6 +2259,157 @@ pmu_release(struct inode *inode, struct
return 0;
}
+#if defined(CONFIG_SUSPEND) && defined(CONFIG_PPC32)
+static int powerbook_prepare_sleep(void)
+{
+ if (pmu_kind == PMU_OHARE_BASED) {
+ /* first map in the memory controller registers */
+ pb3400_mem_ctrl = ioremap(PB3400_MEM_CTRL, 0x100);
+ if (!pb3400_mem_ctrl) {
+ printk(KERN_ERR "powerbook_sleep_3400: "
+ "ioremap failed\n");
+ return -ENOMEM;
+ }
+
+ /* Allocate room for PCI save */
+ pbook_alloc_pci_save();
+ }
+
+ return 0;
+}
+
+/*
+ * overrides the weak arch_suspend_disable_irqs in kernel/power/main.c
+ *
+ * XXX: Once Scott Wood's patch is merged, this needs to use the ppc_md
+ * hooks that patch adds!
+ */
+void arch_suspend_disable_irqs(void)
+{
+#ifdef CONFIG_PMAC_BACKLIGHT
+ /* Tell backlight code not to muck around with the chip anymore */
+ pmu_backlight_set_sleep(1);
+#endif
+
+ /* Call platform functions marked "on sleep" */
+ pmac_pfunc_i2c_suspend();
+ pmac_pfunc_base_suspend();
+
+ /* Stop preemption */
+ preempt_disable();
+
+ /* Make sure the decrementer won't interrupt us */
+ asm volatile("mtdec %0" : : "r" (0x7fffffff));
+ /* Make sure any pending DEC interrupt occurring while we did
+ * the above didn't re-enable the DEC */
+ mb();
+ asm volatile("mtdec %0" : : "r" (0x7fffffff));
+
+ local_irq_disable();
+}
+
+static int powerbook_sleep(suspend_state_t state)
+{
+ int error = 0;
+
+ /* Wait for completion of async requests */
+ while (!batt_req.complete)
+ pmu_poll();
+
+ /* Giveup the lazy FPU & vec so we don't have to back them
+ * up from the low level code
+ */
+ enable_kernel_fp();
+
+#ifdef CONFIG_ALTIVEC
+ if (cpu_has_feature(CPU_FTR_ALTIVEC))
+ enable_kernel_altivec();
+#endif /* CONFIG_ALTIVEC */
+
+ switch (pmu_kind) {
+ case PMU_OHARE_BASED:
+ error = powerbook_sleep_3400();
+ break;
+ case PMU_HEATHROW_BASED:
+ case PMU_PADDINGTON_BASED:
+ error = powerbook_sleep_grackle();
+ break;
+ case PMU_KEYLARGO_BASED:
+ error = powerbook_sleep_Core99();
+ break;
+ default:
+ return -ENOSYS;
+ }
+
+ if (error)
+ return error;
+
+ mdelay(100);
+
+#ifdef CONFIG_PMAC_BACKLIGHT
+ /* Tell backlight code it can use the chip again */
+ pmu_backlight_set_sleep(0);
+#endif
+
+ return 0;
+}
+
+/*
+ * overrides the weak arch_suspend_enable_irqs in kernel/power/main.c
+ *
+ * XXX: Once Scott Wood's patch is merged, this needs to use the ppc_md
+ * hooks that patch adds!
+ */
+void arch_suspend_enable_irqs(void)
+{
+ /* Force a poll of ADB interrupts */
+ adb_int_pending = 1;
+ via_pmu_interrupt(0, NULL);
+
+ /* Restart jiffies & scheduling */
+ wakeup_decrementer();
+
+ /* Re-enable local CPU interrupts */
+ local_irq_enable();
+ mdelay(10);
+ preempt_enable();
+
+ /* Call platform functions marked "on wake" */
+ pmac_pfunc_base_resume();
+ pmac_pfunc_i2c_resume();
+}
+
+static void powerbook_finish_sleep(void)
+{
+ if (pmu_kind == PMU_OHARE_BASED) {
+ pbook_free_pci_save();
+ iounmap(pb3400_mem_ctrl);
+ }
+}
+
+static int pmu_sleep_valid(suspend_state_t state)
+{
+ return state == PM_SUSPEND_MEM
+ && (pmac_call_feature(PMAC_FTR_SLEEP_STATE, NULL, 0, -1) >= 0);
+}
+
+static struct platform_suspend_ops pmu_pm_ops = {
+ .prepare = powerbook_prepare_sleep,
+ .enter = powerbook_sleep,
+ .finish = powerbook_finish_sleep,
+ .valid = pmu_sleep_valid,
+};
+
+static int register_pmu_pm_ops(void)
+{
+ suspend_set_ops(&pmu_pm_ops);
+
+ return 0;
+}
+
+device_initcall(register_pmu_pm_ops);
+#endif
+
static int
pmu_ioctl(struct inode * inode, struct file *filp,
u_int cmd, u_long arg)
@@ -2459,35 +2418,15 @@ pmu_ioctl(struct inode * inode, struct f
int error = -EINVAL;
switch (cmd) {
-#if defined(CONFIG_PM_SLEEP) && defined(CONFIG_PPC32)
case PMU_IOC_SLEEP:
if (!capable(CAP_SYS_ADMIN))
return -EACCES;
- if (sleep_in_progress)
- return -EBUSY;
- sleep_in_progress = 1;
- switch (pmu_kind) {
- case PMU_OHARE_BASED:
- error = powerbook_sleep_3400();
- break;
- case PMU_HEATHROW_BASED:
- case PMU_PADDINGTON_BASED:
- error = powerbook_sleep_grackle();
- break;
- case PMU_KEYLARGO_BASED:
- error = powerbook_sleep_Core99();
- break;
- default:
- error = -ENOSYS;
- }
- sleep_in_progress = 0;
- break;
+ return pm_suspend(PM_SUSPEND_MEM);
case PMU_IOC_CAN_SLEEP:
- if (pmac_call_feature(PMAC_FTR_SLEEP_STATE,NULL,0,-1) < 0)
+ if (pmac_call_feature(PMAC_FTR_SLEEP_STATE, NULL, 0, -1) < 0)
return put_user(0, argp);
else
return put_user(1, argp);
-#endif /* CONFIG_PM_SLEEP && CONFIG_PPC32 */
#ifdef CONFIG_PMAC_BACKLIGHT_LEGACY
/* Compatibility ioctl's for backlight */
@@ -2495,9 +2434,6 @@ pmu_ioctl(struct inode * inode, struct f
{
int brightness;
- if (sleep_in_progress)
- return -EBUSY;
-
brightness = pmac_backlight_get_legacy_brightness();
if (brightness < 0)
return brightness;
@@ -2509,9 +2445,6 @@ pmu_ioctl(struct inode * inode, struct f
{
int brightness;
- if (sleep_in_progress)
- return -EBUSY;
-
error = get_user(brightness, argp);
if (error)
return error;
@@ -2636,15 +2569,43 @@ pmu_polled_request(struct adb_request *r
local_irq_restore(flags);
return 0;
}
-#endif /* DEBUG_SLEEP */
+/* N.B. This doesn't work on the 3400 */
+void pmu_blink(int n)
+{
+ struct adb_request req;
-/* FIXME: This is a temporary set of callbacks to enable us
- * to do suspend-to-disk.
- */
+ memset(&req, 0, sizeof(req));
-#if defined(CONFIG_PM_SLEEP) && defined(CONFIG_PPC32)
+ for (; n > 0; --n) {
+ req.nbytes = 4;
+ req.done = NULL;
+ req.data[0] = 0xee;
+ req.data[1] = 4;
+ req.data[2] = 0;
+ req.data[3] = 1;
+ req.reply[0] = ADB_RET_OK;
+ req.reply_len = 1;
+ req.reply_expected = 0;
+ pmu_polled_request(&req);
+ mdelay(50);
+ req.nbytes = 4;
+ req.done = NULL;
+ req.data[0] = 0xee;
+ req.data[1] = 4;
+ req.data[2] = 0;
+ req.data[3] = 0;
+ req.reply[0] = ADB_RET_OK;
+ req.reply_len = 1;
+ req.reply_expected = 0;
+ pmu_polled_request(&req);
+ mdelay(50);
+ }
+ mdelay(50);
+}
+#endif /* DEBUG_SLEEP */
+#if defined(CONFIG_SUSPEND) && defined(CONFIG_PPC32)
int pmu_sys_suspended;
static int pmu_sys_suspend(struct sys_device *sysdev, pm_message_t state)
@@ -2678,7 +2639,7 @@ static int pmu_sys_resume(struct sys_dev
return 0;
}
-#endif /* CONFIG_PM_SLEEP && CONFIG_PPC32 */
+#endif /* CONFIG_SUSPEND && CONFIG_PPC32 */
static struct sysdev_class pmu_sysclass = {
set_kset_name("pmu"),
@@ -2689,10 +2650,10 @@ static struct sys_device device_pmu = {
};
static struct sysdev_driver driver_pmu = {
-#if defined(CONFIG_PM_SLEEP) && defined(CONFIG_PPC32)
+#if defined(CONFIG_SUSPEND) && defined(CONFIG_PPC32)
.suspend = &pmu_sys_suspend,
.resume = &pmu_sys_resume,
-#endif /* CONFIG_PM_SLEEP && CONFIG_PPC32 */
+#endif /* CONFIG_SUSPEND && CONFIG_PPC32 */
};
static int __init init_pmu_sysfs(void)
@@ -2727,10 +2688,10 @@ EXPORT_SYMBOL(pmu_wait_complete);
EXPORT_SYMBOL(pmu_suspend);
EXPORT_SYMBOL(pmu_resume);
EXPORT_SYMBOL(pmu_unlock);
-#if defined(CONFIG_PM_SLEEP) && defined(CONFIG_PPC32)
+#if defined(CONFIG_SUSPEND) && defined(CONFIG_PPC32)
EXPORT_SYMBOL(pmu_enable_irled);
EXPORT_SYMBOL(pmu_battery_count);
EXPORT_SYMBOL(pmu_batteries);
EXPORT_SYMBOL(pmu_power_flags);
-#endif /* CONFIG_PM_SLEEP && CONFIG_PPC32 */
+#endif /* CONFIG_SUSPEND && CONFIG_PPC32 */
^ permalink raw reply
* Re: Patches added to for-2.6.25 and master branches of powerpc.git
From: Jon Loeliger @ 2007-12-11 14:41 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev, arnd
In-Reply-To: <18270.8249.393061.840667@cargo.ozlabs.ibm.com>
So, like, the other day Paul Mackerras mumbled:
>
> Jon Loeliger (2):
> [POWERPC] Clean out asm/of_{platform, device}.h
> [POWERPC] Clean out asm/of_{platform, device}.h from sysdev/
Excellent, thanks!
That leaves just this following patch from my janitor series.
http://patchwork.ozlabs.org/linuxppc/patch?id=14712
I suspect Arnd might need to pick it up or ACK it now?
Thanks,
jdl
From: Jon Loeliger <jdl@freescale.com>
Date: Mon, 12 Nov 2007 14:23:16 -0600
Subject: [PATCH] cell: Convert #include of asm/of_{platform, device}.h into linux/of_{platform, device}.h.
Signed-off-by: Jon Loeliger <jdl@freescale.com>
Acked-by: Stephen Rothwell <sfr@canb.auug.org.au> Built a ppc64_defconfig
---
This version picks up the celleb/ files too.
Stephen, notice that you tacitly ACK'ed this pickup too... :-)
arch/powerpc/platforms/cell/cbe_cpufreq.c | 3 ++-
arch/powerpc/platforms/cell/cbe_cpufreq_pmi.c | 3 ++-
arch/powerpc/platforms/cell/cbe_regs.c | 4 ++--
arch/powerpc/platforms/cell/iommu.c | 2 +-
arch/powerpc/platforms/cell/setup.c | 2 +-
arch/powerpc/platforms/celleb/iommu.c | 3 +--
arch/powerpc/platforms/celleb/setup.c | 2 +-
7 files changed, 10 insertions(+), 9 deletions(-)
^ permalink raw reply
* Re: [PATCH] Fix rounding bug in emulation for double floatoperating
From: Kumar Gala @ 2007-12-11 15:26 UTC (permalink / raw)
To: Zang Roy-r61911; +Cc: linuxppc-dev list, Liu Yu, David Gibson
In-Reply-To: <1197343143.13519.2.camel@localhost.localdomain>
>>
>> how did you find this?
>>
> It supposed to run the following test case on a powerpc platform.
> Yu's patch fixes the issue.
> Could you help to merge this patch in your tree?
> ---
> #include <stdio.h>
> #include <math.h>
> #include <bits/nan.h>
> #ifdef __SPE__
> #include <spe.h>
> int
> getSPEFSCR()
> {
> return __builtin_spe_mfspefscr();
> }
>
> void
> setSPEFSCR(int i)
> {
> __builtin_spe_mtspefscr(i);
> }
> #else
> int
> getSPEFSCR()
> {
> return 0;
> }
>
> void
> setSPEFSCR(int i)
> {
> }
> #endif
>
> void
> dmul(double d, double d1, double expected)
> {
> double d2;
> int before, after;
>
> before = getSPEFSCR();
> d2 = d * d1;
> after = getSPEFSCR();
>
> printf("dmul %llx * %llx = %llx expected %llx %s [0x%x 0x%x]\n",
> d, d1, d2, expected,
> (d2 == expected) ? "(PASS)" : "(FAIL)", before, after);
> }
>
> void
> ddiv(double d, double d1, double expected)
> {
> register double d2;
> int before, after;
>
> before = getSPEFSCR();
> d2 = d / d1;
> after = getSPEFSCR();
>
> printf("ddiv %llx / %llx = %llx expected %llx %s [0x%x 0x%x]\n",
> d, d1, d2, expected,
> (d2 == expected) ? "(PASS)" : "(FAIL)", before, after);
> }
>
> main()
> {
> const double min_double = 4.9406564584124654e-324L;
>
> printf("\n");
> dmul(0.5L, min_double, 0.0L);
> dmul(-0.5L, min_double, 0.0L);
> dmul(-min_double, -0.5L, 0.0L);
> printf("\n");
> ddiv(min_double, 2.0L, 0.0L);
> }
When I run this on a G5 (w/HW FP) I get:
dmul 3fe0000000000000 * 1 = 0 expected 0 (PASS)
dmul bfe0000000000000 * 1 = 8000000000000000 expected 0 (PASS)
dmul 8000000000000001 * bfe0000000000000 = 0 expected 0 (PASS)
ddiv 1 / 4000000000000000 = 0 expected 0 (PASS)
and on the 85xx w/FP emu:
dmul 3fe0000000000000 * 1 = 0 expected 0 (PASS)
dmul bfe0000000000000 * 1 = 8000000000000000 expected 0 (PASS)
dmul 8000000000000001 * bfe0000000000000 = 0 expected 0 (PASS)
ddiv 1 / 4000000000000000 = 0 expected 0 (PASS)
Maybe I'm missing where the error is.
- k
^ permalink raw reply
* Re: Linux 2.6 from git.xilinx and XUPV2P
From: Grant Likely @ 2007-12-11 15:34 UTC (permalink / raw)
To: greenlean; +Cc: linuxppc-embedded
In-Reply-To: <14274035.post@talk.nabble.com>
On 12/11/07, greenlean <jmgomez@atc.ugr.es> wrote:
>
> Hi all,
>
> I'm a beginner in Xilinx & Linux world and I'm getting a bit loose. I'm
> trying to run linux kernel 2.6 that I downloaded from the xilinx git server
> on the PPC405 of the Xilinx university program Virtex II Pro (XUPV2P for the
> search engine) board, and I'm using the compiler ELDK 4.1 (I' ve just read
> this compiler may cause some error so I'll change it, and try the 4.0
> version) and I'm getting a lot of compilation error and warning.
Hmm. I use ELDK 4.1 daily and I've not had any problems on the
virtex. What compile errors are you getting?
> I think this is what I should use, Does anybody if I have to patch this
> kernel or if it is still prepatched??
The xilinx git tree should be ready to go without patches. In fact,
the mainline Linux tree supports the Virtex powerpc. All that is
missing is some of the device drivers (EMAC, TEMAC).
> My compiler can find some definitions like TASK_SIZE or CONFIG_KERNEL_START,
> now I'm solving it writting the values manually , I google for the error
> and make the definition where it's needed, but I don't think this is a good
> idea ;). I think this definitions should be defined in the .config file,
> because I found the values I wrote on a posted message in this list.
You should *not* need to do this. The following should compile a
working kernel for the ml300 reference design (using ELDK):
$ export ARCH=ppc
$ export CROSS_COMPILE=ppc_4xx-
$ make ml300_defconfig
$ make
>
> Maybe somebody could guide me a bit through this kernel compilation, or send
> me .config file running. I don't know if a revision in the project is a good
> way, to put things in situation for beginers.
hint: look in arch/ppc/configs for working .config files.
>
> Thanks, any info would be interesting.
I've collected some of my notes here:
http://wiki.secretlab.ca/index.php/Linux_on_Xilinx_Virtex
Hope this helps,
g.
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195
^ permalink raw reply
* Re: [RFC][POWERPC] Provide a way to protect 4k subpages when using 64k pages
From: Christoph Hellwig @ 2007-12-11 15:53 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev, linux-kernel
In-Reply-To: <18264.58263.818005.757831@cargo.ozlabs.ibm.com>
On Fri, Dec 07, 2007 at 05:09:27PM +1100, Paul Mackerras wrote:
> Implicit in this is that the regions of the address space that are
> protected are switched to use 4k hardware pages rather than 64k
> hardware pages (on machines with hardware 64k page support). In fact
> the whole process is switched to use 4k hardware pages when the
> subpage_prot system call is used, but this could be improved in future
> to switch only the affected segments.
> I have re-purposed the ioperm system call for this. The old ioperm
> system call never did anything (except return an ENOSYS error) and in
> fact never could have actually been useful for anything on the PowerPC
> architecture, so nothing ever used it.
As Arnd said reusing an old system call slot seems rather dangerous,
I'd rather avoid it. But I wonder whether we really need a new
syscall. Using 4k pages should basically be a pre-process flag
(which it already is as an implementation detail in your patch), and
thus the proper way to mark it should be a personality flag. This
also means it could be implied by certain personalities, e.g. powerpc
32bit for full compatiblity. All these process would use plain mmap/
mprotect to deal with the subpage protections.
In fact the x86 emulation on ia64 already has some hacks for that in
arch/ia64/ia32/sys_ia32.c, and it would be really useful if we could
make both the interface and eventually the code implementing it generic.
At least ia64 and mips have multiple pages sizes already and I suspect
more architectures will grow support for it.
^ permalink raw reply
* Re: [PATCH] [POWERPC][RFC] MPC8360E-RDK: Device tree and board file
From: Anton Vorontsov @ 2007-12-11 17:19 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: linuxppc-dev
In-Reply-To: <20071211113027.bee17bc0.sfr@canb.auug.org.au>
On Tue, Dec 11, 2007 at 11:30:27AM +1100, Stephen Rothwell wrote:
> On Mon, 10 Dec 2007 23:29:34 +0300 Anton Vorontsov <avorontsov@ru.mvista.com> wrote:
> >
> > +++ b/arch/powerpc/platforms/83xx/mpc836x_rdk.c
> > +
> > +static void __init mpc836x_rdk_setup_arch(void)
> > +{
> > + struct device_node *np;
> > +
> > + if (ppc_md.progress)
> > + ppc_md.progress("mpc836x_rdk_setup_arch()", 0);
> > +
> > +#ifdef CONFIG_QUICC_ENGINE
> > + qe_reset();
> > +
> > + np = of_find_node_by_name(NULL, "par_io");
> > + if (np)
> > + par_io_init(np);
> > + else
> > + pr_warning("QE PIO not initialized!\n");
>
> of_node_put(np); ?
>
> > +static int __init mpc836x_rdk_probe(void)
> > +{
> > + unsigned long root = of_get_flat_dt_root();
> > +
> > + return of_flat_dt_is_compatible(root, "MPC836xRDK");
>
> You need to include asm/prom.h to use the flattened device tree accessors.
Will fix. Much thanks for looking into this.
--
Anton Vorontsov
email: cbou@mail.ru
backup email: ya-cbou@yandex.ru
irc://irc.freenode.net/bd2
^ permalink raw reply
* Re: Patches added to for-2.6.25 and master branches of powerpc.git
From: Arnd Bergmann @ 2007-12-11 17:44 UTC (permalink / raw)
To: Jon Loeliger; +Cc: linuxppc-dev, Paul Mackerras
In-Reply-To: <E1J26IB-0004sq-Pt@jdl.com>
On Tuesday 11 December 2007, Jon Loeliger wrote:
> So, like, the other day Paul Mackerras mumbled:
> >=20
> > Jon Loeliger (2):
> > =A0 =A0 =A0 [POWERPC] Clean out asm/of_{platform, device}.h
> > =A0 =A0 =A0 [POWERPC] Clean out asm/of_{platform, device}.h from sysdev/
>=20
> Excellent, thanks!
>=20
> That leaves just this following patch from my janitor series.
>=20
> =A0 =A0 http://patchwork.ozlabs.org/linuxppc/patch?id=3D14712
>=20
> I suspect Arnd might need to pick it up or ACK it now?
>=20
Thanks for reminding me. Incidentally, I picked it up today anyway,
but I guess it would be good if Paul took it directly now that
we're on the topic. Otherwise, I'll submit it along with the
others I found in the archives within the next days.
Acked-by: Arnd Bergmann <arnd@arndb.de>
^ permalink raw reply
* RE: Linux 2.6 from git.xilinx and XUPV2P
From: Stephen Neuendorffer @ 2007-12-11 17:54 UTC (permalink / raw)
To: greenlean, linuxppc-embedded
In-Reply-To: <14274035.post@talk.nabble.com>
Hi!
Unfortunately, at this point, git.xilinx.com is not 'beginner friendly'.
There is a rather complicated set of things that has to be coordinated
between EDK and the linux kernel. Also, many EDK designs will simply
not work with the Linux drivers. Today, it is primarily a place for us
to collaborate with the open source community on new development, hence
it also is perhaps less stable than a beginner really wants.
That said:
git.xilinx.com includes all the common EDK drivers. The only thing you
should need to add is the xparameters file. Today, this requires
generating the Board Support Package from a recent version of EDK, using
the linux_2_6 OS support and copied into
arch/ppc/platforms/4xx/xparameters/. Then whenever you run make use
ARCH=3Dppc.
This appnote shows how to use the linux_2.6 BSP:
http://www.xilinx.com/support/documentation/application_notes/xapp969.pd
f
There are also several websites with more information about 'rolling
your own' Linux kernel and root file system (google some combination of
'xilinx' 'virtex' 'ml310' 'ml300' and 'linux'):
http://www.crhc.uiuc.edu/IMPACT/gsrc/hardwarelab/docs/kernel-HOWTO.html
http://www.klingauf.com/v2p/index.phtml
http://www.soe.ucsc.edu/~rios/ml310/ml310_linux.htm
http://www.cs.washington.edu/research/lis/empart/xup_ppc_linux.shtml
http://splish.ee.byu.edu/projects/LinuxFPGA/index.htm
Personally, EDK4.1 works fine for me. It may be that you are
configuring lots of features in the kernel. A good start would be the
ml300_defconfig.
Steve
> -----Original Message-----
> From:=20
> linuxppc-embedded-bounces+stephen=3Dneuendorffer.name@ozlabs.org
> =20
> [mailto:linuxppc-embedded-bounces+stephen=3Dneuendorffer.name@oz
> labs.org] On Behalf Of greenlean
> Sent: Tuesday, December 11, 2007 5:32 AM
> To: linuxppc-embedded@ozlabs.org
> Subject: Linux 2.6 from git.xilinx and XUPV2P
>=20
>=20
> Hi all,
>=20
> I'm a beginner in Xilinx & Linux world and I'm getting a bit=20
> loose. I'm
> trying to run linux kernel 2.6 that I downloaded from the=20
> xilinx git server
> on the PPC405 of the Xilinx university program Virtex II Pro=20
> (XUPV2P for the
> search engine) board, and I'm using the compiler ELDK 4.1=20
> (I' ve just read
> this compiler may cause some error so I'll change it, and try the 4.0
> version) and I'm getting a lot of compilation error and warning.=20
>=20
> I think this is what I should use, Does anybody if I have to=20
> patch this
> kernel or if it is still prepatched??
>=20
> My compiler can find some definitions like TASK_SIZE or=20
> CONFIG_KERNEL_START,
> now I'm solving it writting the values manually , I google=20
> for the error
> and make the definition where it's needed, but I don't think=20
> this is a good
> idea ;). I think this definitions should be defined in the=20
> .config file,
> because I found the values I wrote on a posted message in this list.
>=20
> Maybe somebody could guide me a bit through this kernel=20
> compilation, or send
> me .config file running. I don't know if a revision in the=20
> project is a good
> way, to put things in situation for beginers.=20
>=20
> Thanks, any info would be interesting.=20
>=20
>=20
>=20
> --=20
> View this message in context:=20
> http://www.nabble.com/Linux-2.6-from-git.xilinx-and-XUPV2P-tp1
> 4274035p14274035.html
> Sent from the linuxppc-embedded mailing list archive at Nabble.com.
>=20
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>=20
>=20
^ permalink raw reply
* Re: Patches added to for-2.6.25 and master branches of powerpc.git
From: Josh Boyer @ 2007-12-11 18:07 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev
In-Reply-To: <18270.8249.393061.840667@cargo.ozlabs.ibm.com>
On Tue, 11 Dec 2007 16:29:29 +1100
Paul Mackerras <paulus@samba.org> wrote:
> Benjamin Herrenschmidt (7):
> [POWERPC] Make isa_mem_base common to 32 and 64 bits
> [POWERPC] Merge pci_process_bridge_OF_ranges()
> [POWERPC] Fix powerpc 32-bit resource fixup for 64-bit resources
> [POWERPC] Change 32-bit PCI message about resource allocation
> [POWERPC] Remove useless volatiles in udbg_16550.c
> [POWERPC] Add of_translate_dma_address
> [POWERPC] Early debug forces console log level to max
Excellent. I have a series of patches that I'll be sending your way
shortly after Ben sends out a fixed up 4xx PCI series. Have a few
commits from Valentine and Stefan in there as well.
josh
^ 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