metalsvm/arch/x86/include/asm/scc.h
stefan 61907132a8 - rename some functions
git-svn-id: http://svn.lfbs.rwth-aachen.de/svn/scc/trunk/MetalSVM@69 315a16e6-25f9-4109-90ae-ca3045a26c18
2010-08-11 13:12:55 +00:00

99 lines
2.6 KiB
C

/*
* Copyright 2010 Stefan Lankes, Chair for Operating Systems,
* RWTH Aachen University
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* This file is part of MetalSVM.
*/
#ifndef __ARCH_RCK_H__
#define __ARCH_RCK_H__
#include <metalsvm/stddef.h>
#ifdef CONFIG_ROCKCREEK
/* Symbols for CRB addresses */
#define CRB_X0_Y0 0xe0000000
#define CRB_X1_Y0 0xe1000000
#define CRB_X2_Y0 0xe2000000
#define CRB_X3_Y0 0xe3000000
#define CRB_X4_Y0 0xe4000000
#define CRB_X5_Y0 0xe5000000
#define CRB_X0_Y1 0xe6000000
#define CRB_X1_Y1 0xe7000000
#define CRB_X2_Y1 0xe8000000
#define CRB_X3_Y1 0xe9000000
#define CRB_X4_Y1 0xea000000
#define CRB_X5_Y1 0xeb000000
#define CRB_X0_Y2 0xec000000
#define CRB_X1_Y2 0xed000000
#define CRB_X2_Y2 0xee000000
#define CRB_X3_Y2 0xef000000
#define CRB_X4_Y2 0xf0000000
#define CRB_X5_Y2 0xf1000000
#define CRB_X0_Y3 0xf2000000
#define CRB_X1_Y3 0xf3000000
#define CRB_X2_Y3 0xf4000000
#define CRB_X3_Y3 0xf5000000
#define CRB_X4_Y3 0xf6000000
#define CRB_X5_Y3 0xf7000000
#define CRB_OWN 0xf8000000
/* Symbols for CRB sub-addresses */
#define GLCFG0 0x010
#define GLCFG1 0x018
#define L2CFG0 0x020
#define L2CFG1 0x028
#define SENSOR 0x040
#define GCBCFG 0x080
#define MYTILEID 0x100
#define LOCK0 0x200
#define LOCK1 0x400
#define LUT0 0x00800
#define LUT1 0x01000
#define NUM_ROWS 4
#define NUM_COLS 6
#define NUM_CORES 2
#define CRB_ADDR(x,y) (CRB_X0_Y0+(0x01000000*x)+(0x01000000*NUM_COLS*y))
#define MPB_ADDR(x,y,z) (MPB_X0_Y0+(0x01000000*x)+(0x01000000*NUM_COLS*y)+(MPBSIZE*z))
#define TID(x,y) ((y<<4)+x)
#define X_TID(tid) (tid&0x0f)
#define Y_TID(tid) (tid>>4)
#define PID(x,y,core) ((NUM_CORES*NUM_COLS*y)+(NUM_CORES*x)+core)
#define X_PID(pid) ((pid/NUM_CORES)-(NUM_COLS*Y_PID(pid)))
#define Y_PID(pid) ((pid/NUM_CORES)/NUM_COLS)
#define Z_PID(pid) (pid%NUM_CORES)
#define SCC_PMEM_REGIONS 2
typedef struct {
uint32_t low;
uint32_t high;
} mem_region_t;
typedef struct {
uint32_t pid;
mem_region_t private_mem[SCC_PMEM_REGIONS];
} scc_info_t;
extern scc_info_t scc_info;
int scc_init(void);
#endif
#endif