mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-24 21:54:01 +00:00
86xx: Add print_laws function to fsl_law.c
This can be used for debug, and will be used by board code to help implement reginfo. Signed-off-by: Becky Bruce <becky.bruce@freescale.com>
This commit is contained in:
parent
9cd32426f2
commit
ddcebcb638
2 changed files with 20 additions and 0 deletions
|
@ -28,6 +28,7 @@
|
|||
#include <asm/io.h>
|
||||
|
||||
#define LAWAR_EN 0x80000000
|
||||
#define FSL_HW_NUM_LAWS 10 /* number of LAWs in the hw implementation */
|
||||
|
||||
void set_law(u8 idx, phys_addr_t addr, enum law_size sz, enum law_trgt_if id)
|
||||
{
|
||||
|
@ -53,6 +54,24 @@ void disable_law(u8 idx)
|
|||
return;
|
||||
}
|
||||
|
||||
void print_laws(void)
|
||||
{
|
||||
volatile u32 *base = (volatile u32 *)(CFG_IMMR + 0xc08);
|
||||
volatile u32 *lawbar = base;
|
||||
volatile u32 *lawar = base + 2;
|
||||
int i;
|
||||
|
||||
printf("\nLocal Access Window Configuration\n");
|
||||
for(i = 0; i < FSL_HW_NUM_LAWS; i++) {
|
||||
printf("\tLAWBAR%d : 0x%08x, LAWAR%d : 0x%08x\n",
|
||||
i, in_be32(lawbar), i, in_be32(lawar));
|
||||
lawbar += 8;
|
||||
lawar += 8;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void init_laws(void)
|
||||
{
|
||||
int i;
|
||||
|
|
|
@ -73,6 +73,7 @@ struct law_entry {
|
|||
extern void set_law(u8 idx, phys_addr_t addr, enum law_size sz, enum law_trgt_if id);
|
||||
extern void disable_law(u8 idx);
|
||||
extern void init_laws(void);
|
||||
extern void print_laws(void);
|
||||
|
||||
/* define in board code */
|
||||
extern struct law_entry law_table[];
|
||||
|
|
Loading…
Reference in a new issue