Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fa48f84a authored by Mike Frysinger's avatar Mike Frysinger
Browse files

Blackfin: unify memory map headers



Many aspects of the Blackfin memory map is exactly the same across all
variants.  Rather than copy and paste all of these duplicated values in
each header, unify all of these into the common Blackfin memory map header
file.  In the process, push down BF561 SMP specific stuff to the BF561
specific header to keep the noise down.

Signed-off-by: default avatarMike Frysinger <vapier@gentoo.org>
parent 985895bd
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -86,6 +86,7 @@ static inline void CSYNC(void)

#endif /* __ASSEMBLY__ */

#include <asm/mem_map.h>
#include <mach/blackfin.h>
#include <asm/bfin-global.h>

+47 −50
Original line number Diff line number Diff line
/*
 * mem_map.h
 * Common header file for blackfin family of processors.
 * Common Blackfin memory map
 *
 * Copyright 2004-2009 Analog Devices Inc.
 * Licensed under the GPL-2 or later.
 */

#ifndef _MEM_MAP_H_
#define _MEM_MAP_H_
#ifndef __BFIN_MEM_MAP_H__
#define __BFIN_MEM_MAP_H__

#include <mach/mem_map.h>

#ifndef __ASSEMBLY__
/* Every Blackfin so far has MMRs like this */
#ifndef COREMMR_BASE
# define COREMMR_BASE 0xFFE00000
#endif
#ifndef SYSMMR_BASE
# define SYSMMR_BASE  0xFFC00000
#endif

#ifdef CONFIG_SMP
static inline ulong get_l1_scratch_start_cpu(int cpu)
{
	return (cpu) ? COREB_L1_SCRATCH_START : COREA_L1_SCRATCH_START;
}
static inline ulong get_l1_code_start_cpu(int cpu)
{
	return (cpu) ? COREB_L1_CODE_START : COREA_L1_CODE_START;
}
static inline ulong get_l1_data_a_start_cpu(int cpu)
{
	return (cpu) ? COREB_L1_DATA_A_START : COREA_L1_DATA_A_START;
}
static inline ulong get_l1_data_b_start_cpu(int cpu)
{
	return (cpu) ? COREB_L1_DATA_B_START : COREA_L1_DATA_B_START;
}
/* Every Blackfin so far has on-chip Scratch Pad SRAM like this */
#ifndef L1_SCRATCH_START
# define L1_SCRATCH_START  0xFFB00000
# define L1_SCRATCH_LENGTH 0x1000
#endif

static inline ulong get_l1_scratch_start(void)
{
	return get_l1_scratch_start_cpu(blackfin_core_id());
}
static inline ulong get_l1_code_start(void)
{
	return get_l1_code_start_cpu(blackfin_core_id());
}
static inline ulong get_l1_data_a_start(void)
{
	return get_l1_data_a_start_cpu(blackfin_core_id());
}
static inline ulong get_l1_data_b_start(void)
{
	return get_l1_data_b_start_cpu(blackfin_core_id());
}
/* Most parts lack on-chip L2 SRAM */
#ifndef L2_START
# define L2_START  0
# define L2_LENGTH 0
#endif

/* Most parts lack on-chip L1 ROM */
#ifndef L1_ROM_START
# define L1_ROM_START  0
# define L1_ROM_LENGTH 0
#endif

#else /* !CONFIG_SMP */
/* Allow wonky SMP ports to override this */
#ifndef GET_PDA_SAFE
# define GET_PDA_SAFE(preg) \
	preg.l = _cpu_pda; \
	preg.h = _cpu_pda;
# define GET_PDA(preg, dreg) GET_PDA_SAFE(preg)

# ifndef __ASSEMBLY__

static inline ulong get_l1_scratch_start_cpu(int cpu)
static inline unsigned long get_l1_scratch_start_cpu(int cpu)
{
	return L1_SCRATCH_START;
}
static inline ulong get_l1_code_start_cpu(int cpu)
static inline unsigned long get_l1_code_start_cpu(int cpu)
{
	return L1_CODE_START;
}
static inline ulong get_l1_data_a_start_cpu(int cpu)
static inline unsigned long get_l1_data_a_start_cpu(int cpu)
{
	return L1_DATA_A_START;
}
static inline ulong get_l1_data_b_start_cpu(int cpu)
static inline unsigned long get_l1_data_b_start_cpu(int cpu)
{
	return L1_DATA_B_START;
}
static inline ulong get_l1_scratch_start(void)
static inline unsigned long get_l1_scratch_start(void)
{
	return get_l1_scratch_start_cpu(0);
}
static inline ulong get_l1_code_start(void)
static inline unsigned long get_l1_code_start(void)
{
	return  get_l1_code_start_cpu(0);
}
static inline ulong get_l1_data_a_start(void)
static inline unsigned long get_l1_data_a_start(void)
{
	return get_l1_data_a_start_cpu(0);
}
static inline ulong get_l1_data_b_start(void)
static inline unsigned long get_l1_data_b_start(void)
{
	return get_l1_data_b_start_cpu(0);
}

#endif /* CONFIG_SMP */
# endif /* __ASSEMBLY__ */
#endif /* !GET_PDA_SAFE */

#endif				/* _MEM_MAP_H_ */
#endif
+0 −1
Original line number Diff line number Diff line
@@ -33,7 +33,6 @@
#define _MACH_BLACKFIN_H_

#include "bf518.h"
#include "mem_map.h"
#include "defBF512.h"
#include "anomaly.h"

+9 −47
Original line number Diff line number Diff line
/*
 * file:         include/asm-blackfin/mach-bf518/mem_map.h
 * based on:	include/asm-blackfin/mach-bf527/mem_map.h
 * author:	Bryan Wu <cooloney@kernel.org>
 * BF51x memory map
 *
 * created:
 * description:
 *	Memory MAP Common header file for blackfin BF518/6/4/2 of processors.
 * rev:
 *
 * modified:
 *
 * bugs:         enter bugs at http://blackfin.uclinux.org/
 *
 * this program is free software; you can redistribute it and/or modify
 * it under the terms of the gnu general public license as published by
 * the free software foundation; either version 2, or (at your option)
 * any later version.
 *
 * this program is distributed in the hope that it will be useful,
 * but without any warranty; without even the implied warranty of
 * merchantability or fitness for a particular purpose.  see the
 * gnu general public license for more details.
 *
 * you should have received a copy of the gnu general public license
 * along with this program; see the file copying.
 * if not, write to the free software foundation,
 * 59 temple place - suite 330, boston, ma 02111-1307, usa.
 * Copyright 2004-2009 Analog Devices Inc.
 * Licensed under the GPL-2 or later.
 */

#ifndef _MEM_MAP_518_H_
#define _MEM_MAP_518_H_
#ifndef __BFIN_MACH_MEM_MAP_H__
#define __BFIN_MACH_MEM_MAP_H__

#define COREMMR_BASE           0xFFE00000	/* Core MMRs */
#define SYSMMR_BASE            0xFFC00000	/* System MMRs */
#ifndef __BFIN_MEM_MAP_H__
# error "do not include mach/mem_map.h directly -- use asm/mem_map.h"
#endif

/* Async Memory Banks */
#define ASYNC_BANK3_BASE	0x20300000	/* Async Bank 3 */
@@ -89,20 +67,4 @@
#define BFIN_DSUPBANKS		0
#endif				/*CONFIG_BFIN_DCACHE */

/* Level 2 Memory - none */

#define L2_START	0
#define L2_LENGTH	0

/* Scratch Pad Memory */

#define L1_SCRATCH_START	0xFFB00000
#define L1_SCRATCH_LENGTH	0x1000

#define GET_PDA_SAFE(preg)		\
	preg.l = _cpu_pda;		\
	preg.h = _cpu_pda;

#define GET_PDA(preg, dreg)	GET_PDA_SAFE(preg)

#endif				/* _MEM_MAP_518_H_ */
#endif
+0 −1
Original line number Diff line number Diff line
@@ -33,7 +33,6 @@
#define _MACH_BLACKFIN_H_

#include "bf527.h"
#include "mem_map.h"
#include "defBF522.h"
#include "anomaly.h"

Loading