X-Git-Url: https://nv-tegra.nvidia.com/r/gitweb?p=linux-3.10.git;a=blobdiff_plain;f=arch%2Farm%2Fmach-tegra%2Fedp.c;h=b0604cc9607d1f115d1112f350365f92f302a972;hp=fbbe24ded1c5e7e2bd45e74a196b57254d695b71;hb=3d403943a99f02c6810765b6ef353ca07a07d265;hpb=47f2981b07371c2f3b19b9a50a992099a077fd67 diff --git a/arch/arm/mach-tegra/edp.c b/arch/arm/mach-tegra/edp.c index fbbe24ded1c..b0604cc9607 100644 --- a/arch/arm/mach-tegra/edp.c +++ b/arch/arm/mach-tegra/edp.c @@ -26,7 +26,6 @@ #include "fuse.h" - static const struct tegra_edp_limits *edp_limits; static int edp_limits_size; @@ -39,68 +38,103 @@ static int edp_limits_size; * comes first */ static char __initdata tegra_edp_map[] = { - 0x00, 0x3d, 0x2d, 0x8c, 0x82, 0x82, 0x82, 0x00, - 0x3d, 0x3c, 0x8c, 0x82, 0x82, 0x82, 0x00, 0x3d, - 0x4b, 0x8c, 0x82, 0x82, 0x82, 0x00, 0x3d, 0x5a, - 0x8c, 0x82, 0x82, 0x82, 0x00, 0x32, 0x2d, 0x8c, - 0x82, 0x82, 0x82, 0x00, 0x32, 0x3c, 0x8c, 0x82, - 0x82, 0x82, 0x00, 0x32, 0x4b, 0x8c, 0x82, 0x82, - 0x78, 0x00, 0x32, 0x5a, 0x8c, 0x82, 0x82, 0x6e, - 0x00, 0x28, 0x2d, 0x8c, 0x82, 0x82, 0x78, 0x00, - 0x28, 0x3c, 0x8c, 0x82, 0x82, 0x73, 0x00, 0x28, - 0x4b, 0x8c, 0x82, 0x78, 0x6e, 0x00, 0x28, 0x5a, - 0x8c, 0x82, 0x73, 0x5f, 0x00, 0x23, 0x2d, 0x8c, - 0x82, 0x82, 0x6e, 0x00, 0x23, 0x3c, 0x8c, 0x82, - 0x78, 0x69, 0x00, 0x23, 0x4b, 0x8c, 0x82, 0x73, - 0x5f, 0x00, 0x23, 0x5a, 0x8c, 0x82, 0x69, 0x55, - 0x01, 0x2f, 0x2d, 0x8c, 0x78, 0x78, 0x78, 0x01, - 0x2f, 0x3c, 0x8c, 0x78, 0x78, 0x78, 0x01, 0x2f, - 0x4b, 0x8c, 0x78, 0x78, 0x78, 0x01, 0x2f, 0x5a, - 0x8c, 0x78, 0x78, 0x78, 0x01, 0x28, 0x2d, 0x8c, - 0x78, 0x78, 0x78, 0x01, 0x28, 0x3c, 0x8c, 0x78, - 0x78, 0x78, 0x01, 0x28, 0x4b, 0x8c, 0x78, 0x78, - 0x73, 0x01, 0x28, 0x5a, 0x8c, 0x78, 0x73, 0x69, - 0x01, 0x23, 0x2d, 0x8c, 0x78, 0x78, 0x78, 0x01, - 0x23, 0x3c, 0x8c, 0x78, 0x78, 0x6e, 0x01, 0x23, - 0x4b, 0x8c, 0x78, 0x78, 0x64, 0x01, 0x23, 0x5a, - 0x8c, 0x78, 0x6e, 0x5a, 0x01, 0x1e, 0x2d, 0x8c, - 0x78, 0x78, 0x69, 0x01, 0x1e, 0x3c, 0x8c, 0x78, - 0x78, 0x64, 0x01, 0x1e, 0x4b, 0x8c, 0x78, 0x6e, - 0x5a, 0x01, 0x1e, 0x5a, 0x8c, 0x78, 0x64, 0x5a, - 0x01, 0x19, 0x23, 0x82, 0x78, 0x70, 0x5c, 0x01, - 0x19, 0x32, 0x82, 0x78, 0x6c, 0x56, 0x01, 0x19, - 0x3c, 0x82, 0x78, 0x66, 0x52, 0x01, 0x19, 0x46, - 0x82, 0x78, 0x60, 0x4e, 0x01, 0x19, 0x50, 0x82, - 0x78, 0x5c, 0x4a, 0x01, 0x19, 0x5a, 0x82, 0x72, - 0x58, 0x40, 0x02, 0x3d, 0x2d, 0x8c, 0x82, 0x82, - 0x82, 0x02, 0x3d, 0x3c, 0x8c, 0x82, 0x82, 0x82, - 0x02, 0x3d, 0x4b, 0x8c, 0x82, 0x82, 0x82, 0x02, - 0x3d, 0x5a, 0x8c, 0x82, 0x82, 0x82, 0x02, 0x32, - 0x2d, 0x8c, 0x82, 0x82, 0x82, 0x02, 0x32, 0x3c, - 0x8c, 0x82, 0x82, 0x82, 0x02, 0x32, 0x4b, 0x8c, - 0x82, 0x82, 0x78, 0x02, 0x32, 0x5a, 0x8c, 0x82, - 0x82, 0x6e, 0x02, 0x28, 0x2d, 0x8c, 0x82, 0x82, - 0x78, 0x02, 0x28, 0x3c, 0x8c, 0x82, 0x82, 0x73, - 0x02, 0x28, 0x4b, 0x8c, 0x82, 0x78, 0x6e, 0x02, - 0x28, 0x5a, 0x8c, 0x82, 0x73, 0x5f, 0x02, 0x23, - 0x2d, 0x8c, 0x82, 0x82, 0x6e, 0x02, 0x23, 0x3c, - 0x8c, 0x82, 0x78, 0x69, 0x02, 0x23, 0x4b, 0x8c, - 0x82, 0x73, 0x5f, 0x02, 0x23, 0x5a, 0x8c, 0x82, - 0x69, 0x55, 0x03, 0x3d, 0x2d, 0x8c, 0x82, 0x82, - 0x82, 0x03, 0x3d, 0x3c, 0x8c, 0x82, 0x82, 0x82, - 0x03, 0x3d, 0x4b, 0x8c, 0x82, 0x82, 0x82, 0x03, - 0x3d, 0x5a, 0x8c, 0x82, 0x82, 0x82, 0x03, 0x32, - 0x2d, 0x8c, 0x82, 0x82, 0x82, 0x03, 0x32, 0x3c, - 0x8c, 0x82, 0x82, 0x82, 0x03, 0x32, 0x4b, 0x8c, - 0x82, 0x82, 0x73, 0x03, 0x32, 0x5a, 0x8c, 0x82, - 0x82, 0x6e, 0x03, 0x28, 0x2d, 0x8c, 0x82, 0x82, - 0x78, 0x03, 0x28, 0x3c, 0x8c, 0x82, 0x82, 0x73, - 0x03, 0x28, 0x4b, 0x8c, 0x82, 0x7d, 0x6e, 0x03, - 0x28, 0x5a, 0x8c, 0x82, 0x73, 0x5f, 0x03, 0x23, - 0x2d, 0x8c, 0x82, 0x82, 0x6e, 0x03, 0x23, 0x3c, - 0x8c, 0x82, 0x78, 0x6e, 0x03, 0x23, 0x4b, 0x8c, - 0x82, 0x78, 0x5f, 0x03, 0x23, 0x5a, 0x8c, 0x82, - 0x6e, 0x5a, + 0x00, 0x2f, 0x2d, 0x82, 0x78, 0x78, 0x78, 0x00, + 0x2f, 0x3c, 0x82, 0x78, 0x78, 0x78, 0x00, 0x2f, + 0x4b, 0x82, 0x78, 0x78, 0x78, 0x00, 0x2f, 0x55, + 0x82, 0x78, 0x78, 0x78, 0x00, 0x28, 0x2d, 0x82, + 0x78, 0x78, 0x78, 0x00, 0x28, 0x3c, 0x82, 0x78, + 0x78, 0x78, 0x00, 0x28, 0x4b, 0x82, 0x78, 0x78, + 0x73, 0x00, 0x28, 0x55, 0x82, 0x78, 0x73, 0x69, + 0x00, 0x23, 0x2d, 0x82, 0x78, 0x78, 0x78, 0x00, + 0x23, 0x3c, 0x82, 0x78, 0x78, 0x6e, 0x00, 0x23, + 0x4b, 0x82, 0x78, 0x78, 0x64, 0x00, 0x23, 0x55, + 0x82, 0x78, 0x6e, 0x5a, 0x00, 0x1e, 0x2d, 0x82, + 0x78, 0x78, 0x69, 0x00, 0x1e, 0x3c, 0x82, 0x78, + 0x78, 0x64, 0x00, 0x1e, 0x4b, 0x82, 0x78, 0x6e, + 0x5a, 0x00, 0x1e, 0x55, 0x82, 0x78, 0x64, 0x5a, + 0x00, 0x19, 0x2d, 0x82, 0x78, 0x6e, 0x5a, 0x00, + 0x19, 0x3c, 0x82, 0x78, 0x69, 0x55, 0x00, 0x19, + 0x4b, 0x82, 0x78, 0x5f, 0x4b, 0x00, 0x19, 0x55, + 0x82, 0x73, 0x5a, 0x3c, 0x01, 0x2f, 0x2d, 0x82, + 0x78, 0x78, 0x78, 0x01, 0x2f, 0x3c, 0x82, 0x78, + 0x78, 0x78, 0x01, 0x2f, 0x4b, 0x82, 0x78, 0x78, + 0x78, 0x01, 0x2f, 0x55, 0x82, 0x78, 0x78, 0x78, + 0x01, 0x28, 0x2d, 0x82, 0x78, 0x78, 0x78, 0x01, + 0x28, 0x3c, 0x82, 0x78, 0x78, 0x78, 0x01, 0x28, + 0x4b, 0x82, 0x78, 0x78, 0x73, 0x01, 0x28, 0x55, + 0x82, 0x78, 0x73, 0x69, 0x01, 0x23, 0x2d, 0x82, + 0x78, 0x78, 0x78, 0x01, 0x23, 0x3c, 0x82, 0x78, + 0x78, 0x6e, 0x01, 0x23, 0x4b, 0x82, 0x78, 0x78, + 0x64, 0x01, 0x23, 0x55, 0x82, 0x78, 0x6e, 0x5a, + 0x01, 0x1e, 0x2d, 0x82, 0x78, 0x78, 0x69, 0x01, + 0x1e, 0x3c, 0x82, 0x78, 0x78, 0x64, 0x01, 0x1e, + 0x4b, 0x82, 0x78, 0x6e, 0x5a, 0x01, 0x1e, 0x55, + 0x82, 0x78, 0x64, 0x5a, 0x01, 0x19, 0x2d, 0x82, + 0x78, 0x6e, 0x5a, 0x01, 0x19, 0x3c, 0x82, 0x78, + 0x69, 0x55, 0x01, 0x19, 0x4b, 0x82, 0x78, 0x5f, + 0x4b, 0x01, 0x19, 0x55, 0x82, 0x73, 0x5a, 0x3c, + 0x02, 0x3d, 0x2d, 0x8c, 0x82, 0x82, 0x82, 0x02, + 0x3d, 0x3c, 0x8c, 0x82, 0x82, 0x82, 0x02, 0x3d, + 0x4b, 0x8c, 0x82, 0x82, 0x82, 0x02, 0x3d, 0x55, + 0x8c, 0x82, 0x82, 0x82, 0x02, 0x32, 0x2d, 0x8c, + 0x82, 0x82, 0x82, 0x02, 0x32, 0x3c, 0x8c, 0x82, + 0x82, 0x82, 0x02, 0x32, 0x4b, 0x8c, 0x82, 0x82, + 0x78, 0x02, 0x32, 0x55, 0x8c, 0x82, 0x82, 0x6e, + 0x02, 0x28, 0x2d, 0x8c, 0x82, 0x82, 0x78, 0x02, + 0x28, 0x3c, 0x8c, 0x82, 0x82, 0x73, 0x02, 0x28, + 0x4b, 0x8c, 0x82, 0x78, 0x6e, 0x02, 0x28, 0x55, + 0x8c, 0x82, 0x73, 0x5f, 0x02, 0x23, 0x2d, 0x8c, + 0x82, 0x82, 0x6e, 0x02, 0x23, 0x3c, 0x8c, 0x82, + 0x78, 0x69, 0x02, 0x23, 0x4b, 0x8c, 0x82, 0x73, + 0x5f, 0x02, 0x23, 0x55, 0x8c, 0x82, 0x69, 0x55, + 0x03, 0x3d, 0x2d, 0x8c, 0x82, 0x82, 0x82, 0x03, + 0x3d, 0x3c, 0x8c, 0x82, 0x82, 0x82, 0x03, 0x3d, + 0x4b, 0x8c, 0x82, 0x82, 0x82, 0x03, 0x3d, 0x55, + 0x8c, 0x82, 0x82, 0x82, 0x03, 0x32, 0x2d, 0x8c, + 0x82, 0x82, 0x82, 0x03, 0x32, 0x3c, 0x8c, 0x82, + 0x82, 0x82, 0x03, 0x32, 0x4b, 0x8c, 0x82, 0x82, + 0x73, 0x03, 0x32, 0x55, 0x8c, 0x82, 0x82, 0x6e, + 0x03, 0x28, 0x2d, 0x8c, 0x82, 0x82, 0x78, 0x03, + 0x28, 0x3c, 0x8c, 0x82, 0x82, 0x73, 0x03, 0x28, + 0x4b, 0x8c, 0x82, 0x7d, 0x6e, 0x03, 0x28, 0x55, + 0x8c, 0x82, 0x73, 0x5f, 0x03, 0x23, 0x2d, 0x8c, + 0x82, 0x82, 0x6e, 0x03, 0x23, 0x3c, 0x8c, 0x82, + 0x78, 0x69, 0x03, 0x23, 0x4b, 0x8c, 0x82, 0x6e, + 0x5a, 0x03, 0x23, 0x55, 0x8c, 0x82, 0x64, 0x50, + 0x04, 0x32, 0x2d, 0x96, 0x8c, 0x8c, 0x8c, 0x04, + 0x32, 0x3c, 0x96, 0x8c, 0x8c, 0x8c, 0x04, 0x32, + 0x46, 0x96, 0x8c, 0x8c, 0x8c, 0x04, 0x32, 0x4b, + 0x82, 0x78, 0x78, 0x78, 0x04, 0x32, 0x55, 0x82, + 0x78, 0x78, 0x78, 0x04, 0x2f, 0x2d, 0x96, 0x8c, + 0x8c, 0x8c, 0x04, 0x2f, 0x3c, 0x96, 0x8c, 0x8c, + 0x8c, 0x04, 0x2f, 0x46, 0x96, 0x8c, 0x8c, 0x82, + 0x04, 0x2f, 0x4b, 0x82, 0x78, 0x78, 0x78, 0x04, + 0x2f, 0x55, 0x82, 0x78, 0x78, 0x78, 0x04, 0x28, + 0x2d, 0x96, 0x8c, 0x8c, 0x82, 0x04, 0x28, 0x3c, + 0x96, 0x8c, 0x8c, 0x82, 0x04, 0x28, 0x46, 0x96, + 0x8c, 0x8c, 0x78, 0x04, 0x28, 0x4b, 0x82, 0x78, + 0x78, 0x78, 0x04, 0x28, 0x55, 0x82, 0x78, 0x78, + 0x6e, 0x04, 0x23, 0x2d, 0x96, 0x8c, 0x8c, 0x78, + 0x04, 0x23, 0x3c, 0x96, 0x8c, 0x82, 0x78, 0x04, + 0x23, 0x46, 0x96, 0x8c, 0x82, 0x6e, 0x04, 0x23, + 0x4b, 0x82, 0x78, 0x78, 0x6e, 0x04, 0x23, 0x55, + 0x82, 0x78, 0x78, 0x64, 0x04, 0x1e, 0x2d, 0x96, + 0x8c, 0x82, 0x6e, 0x04, 0x1e, 0x3c, 0x96, 0x8c, + 0x78, 0x64, 0x04, 0x1e, 0x46, 0x96, 0x8c, 0x78, + 0x5a, 0x04, 0x1e, 0x4b, 0x82, 0x78, 0x78, 0x5a, + 0x04, 0x1e, 0x55, 0x82, 0x78, 0x69, 0x50, 0x04, + 0x19, 0x2d, 0x96, 0x8c, 0x6e, 0x5a, 0x04, 0x19, + 0x3c, 0x96, 0x82, 0x6e, 0x55, 0x04, 0x19, 0x46, + 0x96, 0x82, 0x64, 0x50, 0x04, 0x19, 0x4b, 0x82, + 0x78, 0x64, 0x50, 0x04, 0x19, 0x55, 0x82, 0x78, + 0x55, 0x3c, 0x05, 0x64, 0x3c, 0xaa, 0xa0, 0xa0, + 0xa0, 0x05, 0x64, 0x55, 0x8c, 0x82, 0x82, 0x82, + 0x05, 0x3c, 0x3c, 0x8c, 0x82, 0x82, 0x82, 0x05, + 0x3c, 0x55, 0x8c, 0x82, 0x82, 0x82, 0x06, 0x64, + 0x3c, 0xaa, 0xa0, 0x82, 0x82, 0x06, 0x64, 0x55, + 0x8c, 0x82, 0x82, 0x82, 0x06, 0x3c, 0x3c, 0x8c, + 0x82, 0x82, 0x82, 0x06, 0x3c, 0x55, 0x8c, 0x82, + 0x82, 0x82, }; @@ -109,7 +143,7 @@ static char __initdata tegra_edp_map[] = { * regulator_cur is found; must be the last one */ static struct tegra_edp_limits edp_default_limits[] = { - {90, {1000000, 1000000, 1000000, 1000000} }, + {85, {1000000, 1000000, 1000000, 1000000} }, }; @@ -126,6 +160,10 @@ void __init tegra_init_cpu_edp_limits(unsigned int regulator_mA) struct tegra_edp_entry *t = (struct tegra_edp_entry *)tegra_edp_map; int tsize = sizeof(tegra_edp_map)/sizeof(struct tegra_edp_entry); + /* FIXME: Now for T33 we use 6A limit - fix this later */ + if (cpu_speedo_id > 3) + regulator_mA = 6000; + if (!regulator_mA) { edp_limits = edp_default_limits; edp_limits_size = ARRAY_SIZE(edp_default_limits); @@ -179,6 +217,12 @@ void tegra_get_cpu_edp_limits(const struct tegra_edp_limits **limits, int *size) #ifdef CONFIG_DEBUG_FS +static int edp_limit_debugfs_show(struct seq_file *s, void *data) +{ + seq_printf(s, "%u\n", tegra_get_edp_limit()); + return 0; +} + static int edp_debugfs_show(struct seq_file *s, void *data) { int i; @@ -206,6 +250,11 @@ static int edp_debugfs_open(struct inode *inode, struct file *file) return single_open(file, edp_debugfs_show, inode->i_private); } +static int edp_limit_debugfs_open(struct inode *inode, struct file *file) +{ + return single_open(file, edp_limit_debugfs_show, inode->i_private); +} + static const struct file_operations edp_debugfs_fops = { .open = edp_debugfs_open, @@ -214,6 +263,12 @@ static const struct file_operations edp_debugfs_fops = { .release = single_release, }; +static const struct file_operations edp_limit_debugfs_fops = { + .open = edp_limit_debugfs_open, + .read = seq_read, + .llseek = seq_lseek, + .release = single_release, +}; static int __init tegra_edp_debugfs_init(void) { @@ -224,6 +279,9 @@ static int __init tegra_edp_debugfs_init(void) if (!d) return -ENOMEM; + d = debugfs_create_file("edp_limit", S_IRUGO, NULL, NULL, + &edp_limit_debugfs_fops); + return 0; }