From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1CC17C3A5A4 for ; Sun, 1 Sep 2019 16:03:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E3AB6215EA for ; Sun, 1 Sep 2019 16:03:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728863AbfIAQDG (ORCPT ); Sun, 1 Sep 2019 12:03:06 -0400 Received: from pio-pvt-msa2.bahnhof.se ([79.136.2.41]:58832 "EHLO pio-pvt-msa2.bahnhof.se" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728570AbfIAQDG (ORCPT ); Sun, 1 Sep 2019 12:03:06 -0400 Received: from localhost (localhost [127.0.0.1]) by pio-pvt-msa2.bahnhof.se (Postfix) with ESMTP id CEC7B3FC34 for ; Sun, 1 Sep 2019 18:03:04 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at bahnhof.se Received: from pio-pvt-msa2.bahnhof.se ([127.0.0.1]) by localhost (pio-pvt-msa2.bahnhof.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DN2xY3Z4xV6m for ; Sun, 1 Sep 2019 18:03:04 +0200 (CEST) Received: from localhost (h-41-252.A163.priv.bahnhof.se [46.59.41.252]) (Authenticated sender: mb547485) by pio-pvt-msa2.bahnhof.se (Postfix) with ESMTPA id 300593F53F for ; Sun, 1 Sep 2019 18:03:04 +0200 (CEST) Date: Sun, 1 Sep 2019 18:03:04 +0200 From: Fredrik Noring To: linux-mips@vger.kernel.org Subject: [PATCH 064/120] MIPS: PS2: IOP: Permit /dev/mem to access IOP memory Message-ID: <63369b9b67d63891d34e854ca9110da78415d19b.1567326213.git.noring@nocrew.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org Signed-off-by: Fredrik Noring --- arch/mips/include/asm/mach-ps2/iop.h | 21 +++++++++++++++++++++ arch/mips/ps2/memory.c | 2 ++ 2 files changed, 23 insertions(+) create mode 100644 arch/mips/include/asm/mach-ps2/iop.h diff --git a/arch/mips/include/asm/mach-ps2/iop.h b/arch/mips/include/asm/mach-ps2/iop.h new file mode 100644 index 000000000000..65585451e743 --- /dev/null +++ b/arch/mips/include/asm/mach-ps2/iop.h @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * PlayStation 2 input/output processor (IOP) + * + * Copyright (C) 2019 Fredrik Noring + */ + +#ifndef __ASM_MACH_PS2_IOP_H +#define __ASM_MACH_PS2_IOP_H + +#define IOP_RAM_BASE 0x1c000000 +#define IOP_RAM_SIZE 0x200000 + +#define IOP_OHCI_BASE 0x1f801600 + +/** + * iop_addr_t - I/O processor (IOP) bus address + */ +typedef u32 iop_addr_t; + +#endif /* __ASM_MACH_PS2_IOP_H */ diff --git a/arch/mips/ps2/memory.c b/arch/mips/ps2/memory.c index c513b6912bb0..51614b6d0515 100644 --- a/arch/mips/ps2/memory.c +++ b/arch/mips/ps2/memory.c @@ -13,11 +13,13 @@ #include #include +#include #include int valid_phys_addr_range(phys_addr_t addr, size_t size) { return addr + size <= __pa(high_memory) || + (IOP_RAM_BASE <= addr && addr + size <= IOP_RAM_BASE + IOP_RAM_SIZE) || (ROM0_BASE <= addr && addr + size <= ROM0_BASE + ROM0_SIZE) || (ROM1_BASE <= addr && addr + size <= ROM1_BASE + ROM1_SIZE); } -- 2.21.0