162306a36Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0 262306a36Sopenharmony_ci/* 362306a36Sopenharmony_ci * arch/sh/drivers/pci/fixups-sdk7780.c 462306a36Sopenharmony_ci * 562306a36Sopenharmony_ci * PCI fixups for the SDK7780SE03 662306a36Sopenharmony_ci * 762306a36Sopenharmony_ci * Copyright (C) 2003 Lineo uSolutions, Inc. 862306a36Sopenharmony_ci * Copyright (C) 2004 - 2006 Paul Mundt 962306a36Sopenharmony_ci * Copyright (C) 2006 Nobuhiro Iwamatsu 1062306a36Sopenharmony_ci */ 1162306a36Sopenharmony_ci#include <linux/pci.h> 1262306a36Sopenharmony_ci#include <linux/io.h> 1362306a36Sopenharmony_ci#include <linux/sh_intc.h> 1462306a36Sopenharmony_ci#include "pci-sh4.h" 1562306a36Sopenharmony_ci 1662306a36Sopenharmony_ci#define IRQ_INTA evt2irq(0xa20) 1762306a36Sopenharmony_ci#define IRQ_INTB evt2irq(0xa40) 1862306a36Sopenharmony_ci#define IRQ_INTC evt2irq(0xa60) 1962306a36Sopenharmony_ci#define IRQ_INTD evt2irq(0xa80) 2062306a36Sopenharmony_ci 2162306a36Sopenharmony_ci/* IDSEL [16][17][18][19][20][21][22][23][24][25][26][27][28][29][30][31] */ 2262306a36Sopenharmony_cistatic char sdk7780_irq_tab[4][16] = { 2362306a36Sopenharmony_ci /* INTA */ 2462306a36Sopenharmony_ci { IRQ_INTA, IRQ_INTD, IRQ_INTC, IRQ_INTD, -1, -1, -1, -1, -1, -1, 2562306a36Sopenharmony_ci -1, -1, -1, -1, -1, -1 }, 2662306a36Sopenharmony_ci /* INTB */ 2762306a36Sopenharmony_ci { IRQ_INTB, IRQ_INTA, -1, IRQ_INTA, -1, -1, -1, -1, -1, -1, -1, -1, 2862306a36Sopenharmony_ci -1, -1, -1, -1 }, 2962306a36Sopenharmony_ci /* INTC */ 3062306a36Sopenharmony_ci { IRQ_INTC, IRQ_INTB, -1, IRQ_INTB, -1, -1, -1, -1, -1, -1, -1, -1, 3162306a36Sopenharmony_ci -1, -1, -1, -1 }, 3262306a36Sopenharmony_ci /* INTD */ 3362306a36Sopenharmony_ci { IRQ_INTD, IRQ_INTC, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3462306a36Sopenharmony_ci -1, -1, -1 }, 3562306a36Sopenharmony_ci}; 3662306a36Sopenharmony_ci 3762306a36Sopenharmony_ciint pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin) 3862306a36Sopenharmony_ci{ 3962306a36Sopenharmony_ci return sdk7780_irq_tab[pin-1][slot]; 4062306a36Sopenharmony_ci} 41