Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 373893
b: refs/heads/master
c: 96790f0
h: refs/heads/master
i:
  373891: a2ea87e
v: v3
  • Loading branch information
Michal Simek committed Apr 4, 2013
1 parent a08e0ba commit 0993349
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 64b889b39e9958fdcfe5e9b7aa1ac0ffca3fc9a2
refs/heads/master: 96790f0a283976bc59f68657237293fe97b02334
6 changes: 6 additions & 0 deletions trunk/arch/arm/mach-zynq/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ static void __init xilinx_map_io(void)
zynq_scu_map_io();
}

static void zynq_system_reset(char mode, const char *cmd)
{
zynq_slcr_system_reset();
}

static const char *xilinx_dt_match[] = {
"xlnx,zynq-zc702",
"xlnx,zynq-7000",
Expand All @@ -104,4 +109,5 @@ MACHINE_START(XILINX_EP107, "Xilinx Zynq Platform")
.init_machine = xilinx_init_machine,
.init_time = xilinx_zynq_timer_init,
.dt_compat = xilinx_dt_match,
.restart = zynq_system_reset,
MACHINE_END
1 change: 1 addition & 0 deletions trunk/arch/arm/mach-zynq/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#define __MACH_ZYNQ_COMMON_H__

extern int zynq_slcr_init(void);
extern void zynq_slcr_system_reset(void);

extern void __iomem *zynq_slcr_base;
extern void __iomem *zynq_scu_base;
Expand Down
27 changes: 27 additions & 0 deletions trunk/arch/arm/mach-zynq/slcr.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,35 @@
#define SLCR_UNLOCK_MAGIC 0xDF0D
#define SLCR_UNLOCK 0x8 /* SCLR unlock register */

#define SLCR_PS_RST_CTRL_OFFSET 0x200 /* PS Software Reset Control */
#define SLCR_REBOOT_STATUS 0x258 /* PS Reboot Status */

void __iomem *zynq_slcr_base;

/**
* zynq_slcr_system_reset - Reset the entire system.
*/
void zynq_slcr_system_reset(void)
{
u32 reboot;

/*
* Unlock the SLCR then reset the system.
* Note that this seems to require raw i/o
* functions or there's a lockup?
*/
writel(SLCR_UNLOCK_MAGIC, zynq_slcr_base + SLCR_UNLOCK);

/*
* Clear 0x0F000000 bits of reboot status register to workaround
* the FSBL not loading the bitstream after soft-reboot
* This is a temporary solution until we know more.
*/
reboot = readl(zynq_slcr_base + SLCR_REBOOT_STATUS);
writel(reboot & 0xF0FFFFFF, zynq_slcr_base + SLCR_REBOOT_STATUS);
writel(1, zynq_slcr_base + SLCR_PS_RST_CTRL_OFFSET);
}

/**
* zynq_slcr_init
* Returns 0 on success, negative errno otherwise.
Expand Down

0 comments on commit 0993349

Please sign in to comment.