mm: hugetlb: fix hugepage memory leak caused by wrong reserve count
[linux/fpc-iii.git] / arch / blackfin / mach-common / scb-init.c
blob8923398db66f01eef7777faaa08f2d324674e4ed
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/errno.h>
10 #include <linux/kernel.h>
11 #include <asm/scb.h>
13 __attribute__((l1_text))
14 inline void scb_mi_write(unsigned long scb_mi_arbw, unsigned int slots,
15 unsigned char *scb_mi_prio)
17 unsigned int i;
19 for (i = 0; i < slots; ++i)
20 bfin_write32(scb_mi_arbw, (i << SCB_SLOT_OFFSET) | scb_mi_prio[i]);
23 __attribute__((l1_text))
24 inline void scb_mi_read(unsigned long scb_mi_arbw, unsigned int slots,
25 unsigned char *scb_mi_prio)
27 unsigned int i;
29 for (i = 0; i < slots; ++i) {
30 bfin_write32(scb_mi_arbw, (0xFF << SCB_SLOT_OFFSET) | i);
31 scb_mi_prio[i] = bfin_read32(scb_mi_arbw);
35 __attribute__((l1_text))
36 void init_scb(void)
38 unsigned int i, j;
39 unsigned char scb_tmp_prio[32];
41 pr_info("Init System Crossbar\n");
42 for (i = 0; scb_data[i].scb_mi_arbr > 0; ++i) {
44 scb_mi_write(scb_data[i].scb_mi_arbw, scb_data[i].scb_mi_slots, scb_data[i].scb_mi_prio);
46 pr_debug("scb priority at 0x%lx:\n", scb_data[i].scb_mi_arbr);
47 scb_mi_read(scb_data[i].scb_mi_arbw, scb_data[i].scb_mi_slots, scb_tmp_prio);
48 for (j = 0; j < scb_data[i].scb_mi_slots; ++j)
49 pr_debug("slot %d = %d\n", j, scb_tmp_prio[j]);