-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yaml --- r: 201550 b: refs/heads/master c: 129961e h: refs/heads/master v: v3
- Loading branch information
Russell King
committed
Jul 29, 2010
1 parent
23a9265
commit 4b61f89
Showing
57 changed files
with
2,696 additions
and
578 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: cccf59abea4e1c36322e365d6e61ff7de1f3ee07 | ||
refs/heads/master: 129961ecaf21c9ee899ad9067d917c1aa172fb7a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* GCC stack protector support. | ||
* | ||
* Stack protector works by putting predefined pattern at the start of | ||
* the stack frame and verifying that it hasn't been overwritten when | ||
* returning from the function. The pattern is called stack canary | ||
* and gcc expects it to be defined by a global variable called | ||
* "__stack_chk_guard" on ARM. This unfortunately means that on SMP | ||
* we cannot have a different canary value per task. | ||
*/ | ||
|
||
#ifndef _ASM_STACKPROTECTOR_H | ||
#define _ASM_STACKPROTECTOR_H 1 | ||
|
||
#include <linux/random.h> | ||
#include <linux/version.h> | ||
|
||
extern unsigned long __stack_chk_guard; | ||
|
||
/* | ||
* Initialize the stackprotector canary value. | ||
* | ||
* NOTE: this must only be called from functions that never return, | ||
* and it must always be inlined. | ||
*/ | ||
static __always_inline void boot_init_stack_canary(void) | ||
{ | ||
unsigned long canary; | ||
|
||
/* Try to get a semi random initial value. */ | ||
get_random_bytes(&canary, sizeof(canary)); | ||
canary ^= LINUX_VERSION_CODE; | ||
|
||
current->stack_canary = canary; | ||
__stack_chk_guard = current->stack_canary; | ||
} | ||
|
||
#endif /* _ASM_STACKPROTECTOR_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
obj-$(CONFIG_ARCH_CNS3XXX) += core.o pm.o | ||
obj-$(CONFIG_ARCH_CNS3XXX) += core.o pm.o devices.o | ||
obj-$(CONFIG_PCI) += pcie.o | ||
obj-$(CONFIG_MACH_CNS3420VB) += cns3420vb.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
/* | ||
* CNS3xxx common devices | ||
* | ||
* Copyright 2008 Cavium Networks | ||
* Scott Shu | ||
* Copyright 2010 MontaVista Software, LLC. | ||
* Anton Vorontsov <avorontsov@mvista.com> | ||
* | ||
* This file is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License, Version 2, as | ||
* published by the Free Software Foundation. | ||
*/ | ||
|
||
#include <linux/io.h> | ||
#include <linux/init.h> | ||
#include <linux/compiler.h> | ||
#include <linux/dma-mapping.h> | ||
#include <linux/platform_device.h> | ||
#include <mach/cns3xxx.h> | ||
#include <mach/irqs.h> | ||
#include "core.h" | ||
#include "devices.h" | ||
|
||
/* | ||
* AHCI | ||
*/ | ||
static struct resource cns3xxx_ahci_resource[] = { | ||
[0] = { | ||
.start = CNS3XXX_SATA2_BASE, | ||
.end = CNS3XXX_SATA2_BASE + CNS3XXX_SATA2_SIZE - 1, | ||
.flags = IORESOURCE_MEM, | ||
}, | ||
[1] = { | ||
.start = IRQ_CNS3XXX_SATA, | ||
.end = IRQ_CNS3XXX_SATA, | ||
.flags = IORESOURCE_IRQ, | ||
}, | ||
}; | ||
|
||
static u64 cns3xxx_ahci_dmamask = DMA_BIT_MASK(32); | ||
|
||
static struct platform_device cns3xxx_ahci_pdev = { | ||
.name = "ahci", | ||
.id = 0, | ||
.resource = cns3xxx_ahci_resource, | ||
.num_resources = ARRAY_SIZE(cns3xxx_ahci_resource), | ||
.dev = { | ||
.dma_mask = &cns3xxx_ahci_dmamask, | ||
.coherent_dma_mask = DMA_BIT_MASK(32), | ||
}, | ||
}; | ||
|
||
void __init cns3xxx_ahci_init(void) | ||
{ | ||
u32 tmp; | ||
|
||
tmp = __raw_readl(MISC_SATA_POWER_MODE); | ||
tmp |= 0x1 << 16; /* Disable SATA PHY 0 from SLUMBER Mode */ | ||
tmp |= 0x1 << 17; /* Disable SATA PHY 1 from SLUMBER Mode */ | ||
__raw_writel(tmp, MISC_SATA_POWER_MODE); | ||
|
||
/* Enable SATA PHY */ | ||
cns3xxx_pwr_power_up(0x1 << PM_PLL_HM_PD_CTRL_REG_OFFSET_SATA_PHY0); | ||
cns3xxx_pwr_power_up(0x1 << PM_PLL_HM_PD_CTRL_REG_OFFSET_SATA_PHY1); | ||
|
||
/* Enable SATA Clock */ | ||
cns3xxx_pwr_clk_en(0x1 << PM_CLK_GATE_REG_OFFSET_SATA); | ||
|
||
/* De-Asscer SATA Reset */ | ||
cns3xxx_pwr_soft_rst(CNS3XXX_PWR_SOFTWARE_RST(SATA)); | ||
|
||
platform_device_register(&cns3xxx_ahci_pdev); | ||
} | ||
|
||
/* | ||
* SDHCI | ||
*/ | ||
static struct resource cns3xxx_sdhci_resources[] = { | ||
[0] = { | ||
.start = CNS3XXX_SDIO_BASE, | ||
.end = CNS3XXX_SDIO_BASE + SZ_4K - 1, | ||
.flags = IORESOURCE_MEM, | ||
}, | ||
[1] = { | ||
.start = IRQ_CNS3XXX_SDIO, | ||
.end = IRQ_CNS3XXX_SDIO, | ||
.flags = IORESOURCE_IRQ, | ||
}, | ||
}; | ||
|
||
static struct platform_device cns3xxx_sdhci_pdev = { | ||
.name = "sdhci-cns3xxx", | ||
.id = 0, | ||
.num_resources = ARRAY_SIZE(cns3xxx_sdhci_resources), | ||
.resource = cns3xxx_sdhci_resources, | ||
}; | ||
|
||
void __init cns3xxx_sdhci_init(void) | ||
{ | ||
u32 __iomem *gpioa = __io(CNS3XXX_MISC_BASE_VIRT + 0x0014); | ||
u32 gpioa_pins = __raw_readl(gpioa); | ||
|
||
/* MMC/SD pins share with GPIOA */ | ||
gpioa_pins |= 0x1fff0004; | ||
__raw_writel(gpioa_pins, gpioa); | ||
|
||
cns3xxx_pwr_clk_en(CNS3XXX_PWR_CLK_EN(SDIO)); | ||
cns3xxx_pwr_soft_rst(CNS3XXX_PWR_SOFTWARE_RST(SDIO)); | ||
|
||
platform_device_register(&cns3xxx_sdhci_pdev); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
* CNS3xxx common devices | ||
* | ||
* Copyright 2008 Cavium Networks | ||
* Scott Shu | ||
* Copyright 2010 MontaVista Software, LLC. | ||
* Anton Vorontsov <avorontsov@mvista.com> | ||
* | ||
* This file is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License, Version 2, as | ||
* published by the Free Software Foundation. | ||
*/ | ||
|
||
#ifndef __CNS3XXX_DEVICES_H_ | ||
#define __CNS3XXX_DEVICES_H_ | ||
|
||
void __init cns3xxx_ahci_init(void); | ||
void __init cns3xxx_sdhci_init(void); | ||
|
||
#endif /* __CNS3XXX_DEVICES_H_ */ |
Oops, something went wrong.