Dwayne Dietrich

5272 vrs 5282 memory protection, was problems writing a driver

Discussion created by Dwayne Dietrich Employee on Mar 31, 2006
Latest reply on Mar 31, 2006 by Dwayne Dietrich
This message contains an entire topic ported from the WildRice - Coldfire forum.  Freescale has received the approval from the WildRice administrator on seeding the Freescale forum with messages.  The original message and all replies are in this single message. We have seeded this new forum with selected information that we expect will be of value as you search for answers to your questions.  Freescale assumes no responsibility whatsoever with respect to Posted Material.  For additional information, please see the Terms of Use - Message Boards and Community Forums.  Thank You and Enjoy the Forum!


Feb 1, 2006, 7:33 AM
Post #1 of 8 (38 views)
 [ColdFire] 5272 vrs 5282 memory protection, was problems writing a driver
--------------------------------------------------------------------------------
 
>> But I was only trying to make the point, that it is not going to help him
>> accomplish memory protection on a 5272, which is impossible.
> I just had a quick glance at the 5272 UM and it looks like it
> implements a super/user bit in each CSBR register, to restrict
> accesses to being allow only when in the appropriate protection
> mode.
> So it would allow some limited address space protection (certainly
> against perhiperal devices on CS lines). I didn't check any further
> but you may be able to protect internal perhipals too.
Huh, there is, ok, but I don't see any sort of protection capable of locking
down GPIO registers, (this was the original discussion although yes, I did
foolishly started throwing out absolutes).The 5282 provides this capability
with it's SCM module, which the 5272 lacks. Historically there is no sort of
memory protection to these registers in the uClinux port for the 5272.
Whether or not the processor has the capability to implement some sort of
memory protection is more research than I want to do right now, I don't see
anything looking in the features list.
I cc'd the Wildrice list. Maybe somebody over there can shine some light on
this discussion, it's really more their realm.
Would anyone mind giving a brief overview of the memory protection capabilties
of the 5272 vrs the 5282?
thx,
NZG
--------------------------------------------------------------------
Feb 1, 2006, 4:51 PM
Post #2 of 8 (36 views)
 Re: [ColdFire] 5272 vrs 5282 memory protection, was problems writing a driver [In reply to]
--------------------------------------------------------------------------------
 
 
NZG wrote:
>>>But I was only trying to make the point, that it is not going to help him
>>>accomplish memory protection on a 5272, which is impossible.
>
>
>>I just had a quick glance at the 5272 UM and it looks like it
>>implements a super/user bit in each CSBR register, to restrict
>>accesses to being allow only when in the appropriate protection
>>mode.
>>So it would allow some limited address space protection (certainly
>>against perhiperal devices on CS lines). I didn't check any further
>>but you may be able to protect internal perhipals too.
>
>
> Huh, there is, ok, but I don't see any sort of protection capable of locking
> down GPIO registers, (this was the original discussion although yes, I did
> foolishly started throwing out absolutes).The 5282 provides this capability
> with it's SCM module, which the 5272 lacks. Historically there is no sort of
> memory protection to these registers in the uClinux port for the 5272.
Yes, as I already told you in this thread. None of the address space
protection mechanisms has ever been used on any ColdFire part running
uClinux. Not just the 5272.
Regards
Greg
 
------------------------------------------------------------------------
Greg Ungerer -- Chief Software Dude 
SnapGear -- a CyberGuard Company PHONE: +61 7 3435 2888
825 Stanley St, FAX: +61 7 3891 3630
Woolloongabba, QLD, 4102, Australia
--------------------------------------------------------------------
Feb 2, 2006, 6:43 AM
Post #3 of 8 (34 views)
 
 Re: [ColdFire] 5272 vrs 5282 memory protection, was problems writing a driver [In reply to] 
--------------------------------------------------------------------------------
 
> Yes, as I already told you in this thread. None of the address space
> protection mechanisms has ever been used on any ColdFire part running
> uClinux. Not just the 5272.
Perhaps not deliberately, but address protection is used on most 5282
platforms.
By default the MCF5282 prevents users from dereferencing internal registers
except from supervisor mode, which the kernel runs in.
This may have not been intentional, but it does result in a protection scheme.
NZG
 
--------------------------------------------------------------------
Feb 2, 2006, 7:52 PM
Post #4 of 8 (32 views)
 
 Re: [ColdFire] 5272 vrs 5282 memory protection, was problems writing a driver [In reply to] 
--------------------------------------------------------------------------------
 
 
NZG wrote:
>>Yes, as I already told you in this thread. None of the address space
>>protection mechanisms has ever been used on any ColdFire part running
>>uClinux. Not just the 5272.
>
> Perhaps not deliberately, but address protection is used on most 5282
> platforms.
This is completely boot loader specific, so generalizing it to
"most" is not really helpful.
uClinux neither setups any address space registers itself, and it
doesn't rely on them being set in any particular way.
Regards
Greg

------------------------------------------------------------------------
Greg Ungerer -- Chief Software Dude
SnapGear -- a CyberGuard Company PHONE: +61 7 3435 2888
825 Stanley St, FAX: +61 7 3891 3630
Woolloongabba, QLD, 4102, Australia
--------------------------------------------------------------------
Feb 3, 2006, 7:29 AM
Post #5 of 8 (29 views)
 
 Re: [ColdFire] 5272 vrs 5282 memory protection, was problems writing a driver [In reply to] 
--------------------------------------------------------------------------------
 
On Thursday 02 February 2006 9:52 pm, Greg Ungerer wrote:
> NZG wrote:
> >>Yes, as I already told you in this thread. None of the address space
> >>protection mechanisms has ever been used on any ColdFire part running
> >>uClinux. Not just the 5272.
> >
> > Perhaps not deliberately, but address protection is used on most 5282
> > platforms.
>
> This is completely boot loader specific,
That is true in the sense that since Linux doesn't modify it, it keeps
whatever was passed to it.
But it's not truein the fact that it isn't something that has to set up, it
defaults to it.
It's also not true in the fact that Linux implements a separate kernel/user
space which allows the memory protection scheme to work.
Although, yes, theoretically it's out of Linux's hands, I get customer
support requests and emails saying "I can't access my 5282 registers from
user space but I could from my old 5272, whats wrong?"
> so generalizing it to
> "most" is not really helpful.
I disagree, I don't have any statistical evidence to back me up, but I think
it very likely that this will "mostly" be the case.
Because the only reason you would have user space access is if the bootloader
specifically turned off supervisor protection of registers before passing
control to the OS, which would be a very silly thing for it to do. Register
protection in the 5282 is controlled by a section of registers that do
nothing but provide register protection, so their wouldn't really be a reason
to set them inadvertantly.
I know for a fact that u-boot does not turn them off.
I don't know about Freescales bootloader, but it would be very silly for them
to do that since they designed the hardware and should really know better.
Does the bootloader you use turn it off?
Does anyone on this list know of one that does?
NZG
-------------------------------------------------------------------- 
 
 

Message Edited by Dietrich on 04-01-2006 11:32 AM

Message Edited by Dietrich on 04-04-2006 09:32 PM

Outcomes