2 * arch/blackfin/mach-common/scb-init.c - reprogram system cross bar priority
4 * Copyright 2012 Analog Devices Inc.
6 * Licensed under the GPL-2 or later.
9 #include <linux/init.h>
10 #include <linux/errno.h>
11 #include <linux/kernel.h>
14 __attribute__((l1_text
))
15 inline void scb_mi_write(unsigned long scb_mi_arbw
, unsigned int slots
,
16 unsigned char *scb_mi_prio
)
20 for (i
= 0; i
< slots
; ++i
)
21 bfin_write32(scb_mi_arbw
, (i
<< SCB_SLOT_OFFSET
) | scb_mi_prio
[i
]);
24 __attribute__((l1_text
))
25 inline void scb_mi_read(unsigned long scb_mi_arbw
, unsigned int slots
,
26 unsigned char *scb_mi_prio
)
30 for (i
= 0; i
< slots
; ++i
) {
31 bfin_write32(scb_mi_arbw
, (0xFF << SCB_SLOT_OFFSET
) | i
);
32 scb_mi_prio
[i
] = bfin_read32(scb_mi_arbw
);
36 __attribute__((l1_text
))
40 unsigned char scb_tmp_prio
[32];
42 pr_info("Init System Crossbar\n");
43 for (i
= 0; scb_data
[i
].scb_mi_arbr
> 0; ++i
) {
45 scb_mi_write(scb_data
[i
].scb_mi_arbw
, scb_data
[i
].scb_mi_slots
, scb_data
[i
].scb_mi_prio
);
47 pr_debug("scb priority at 0x%lx:\n", scb_data
[i
].scb_mi_arbr
);
48 scb_mi_read(scb_data
[i
].scb_mi_arbw
, scb_data
[i
].scb_mi_slots
, scb_tmp_prio
);
49 for (j
= 0; j
< scb_data
[i
].scb_mi_slots
; ++j
)
50 pr_debug("slot %d = %d\n", j
, scb_tmp_prio
[j
]);