162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
262306a36Sopenharmony_ci#ifndef _SPARC_VADDRS_H
362306a36Sopenharmony_ci#define _SPARC_VADDRS_H
462306a36Sopenharmony_ci
562306a36Sopenharmony_ci#include <asm/head.h>
662306a36Sopenharmony_ci
762306a36Sopenharmony_ci/*
862306a36Sopenharmony_ci * asm/vaddrs.h:  Here we define the virtual addresses at
962306a36Sopenharmony_ci *                      which important things will be mapped.
1062306a36Sopenharmony_ci *
1162306a36Sopenharmony_ci * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
1262306a36Sopenharmony_ci * Copyright (C) 2000 Anton Blanchard (anton@samba.org)
1362306a36Sopenharmony_ci */
1462306a36Sopenharmony_ci
1562306a36Sopenharmony_ci#define SRMMU_MAXMEM		0x0c000000
1662306a36Sopenharmony_ci
1762306a36Sopenharmony_ci#define SRMMU_NOCACHE_VADDR	(KERNBASE + SRMMU_MAXMEM)
1862306a36Sopenharmony_ci				/* = 0x0fc000000 */
1962306a36Sopenharmony_ci/* XXX Empiricals - this needs to go away - KMW */
2062306a36Sopenharmony_ci#define SRMMU_MIN_NOCACHE_PAGES (550)
2162306a36Sopenharmony_ci#define SRMMU_MAX_NOCACHE_PAGES	(1280)
2262306a36Sopenharmony_ci
2362306a36Sopenharmony_ci/* The following constant is used in mm/srmmu.c::srmmu_nocache_calcsize()
2462306a36Sopenharmony_ci * to determine the amount of memory that will be reserved as nocache:
2562306a36Sopenharmony_ci *
2662306a36Sopenharmony_ci * 256 pages will be taken as nocache per each
2762306a36Sopenharmony_ci * SRMMU_NOCACHE_ALCRATIO MB of system memory.
2862306a36Sopenharmony_ci *
2962306a36Sopenharmony_ci * limits enforced:	nocache minimum = 256 pages
3062306a36Sopenharmony_ci *			nocache maximum = 1280 pages
3162306a36Sopenharmony_ci */
3262306a36Sopenharmony_ci#define SRMMU_NOCACHE_ALCRATIO	64	/* 256 pages per 64MB of system RAM */
3362306a36Sopenharmony_ci
3462306a36Sopenharmony_ci#ifndef __ASSEMBLY__
3562306a36Sopenharmony_ci#include <asm/kmap_size.h>
3662306a36Sopenharmony_ci
3762306a36Sopenharmony_cienum fixed_addresses {
3862306a36Sopenharmony_ci	FIX_HOLE,
3962306a36Sopenharmony_ci#ifdef CONFIG_HIGHMEM
4062306a36Sopenharmony_ci	FIX_KMAP_BEGIN,
4162306a36Sopenharmony_ci	FIX_KMAP_END = (KM_MAX_IDX * NR_CPUS),
4262306a36Sopenharmony_ci#endif
4362306a36Sopenharmony_ci	__end_of_fixed_addresses
4462306a36Sopenharmony_ci};
4562306a36Sopenharmony_ci#endif
4662306a36Sopenharmony_ci
4762306a36Sopenharmony_ci/* Leave one empty page between IO pages at 0xfd000000 and
4862306a36Sopenharmony_ci * the top of the fixmap.
4962306a36Sopenharmony_ci */
5062306a36Sopenharmony_ci#define FIXADDR_TOP		(0xfcfff000UL)
5162306a36Sopenharmony_ci#define FIXADDR_SIZE		((FIX_KMAP_END + 1) << PAGE_SHIFT)
5262306a36Sopenharmony_ci#define FIXADDR_START		(FIXADDR_TOP - FIXADDR_SIZE)
5362306a36Sopenharmony_ci
5462306a36Sopenharmony_ci#define __fix_to_virt(x)        (FIXADDR_TOP - ((x) << PAGE_SHIFT))
5562306a36Sopenharmony_ci
5662306a36Sopenharmony_ci#define SUN4M_IOBASE_VADDR	0xfd000000 /* Base for mapping pages */
5762306a36Sopenharmony_ci#define IOBASE_VADDR		0xfe000000
5862306a36Sopenharmony_ci#define IOBASE_END		0xfe600000
5962306a36Sopenharmony_ci
6062306a36Sopenharmony_ci#define KADB_DEBUGGER_BEGVM	0xffc00000 /* Where kern debugger is in virt-mem */
6162306a36Sopenharmony_ci#define KADB_DEBUGGER_ENDVM	0xffd00000
6262306a36Sopenharmony_ci#define DEBUG_FIRSTVADDR	KADB_DEBUGGER_BEGVM
6362306a36Sopenharmony_ci#define DEBUG_LASTVADDR		KADB_DEBUGGER_ENDVM
6462306a36Sopenharmony_ci
6562306a36Sopenharmony_ci#define LINUX_OPPROM_BEGVM	0xffd00000
6662306a36Sopenharmony_ci#define LINUX_OPPROM_ENDVM	0xfff00000
6762306a36Sopenharmony_ci
6862306a36Sopenharmony_ci#define DVMA_VADDR		0xfff00000 /* Base area of the DVMA on suns */
6962306a36Sopenharmony_ci#define DVMA_END		0xfffc0000
7062306a36Sopenharmony_ci
7162306a36Sopenharmony_ci#endif /* !(_SPARC_VADDRS_H) */
72