175722d39SBenjamin Herrenschmidt /* 275722d39SBenjamin Herrenschmidt * Windfarm PowerMac thermal control. SMU based controls 375722d39SBenjamin Herrenschmidt * 475722d39SBenjamin Herrenschmidt * (c) Copyright 2005 Benjamin Herrenschmidt, IBM Corp. 575722d39SBenjamin Herrenschmidt * <benh@kernel.crashing.org> 675722d39SBenjamin Herrenschmidt * 775722d39SBenjamin Herrenschmidt * Released under the term of the GNU GPL v2. 875722d39SBenjamin Herrenschmidt */ 975722d39SBenjamin Herrenschmidt 1075722d39SBenjamin Herrenschmidt #include <linux/types.h> 1175722d39SBenjamin Herrenschmidt #include <linux/errno.h> 1275722d39SBenjamin Herrenschmidt #include <linux/kernel.h> 1375722d39SBenjamin Herrenschmidt #include <linux/delay.h> 1475722d39SBenjamin Herrenschmidt #include <linux/slab.h> 1575722d39SBenjamin Herrenschmidt #include <linux/init.h> 1675722d39SBenjamin Herrenschmidt #include <linux/wait.h> 17de25968cSTim Schmielau #include <linux/completion.h> 1875722d39SBenjamin Herrenschmidt #include <asm/prom.h> 1975722d39SBenjamin Herrenschmidt #include <asm/machdep.h> 2075722d39SBenjamin Herrenschmidt #include <asm/io.h> 2175722d39SBenjamin Herrenschmidt #include <asm/system.h> 2275722d39SBenjamin Herrenschmidt #include <asm/sections.h> 2375722d39SBenjamin Herrenschmidt #include <asm/smu.h> 2475722d39SBenjamin Herrenschmidt 2575722d39SBenjamin Herrenschmidt #include "windfarm.h" 2675722d39SBenjamin Herrenschmidt 27ac171c46SBenjamin Herrenschmidt #define VERSION "0.4" 2875722d39SBenjamin Herrenschmidt 2975722d39SBenjamin Herrenschmidt #undef DEBUG 3075722d39SBenjamin Herrenschmidt 3175722d39SBenjamin Herrenschmidt #ifdef DEBUG 3275722d39SBenjamin Herrenschmidt #define DBG(args...) printk(args) 3375722d39SBenjamin Herrenschmidt #else 3475722d39SBenjamin Herrenschmidt #define DBG(args...) do { } while(0) 3575722d39SBenjamin Herrenschmidt #endif 3675722d39SBenjamin Herrenschmidt 37ac171c46SBenjamin Herrenschmidt static int smu_supports_new_fans_ops = 1; 38ac171c46SBenjamin Herrenschmidt 3975722d39SBenjamin Herrenschmidt /* 4075722d39SBenjamin Herrenschmidt * SMU fans control object 4175722d39SBenjamin Herrenschmidt */ 4275722d39SBenjamin Herrenschmidt 4375722d39SBenjamin Herrenschmidt static LIST_HEAD(smu_fans); 4475722d39SBenjamin Herrenschmidt 4575722d39SBenjamin Herrenschmidt struct smu_fan_control { 4675722d39SBenjamin Herrenschmidt struct list_head link; 4775722d39SBenjamin Herrenschmidt int fan_type; /* 0 = rpm, 1 = pwm */ 4875722d39SBenjamin Herrenschmidt u32 reg; /* index in SMU */ 4975722d39SBenjamin Herrenschmidt s32 value; /* current value */ 5075722d39SBenjamin Herrenschmidt s32 min, max; /* min/max values */ 5175722d39SBenjamin Herrenschmidt struct wf_control ctrl; 5275722d39SBenjamin Herrenschmidt }; 5375722d39SBenjamin Herrenschmidt #define to_smu_fan(c) container_of(c, struct smu_fan_control, ctrl) 5475722d39SBenjamin Herrenschmidt 5575722d39SBenjamin Herrenschmidt static int smu_set_fan(int pwm, u8 id, u16 value) 5675722d39SBenjamin Herrenschmidt { 5775722d39SBenjamin Herrenschmidt struct smu_cmd cmd; 5875722d39SBenjamin Herrenschmidt u8 buffer[16]; 596e9a4738SPeter Zijlstra DECLARE_COMPLETION_ONSTACK(comp); 6075722d39SBenjamin Herrenschmidt int rc; 6175722d39SBenjamin Herrenschmidt 6275722d39SBenjamin Herrenschmidt /* Fill SMU command structure */ 6375722d39SBenjamin Herrenschmidt cmd.cmd = SMU_CMD_FAN_COMMAND; 64ac171c46SBenjamin Herrenschmidt 65ac171c46SBenjamin Herrenschmidt /* The SMU has an "old" and a "new" way of setting the fan speed 66ac171c46SBenjamin Herrenschmidt * Unfortunately, I found no reliable way to know which one works 67ac171c46SBenjamin Herrenschmidt * on a given machine model. After some investigations it appears 68ac171c46SBenjamin Herrenschmidt * that MacOS X just tries the new one, and if it fails fallbacks 69ac171c46SBenjamin Herrenschmidt * to the old ones ... Ugh. 70ac171c46SBenjamin Herrenschmidt */ 71ac171c46SBenjamin Herrenschmidt retry: 72ac171c46SBenjamin Herrenschmidt if (smu_supports_new_fans_ops) { 73ac171c46SBenjamin Herrenschmidt buffer[0] = 0x30; 74ac171c46SBenjamin Herrenschmidt buffer[1] = id; 75ac171c46SBenjamin Herrenschmidt *((u16 *)(&buffer[2])) = value; 76ac171c46SBenjamin Herrenschmidt cmd.data_len = 4; 77ac171c46SBenjamin Herrenschmidt } else { 78ac171c46SBenjamin Herrenschmidt if (id > 7) 79ac171c46SBenjamin Herrenschmidt return -EINVAL; 80ac171c46SBenjamin Herrenschmidt /* Fill argument buffer */ 81ac171c46SBenjamin Herrenschmidt memset(buffer, 0, 16); 82ac171c46SBenjamin Herrenschmidt buffer[0] = pwm ? 0x10 : 0x00; 83ac171c46SBenjamin Herrenschmidt buffer[1] = 0x01 << id; 84ac171c46SBenjamin Herrenschmidt *((u16 *)&buffer[2 + id * 2]) = value; 8575722d39SBenjamin Herrenschmidt cmd.data_len = 14; 86ac171c46SBenjamin Herrenschmidt } 87ac171c46SBenjamin Herrenschmidt 8875722d39SBenjamin Herrenschmidt cmd.reply_len = 16; 8975722d39SBenjamin Herrenschmidt cmd.data_buf = cmd.reply_buf = buffer; 9075722d39SBenjamin Herrenschmidt cmd.status = 0; 9175722d39SBenjamin Herrenschmidt cmd.done = smu_done_complete; 9275722d39SBenjamin Herrenschmidt cmd.misc = ∁ 9375722d39SBenjamin Herrenschmidt 9475722d39SBenjamin Herrenschmidt rc = smu_queue_cmd(&cmd); 9575722d39SBenjamin Herrenschmidt if (rc) 9675722d39SBenjamin Herrenschmidt return rc; 9775722d39SBenjamin Herrenschmidt wait_for_completion(&comp); 98ac171c46SBenjamin Herrenschmidt 99ac171c46SBenjamin Herrenschmidt /* Handle fallback (see coment above) */ 100ac171c46SBenjamin Herrenschmidt if (cmd.status != 0 && smu_supports_new_fans_ops) { 101ac171c46SBenjamin Herrenschmidt printk(KERN_WARNING "windfarm: SMU failed new fan command " 102ac171c46SBenjamin Herrenschmidt "falling back to old method\n"); 103ac171c46SBenjamin Herrenschmidt smu_supports_new_fans_ops = 0; 104ac171c46SBenjamin Herrenschmidt goto retry; 105ac171c46SBenjamin Herrenschmidt } 106ac171c46SBenjamin Herrenschmidt 10775722d39SBenjamin Herrenschmidt return cmd.status; 10875722d39SBenjamin Herrenschmidt } 10975722d39SBenjamin Herrenschmidt 11075722d39SBenjamin Herrenschmidt static void smu_fan_release(struct wf_control *ct) 11175722d39SBenjamin Herrenschmidt { 11275722d39SBenjamin Herrenschmidt struct smu_fan_control *fct = to_smu_fan(ct); 11375722d39SBenjamin Herrenschmidt 11475722d39SBenjamin Herrenschmidt kfree(fct); 11575722d39SBenjamin Herrenschmidt } 11675722d39SBenjamin Herrenschmidt 11775722d39SBenjamin Herrenschmidt static int smu_fan_set(struct wf_control *ct, s32 value) 11875722d39SBenjamin Herrenschmidt { 11975722d39SBenjamin Herrenschmidt struct smu_fan_control *fct = to_smu_fan(ct); 12075722d39SBenjamin Herrenschmidt 12175722d39SBenjamin Herrenschmidt if (value < fct->min) 12275722d39SBenjamin Herrenschmidt value = fct->min; 12375722d39SBenjamin Herrenschmidt if (value > fct->max) 12475722d39SBenjamin Herrenschmidt value = fct->max; 12575722d39SBenjamin Herrenschmidt fct->value = value; 12675722d39SBenjamin Herrenschmidt 12775722d39SBenjamin Herrenschmidt return smu_set_fan(fct->fan_type, fct->reg, value); 12875722d39SBenjamin Herrenschmidt } 12975722d39SBenjamin Herrenschmidt 13075722d39SBenjamin Herrenschmidt static int smu_fan_get(struct wf_control *ct, s32 *value) 13175722d39SBenjamin Herrenschmidt { 13275722d39SBenjamin Herrenschmidt struct smu_fan_control *fct = to_smu_fan(ct); 13375722d39SBenjamin Herrenschmidt *value = fct->value; /* todo: read from SMU */ 13475722d39SBenjamin Herrenschmidt return 0; 13575722d39SBenjamin Herrenschmidt } 13675722d39SBenjamin Herrenschmidt 13775722d39SBenjamin Herrenschmidt static s32 smu_fan_min(struct wf_control *ct) 13875722d39SBenjamin Herrenschmidt { 13975722d39SBenjamin Herrenschmidt struct smu_fan_control *fct = to_smu_fan(ct); 14075722d39SBenjamin Herrenschmidt return fct->min; 14175722d39SBenjamin Herrenschmidt } 14275722d39SBenjamin Herrenschmidt 14375722d39SBenjamin Herrenschmidt static s32 smu_fan_max(struct wf_control *ct) 14475722d39SBenjamin Herrenschmidt { 14575722d39SBenjamin Herrenschmidt struct smu_fan_control *fct = to_smu_fan(ct); 14675722d39SBenjamin Herrenschmidt return fct->max; 14775722d39SBenjamin Herrenschmidt } 14875722d39SBenjamin Herrenschmidt 14975722d39SBenjamin Herrenschmidt static struct wf_control_ops smu_fan_ops = { 15075722d39SBenjamin Herrenschmidt .set_value = smu_fan_set, 15175722d39SBenjamin Herrenschmidt .get_value = smu_fan_get, 15275722d39SBenjamin Herrenschmidt .get_min = smu_fan_min, 15375722d39SBenjamin Herrenschmidt .get_max = smu_fan_max, 15475722d39SBenjamin Herrenschmidt .release = smu_fan_release, 15575722d39SBenjamin Herrenschmidt .owner = THIS_MODULE, 15675722d39SBenjamin Herrenschmidt }; 15775722d39SBenjamin Herrenschmidt 15875722d39SBenjamin Herrenschmidt static struct smu_fan_control *smu_fan_create(struct device_node *node, 15975722d39SBenjamin Herrenschmidt int pwm_fan) 16075722d39SBenjamin Herrenschmidt { 16175722d39SBenjamin Herrenschmidt struct smu_fan_control *fct; 162018a3d1dSJeremy Kerr const s32 *v; 163018a3d1dSJeremy Kerr const u32 *reg; 164018a3d1dSJeremy Kerr const char *l; 16575722d39SBenjamin Herrenschmidt 16675722d39SBenjamin Herrenschmidt fct = kmalloc(sizeof(struct smu_fan_control), GFP_KERNEL); 16775722d39SBenjamin Herrenschmidt if (fct == NULL) 16875722d39SBenjamin Herrenschmidt return NULL; 16975722d39SBenjamin Herrenschmidt fct->ctrl.ops = &smu_fan_ops; 17001b2726dSStephen Rothwell l = of_get_property(node, "location", NULL); 17175722d39SBenjamin Herrenschmidt if (l == NULL) 17275722d39SBenjamin Herrenschmidt goto fail; 17375722d39SBenjamin Herrenschmidt 17475722d39SBenjamin Herrenschmidt fct->fan_type = pwm_fan; 17575722d39SBenjamin Herrenschmidt fct->ctrl.type = pwm_fan ? WF_CONTROL_PWM_FAN : WF_CONTROL_RPM_FAN; 17675722d39SBenjamin Herrenschmidt 17775722d39SBenjamin Herrenschmidt /* We use the name & location here the same way we do for SMU sensors, 17875722d39SBenjamin Herrenschmidt * see the comment in windfarm_smu_sensors.c. The locations are a bit 17975722d39SBenjamin Herrenschmidt * less consistent here between the iMac and the desktop models, but 18075722d39SBenjamin Herrenschmidt * that is good enough for our needs for now at least. 18175722d39SBenjamin Herrenschmidt * 18275722d39SBenjamin Herrenschmidt * One problem though is that Apple seem to be inconsistent with case 18375722d39SBenjamin Herrenschmidt * and the kernel doesn't have strcasecmp =P 18475722d39SBenjamin Herrenschmidt */ 18575722d39SBenjamin Herrenschmidt 18675722d39SBenjamin Herrenschmidt fct->ctrl.name = NULL; 18775722d39SBenjamin Herrenschmidt 18875722d39SBenjamin Herrenschmidt /* Names used on desktop models */ 18975722d39SBenjamin Herrenschmidt if (!strcmp(l, "Rear Fan 0") || !strcmp(l, "Rear Fan") || 190ac171c46SBenjamin Herrenschmidt !strcmp(l, "Rear fan 0") || !strcmp(l, "Rear fan") || 191ac171c46SBenjamin Herrenschmidt !strcmp(l, "CPU A EXHAUST")) 19275722d39SBenjamin Herrenschmidt fct->ctrl.name = "cpu-rear-fan-0"; 193ac171c46SBenjamin Herrenschmidt else if (!strcmp(l, "Rear Fan 1") || !strcmp(l, "Rear fan 1") || 194ac171c46SBenjamin Herrenschmidt !strcmp(l, "CPU B EXHAUST")) 19575722d39SBenjamin Herrenschmidt fct->ctrl.name = "cpu-rear-fan-1"; 19675722d39SBenjamin Herrenschmidt else if (!strcmp(l, "Front Fan 0") || !strcmp(l, "Front Fan") || 197ac171c46SBenjamin Herrenschmidt !strcmp(l, "Front fan 0") || !strcmp(l, "Front fan") || 198ac171c46SBenjamin Herrenschmidt !strcmp(l, "CPU A INTAKE")) 19975722d39SBenjamin Herrenschmidt fct->ctrl.name = "cpu-front-fan-0"; 200ac171c46SBenjamin Herrenschmidt else if (!strcmp(l, "Front Fan 1") || !strcmp(l, "Front fan 1") || 201ac171c46SBenjamin Herrenschmidt !strcmp(l, "CPU B INTAKE")) 20275722d39SBenjamin Herrenschmidt fct->ctrl.name = "cpu-front-fan-1"; 203ac171c46SBenjamin Herrenschmidt else if (!strcmp(l, "CPU A PUMP")) 204ac171c46SBenjamin Herrenschmidt fct->ctrl.name = "cpu-pump-0"; 205ac171c46SBenjamin Herrenschmidt else if (!strcmp(l, "Slots Fan") || !strcmp(l, "Slots fan") || 206ac171c46SBenjamin Herrenschmidt !strcmp(l, "EXPANSION SLOTS INTAKE")) 20775722d39SBenjamin Herrenschmidt fct->ctrl.name = "slots-fan"; 208ac171c46SBenjamin Herrenschmidt else if (!strcmp(l, "Drive Bay") || !strcmp(l, "Drive bay") || 209ac171c46SBenjamin Herrenschmidt !strcmp(l, "DRIVE BAY A INTAKE")) 21075722d39SBenjamin Herrenschmidt fct->ctrl.name = "drive-bay-fan"; 211ac171c46SBenjamin Herrenschmidt else if (!strcmp(l, "BACKSIDE")) 212ac171c46SBenjamin Herrenschmidt fct->ctrl.name = "backside-fan"; 21375722d39SBenjamin Herrenschmidt 21475722d39SBenjamin Herrenschmidt /* Names used on iMac models */ 21575722d39SBenjamin Herrenschmidt if (!strcmp(l, "System Fan") || !strcmp(l, "System fan")) 21675722d39SBenjamin Herrenschmidt fct->ctrl.name = "system-fan"; 21775722d39SBenjamin Herrenschmidt else if (!strcmp(l, "CPU Fan") || !strcmp(l, "CPU fan")) 21875722d39SBenjamin Herrenschmidt fct->ctrl.name = "cpu-fan"; 21975722d39SBenjamin Herrenschmidt else if (!strcmp(l, "Hard Drive") || !strcmp(l, "Hard drive")) 22075722d39SBenjamin Herrenschmidt fct->ctrl.name = "drive-bay-fan"; 22175722d39SBenjamin Herrenschmidt 22275722d39SBenjamin Herrenschmidt /* Unrecognized fan, bail out */ 22375722d39SBenjamin Herrenschmidt if (fct->ctrl.name == NULL) 22475722d39SBenjamin Herrenschmidt goto fail; 22575722d39SBenjamin Herrenschmidt 22675722d39SBenjamin Herrenschmidt /* Get min & max values*/ 22701b2726dSStephen Rothwell v = of_get_property(node, "min-value", NULL); 22875722d39SBenjamin Herrenschmidt if (v == NULL) 22975722d39SBenjamin Herrenschmidt goto fail; 23075722d39SBenjamin Herrenschmidt fct->min = *v; 23101b2726dSStephen Rothwell v = of_get_property(node, "max-value", NULL); 23275722d39SBenjamin Herrenschmidt if (v == NULL) 23375722d39SBenjamin Herrenschmidt goto fail; 23475722d39SBenjamin Herrenschmidt fct->max = *v; 23575722d39SBenjamin Herrenschmidt 23675722d39SBenjamin Herrenschmidt /* Get "reg" value */ 23701b2726dSStephen Rothwell reg = of_get_property(node, "reg", NULL); 23875722d39SBenjamin Herrenschmidt if (reg == NULL) 23975722d39SBenjamin Herrenschmidt goto fail; 24075722d39SBenjamin Herrenschmidt fct->reg = *reg; 24175722d39SBenjamin Herrenschmidt 24275722d39SBenjamin Herrenschmidt if (wf_register_control(&fct->ctrl)) 24375722d39SBenjamin Herrenschmidt goto fail; 24475722d39SBenjamin Herrenschmidt 24575722d39SBenjamin Herrenschmidt return fct; 24675722d39SBenjamin Herrenschmidt fail: 24775722d39SBenjamin Herrenschmidt kfree(fct); 24875722d39SBenjamin Herrenschmidt return NULL; 24975722d39SBenjamin Herrenschmidt } 25075722d39SBenjamin Herrenschmidt 25175722d39SBenjamin Herrenschmidt 25275722d39SBenjamin Herrenschmidt static int __init smu_controls_init(void) 25375722d39SBenjamin Herrenschmidt { 25475722d39SBenjamin Herrenschmidt struct device_node *smu, *fans, *fan; 25575722d39SBenjamin Herrenschmidt 25675722d39SBenjamin Herrenschmidt if (!smu_present()) 25775722d39SBenjamin Herrenschmidt return -ENODEV; 25875722d39SBenjamin Herrenschmidt 25975722d39SBenjamin Herrenschmidt smu = of_find_node_by_type(NULL, "smu"); 26075722d39SBenjamin Herrenschmidt if (smu == NULL) 26175722d39SBenjamin Herrenschmidt return -ENODEV; 26275722d39SBenjamin Herrenschmidt 26375722d39SBenjamin Herrenschmidt /* Look for RPM fans */ 26475722d39SBenjamin Herrenschmidt for (fans = NULL; (fans = of_get_next_child(smu, fans)) != NULL;) 265ac171c46SBenjamin Herrenschmidt if (!strcmp(fans->name, "rpm-fans") || 266*55b61fecSStephen Rothwell of_device_is_compatible(fans, "smu-rpm-fans")) 26775722d39SBenjamin Herrenschmidt break; 26875722d39SBenjamin Herrenschmidt for (fan = NULL; 26975722d39SBenjamin Herrenschmidt fans && (fan = of_get_next_child(fans, fan)) != NULL;) { 27075722d39SBenjamin Herrenschmidt struct smu_fan_control *fct; 27175722d39SBenjamin Herrenschmidt 27275722d39SBenjamin Herrenschmidt fct = smu_fan_create(fan, 0); 27375722d39SBenjamin Herrenschmidt if (fct == NULL) { 27475722d39SBenjamin Herrenschmidt printk(KERN_WARNING "windfarm: Failed to create SMU " 27575722d39SBenjamin Herrenschmidt "RPM fan %s\n", fan->name); 27675722d39SBenjamin Herrenschmidt continue; 27775722d39SBenjamin Herrenschmidt } 27875722d39SBenjamin Herrenschmidt list_add(&fct->link, &smu_fans); 27975722d39SBenjamin Herrenschmidt } 28075722d39SBenjamin Herrenschmidt of_node_put(fans); 28175722d39SBenjamin Herrenschmidt 28275722d39SBenjamin Herrenschmidt 28375722d39SBenjamin Herrenschmidt /* Look for PWM fans */ 28475722d39SBenjamin Herrenschmidt for (fans = NULL; (fans = of_get_next_child(smu, fans)) != NULL;) 28575722d39SBenjamin Herrenschmidt if (!strcmp(fans->name, "pwm-fans")) 28675722d39SBenjamin Herrenschmidt break; 28775722d39SBenjamin Herrenschmidt for (fan = NULL; 28875722d39SBenjamin Herrenschmidt fans && (fan = of_get_next_child(fans, fan)) != NULL;) { 28975722d39SBenjamin Herrenschmidt struct smu_fan_control *fct; 29075722d39SBenjamin Herrenschmidt 29175722d39SBenjamin Herrenschmidt fct = smu_fan_create(fan, 1); 29275722d39SBenjamin Herrenschmidt if (fct == NULL) { 29375722d39SBenjamin Herrenschmidt printk(KERN_WARNING "windfarm: Failed to create SMU " 29475722d39SBenjamin Herrenschmidt "PWM fan %s\n", fan->name); 29575722d39SBenjamin Herrenschmidt continue; 29675722d39SBenjamin Herrenschmidt } 29775722d39SBenjamin Herrenschmidt list_add(&fct->link, &smu_fans); 29875722d39SBenjamin Herrenschmidt } 29975722d39SBenjamin Herrenschmidt of_node_put(fans); 30075722d39SBenjamin Herrenschmidt of_node_put(smu); 30175722d39SBenjamin Herrenschmidt 30275722d39SBenjamin Herrenschmidt return 0; 30375722d39SBenjamin Herrenschmidt } 30475722d39SBenjamin Herrenschmidt 30575722d39SBenjamin Herrenschmidt static void __exit smu_controls_exit(void) 30675722d39SBenjamin Herrenschmidt { 30775722d39SBenjamin Herrenschmidt struct smu_fan_control *fct; 30875722d39SBenjamin Herrenschmidt 30975722d39SBenjamin Herrenschmidt while (!list_empty(&smu_fans)) { 31075722d39SBenjamin Herrenschmidt fct = list_entry(smu_fans.next, struct smu_fan_control, link); 31175722d39SBenjamin Herrenschmidt list_del(&fct->link); 31275722d39SBenjamin Herrenschmidt wf_unregister_control(&fct->ctrl); 31375722d39SBenjamin Herrenschmidt } 31475722d39SBenjamin Herrenschmidt } 31575722d39SBenjamin Herrenschmidt 31675722d39SBenjamin Herrenschmidt 31775722d39SBenjamin Herrenschmidt module_init(smu_controls_init); 31875722d39SBenjamin Herrenschmidt module_exit(smu_controls_exit); 31975722d39SBenjamin Herrenschmidt 32075722d39SBenjamin Herrenschmidt MODULE_AUTHOR("Benjamin Herrenschmidt <benh@kernel.crashing.org>"); 32175722d39SBenjamin Herrenschmidt MODULE_DESCRIPTION("SMU control objects for PowerMacs thermal control"); 32275722d39SBenjamin Herrenschmidt MODULE_LICENSE("GPL"); 32375722d39SBenjamin Herrenschmidt 324