* RE: using the little endian bit 4xx mmu
@ 2001-08-23 18:28 Marti, Felix
2001-08-24 4:26 ` Dan Malek
0 siblings, 1 reply; 6+ messages in thread
From: Marti, Felix @ 2001-08-23 18:28 UTC (permalink / raw)
To: 'Troy Benjegerdes', Ralph Blach; +Cc: Linix PPC Emmbedded
I hacked it in a few hours:
in arch/ppc/kernel/head_4xx.S
in the DTLBMissHandler
START_EXCEPTION(0x1100, DTLBMiss)
check if we want to set the bit (_PAGE_ENDIAN is defined to be 0x800)
<nl> andi. r22, r21, _PAGE_ENDIAN /* Perfom endian swap on this
page */
<nl> bne endian_tlb_load
^[OA^[OA\b
/*
<nl> * mapping with endian (e) storage attribute set, see ch. 3.5.3
<nl> * in the PPC405GP User's Manual.
<nl> * (this is kind of temporary, until the SCF does the swapping
<nl> * for us) --fmarti
<nl> */
endian_tlb_load:
<nl> li r22, 0x0c00
<nl> andc r21, r21, r22 /* Make sure 20, 21 are zero */
<nl> ori r21, r21, 0x02e0 /* TLB LO ready to go */
<nl>
<nl> tlbsx. r23, 0, r20
<nl> beq match_exists
<nl>
<nl> /* load the next available TLB index.
<nl> */
<nl> lis r22, tlb_4xx_index@h
<nl> ori r22, r22, tlb_4xx_index@l
<nl> tophys(r22, r22)
<nl> lwz r23, 0(r22)
<nl> addi r23, r23, 1
<nl> andi. r23, r23, (PPC4XX_TLB_SIZE-1)
<nl> stw r23, 0(r22)
<nl>
match_exists:
<nl> tlbwe r21, r23, TLB_DATA /* Load TLB LO */
<nl>
<nl> /* Create EPN. This is the faulting address plus a static
<nl> * set of bits. These are size, valid, E, U0, and ensure
<nl> * bits 20 and 21 are zero.
<nl> */
<nl> li r22, 0x00e0 /* Set Size=4kB, V=1,
E=1 */
<nl> rlwimi r20, r22, 0, 20, 31
<nl> tlbwe r20, r23, TLB_TAG /* Load TLB HI */
<nl>
<nl> /* Done...restore registers and get out of here.
<nl> */
<nl> mfspr r22, SPRG6
<nl> mfspr r21, SPRG7
<nl> mtspr SPRN_PID, r22
<nl> mtcr r21
<nl> mfspr r23, SPRG5
<nl> mfspr r22, SPRG4
<nl> mfspr r21, SPRG1
<nl> mfspr r20, SPRG0
<nl> rfi
it could be done nicer (less code), but I needed it fast and it is only a
temporary solution for me.
-----Original Message-----
From: Troy Benjegerdes [mailto:hozer@drgw.net]
Sent: Thursday, August 23, 2001 10:53 AM
To: Ralph Blach
Cc: Linix PPC Emmbedded
Subject: Re: using the little endian bit 4xx mmu
On Thu, Aug 23, 2001 at 01:39:15PM -0400, Ralph Blach wrote:
>
> Is there any hope of getting an ioremap little endian in the 4xx code
> so the tlb would use little endian bit in the tlb?
Do you have an implementation or a patch that does this?
I think we'd be happy to look at it if someone comes up with a nice, clean
implementation.
Most of the developers seem too busy with other problems to work on
something that might take a lot of work, but only works on a small subset
of PPC chips.
--
Troy Benjegerdes | master of mispeeling | 'da hozer' | hozer@drgw.net
-----"If this message isn't misspelled, I didn't write it" -- Me -----
"Why do musicians compose symphonies and poets write poems? They do it
because life wouldn't have any meaning for them if they didn't. That's
why I draw cartoons. It's my life." -- Charles Shulz
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: using the little endian bit 4xx mmu
2001-08-23 18:28 using the little endian bit 4xx mmu Marti, Felix
@ 2001-08-24 4:26 ` Dan Malek
2001-08-24 10:41 ` Ralph Blach
0 siblings, 1 reply; 6+ messages in thread
From: Dan Malek @ 2001-08-24 4:26 UTC (permalink / raw)
To: Marti, Felix; +Cc: 'Troy Benjegerdes', Ralph Blach, Linix PPC Emmbedded
"Marti, Felix" wrote:
>
> I hacked it in a few hours:
> in arch/ppc/kernel/head_4xx.S
Ugh....we have discussed this in the past. What is the advantage
of using this feature? All of the existing drivers and I/O macros
are designed to handle mixing of endian modes depending upon the
processor and I/O device. All this does is complicate a standard
set of programming interfaces that everyone expects to work as they
have in the past.
The ability to set a feature flag in the PTE and transfer that to
the TLB isn't a solution to anything. You are going to have to
rewrite all of the standard functions, macros, and device drivers
to utilize this feature, and we haven't seen any benefit to doing this.
-- Dan
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: using the little endian bit 4xx mmu
2001-08-24 4:26 ` Dan Malek
@ 2001-08-24 10:41 ` Ralph Blach
0 siblings, 0 replies; 6+ messages in thread
From: Ralph Blach @ 2001-08-24 10:41 UTC (permalink / raw)
To: Dan Malek; +Cc: Marti, Felix, 'Troy Benjegerdes', Linix PPC Emmbedded
Dan,
Because its there, and its been hacked in here and the people here have
found it VERY useful and convienent. 4xx specific or not, the people
found it extremely convienent.
Chip
Dan Malek wrote:
>
> "Marti, Felix" wrote:
> >
> > I hacked it in a few hours:
> > in arch/ppc/kernel/head_4xx.S
>
> Ugh....we have discussed this in the past. What is the advantage
> of using this feature? All of the existing drivers and I/O macros
> are designed to handle mixing of endian modes depending upon the
> processor and I/O device. All this does is complicate a standard
> set of programming interfaces that everyone expects to work as they
> have in the past.
>
> The ability to set a feature flag in the PTE and transfer that to
> the TLB isn't a solution to anything. You are going to have to
> rewrite all of the standard functions, macros, and device drivers
> to utilize this feature, and we haven't seen any benefit to doing this.
>
> -- Dan
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: using the little endian bit 4xx mmu
@ 2001-08-24 21:21 Marti, Felix
0 siblings, 0 replies; 6+ messages in thread
From: Marti, Felix @ 2001-08-24 21:21 UTC (permalink / raw)
To: 'Ralph Blach', Dan Malek
Cc: Marti, Felix, 'Troy Benjegerdes', Linix PPC Emmbedded
I don't see why anybody would object to the feature. Legacy code simply
doesn't take advantage of it and uses the old macros (personally, I find the
feature flag a much cleaner solution though). New development can start
taking advantage of it.
felix
-----Original Message-----
From: Ralph Blach [mailto:rcblach@raleigh.ibm.com]
Sent: Friday, August 24, 2001 3:42 AM
To: Dan Malek
Cc: Marti, Felix; 'Troy Benjegerdes'; Linix PPC Emmbedded
Subject: Re: using the little endian bit 4xx mmu
Dan,
Because its there, and its been hacked in here and the people here have
found it VERY useful and convienent. 4xx specific or not, the people
found it extremely convienent.
Chip
Dan Malek wrote:
>
> "Marti, Felix" wrote:
> >
> > I hacked it in a few hours:
> > in arch/ppc/kernel/head_4xx.S
>
> Ugh....we have discussed this in the past. What is the advantage
> of using this feature? All of the existing drivers and I/O macros
> are designed to handle mixing of endian modes depending upon the
> processor and I/O device. All this does is complicate a standard
> set of programming interfaces that everyone expects to work as they
> have in the past.
>
> The ability to set a feature flag in the PTE and transfer that to
> the TLB isn't a solution to anything. You are going to have to
> rewrite all of the standard functions, macros, and device drivers
> to utilize this feature, and we haven't seen any benefit to doing this.
>
> -- Dan
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 6+ messages in thread
* using the little endian bit 4xx mmu
@ 2001-08-23 17:39 Ralph Blach
2001-08-23 17:53 ` Troy Benjegerdes
0 siblings, 1 reply; 6+ messages in thread
From: Ralph Blach @ 2001-08-23 17:39 UTC (permalink / raw)
To: Linix PPC Emmbedded
Is there any hope of getting an ioremap little endian in the 4xx code
so the tlb would use little endian bit in the tlb?
Thanks
Chip
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: using the little endian bit 4xx mmu
2001-08-23 17:39 Ralph Blach
@ 2001-08-23 17:53 ` Troy Benjegerdes
0 siblings, 0 replies; 6+ messages in thread
From: Troy Benjegerdes @ 2001-08-23 17:53 UTC (permalink / raw)
To: Ralph Blach; +Cc: Linix PPC Emmbedded
On Thu, Aug 23, 2001 at 01:39:15PM -0400, Ralph Blach wrote:
>
> Is there any hope of getting an ioremap little endian in the 4xx code
> so the tlb would use little endian bit in the tlb?
Do you have an implementation or a patch that does this?
I think we'd be happy to look at it if someone comes up with a nice, clean
implementation.
Most of the developers seem too busy with other problems to work on
something that might take a lot of work, but only works on a small subset
of PPC chips.
--
Troy Benjegerdes | master of mispeeling | 'da hozer' | hozer@drgw.net
-----"If this message isn't misspelled, I didn't write it" -- Me -----
"Why do musicians compose symphonies and poets write poems? They do it
because life wouldn't have any meaning for them if they didn't. That's
why I draw cartoons. It's my life." -- Charles Shulz
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2001-08-24 21:21 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-08-23 18:28 using the little endian bit 4xx mmu Marti, Felix
2001-08-24 4:26 ` Dan Malek
2001-08-24 10:41 ` Ralph Blach
-- strict thread matches above, loose matches on Subject: below --
2001-08-24 21:21 Marti, Felix
2001-08-23 17:39 Ralph Blach
2001-08-23 17:53 ` Troy Benjegerdes
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).