On Tue, Feb 26, 2013 at 10:10:17PM +0100, Ján Veselý wrote:
> +/** Disable the MMU */
> +static void disable_paging(void)
> +{
> + asm volatile (
> + "mrc p15, 0, r0, c1, c0, 0\n"
> + "bic r0, r0, #1\n"
> + "mcr p15, 0, r0, c1, c0, 0\n"
> + ::: "r0"
> + );
> +}
>
> I don't understand why paging needs to be disabled.
> is TLB flush after setting new page tables (just like normal AS switch) not
> enough?
On my beaglebone, u-boot does not disable the MMU before passing
the control to the HelenOS loader, this leads to a "Permission
Fault on Section" exception when changing the access permissions.
I'm talking about these instructions:
/* Behave as a client of domains */
"ldr r0, =0x55555555\n"
"mcr p15, 0, r0, c3, c0, 0\n"
I decided to force the MMU off before starting changing
the settings, it fixed this problem and at the same time
it exposed the TLB bug.
>
>
> --- kernel/arch/arm32/_link.ld.in 2012-07-14 11:18:40 +0000
> +++ kernel/arch/arm32/_link.ld.in 2013-01-26 09:05:12 +0000
> @@ -10,6 +10,8 @@
> #define KERNEL_LOAD_ADDRESS 0xb0a08000
> #elif defined MACHINE_beagleboardxm
> #define KERNEL_LOAD_ADDRESS 0x80a00000
> +#elif define MACHINE_beaglebone
> +#define KERNEL_LOAD_ADDRESS 0x80a00000
>
> typo, should be probably define-d-.
Yes that's a typo, damn. Thanks for reporting this.
I'll commit a fix later.
>
> kernel/genarch/include/drivers/am335x/ctrl_module_regs.h:
>
> I don't understand why the ctrl module register access is different from
> all the other drivers added.
> Do you plan to convert it, or does it need this format for some reason?
> you use arbitrary constant values in few places (I do too :), it might be
> better to switch them to defines.
I was trying two different approaches to the registers access, the one based
on structures (uart, timers...) and the one based on offsets (the ctrl
module).
The latter is the preferred way under FreeBSD, and it has some merits.
Don't worry about that, I still have to work on that part.
I know I'm using constant values in some places instead of defines and that
I should fix that.
BTW, are we really sure that this line of code
/* Get the sysboot1 field at control_status[22,23] */
unsigned const sysboot1 = (control_status >> 22) & 0x03;
is less readable than
unsigned const sysboot1 = (control_status >>
AM335x_CTRL_MODULE_REG_SYSBOOT1_SHIFT) &
AM335x_CTRL_MODULE_REG_SYSBOOT1_MASK;
?
----
Maurizio Lombardi
_______________________________________________
HelenOS-devel mailing list
[email protected]
http://lists.modry.cz/cgi-bin/listinfo/helenos-devel