Blackfin: Split PLL code from mach-specific cdef headers
Split the PLL control code from the Blackfin machine-specific cdef headers so that the irqflags functions can be renamed without incurring a header loop. Signed-off-by: David Howells <dhowells@redhat.com>
This commit is contained in:
Родитель
cb655d0f3d
Коммит
3dcc1e7f9f
|
@ -1058,54 +1058,4 @@
|
||||||
/* These need to be last due to the cdef/linux inter-dependencies */
|
/* These need to be last due to the cdef/linux inter-dependencies */
|
||||||
#include <asm/irq.h>
|
#include <asm/irq.h>
|
||||||
|
|
||||||
/* Writing to PLL_CTL initiates a PLL relock sequence. */
|
|
||||||
static __inline__ void bfin_write_PLL_CTL(unsigned int val)
|
|
||||||
{
|
|
||||||
unsigned long flags, iwr0, iwr1;
|
|
||||||
|
|
||||||
if (val == bfin_read_PLL_CTL())
|
|
||||||
return;
|
|
||||||
|
|
||||||
local_irq_save_hw(flags);
|
|
||||||
/* Enable the PLL Wakeup bit in SIC IWR */
|
|
||||||
iwr0 = bfin_read32(SIC_IWR0);
|
|
||||||
iwr1 = bfin_read32(SIC_IWR1);
|
|
||||||
/* Only allow PPL Wakeup) */
|
|
||||||
bfin_write32(SIC_IWR0, IWR_ENABLE(0));
|
|
||||||
bfin_write32(SIC_IWR1, 0);
|
|
||||||
|
|
||||||
bfin_write16(PLL_CTL, val);
|
|
||||||
SSYNC();
|
|
||||||
asm("IDLE;");
|
|
||||||
|
|
||||||
bfin_write32(SIC_IWR0, iwr0);
|
|
||||||
bfin_write32(SIC_IWR1, iwr1);
|
|
||||||
local_irq_restore_hw(flags);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Writing to VR_CTL initiates a PLL relock sequence. */
|
|
||||||
static __inline__ void bfin_write_VR_CTL(unsigned int val)
|
|
||||||
{
|
|
||||||
unsigned long flags, iwr0, iwr1;
|
|
||||||
|
|
||||||
if (val == bfin_read_VR_CTL())
|
|
||||||
return;
|
|
||||||
|
|
||||||
local_irq_save_hw(flags);
|
|
||||||
/* Enable the PLL Wakeup bit in SIC IWR */
|
|
||||||
iwr0 = bfin_read32(SIC_IWR0);
|
|
||||||
iwr1 = bfin_read32(SIC_IWR1);
|
|
||||||
/* Only allow PPL Wakeup) */
|
|
||||||
bfin_write32(SIC_IWR0, IWR_ENABLE(0));
|
|
||||||
bfin_write32(SIC_IWR1, 0);
|
|
||||||
|
|
||||||
bfin_write16(VR_CTL, val);
|
|
||||||
SSYNC();
|
|
||||||
asm("IDLE;");
|
|
||||||
|
|
||||||
bfin_write32(SIC_IWR0, iwr0);
|
|
||||||
bfin_write32(SIC_IWR1, iwr1);
|
|
||||||
local_irq_restore_hw(flags);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* _CDEF_BF52X_H */
|
#endif /* _CDEF_BF52X_H */
|
||||||
|
|
|
@ -0,0 +1,63 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2008 Analog Devices Inc.
|
||||||
|
*
|
||||||
|
* Licensed under the GPL-2 or later
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _MACH_PLL_H
|
||||||
|
#define _MACH_PLL_H
|
||||||
|
|
||||||
|
#include <asm/blackfin.h>
|
||||||
|
#include <asm/irqflags.h>
|
||||||
|
|
||||||
|
/* Writing to PLL_CTL initiates a PLL relock sequence. */
|
||||||
|
static __inline__ void bfin_write_PLL_CTL(unsigned int val)
|
||||||
|
{
|
||||||
|
unsigned long flags, iwr0, iwr1;
|
||||||
|
|
||||||
|
if (val == bfin_read_PLL_CTL())
|
||||||
|
return;
|
||||||
|
|
||||||
|
local_irq_save_hw(flags);
|
||||||
|
/* Enable the PLL Wakeup bit in SIC IWR */
|
||||||
|
iwr0 = bfin_read32(SIC_IWR0);
|
||||||
|
iwr1 = bfin_read32(SIC_IWR1);
|
||||||
|
/* Only allow PPL Wakeup) */
|
||||||
|
bfin_write32(SIC_IWR0, IWR_ENABLE(0));
|
||||||
|
bfin_write32(SIC_IWR1, 0);
|
||||||
|
|
||||||
|
bfin_write16(PLL_CTL, val);
|
||||||
|
SSYNC();
|
||||||
|
asm("IDLE;");
|
||||||
|
|
||||||
|
bfin_write32(SIC_IWR0, iwr0);
|
||||||
|
bfin_write32(SIC_IWR1, iwr1);
|
||||||
|
local_irq_restore_hw(flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Writing to VR_CTL initiates a PLL relock sequence. */
|
||||||
|
static __inline__ void bfin_write_VR_CTL(unsigned int val)
|
||||||
|
{
|
||||||
|
unsigned long flags, iwr0, iwr1;
|
||||||
|
|
||||||
|
if (val == bfin_read_VR_CTL())
|
||||||
|
return;
|
||||||
|
|
||||||
|
local_irq_save_hw(flags);
|
||||||
|
/* Enable the PLL Wakeup bit in SIC IWR */
|
||||||
|
iwr0 = bfin_read32(SIC_IWR0);
|
||||||
|
iwr1 = bfin_read32(SIC_IWR1);
|
||||||
|
/* Only allow PPL Wakeup) */
|
||||||
|
bfin_write32(SIC_IWR0, IWR_ENABLE(0));
|
||||||
|
bfin_write32(SIC_IWR1, 0);
|
||||||
|
|
||||||
|
bfin_write16(VR_CTL, val);
|
||||||
|
SSYNC();
|
||||||
|
asm("IDLE;");
|
||||||
|
|
||||||
|
bfin_write32(SIC_IWR0, iwr0);
|
||||||
|
bfin_write32(SIC_IWR1, iwr1);
|
||||||
|
local_irq_restore_hw(flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* _MACH_PLL_H */
|
|
@ -1110,54 +1110,4 @@
|
||||||
/* These need to be last due to the cdef/linux inter-dependencies */
|
/* These need to be last due to the cdef/linux inter-dependencies */
|
||||||
#include <asm/irq.h>
|
#include <asm/irq.h>
|
||||||
|
|
||||||
/* Writing to PLL_CTL initiates a PLL relock sequence. */
|
|
||||||
static __inline__ void bfin_write_PLL_CTL(unsigned int val)
|
|
||||||
{
|
|
||||||
unsigned long flags, iwr0, iwr1;
|
|
||||||
|
|
||||||
if (val == bfin_read_PLL_CTL())
|
|
||||||
return;
|
|
||||||
|
|
||||||
local_irq_save_hw(flags);
|
|
||||||
/* Enable the PLL Wakeup bit in SIC IWR */
|
|
||||||
iwr0 = bfin_read32(SIC_IWR0);
|
|
||||||
iwr1 = bfin_read32(SIC_IWR1);
|
|
||||||
/* Only allow PPL Wakeup) */
|
|
||||||
bfin_write32(SIC_IWR0, IWR_ENABLE(0));
|
|
||||||
bfin_write32(SIC_IWR1, 0);
|
|
||||||
|
|
||||||
bfin_write16(PLL_CTL, val);
|
|
||||||
SSYNC();
|
|
||||||
asm("IDLE;");
|
|
||||||
|
|
||||||
bfin_write32(SIC_IWR0, iwr0);
|
|
||||||
bfin_write32(SIC_IWR1, iwr1);
|
|
||||||
local_irq_restore_hw(flags);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Writing to VR_CTL initiates a PLL relock sequence. */
|
|
||||||
static __inline__ void bfin_write_VR_CTL(unsigned int val)
|
|
||||||
{
|
|
||||||
unsigned long flags, iwr0, iwr1;
|
|
||||||
|
|
||||||
if (val == bfin_read_VR_CTL())
|
|
||||||
return;
|
|
||||||
|
|
||||||
local_irq_save_hw(flags);
|
|
||||||
/* Enable the PLL Wakeup bit in SIC IWR */
|
|
||||||
iwr0 = bfin_read32(SIC_IWR0);
|
|
||||||
iwr1 = bfin_read32(SIC_IWR1);
|
|
||||||
/* Only allow PPL Wakeup) */
|
|
||||||
bfin_write32(SIC_IWR0, IWR_ENABLE(0));
|
|
||||||
bfin_write32(SIC_IWR1, 0);
|
|
||||||
|
|
||||||
bfin_write16(VR_CTL, val);
|
|
||||||
SSYNC();
|
|
||||||
asm("IDLE;");
|
|
||||||
|
|
||||||
bfin_write32(SIC_IWR0, iwr0);
|
|
||||||
bfin_write32(SIC_IWR1, iwr1);
|
|
||||||
local_irq_restore_hw(flags);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* _CDEF_BF52X_H */
|
#endif /* _CDEF_BF52X_H */
|
||||||
|
|
|
@ -0,0 +1,63 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2007-2008 Analog Devices Inc.
|
||||||
|
*
|
||||||
|
* Licensed under the GPL-2 or later
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _MACH_PLL_H
|
||||||
|
#define _MACH_PLL_H
|
||||||
|
|
||||||
|
#include <asm/blackfin.h>
|
||||||
|
#include <asm/irqflags.h>
|
||||||
|
|
||||||
|
/* Writing to PLL_CTL initiates a PLL relock sequence. */
|
||||||
|
static __inline__ void bfin_write_PLL_CTL(unsigned int val)
|
||||||
|
{
|
||||||
|
unsigned long flags, iwr0, iwr1;
|
||||||
|
|
||||||
|
if (val == bfin_read_PLL_CTL())
|
||||||
|
return;
|
||||||
|
|
||||||
|
local_irq_save_hw(flags);
|
||||||
|
/* Enable the PLL Wakeup bit in SIC IWR */
|
||||||
|
iwr0 = bfin_read32(SIC_IWR0);
|
||||||
|
iwr1 = bfin_read32(SIC_IWR1);
|
||||||
|
/* Only allow PPL Wakeup) */
|
||||||
|
bfin_write32(SIC_IWR0, IWR_ENABLE(0));
|
||||||
|
bfin_write32(SIC_IWR1, 0);
|
||||||
|
|
||||||
|
bfin_write16(PLL_CTL, val);
|
||||||
|
SSYNC();
|
||||||
|
asm("IDLE;");
|
||||||
|
|
||||||
|
bfin_write32(SIC_IWR0, iwr0);
|
||||||
|
bfin_write32(SIC_IWR1, iwr1);
|
||||||
|
local_irq_restore_hw(flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Writing to VR_CTL initiates a PLL relock sequence. */
|
||||||
|
static __inline__ void bfin_write_VR_CTL(unsigned int val)
|
||||||
|
{
|
||||||
|
unsigned long flags, iwr0, iwr1;
|
||||||
|
|
||||||
|
if (val == bfin_read_VR_CTL())
|
||||||
|
return;
|
||||||
|
|
||||||
|
local_irq_save_hw(flags);
|
||||||
|
/* Enable the PLL Wakeup bit in SIC IWR */
|
||||||
|
iwr0 = bfin_read32(SIC_IWR0);
|
||||||
|
iwr1 = bfin_read32(SIC_IWR1);
|
||||||
|
/* Only allow PPL Wakeup) */
|
||||||
|
bfin_write32(SIC_IWR0, IWR_ENABLE(0));
|
||||||
|
bfin_write32(SIC_IWR1, 0);
|
||||||
|
|
||||||
|
bfin_write16(VR_CTL, val);
|
||||||
|
SSYNC();
|
||||||
|
asm("IDLE;");
|
||||||
|
|
||||||
|
bfin_write32(SIC_IWR0, iwr0);
|
||||||
|
bfin_write32(SIC_IWR1, iwr1);
|
||||||
|
local_irq_restore_hw(flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* _MACH_PLL_H */
|
|
@ -697,48 +697,4 @@ BFIN_READ_FIO_FLAG(T)
|
||||||
#define bfin_read_FIO_FLAG_D() bfin_read16(FIO_FLAG_D)
|
#define bfin_read_FIO_FLAG_D() bfin_read16(FIO_FLAG_D)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Writing to PLL_CTL initiates a PLL relock sequence. */
|
|
||||||
static __inline__ void bfin_write_PLL_CTL(unsigned int val)
|
|
||||||
{
|
|
||||||
unsigned long flags, iwr;
|
|
||||||
|
|
||||||
if (val == bfin_read_PLL_CTL())
|
|
||||||
return;
|
|
||||||
|
|
||||||
local_irq_save_hw(flags);
|
|
||||||
/* Enable the PLL Wakeup bit in SIC IWR */
|
|
||||||
iwr = bfin_read32(SIC_IWR);
|
|
||||||
/* Only allow PPL Wakeup) */
|
|
||||||
bfin_write32(SIC_IWR, IWR_ENABLE(0));
|
|
||||||
|
|
||||||
bfin_write16(PLL_CTL, val);
|
|
||||||
SSYNC();
|
|
||||||
asm("IDLE;");
|
|
||||||
|
|
||||||
bfin_write32(SIC_IWR, iwr);
|
|
||||||
local_irq_restore_hw(flags);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Writing to VR_CTL initiates a PLL relock sequence. */
|
|
||||||
static __inline__ void bfin_write_VR_CTL(unsigned int val)
|
|
||||||
{
|
|
||||||
unsigned long flags, iwr;
|
|
||||||
|
|
||||||
if (val == bfin_read_VR_CTL())
|
|
||||||
return;
|
|
||||||
|
|
||||||
local_irq_save_hw(flags);
|
|
||||||
/* Enable the PLL Wakeup bit in SIC IWR */
|
|
||||||
iwr = bfin_read32(SIC_IWR);
|
|
||||||
/* Only allow PPL Wakeup) */
|
|
||||||
bfin_write32(SIC_IWR, IWR_ENABLE(0));
|
|
||||||
|
|
||||||
bfin_write16(VR_CTL, val);
|
|
||||||
SSYNC();
|
|
||||||
asm("IDLE;");
|
|
||||||
|
|
||||||
bfin_write32(SIC_IWR, iwr);
|
|
||||||
local_irq_restore_hw(flags);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* _CDEF_BF532_H */
|
#endif /* _CDEF_BF532_H */
|
||||||
|
|
|
@ -0,0 +1,57 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2005-2008 Analog Devices Inc.
|
||||||
|
*
|
||||||
|
* Licensed under the GPL-2 or later
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _MACH_PLL_H
|
||||||
|
#define _MACH_PLL_H
|
||||||
|
|
||||||
|
#include <asm/blackfin.h>
|
||||||
|
#include <asm/irqflags.h>
|
||||||
|
|
||||||
|
/* Writing to PLL_CTL initiates a PLL relock sequence. */
|
||||||
|
static __inline__ void bfin_write_PLL_CTL(unsigned int val)
|
||||||
|
{
|
||||||
|
unsigned long flags, iwr;
|
||||||
|
|
||||||
|
if (val == bfin_read_PLL_CTL())
|
||||||
|
return;
|
||||||
|
|
||||||
|
local_irq_save_hw(flags);
|
||||||
|
/* Enable the PLL Wakeup bit in SIC IWR */
|
||||||
|
iwr = bfin_read32(SIC_IWR);
|
||||||
|
/* Only allow PPL Wakeup) */
|
||||||
|
bfin_write32(SIC_IWR, IWR_ENABLE(0));
|
||||||
|
|
||||||
|
bfin_write16(PLL_CTL, val);
|
||||||
|
SSYNC();
|
||||||
|
asm("IDLE;");
|
||||||
|
|
||||||
|
bfin_write32(SIC_IWR, iwr);
|
||||||
|
local_irq_restore_hw(flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Writing to VR_CTL initiates a PLL relock sequence. */
|
||||||
|
static __inline__ void bfin_write_VR_CTL(unsigned int val)
|
||||||
|
{
|
||||||
|
unsigned long flags, iwr;
|
||||||
|
|
||||||
|
if (val == bfin_read_VR_CTL())
|
||||||
|
return;
|
||||||
|
|
||||||
|
local_irq_save_hw(flags);
|
||||||
|
/* Enable the PLL Wakeup bit in SIC IWR */
|
||||||
|
iwr = bfin_read32(SIC_IWR);
|
||||||
|
/* Only allow PPL Wakeup) */
|
||||||
|
bfin_write32(SIC_IWR, IWR_ENABLE(0));
|
||||||
|
|
||||||
|
bfin_write16(VR_CTL, val);
|
||||||
|
SSYNC();
|
||||||
|
asm("IDLE;");
|
||||||
|
|
||||||
|
bfin_write32(SIC_IWR, iwr);
|
||||||
|
local_irq_restore_hw(flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* _MACH_PLL_H */
|
|
@ -1750,48 +1750,4 @@
|
||||||
/* These need to be last due to the cdef/linux inter-dependencies */
|
/* These need to be last due to the cdef/linux inter-dependencies */
|
||||||
#include <asm/irq.h>
|
#include <asm/irq.h>
|
||||||
|
|
||||||
/* Writing to PLL_CTL initiates a PLL relock sequence. */
|
|
||||||
static __inline__ void bfin_write_PLL_CTL(unsigned int val)
|
|
||||||
{
|
|
||||||
unsigned long flags, iwr;
|
|
||||||
|
|
||||||
if (val == bfin_read_PLL_CTL())
|
|
||||||
return;
|
|
||||||
|
|
||||||
local_irq_save_hw(flags);
|
|
||||||
/* Enable the PLL Wakeup bit in SIC IWR */
|
|
||||||
iwr = bfin_read32(SIC_IWR);
|
|
||||||
/* Only allow PPL Wakeup) */
|
|
||||||
bfin_write32(SIC_IWR, IWR_ENABLE(0));
|
|
||||||
|
|
||||||
bfin_write16(PLL_CTL, val);
|
|
||||||
SSYNC();
|
|
||||||
asm("IDLE;");
|
|
||||||
|
|
||||||
bfin_write32(SIC_IWR, iwr);
|
|
||||||
local_irq_restore_hw(flags);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Writing to VR_CTL initiates a PLL relock sequence. */
|
|
||||||
static __inline__ void bfin_write_VR_CTL(unsigned int val)
|
|
||||||
{
|
|
||||||
unsigned long flags, iwr;
|
|
||||||
|
|
||||||
if (val == bfin_read_VR_CTL())
|
|
||||||
return;
|
|
||||||
|
|
||||||
local_irq_save_hw(flags);
|
|
||||||
/* Enable the PLL Wakeup bit in SIC IWR */
|
|
||||||
iwr = bfin_read32(SIC_IWR);
|
|
||||||
/* Only allow PPL Wakeup) */
|
|
||||||
bfin_write32(SIC_IWR, IWR_ENABLE(0));
|
|
||||||
|
|
||||||
bfin_write16(VR_CTL, val);
|
|
||||||
SSYNC();
|
|
||||||
asm("IDLE;");
|
|
||||||
|
|
||||||
bfin_write32(SIC_IWR, iwr);
|
|
||||||
local_irq_restore_hw(flags);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* _CDEF_BF534_H */
|
#endif /* _CDEF_BF534_H */
|
||||||
|
|
|
@ -0,0 +1,57 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2005-2008 Analog Devices Inc.
|
||||||
|
*
|
||||||
|
* Licensed under the GPL-2 or later
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _MACH_PLL_H
|
||||||
|
#define _MACH_PLL_H
|
||||||
|
|
||||||
|
#include <asm/blackfin.h>
|
||||||
|
#include <asm/irqflags.h>
|
||||||
|
|
||||||
|
/* Writing to PLL_CTL initiates a PLL relock sequence. */
|
||||||
|
static __inline__ void bfin_write_PLL_CTL(unsigned int val)
|
||||||
|
{
|
||||||
|
unsigned long flags, iwr;
|
||||||
|
|
||||||
|
if (val == bfin_read_PLL_CTL())
|
||||||
|
return;
|
||||||
|
|
||||||
|
local_irq_save_hw(flags);
|
||||||
|
/* Enable the PLL Wakeup bit in SIC IWR */
|
||||||
|
iwr = bfin_read32(SIC_IWR);
|
||||||
|
/* Only allow PPL Wakeup) */
|
||||||
|
bfin_write32(SIC_IWR, IWR_ENABLE(0));
|
||||||
|
|
||||||
|
bfin_write16(PLL_CTL, val);
|
||||||
|
SSYNC();
|
||||||
|
asm("IDLE;");
|
||||||
|
|
||||||
|
bfin_write32(SIC_IWR, iwr);
|
||||||
|
local_irq_restore_hw(flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Writing to VR_CTL initiates a PLL relock sequence. */
|
||||||
|
static __inline__ void bfin_write_VR_CTL(unsigned int val)
|
||||||
|
{
|
||||||
|
unsigned long flags, iwr;
|
||||||
|
|
||||||
|
if (val == bfin_read_VR_CTL())
|
||||||
|
return;
|
||||||
|
|
||||||
|
local_irq_save_hw(flags);
|
||||||
|
/* Enable the PLL Wakeup bit in SIC IWR */
|
||||||
|
iwr = bfin_read32(SIC_IWR);
|
||||||
|
/* Only allow PPL Wakeup) */
|
||||||
|
bfin_write32(SIC_IWR, IWR_ENABLE(0));
|
||||||
|
|
||||||
|
bfin_write16(VR_CTL, val);
|
||||||
|
SSYNC();
|
||||||
|
asm("IDLE;");
|
||||||
|
|
||||||
|
bfin_write32(SIC_IWR, iwr);
|
||||||
|
local_irq_restore_hw(flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* _MACH_PLL_H */
|
|
@ -2027,54 +2027,4 @@
|
||||||
/* These need to be last due to the cdef/linux inter-dependencies */
|
/* These need to be last due to the cdef/linux inter-dependencies */
|
||||||
#include <asm/irq.h>
|
#include <asm/irq.h>
|
||||||
|
|
||||||
/* Writing to PLL_CTL initiates a PLL relock sequence. */
|
|
||||||
static __inline__ void bfin_write_PLL_CTL(unsigned int val)
|
|
||||||
{
|
|
||||||
unsigned long flags, iwr0, iwr1;
|
|
||||||
|
|
||||||
if (val == bfin_read_PLL_CTL())
|
|
||||||
return;
|
|
||||||
|
|
||||||
local_irq_save_hw(flags);
|
|
||||||
/* Enable the PLL Wakeup bit in SIC IWR */
|
|
||||||
iwr0 = bfin_read32(SIC_IWR0);
|
|
||||||
iwr1 = bfin_read32(SIC_IWR1);
|
|
||||||
/* Only allow PPL Wakeup) */
|
|
||||||
bfin_write32(SIC_IWR0, IWR_ENABLE(0));
|
|
||||||
bfin_write32(SIC_IWR1, 0);
|
|
||||||
|
|
||||||
bfin_write16(PLL_CTL, val);
|
|
||||||
SSYNC();
|
|
||||||
asm("IDLE;");
|
|
||||||
|
|
||||||
bfin_write32(SIC_IWR0, iwr0);
|
|
||||||
bfin_write32(SIC_IWR1, iwr1);
|
|
||||||
local_irq_restore_hw(flags);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Writing to VR_CTL initiates a PLL relock sequence. */
|
|
||||||
static __inline__ void bfin_write_VR_CTL(unsigned int val)
|
|
||||||
{
|
|
||||||
unsigned long flags, iwr0, iwr1;
|
|
||||||
|
|
||||||
if (val == bfin_read_VR_CTL())
|
|
||||||
return;
|
|
||||||
|
|
||||||
local_irq_save_hw(flags);
|
|
||||||
/* Enable the PLL Wakeup bit in SIC IWR */
|
|
||||||
iwr0 = bfin_read32(SIC_IWR0);
|
|
||||||
iwr1 = bfin_read32(SIC_IWR1);
|
|
||||||
/* Only allow PPL Wakeup) */
|
|
||||||
bfin_write32(SIC_IWR0, IWR_ENABLE(0));
|
|
||||||
bfin_write32(SIC_IWR1, 0);
|
|
||||||
|
|
||||||
bfin_write16(VR_CTL, val);
|
|
||||||
SSYNC();
|
|
||||||
asm("IDLE;");
|
|
||||||
|
|
||||||
bfin_write32(SIC_IWR0, iwr0);
|
|
||||||
bfin_write32(SIC_IWR1, iwr1);
|
|
||||||
local_irq_restore_hw(flags);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -0,0 +1,63 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2008-2009 Analog Devices Inc.
|
||||||
|
*
|
||||||
|
* Licensed under the GPL-2 or later.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _MACH_PLL_H
|
||||||
|
#define _MACH_PLL_H
|
||||||
|
|
||||||
|
#include <asm/blackfin.h>
|
||||||
|
#include <asm/irqflags.h>
|
||||||
|
|
||||||
|
/* Writing to PLL_CTL initiates a PLL relock sequence. */
|
||||||
|
static __inline__ void bfin_write_PLL_CTL(unsigned int val)
|
||||||
|
{
|
||||||
|
unsigned long flags, iwr0, iwr1;
|
||||||
|
|
||||||
|
if (val == bfin_read_PLL_CTL())
|
||||||
|
return;
|
||||||
|
|
||||||
|
local_irq_save_hw(flags);
|
||||||
|
/* Enable the PLL Wakeup bit in SIC IWR */
|
||||||
|
iwr0 = bfin_read32(SIC_IWR0);
|
||||||
|
iwr1 = bfin_read32(SIC_IWR1);
|
||||||
|
/* Only allow PPL Wakeup) */
|
||||||
|
bfin_write32(SIC_IWR0, IWR_ENABLE(0));
|
||||||
|
bfin_write32(SIC_IWR1, 0);
|
||||||
|
|
||||||
|
bfin_write16(PLL_CTL, val);
|
||||||
|
SSYNC();
|
||||||
|
asm("IDLE;");
|
||||||
|
|
||||||
|
bfin_write32(SIC_IWR0, iwr0);
|
||||||
|
bfin_write32(SIC_IWR1, iwr1);
|
||||||
|
local_irq_restore_hw(flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Writing to VR_CTL initiates a PLL relock sequence. */
|
||||||
|
static __inline__ void bfin_write_VR_CTL(unsigned int val)
|
||||||
|
{
|
||||||
|
unsigned long flags, iwr0, iwr1;
|
||||||
|
|
||||||
|
if (val == bfin_read_VR_CTL())
|
||||||
|
return;
|
||||||
|
|
||||||
|
local_irq_save_hw(flags);
|
||||||
|
/* Enable the PLL Wakeup bit in SIC IWR */
|
||||||
|
iwr0 = bfin_read32(SIC_IWR0);
|
||||||
|
iwr1 = bfin_read32(SIC_IWR1);
|
||||||
|
/* Only allow PPL Wakeup) */
|
||||||
|
bfin_write32(SIC_IWR0, IWR_ENABLE(0));
|
||||||
|
bfin_write32(SIC_IWR1, 0);
|
||||||
|
|
||||||
|
bfin_write16(VR_CTL, val);
|
||||||
|
SSYNC();
|
||||||
|
asm("IDLE;");
|
||||||
|
|
||||||
|
bfin_write32(SIC_IWR0, iwr0);
|
||||||
|
bfin_write32(SIC_IWR1, iwr1);
|
||||||
|
local_irq_restore_hw(flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* _MACH_PLL_H */
|
|
@ -2648,61 +2648,5 @@
|
||||||
/* These need to be last due to the cdef/linux inter-dependencies */
|
/* These need to be last due to the cdef/linux inter-dependencies */
|
||||||
#include <asm/irq.h>
|
#include <asm/irq.h>
|
||||||
|
|
||||||
/* Writing to PLL_CTL initiates a PLL relock sequence. */
|
|
||||||
static __inline__ void bfin_write_PLL_CTL(unsigned int val)
|
|
||||||
{
|
|
||||||
unsigned long flags, iwr0, iwr1, iwr2;
|
|
||||||
|
|
||||||
if (val == bfin_read_PLL_CTL())
|
|
||||||
return;
|
|
||||||
|
|
||||||
local_irq_save_hw(flags);
|
|
||||||
/* Enable the PLL Wakeup bit in SIC IWR */
|
|
||||||
iwr0 = bfin_read32(SIC_IWR0);
|
|
||||||
iwr1 = bfin_read32(SIC_IWR1);
|
|
||||||
iwr2 = bfin_read32(SIC_IWR2);
|
|
||||||
/* Only allow PPL Wakeup) */
|
|
||||||
bfin_write32(SIC_IWR0, IWR_ENABLE(0));
|
|
||||||
bfin_write32(SIC_IWR1, 0);
|
|
||||||
bfin_write32(SIC_IWR2, 0);
|
|
||||||
|
|
||||||
bfin_write16(PLL_CTL, val);
|
|
||||||
SSYNC();
|
|
||||||
asm("IDLE;");
|
|
||||||
|
|
||||||
bfin_write32(SIC_IWR0, iwr0);
|
|
||||||
bfin_write32(SIC_IWR1, iwr1);
|
|
||||||
bfin_write32(SIC_IWR2, iwr2);
|
|
||||||
local_irq_restore_hw(flags);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Writing to VR_CTL initiates a PLL relock sequence. */
|
|
||||||
static __inline__ void bfin_write_VR_CTL(unsigned int val)
|
|
||||||
{
|
|
||||||
unsigned long flags, iwr0, iwr1, iwr2;
|
|
||||||
|
|
||||||
if (val == bfin_read_VR_CTL())
|
|
||||||
return;
|
|
||||||
|
|
||||||
local_irq_save_hw(flags);
|
|
||||||
/* Enable the PLL Wakeup bit in SIC IWR */
|
|
||||||
iwr0 = bfin_read32(SIC_IWR0);
|
|
||||||
iwr1 = bfin_read32(SIC_IWR1);
|
|
||||||
iwr2 = bfin_read32(SIC_IWR2);
|
|
||||||
/* Only allow PPL Wakeup) */
|
|
||||||
bfin_write32(SIC_IWR0, IWR_ENABLE(0));
|
|
||||||
bfin_write32(SIC_IWR1, 0);
|
|
||||||
bfin_write32(SIC_IWR2, 0);
|
|
||||||
|
|
||||||
bfin_write16(VR_CTL, val);
|
|
||||||
SSYNC();
|
|
||||||
asm("IDLE;");
|
|
||||||
|
|
||||||
bfin_write32(SIC_IWR0, iwr0);
|
|
||||||
bfin_write32(SIC_IWR1, iwr1);
|
|
||||||
bfin_write32(SIC_IWR2, iwr2);
|
|
||||||
local_irq_restore_hw(flags);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* _CDEF_BF54X_H */
|
#endif /* _CDEF_BF54X_H */
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,69 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2007-2008 Analog Devices Inc.
|
||||||
|
*
|
||||||
|
* Licensed under the GPL-2 or later.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _MACH_PLL_H
|
||||||
|
#define _MACH_PLL_H
|
||||||
|
|
||||||
|
#include <asm/blackfin.h>
|
||||||
|
#include <asm/irqflags.h>
|
||||||
|
|
||||||
|
/* Writing to PLL_CTL initiates a PLL relock sequence. */
|
||||||
|
static __inline__ void bfin_write_PLL_CTL(unsigned int val)
|
||||||
|
{
|
||||||
|
unsigned long flags, iwr0, iwr1, iwr2;
|
||||||
|
|
||||||
|
if (val == bfin_read_PLL_CTL())
|
||||||
|
return;
|
||||||
|
|
||||||
|
local_irq_save_hw(flags);
|
||||||
|
/* Enable the PLL Wakeup bit in SIC IWR */
|
||||||
|
iwr0 = bfin_read32(SIC_IWR0);
|
||||||
|
iwr1 = bfin_read32(SIC_IWR1);
|
||||||
|
iwr2 = bfin_read32(SIC_IWR2);
|
||||||
|
/* Only allow PPL Wakeup) */
|
||||||
|
bfin_write32(SIC_IWR0, IWR_ENABLE(0));
|
||||||
|
bfin_write32(SIC_IWR1, 0);
|
||||||
|
bfin_write32(SIC_IWR2, 0);
|
||||||
|
|
||||||
|
bfin_write16(PLL_CTL, val);
|
||||||
|
SSYNC();
|
||||||
|
asm("IDLE;");
|
||||||
|
|
||||||
|
bfin_write32(SIC_IWR0, iwr0);
|
||||||
|
bfin_write32(SIC_IWR1, iwr1);
|
||||||
|
bfin_write32(SIC_IWR2, iwr2);
|
||||||
|
local_irq_restore_hw(flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Writing to VR_CTL initiates a PLL relock sequence. */
|
||||||
|
static __inline__ void bfin_write_VR_CTL(unsigned int val)
|
||||||
|
{
|
||||||
|
unsigned long flags, iwr0, iwr1, iwr2;
|
||||||
|
|
||||||
|
if (val == bfin_read_VR_CTL())
|
||||||
|
return;
|
||||||
|
|
||||||
|
local_irq_save_hw(flags);
|
||||||
|
/* Enable the PLL Wakeup bit in SIC IWR */
|
||||||
|
iwr0 = bfin_read32(SIC_IWR0);
|
||||||
|
iwr1 = bfin_read32(SIC_IWR1);
|
||||||
|
iwr2 = bfin_read32(SIC_IWR2);
|
||||||
|
/* Only allow PPL Wakeup) */
|
||||||
|
bfin_write32(SIC_IWR0, IWR_ENABLE(0));
|
||||||
|
bfin_write32(SIC_IWR1, 0);
|
||||||
|
bfin_write32(SIC_IWR2, 0);
|
||||||
|
|
||||||
|
bfin_write16(VR_CTL, val);
|
||||||
|
SSYNC();
|
||||||
|
asm("IDLE;");
|
||||||
|
|
||||||
|
bfin_write32(SIC_IWR0, iwr0);
|
||||||
|
bfin_write32(SIC_IWR1, iwr1);
|
||||||
|
bfin_write32(SIC_IWR2, iwr2);
|
||||||
|
local_irq_restore_hw(flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* _MACH_PLL_H */
|
|
@ -1534,54 +1534,4 @@
|
||||||
/* These need to be last due to the cdef/linux inter-dependencies */
|
/* These need to be last due to the cdef/linux inter-dependencies */
|
||||||
#include <asm/irq.h>
|
#include <asm/irq.h>
|
||||||
|
|
||||||
/* Writing to PLL_CTL initiates a PLL relock sequence. */
|
|
||||||
static __inline__ void bfin_write_PLL_CTL(unsigned int val)
|
|
||||||
{
|
|
||||||
unsigned long flags, iwr0, iwr1;
|
|
||||||
|
|
||||||
if (val == bfin_read_PLL_CTL())
|
|
||||||
return;
|
|
||||||
|
|
||||||
local_irq_save_hw(flags);
|
|
||||||
/* Enable the PLL Wakeup bit in SIC IWR */
|
|
||||||
iwr0 = bfin_read32(SICA_IWR0);
|
|
||||||
iwr1 = bfin_read32(SICA_IWR1);
|
|
||||||
/* Only allow PPL Wakeup) */
|
|
||||||
bfin_write32(SICA_IWR0, IWR_ENABLE(0));
|
|
||||||
bfin_write32(SICA_IWR1, 0);
|
|
||||||
|
|
||||||
bfin_write16(PLL_CTL, val);
|
|
||||||
SSYNC();
|
|
||||||
asm("IDLE;");
|
|
||||||
|
|
||||||
bfin_write32(SICA_IWR0, iwr0);
|
|
||||||
bfin_write32(SICA_IWR1, iwr1);
|
|
||||||
local_irq_restore_hw(flags);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Writing to VR_CTL initiates a PLL relock sequence. */
|
|
||||||
static __inline__ void bfin_write_VR_CTL(unsigned int val)
|
|
||||||
{
|
|
||||||
unsigned long flags, iwr0, iwr1;
|
|
||||||
|
|
||||||
if (val == bfin_read_VR_CTL())
|
|
||||||
return;
|
|
||||||
|
|
||||||
local_irq_save_hw(flags);
|
|
||||||
/* Enable the PLL Wakeup bit in SIC IWR */
|
|
||||||
iwr0 = bfin_read32(SICA_IWR0);
|
|
||||||
iwr1 = bfin_read32(SICA_IWR1);
|
|
||||||
/* Only allow PPL Wakeup) */
|
|
||||||
bfin_write32(SICA_IWR0, IWR_ENABLE(0));
|
|
||||||
bfin_write32(SICA_IWR1, 0);
|
|
||||||
|
|
||||||
bfin_write16(VR_CTL, val);
|
|
||||||
SSYNC();
|
|
||||||
asm("IDLE;");
|
|
||||||
|
|
||||||
bfin_write32(SICA_IWR0, iwr0);
|
|
||||||
bfin_write32(SICA_IWR1, iwr1);
|
|
||||||
local_irq_restore_hw(flags);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* _CDEF_BF561_H */
|
#endif /* _CDEF_BF561_H */
|
||||||
|
|
|
@ -0,0 +1,63 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2005-2009 Analog Devices Inc.
|
||||||
|
*
|
||||||
|
* Licensed under the GPL-2 or later.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _MACH_PLL_H
|
||||||
|
#define _MACH_PLL_H
|
||||||
|
|
||||||
|
#include <asm/blackfin.h>
|
||||||
|
#include <asm/irqflags.h>
|
||||||
|
|
||||||
|
/* Writing to PLL_CTL initiates a PLL relock sequence. */
|
||||||
|
static __inline__ void bfin_write_PLL_CTL(unsigned int val)
|
||||||
|
{
|
||||||
|
unsigned long flags, iwr0, iwr1;
|
||||||
|
|
||||||
|
if (val == bfin_read_PLL_CTL())
|
||||||
|
return;
|
||||||
|
|
||||||
|
local_irq_save_hw(flags);
|
||||||
|
/* Enable the PLL Wakeup bit in SIC IWR */
|
||||||
|
iwr0 = bfin_read32(SICA_IWR0);
|
||||||
|
iwr1 = bfin_read32(SICA_IWR1);
|
||||||
|
/* Only allow PPL Wakeup) */
|
||||||
|
bfin_write32(SICA_IWR0, IWR_ENABLE(0));
|
||||||
|
bfin_write32(SICA_IWR1, 0);
|
||||||
|
|
||||||
|
bfin_write16(PLL_CTL, val);
|
||||||
|
SSYNC();
|
||||||
|
asm("IDLE;");
|
||||||
|
|
||||||
|
bfin_write32(SICA_IWR0, iwr0);
|
||||||
|
bfin_write32(SICA_IWR1, iwr1);
|
||||||
|
local_irq_restore_hw(flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Writing to VR_CTL initiates a PLL relock sequence. */
|
||||||
|
static __inline__ void bfin_write_VR_CTL(unsigned int val)
|
||||||
|
{
|
||||||
|
unsigned long flags, iwr0, iwr1;
|
||||||
|
|
||||||
|
if (val == bfin_read_VR_CTL())
|
||||||
|
return;
|
||||||
|
|
||||||
|
local_irq_save_hw(flags);
|
||||||
|
/* Enable the PLL Wakeup bit in SIC IWR */
|
||||||
|
iwr0 = bfin_read32(SICA_IWR0);
|
||||||
|
iwr1 = bfin_read32(SICA_IWR1);
|
||||||
|
/* Only allow PPL Wakeup) */
|
||||||
|
bfin_write32(SICA_IWR0, IWR_ENABLE(0));
|
||||||
|
bfin_write32(SICA_IWR1, 0);
|
||||||
|
|
||||||
|
bfin_write16(VR_CTL, val);
|
||||||
|
SSYNC();
|
||||||
|
asm("IDLE;");
|
||||||
|
|
||||||
|
bfin_write32(SICA_IWR0, iwr0);
|
||||||
|
bfin_write32(SICA_IWR1, iwr1);
|
||||||
|
local_irq_restore_hw(flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* _MACH_PLL_H */
|
|
@ -38,6 +38,7 @@
|
||||||
#include <asm/blackfin.h>
|
#include <asm/blackfin.h>
|
||||||
#include <asm/cacheflush.h>
|
#include <asm/cacheflush.h>
|
||||||
#include <asm/portmux.h>
|
#include <asm/portmux.h>
|
||||||
|
#include <mach/pll.h>
|
||||||
|
|
||||||
#include "bfin_mac.h"
|
#include "bfin_mac.h"
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче