x86/efi: Enforce CONFIG_RELOCATABLE for EFI boot stub
[linux/fpc-iii.git] / arch / blackfin / mach-common / scb-init.c
blob2cbfb0b5679ee841ba337d7eaa39ec10a5d694db
1 /*
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.
7 */
9 #include <linux/init.h>
10 #include <linux/errno.h>
11 #include <linux/kernel.h>
12 #include <asm/scb.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)
18 unsigned int i;
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)
28 unsigned int i;
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))
37 void init_scb(void)
39 unsigned int i, j;
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]);