-
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: 172527 b: refs/heads/master c: 86cd4f5 h: refs/heads/master i: 172525: 5334e0f 172523: 00f7f77 172519: 90be589 172511: c6dce14 v: v3
- Loading branch information
Kyungmin Park
authored and
Ben Dooks
committed
Dec 1, 2009
1 parent
a98a898
commit a9c3893
Showing
12 changed files
with
298 additions
and
1 deletion.
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: 067f131d09d89bd56864f1f4b3144cc778024b33 | ||
refs/heads/master: 86cd4f5f83acbfa481c513c74666ad360b49d73b |
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,65 @@ | ||
/* linux/arch/arm/mach-s5pc100/setup-sdhci.c | ||
* | ||
* Copyright 2008 Samsung Electronics | ||
* | ||
* S5PC100 - Helper functions for settign up SDHCI device(s) (HSMMC) | ||
* | ||
* Based on mach-s3c6410/setup-sdhci.c | ||
* | ||
* This program 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/kernel.h> | ||
#include <linux/types.h> | ||
#include <linux/interrupt.h> | ||
#include <linux/platform_device.h> | ||
#include <linux/io.h> | ||
|
||
#include <linux/mmc/card.h> | ||
#include <linux/mmc/host.h> | ||
|
||
#include <plat/regs-sdhci.h> | ||
#include <plat/sdhci.h> | ||
|
||
/* clock sources for the mmc bus clock, order as for the ctrl2[5..4] */ | ||
|
||
char *s5pc100_hsmmc_clksrcs[4] = { | ||
[0] = "hsmmc", | ||
[1] = "hsmmc", | ||
/* [2] = "mmc_bus", not yet succesfuuly used yet */ | ||
/* [3] = "48m", - note not succesfully used yet */ | ||
}; | ||
|
||
|
||
void s5pc100_setup_sdhci0_cfg_card(struct platform_device *dev, | ||
void __iomem *r, | ||
struct mmc_ios *ios, | ||
struct mmc_card *card) | ||
{ | ||
u32 ctrl2, ctrl3; | ||
|
||
/* don't need to alter anything acording to card-type */ | ||
|
||
writel(S3C64XX_SDHCI_CONTROL4_DRIVE_9mA, r + S3C64XX_SDHCI_CONTROL4); | ||
|
||
ctrl2 = readl(r + S3C_SDHCI_CONTROL2); | ||
ctrl2 &= S3C_SDHCI_CTRL2_SELBASECLK_MASK; | ||
ctrl2 |= (S3C64XX_SDHCI_CTRL2_ENSTAASYNCCLR | | ||
S3C64XX_SDHCI_CTRL2_ENCMDCNFMSK | | ||
S3C_SDHCI_CTRL2_ENFBCLKRX | | ||
S3C_SDHCI_CTRL2_DFCNT_NONE | | ||
S3C_SDHCI_CTRL2_ENCLKOUTHOLD); | ||
|
||
if (ios->clock < 25 * 1000000) | ||
ctrl3 = (S3C_SDHCI_CTRL3_FCSEL3 | | ||
S3C_SDHCI_CTRL3_FCSEL2 | | ||
S3C_SDHCI_CTRL3_FCSEL1 | | ||
S3C_SDHCI_CTRL3_FCSEL0); | ||
else | ||
ctrl3 = (S3C_SDHCI_CTRL3_FCSEL1 | S3C_SDHCI_CTRL3_FCSEL0); | ||
|
||
writel(ctrl2, r + S3C_SDHCI_CONTROL2); | ||
writel(ctrl3, r + S3C_SDHCI_CONTROL3); | ||
} |
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,65 @@ | ||
/* linux/arch/arm/plat-s3c/dev-hsmmc2.c | ||
* | ||
* Copyright (c) 2009 Samsung Electronics | ||
* | ||
* S3C series device definition for hsmmc device 2 | ||
* | ||
* This program 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/kernel.h> | ||
#include <linux/platform_device.h> | ||
#include <linux/mmc/host.h> | ||
|
||
#include <mach/map.h> | ||
#include <plat/sdhci.h> | ||
#include <plat/devs.h> | ||
|
||
#define S3C_SZ_HSMMC (0x1000) | ||
|
||
static struct resource s3c_hsmmc2_resource[] = { | ||
[0] = { | ||
.start = S3C_PA_HSMMC2, | ||
.end = S3C_PA_HSMMC2 + S3C_SZ_HSMMC - 1, | ||
.flags = IORESOURCE_MEM, | ||
}, | ||
[1] = { | ||
.start = IRQ_HSMMC2, | ||
.end = IRQ_HSMMC2, | ||
.flags = IORESOURCE_IRQ, | ||
} | ||
}; | ||
|
||
static u64 s3c_device_hsmmc2_dmamask = 0xffffffffUL; | ||
|
||
struct s3c_sdhci_platdata s3c_hsmmc2_def_platdata = { | ||
.max_width = 4, | ||
.host_caps = (MMC_CAP_4_BIT_DATA | | ||
MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED), | ||
}; | ||
|
||
struct platform_device s3c_device_hsmmc2 = { | ||
.name = "s3c-sdhci", | ||
.id = 2, | ||
.num_resources = ARRAY_SIZE(s3c_hsmmc2_resource), | ||
.resource = s3c_hsmmc2_resource, | ||
.dev = { | ||
.dma_mask = &s3c_device_hsmmc2_dmamask, | ||
.coherent_dma_mask = 0xffffffffUL, | ||
.platform_data = &s3c_hsmmc2_def_platdata, | ||
}, | ||
}; | ||
|
||
void s3c_sdhci2_set_platdata(struct s3c_sdhci_platdata *pd) | ||
{ | ||
struct s3c_sdhci_platdata *set = &s3c_hsmmc2_def_platdata; | ||
|
||
set->max_width = pd->max_width; | ||
|
||
if (pd->cfg_gpio) | ||
set->cfg_gpio = pd->cfg_gpio; | ||
if (pd->cfg_card) | ||
set->cfg_card = pd->cfg_card; | ||
} |
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,86 @@ | ||
/* linux/arch/arm/plat-s5pc1xx/setup-sdhci-gpio.c | ||
* | ||
* Copyright 2009 Samsung Eletronics | ||
* | ||
* S5PC1XX - Helper functions for setting up SDHCI device(s) GPIO (HSMMC) | ||
* | ||
* This program 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/kernel.h> | ||
#include <linux/types.h> | ||
#include <linux/interrupt.h> | ||
#include <linux/platform_device.h> | ||
#include <linux/io.h> | ||
#include <linux/gpio.h> | ||
#include <linux/mmc/host.h> | ||
#include <linux/mmc/card.h> | ||
|
||
#include <plat/gpio-cfg.h> | ||
#include <plat/regs-sdhci.h> | ||
|
||
void s5pc100_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width) | ||
{ | ||
unsigned int gpio; | ||
unsigned int end; | ||
unsigned int num; | ||
|
||
num = width; | ||
/* In case of 8 width, we should decrease the 2 */ | ||
if (width == 8) | ||
num = width - 2; | ||
|
||
end = S5PC100_GPG0(2 + num); | ||
|
||
/* Set all the necessary GPG0/GPG1 pins to special-function 0 */ | ||
for (gpio = S5PC100_GPG0(0); gpio < end; gpio++) { | ||
s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); | ||
s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | ||
} | ||
|
||
if (width == 8) { | ||
for (gpio = S5PC100_GPG1(0); gpio <= S5PC100_GPG1(1); gpio++) { | ||
s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); | ||
s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | ||
} | ||
} | ||
|
||
s3c_gpio_setpull(S5PC100_GPG1(2), S3C_GPIO_PULL_UP); | ||
s3c_gpio_cfgpin(S5PC100_GPG1(2), S3C_GPIO_SFN(2)); | ||
} | ||
|
||
void s5pc100_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width) | ||
{ | ||
unsigned int gpio; | ||
unsigned int end; | ||
|
||
end = S5PC100_GPG2(2 + width); | ||
|
||
/* Set all the necessary GPG2 pins to special-function 2 */ | ||
for (gpio = S5PC100_GPG2(0); gpio < end; gpio++) { | ||
s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); | ||
s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | ||
} | ||
|
||
s3c_gpio_setpull(S5PC100_GPG2(6), S3C_GPIO_PULL_UP); | ||
s3c_gpio_cfgpin(S5PC100_GPG2(6), S3C_GPIO_SFN(2)); | ||
} | ||
|
||
void s5pc100_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width) | ||
{ | ||
unsigned int gpio; | ||
unsigned int end; | ||
|
||
end = S5PC100_GPG3(2 + width); | ||
|
||
/* Set all the necessary GPG3 pins to special-function 2 */ | ||
for (gpio = S5PC100_GPG3(0); gpio < end; gpio++) { | ||
s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); | ||
s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | ||
} | ||
|
||
s3c_gpio_setpull(S5PC100_GPG3(6), S3C_GPIO_PULL_UP); | ||
s3c_gpio_cfgpin(S5PC100_GPG3(6), S3C_GPIO_SFN(2)); | ||
} |