Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2)  * This file is subject to the terms and conditions of the GNU General Public
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  * License.  See the file "COPYING" in the main directory of this archive
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  * for more details.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  * Copyright (C) 2003 Atheros Communications, Inc.,  All Rights Reserved.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7)  * Copyright (C) 2006 FON Technology, SL.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8)  * Copyright (C) 2006 Imre Kaloz <kaloz@openwrt.org>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9)  * Copyright (C) 2006-2009 Felix Fietkau <nbd@openwrt.org>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) #include <linux/init.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) #include <linux/interrupt.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) #include <asm/irq_cpu.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) #include <asm/reboot.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) #include <asm/bootinfo.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) #include <asm/time.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) #include <ath25_platform.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) #include "devices.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) #include "ar5312.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) #include "ar2315.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) void (*ath25_irq_dispatch)(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) static inline bool check_radio_magic(const void __iomem *addr)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) 	addr += 0x7a; /* offset for flash magic */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) 	return (__raw_readb(addr) == 0x5a) && (__raw_readb(addr + 1) == 0xa5);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) static inline bool check_notempty(const void __iomem *addr)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) 	return __raw_readl(addr) != 0xffffffff;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) static inline bool check_board_data(const void __iomem *addr, bool broken)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) 	/* config magic found */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) 	if (__raw_readl(addr) == ATH25_BD_MAGIC)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) 		return true;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) 	if (!broken)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) 		return false;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) 	/* broken board data detected, use radio data to find the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 	 * offset, user will fix this */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 	if (check_radio_magic(addr + 0x1000))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 		return true;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 	if (check_radio_magic(addr + 0xf8))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 		return true;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 	return false;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) static const void __iomem * __init find_board_config(const void __iomem *limit,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 						     const bool broken)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 	const void __iomem *addr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 	const void __iomem *begin = limit - 0x1000;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 	const void __iomem *end = limit - 0x30000;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 	for (addr = begin; addr >= end; addr -= 0x1000)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 		if (check_board_data(addr, broken))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 			return addr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 	return NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) static const void __iomem * __init find_radio_config(const void __iomem *limit,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 						     const void __iomem *bcfg)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 	const void __iomem *rcfg, *begin, *end;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 	 * Now find the start of Radio Configuration data, using heuristics:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 	 * Search forward from Board Configuration data by 0x1000 bytes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 	 * at a time until we find non-0xffffffff.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 	begin = bcfg + 0x1000;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 	end = limit;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 	for (rcfg = begin; rcfg < end; rcfg += 0x1000)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 		if (check_notempty(rcfg) && check_radio_magic(rcfg))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 			return rcfg;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 	/* AR2316 relocates radio config to new location */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 	begin = bcfg + 0xf8;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 	end = limit - 0x1000 + 0xf8;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 	for (rcfg = begin; rcfg < end; rcfg += 0x1000)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 		if (check_notempty(rcfg) && check_radio_magic(rcfg))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 			return rcfg;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 	return NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98)  * NB: Search region size could be larger than the actual flash size,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99)  * but this shouldn't be a problem here, because the flash
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100)  * will simply be mapped multiple times.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) int __init ath25_find_config(phys_addr_t base, unsigned long size)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 	const void __iomem *flash_base, *flash_limit;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 	struct ath25_boarddata *config;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 	unsigned int rcfg_size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 	int broken_boarddata = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 	const void __iomem *bcfg, *rcfg;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 	u8 *board_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 	u8 *radio_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 	u8 *mac_addr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 	u32 offset;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 	flash_base = ioremap(base, size);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 	flash_limit = flash_base + size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 	ath25_board.config = NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 	ath25_board.radio = NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 	/* Copy the board and radio data to RAM, because accessing the mapped
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 	 * memory of the flash directly after booting is not safe */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 	/* Try to find valid board and radio data */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 	bcfg = find_board_config(flash_limit, false);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 	/* If that fails, try to at least find valid radio data */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 	if (!bcfg) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 		bcfg = find_board_config(flash_limit, true);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 		broken_boarddata = 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 	if (!bcfg) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 		pr_warn("WARNING: No board configuration data found!\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 		goto error;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 	board_data = kzalloc(BOARD_CONFIG_BUFSZ, GFP_KERNEL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 	if (!board_data)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 		goto error;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 	ath25_board.config = (struct ath25_boarddata *)board_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 	memcpy_fromio(board_data, bcfg, 0x100);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 	if (broken_boarddata) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 		pr_warn("WARNING: broken board data detected\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 		config = ath25_board.config;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 		if (is_zero_ether_addr(config->enet0_mac)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 			pr_info("Fixing up empty mac addresses\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 			config->reset_config_gpio = 0xffff;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 			config->sys_led_gpio = 0xffff;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 			eth_random_addr(config->wlan0_mac);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 			config->wlan0_mac[0] &= ~0x06;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 			eth_random_addr(config->enet0_mac);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 			eth_random_addr(config->enet1_mac);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 	/* Radio config starts 0x100 bytes after board config, regardless
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 	 * of what the physical layout on the flash chip looks like */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 	rcfg = find_radio_config(flash_limit, bcfg);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 	if (!rcfg) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 		pr_warn("WARNING: Could not find Radio Configuration data\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 		goto error;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 	radio_data = board_data + 0x100 + ((rcfg - bcfg) & 0xfff);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 	ath25_board.radio = radio_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 	offset = radio_data - board_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 	pr_info("Radio config found at offset 0x%x (0x%x)\n", rcfg - bcfg,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 		offset);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 	rcfg_size = BOARD_CONFIG_BUFSZ - offset;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 	memcpy_fromio(radio_data, rcfg, rcfg_size);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 	mac_addr = &radio_data[0x1d * 2];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 	if (is_broadcast_ether_addr(mac_addr)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 		pr_info("Radio MAC is blank; using board-data\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 		ether_addr_copy(mac_addr, ath25_board.config->wlan0_mac);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 	iounmap(flash_base);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) error:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 	iounmap(flash_base);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 	return -ENODEV;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) static void ath25_halt(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 	local_irq_disable();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 	unreachable();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) void __init plat_mem_setup(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 	_machine_halt = ath25_halt;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 	pm_power_off = ath25_halt;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 	if (is_ar5312())
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 		ar5312_plat_mem_setup();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 	else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) 		ar2315_plat_mem_setup();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) 	/* Disable data watchpoints */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) 	write_c0_watchlo0(0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) asmlinkage void plat_irq_dispatch(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 	ath25_irq_dispatch();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) void __init plat_time_init(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 	if (is_ar5312())
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) 		ar5312_plat_time_init();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 	else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) 		ar2315_plat_time_init();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) unsigned int get_c0_compare_int(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) 	return CP0_LEGACY_COMPARE_IRQ;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) void __init arch_init_irq(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) 	clear_c0_status(ST0_IM);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) 	mips_cpu_irq_init();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) 	/* Initialize interrupt controllers */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) 	if (is_ar5312())
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) 		ar5312_arch_init_irq();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) 	else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) 		ar2315_arch_init_irq();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) }