2006-03-12 01:12:27 +00:00
|
|
|
/*
|
2009-12-15 08:11:09 +00:00
|
|
|
* barebox - blackfin.h
|
2006-03-12 01:12:27 +00:00
|
|
|
*
|
|
|
|
* Copyright (c) 2005 blackfin.uclinux.org
|
|
|
|
*
|
|
|
|
* See file CREDITS for list of people who contributed to this
|
|
|
|
* project.
|
|
|
|
*
|
|
|
|
* 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 of
|
|
|
|
* the License, 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; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
|
|
|
* MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _BLACKFIN_H_
|
|
|
|
#define _BLACKFIN_H_
|
|
|
|
|
2007-09-11 08:15:32 +00:00
|
|
|
#define lo(con32) ((con32) & 0xFFFF)
|
|
|
|
#define hi(con32) (((con32) >> 16) & 0xFFFF)
|
2006-03-12 01:12:27 +00:00
|
|
|
|
2007-09-11 08:15:32 +00:00
|
|
|
#ifdef CONFIG_BF561
|
|
|
|
|
|
|
|
#include <asm/cpu/defBF561.h>
|
2007-09-16 09:19:28 +00:00
|
|
|
#include <asm/cpu/defBF561_extn.h>
|
2006-03-12 01:12:27 +00:00
|
|
|
#ifndef __ASSEMBLY__
|
2007-09-16 09:19:28 +00:00
|
|
|
#include <asm/cpu/cdef_LPBlackfin.h>
|
2007-09-11 08:15:32 +00:00
|
|
|
#include <asm/cpu/cdefBF561.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|
2006-03-12 01:12:27 +00:00
|
|
|
|
2007-09-11 08:15:32 +00:00
|
|
|
#ifndef __ASSEMBLY__
|
|
|
|
/* Get the System clock */
|
|
|
|
ulong get_sclk(void);
|
2006-03-12 01:12:27 +00:00
|
|
|
#endif
|
|
|
|
|
2007-09-11 08:15:32 +00:00
|
|
|
#if ( CONFIG_CLKIN_HALF == 0 )
|
|
|
|
#define CONFIG_VCO_HZ ( CONFIG_CLKIN_HZ * CONFIG_VCO_MULT )
|
|
|
|
#else
|
|
|
|
#define CONFIG_VCO_HZ (( CONFIG_CLKIN_HZ * CONFIG_VCO_MULT ) / 2 )
|
2006-03-12 01:12:27 +00:00
|
|
|
#endif
|
2007-09-11 08:15:32 +00:00
|
|
|
|
|
|
|
#if (CONFIG_PLL_BYPASS == 0)
|
|
|
|
#define CONFIG_CCLK_HZ ( CONFIG_VCO_HZ / CONFIG_CCLK_DIV )
|
|
|
|
#define CONFIG_SCLK_HZ ( CONFIG_VCO_HZ / CONFIG_SCLK_DIV )
|
|
|
|
#else
|
|
|
|
#define CONFIG_CCLK_HZ CONFIG_CLKIN_HZ
|
|
|
|
#define CONFIG_SCLK_HZ CONFIG_CLKIN_HZ
|
2006-03-12 01:12:27 +00:00
|
|
|
#endif
|
|
|
|
|
2007-09-11 08:15:32 +00:00
|
|
|
#if (CONFIG_CCLK_DIV == 1)
|
|
|
|
#define CONFIG_CCLK_ACT_DIV CCLK_DIV1
|
|
|
|
#endif
|
|
|
|
#if (CONFIG_CCLK_DIV == 2)
|
|
|
|
#define CONFIG_CCLK_ACT_DIV CCLK_DIV2
|
|
|
|
#endif
|
|
|
|
#if (CONFIG_CCLK_DIV == 4)
|
|
|
|
#define CONFIG_CCLK_ACT_DIV CCLK_DIV4
|
|
|
|
#endif
|
|
|
|
#if (CONFIG_CCLK_DIV == 8)
|
|
|
|
#define CONFIG_CCLK_ACT_DIV CCLK_DIV8
|
|
|
|
#endif
|
|
|
|
#ifndef CONFIG_CCLK_ACT_DIV
|
|
|
|
#define CONFIG_CCLK_ACT_DIV CONFIG_CCLK_DIV_not_defined_properly
|
|
|
|
#endif
|
2006-03-12 01:12:27 +00:00
|
|
|
|
|
|
|
#endif
|
2007-09-11 08:15:32 +00:00
|
|
|
|